Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/pom.xml	(revision 15423)
@@ -0,0 +1,133 @@
+<?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/maven-v4_0_0.xsd">
+
+	<modelVersion>4.0.0</modelVersion>
+	<artifactId>org.gvsig.raster.fmap</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster</artifactId>
+		<version>2.2.171</version>
+	</parent>	
+	<dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.lib.api</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.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>
+        -->
+        <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.dal.file.shp</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.fmap.dal.file.dbf</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.metadata.lib.basic.api</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.fmap.control</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.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+</project>

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 15423)
@@ -0,0 +1 @@
+org.gvsig.raster.fmap.FmapRasterLibrary
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/SaveRasterListenerImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/SaveRasterListenerImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/SaveRasterListenerImpl.java	(revision 15423)
@@ -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.fmap.tool;
+
+import java.awt.Image;
+import java.awt.geom.Rectangle2D;
+
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.RectangleListener;
+
+
+
+/**
+* Implementaci�n de la interfaz RectangleListener como herramienta para
+* realizar un Salvado a Raster.
+*
+* @author Nacho Brodin (nachobrodin@gmail.com)
+*/
+public class SaveRasterListenerImpl implements RectangleListener {
+	protected MapControl mapCtrl;
+
+	protected Rectangle2D pixelRect = null;
+	protected Envelope rect = null;
+
+	/**
+	 * Crea un nuevo RectangleListenerImpl.
+	 *
+	 * @param mapCtrl MapControl.
+	 */
+	public SaveRasterListenerImpl(MapControl mapCtrl) {
+		this.mapCtrl = mapCtrl;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.RectangleListener#rectangle(com.iver.cit.gvsig.fmap.tools.Events.RectangleEvent)
+	 */
+	public void rectangle(EnvelopeEvent event) {
+		rect = event.getWorldCoordRect();
+		pixelRect = event.getPixelCoordRect();
+	}
+
+//	/**
+//	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#getCursor()
+//	 */
+//	public Cursor getCursor() {
+//		return cur;
+//	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+	 */
+	public boolean cancelDrawing() {
+	    System.out.println("cancelDrawing del SaveRasterListenerImpl");
+		return true;
+	}
+
+	public Image getImageCursor() {
+		return null;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/SaveRasterListenerImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/behavior/TransformedRectangleBehavior.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/behavior/TransformedRectangleBehavior.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/behavior/TransformedRectangleBehavior.java	(revision 15423)
@@ -0,0 +1,250 @@
+/* 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.fmap.tool.behavior;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Rectangle;
+import java.awt.RenderingHints;
+import java.awt.event.MouseEvent;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.fmap.IconThemeHelper;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontrol.MapControlDrawer;
+import org.gvsig.fmap.mapcontrol.tools.BehaviorException;
+import org.gvsig.fmap.mapcontrol.tools.Behavior.Behavior;
+import org.gvsig.fmap.mapcontrol.tools.Events.EnvelopeEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.RectangleListener;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Comportamiento de una selecci�n por rectangulo con una transformaci�n
+ * aplicada. El resultado visual es la selecci�n como un rectangulo com�n con
+ * el rectangulo transformado superpuesto.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+@SuppressWarnings("deprecation")
+public class TransformedRectangleBehavior extends Behavior {
+	private static final GeometryManager	geomManager		 = GeometryLocator.getGeometryManager();
+	private static final Logger 			logger 			 = LoggerFactory.getLogger(GeometryManager.class);
+	/**
+	 * First point of the rectangle area, that represents a corner.
+	 */
+	private Point2D             			m_FirstPoint     = null;
+
+	/**
+	 * Second point of the rectangle area, that represents the opposite corner of the first,
+	 *  along the diagonal.
+	 */
+	private Point2D              			m_LastPoint     = null;
+
+	/**
+	 * Tool listener used to work with the <code>MapControl</code> object.
+	 *
+	 * @see #getListener()
+	 * @see #setListener(ToolListener)
+	 */
+	private RectangleListener   			listener        = null;
+	private AffineTransform      			at              = null;
+	private BasicStroke          			stroke          = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, new float[]{5.0f}, 0.0f);
+
+	/**
+	 * <p>Creates a new behavior for selecting rectangle areas.</p>
+	 *
+	 * @param zili listener used to permit this object to work with the associated <code>MapControl</code>
+	 */
+	public TransformedRectangleBehavior(RectangleListener zili) {
+		listener = zili;
+	}
+
+	/**
+	 * Asigna la matriz de transformaci�n para el cuadro externo.
+	 * @param at AffineTransform
+	 */
+	public void setAffineTransform(AffineTransform at) {
+		this.at = at;
+	}
+
+	/* (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.IBehavior#getImageCursor()
+	 */
+	public Image getImageCursor(){
+		return IconThemeHelper.getImage("rectangle-select-cursor");
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#paintComponent(java.awt.Graphics)
+	 */
+	public void paintComponent(MapControlDrawer mapControlDrawer) {
+		BufferedImage img = getMapControl().getImage();
+		RenderingHints hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		hints.add(new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY));
+		mapControlDrawer.setRenderingHints(hints);
+		mapControlDrawer.drawImage(img, 0, 0);
+		mapControlDrawer.setColor(Color.black);
+		//g.setXORMode(Color.white);
+
+		// Borramos el anterior
+		Rectangle r = new Rectangle();
+
+		// Dibujamos el actual
+		if ((m_FirstPoint != null) && (m_LastPoint != null)) {
+			r.setFrameFromDiagonal(m_FirstPoint, m_LastPoint);
+			mapControlDrawer.drawRect(r.x, r.y, r.width, r.height);
+		}
+
+		//Dibujamos el cuadro exterior
+		if(at != null) {
+			Point2D.Double ul = new Point2D.Double(r.x, r.y);
+			Point2D.Double ur = new Point2D.Double(r.x + r.width, r.y);
+			Point2D.Double ll = new Point2D.Double(r.x, r.y + r.height);
+			Point2D.Double lr = new Point2D.Double(r.x + r.width, r.y + r.height);
+
+			Point2D center = new Point2D.Double((r.width) / 2.0, (r.height) / 2.0);
+			AffineTransform T1 = new AffineTransform(1D, 0, 0, 1, -center.getX(), -center.getY());
+			AffineTransform R1 = new AffineTransform(1D, at.getShearY() / at.getScaleY(), at.getShearX() / at.getScaleX(), 1, 0, 0);
+			AffineTransform T2 = new AffineTransform(1D, 0, 0, 1, center.getX(), center.getY());
+			T2.concatenate(R1);
+			T2.concatenate(T1);
+
+			try {
+				T2.inverseTransform(ul, ul);
+				T2.inverseTransform(ll, ll);
+				T2.inverseTransform(ur, ur);
+				T2.inverseTransform(lr, lr);
+
+				Point2D.Double ptMin = new Point2D.Double(	Math.min(Math.min(ul.getX(), ur.getX()), Math.min(ll.getX(), lr.getX())),
+															Math.min(Math.min(ul.getY(), ur.getY()), Math.min(ll.getY(), lr.getY())));
+				Point2D.Double ptMax = new Point2D.Double(	Math.max(Math.max(ul.getX(), ur.getX()), Math.max(ll.getX(), lr.getX())),
+															Math.max(Math.max(ul.getY(), ur.getY()), Math.max(ll.getY(), lr.getY())));
+				double w = ptMax.getX() - ptMin.getX();
+				double h = ptMax.getY() - ptMin.getY();
+
+				mapControlDrawer.setStroke(stroke);
+				mapControlDrawer.transform(T2);
+				mapControlDrawer.drawRect((int)ptMin.getX(), (int)ptMin.getY(), (int)w, (int)h);
+				mapControlDrawer.transform(at.createInverse());
+			} catch (NoninvertibleTransformException e) {
+				return;
+			}
+		}
+		//g.setPaintMode();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public void mousePressed(MouseEvent e) {
+		if (e.getButton() == MouseEvent.BUTTON1) {
+			m_FirstPoint = e.getPoint();
+			getMapControl().repaint();
+		}
+		if (listener.cancelDrawing()) {
+			getMapControl().cancelDrawing();
+			getMapControl().repaint();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseReleased(java.awt.event.MouseEvent)
+	 */
+	public void mouseReleased(MouseEvent e) throws BehaviorException {
+	    if (m_FirstPoint == null) return;
+		Point2D p1;
+		Point2D p2;
+		Point pScreen = e.getPoint();
+
+		ViewPort vp = getMapControl().getMapContext().getViewPort();
+
+		p1 = vp.toMapPoint(m_FirstPoint);
+		p2 = vp.toMapPoint(pScreen);
+
+		if (e.getButton() == MouseEvent.BUTTON1) {
+			//	Fijamos el nuevo extent
+			double minX = Math.min(p1.getX(), p2.getX());
+			double minY = Math.min(p1.getY(), p2.getY());
+			double maxX = Math.max(p1.getX(), p2.getX());
+			double maxY = Math.max(p1.getY(), p2.getY());
+			Envelope env = null;
+			try {
+				env = geomManager.createEnvelope(minX, minY, maxX, maxY, SUBTYPES.GEOM2D);
+			} catch (CreateEnvelopeException e1) {
+				logger.error("Error creating the envelope", e);
+			}
+
+			Rectangle2D rectPixel = new Rectangle();
+			rectPixel.setFrameFromDiagonal(m_FirstPoint, pScreen);
+
+			EnvelopeEvent event = new EnvelopeEvent(env, e, rectPixel);
+			listener.rectangle(event);
+		}
+
+		m_FirstPoint = null;
+		m_LastPoint = null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#mouseDragged(java.awt.event.MouseEvent)
+	 */
+	public void mouseDragged(MouseEvent e) {
+		m_LastPoint = e.getPoint();
+		getMapControl().repaint();
+	}
+
+	/**
+	 * <p>Sets a tool listener to work with the <code>MapControl</code> using this behavior.</p>
+	 *
+	 * @param listener a <code>RectangleListener</code> object for this behavior
+	 */
+	public void setListener(ToolListener listener) {
+		this.listener = (RectangleListener) listener;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.tools.Behavior.Behavior#getListener()
+	 */
+	public ToolListener getListener() {
+		return listener;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/tool/behavior/TransformedRectangleBehavior.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ColorTableLegend.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ColorTableLegend.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ColorTableLegend.java	(revision 15423)
@@ -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.fmap.legend;
+
+import java.awt.Color;
+import java.util.Arrays;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.mapcontext.rendering.legend.IClassifiedLegend;
+import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
+import org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener;
+import org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.symbology.SymbologyLocator;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.fill.IFillSymbol;
+import org.gvsig.symbology.fmap.mapcontext.rendering.symbol.line.ILineSymbol;
+import org.gvsig.tools.ToolsLocator;
+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;
+
+/**
+ * Leyenda para tablas de color aplicadas a un raster.
+ *
+ * @version 27/06/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableLegend implements IClassifiedLegend, ILegend {
+	public static final String  COLOR_TABLE_LEGEND_DYNCLASS_NAME = "ColorTableLegend";
+	private static final String FIELD_SYMBOLS                    = "symbols";
+	private static final String FIELD_DESCRIPTIONS               = "descriptions";
+
+	private ISymbol[]           symbols                          = null;
+	private String[]            desc                             = null;
+
+	/**
+	 * Crea una leyenda de tipo ColorTableLegend a partir de un objeto ColorTable
+	 * @param colorTable
+	 * @return ColorTableLegend
+	 */
+	public static ColorTableLegend createLegend(ColorTable colorTable) {
+		if ((colorTable == null) || (colorTable.getColorItems() == null))
+			return null;
+		MathUtils math = RasterLocator.getManager().getMathUtils();
+		
+		ILineSymbol line = SymbologyLocator.getSymbologyManager().createSimpleLineSymbol();
+		line.setLineColor(Color.BLACK);
+		ISymbol[] symbol = new ISymbol[colorTable.getColorItems().size()];
+		String[] desc = new String[colorTable.getColorItems().size()];
+
+		String nameClass = null;
+		for (int i = 0; i < colorTable.getColorItems().size(); i++) {
+			IFillSymbol s = SymbologyLocator.getSymbologyManager().createSimpleFillSymbol();
+			s.setOutline(line);
+			s.setFillColor(((ColorItem) colorTable.getColorItems().get(i)).getColor());
+			nameClass = ((ColorItem) colorTable.getColorItems().get(i)).getNameClass();
+			if ((nameClass == null) || (nameClass.equals(""))){
+				if (i < (colorTable.getColorItems().size() - 1)){
+					desc[i] = "[" + math.format(((ColorItem) colorTable.getColorItems().get(i)).getValue(), 2) + " , " + math.format(((ColorItem) colorTable.getColorItems().get(i + 1)).getValue(), 2) + "[ ";
+				}else{
+					desc[i] = "[" + math.format(((ColorItem) colorTable.getColorItems().get(i)).getValue(), 2) + "] ";
+				}
+			}else{
+				desc[i] = ((ColorItem) colorTable.getColorItems().get(i)).getNameClass();
+			}	
+			symbol[i] = s;
+		}
+
+		return new ColorTableLegend(symbol, desc);
+	}
+
+	/**
+	 * Leyenda para tablas de color raster.
+	 * @param s Lista de simbolos
+	 * @param d Lista de descripciones de simbolos
+	 */
+	public ColorTableLegend(ISymbol[] s, String[] d) {
+		symbols = s;
+		desc = d;
+	}
+
+	/**
+	 * Empty constructor used only for persistence purposes.
+	 */
+	public ColorTableLegend() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.rendering.IClassifiedLegend#getDescriptions()
+	 */
+	public String[] getDescriptions() {
+		return desc;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.rendering.IClassifiedLegend#getSymbols()
+	 */
+	public ISymbol[] getSymbols() {
+		return symbols;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.rendering.IClassifiedLegend#getValues()
+	 */
+	public Object[] getValues() {
+		return desc;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.rendering.ILegend#cloneLegend()
+	 */
+	public ILegend cloneLegend() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.rendering.ILegend#getDefaultSymbol()
+	 */
+	public ISymbol getDefaultSymbol() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.cit.gvsig.fmap.rendering.ILegend#getSLDString(java.lang.String)
+	 */
+	public String getSLDString(String layerName) {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see com.iver.utiles.IPersistance#getClassName()
+	 */
+	public String getClassName() {
+		return null;
+	}
+
+	public void addLegendListener(LegendContentsChangedListener listener) {
+		// TODO Auto-generated method stub
+	}
+
+	public void fireDefaultSymbolChangedEvent(SymbolLegendEvent event) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public LegendContentsChangedListener[] getListeners() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	
+	public void removeLegendListener(LegendContentsChangedListener listener) {
+		// TODO Auto-generated method stub
+	}
+
+	@Override
+	public Object clone() throws CloneNotSupportedException {
+		// TODO Auto-generated method stub
+		return super.clone();
+	}
+
+	private void setDescriptions(String[] descriptions) {
+		this.desc = descriptions;
+	}
+
+	private void setSymbols(ISymbol[] symbols) {
+		this.symbols = symbols;
+	}
+
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		List<ISymbol> symbols = (List<ISymbol>) state.get(FIELD_SYMBOLS);
+		setSymbols(symbols.toArray(new ISymbol[symbols.size()]));
+
+		List<String> descriptions =
+				(List<String>) state.get(FIELD_DESCRIPTIONS);
+		setDescriptions(descriptions.toArray(new String[descriptions.size()]));
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set(FIELD_SYMBOLS, Arrays.asList(getSymbols()));
+		state.set(FIELD_DESCRIPTIONS, Arrays.asList(getDescriptions()));
+	}
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.addDefinition(
+				ColorTableLegend.class,
+				COLOR_TABLE_LEGEND_DYNCLASS_NAME,
+				COLOR_TABLE_LEGEND_DYNCLASS_NAME + " Persistence definition",
+				null, 
+				null
+		);
+
+		// Symbols
+		definition.addDynFieldList(FIELD_SYMBOLS).setClassOfItems(ISymbol.class).setMandatory(true);
+		// Descriptions
+		definition.addDynFieldList(FIELD_DESCRIPTIONS).setClassOfItems(String.class).setMandatory(true);
+
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ColorTableLegend.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ImageLegend.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ImageLegend.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ImageLegend.java	(revision 15423)
@@ -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.fmap.legend;
+
+import java.awt.Image;
+
+import org.gvsig.fmap.mapcontext.layers.operations.IHasImageLegend;
+import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
+import org.gvsig.fmap.mapcontext.rendering.legend.IRasterLegend;
+import org.gvsig.fmap.mapcontext.rendering.legend.events.LegendContentsChangedListener;
+import org.gvsig.fmap.mapcontext.rendering.legend.events.SymbolLegendEvent;
+import org.gvsig.fmap.mapcontext.rendering.symbols.ISymbol;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * This object is for rasters which returns its legend as a image
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class ImageLegend implements IRasterLegend, IHasImageLegend {
+	private Image    image = null;
+	
+	public ImageLegend(Image image) {
+		this.image = image;
+	}
+	
+	public Image getImageLegend() {
+		return image;
+	}
+	
+	public Object clone() throws CloneNotSupportedException {
+		return new ImageLegend(image);
+	}
+	
+	public void addLegendListener(LegendContentsChangedListener listener) {
+		
+	}
+
+	public ILegend cloneLegend() {
+		try {
+			return (ILegend)clone();
+		} catch (CloneNotSupportedException e) {
+		}
+		return null;
+	}
+
+	public void fireDefaultSymbolChangedEvent(SymbolLegendEvent event) {
+		
+	}
+
+	public ISymbol getDefaultSymbol() {
+		return null;
+	}
+
+	public LegendContentsChangedListener[] getListeners() {
+		return null;
+	}
+
+	public void removeLegendListener(LegendContentsChangedListener listener) {
+		
+	}
+
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		
+	}
+
+	public String getPathImage() {
+		return null;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/legend/ImageLegend.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultLayerConfiguration.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultLayerConfiguration.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultLayerConfiguration.java	(revision 15423)
@@ -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.fmap.layers;
+/**
+ * DefaultLayerConfiguration sirve para aquellos objetos que no puedan usar la
+ * configuracion de PluginServices, devolviendo siempre el valor por defecto.
+ * 
+ * @version 14/01/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class DefaultLayerConfiguration implements IConfiguration {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueBoolean(java.lang.String, java.lang.Boolean)
+	 */
+	public Boolean getValueBoolean(String name, Boolean defaultValue) {
+		return defaultValue;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueDouble(java.lang.String, java.lang.Double)
+	 */
+	public Double getValueDouble(String name, Double defaultValue) {
+		return defaultValue;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueFloat(java.lang.String, java.lang.Float)
+	 */
+	public Float getValueFloat(String name, Float defaultValue) {
+		return defaultValue;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueInteger(java.lang.String, java.lang.Integer)
+	 */
+	public Integer getValueInteger(String name, Integer defaultValue) {
+		return defaultValue;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueLong(java.lang.String, java.lang.Long)
+	 */
+	public Long getValueLong(String name, Long defaultValue) {
+		return defaultValue;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueString(java.lang.String, java.lang.String)
+	 */
+	public String getValueString(String name, String defaultValue) {
+		return defaultValue;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultLayerConfiguration.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrState.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrState.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrState.java	(revision 15423)
@@ -0,0 +1,108 @@
+/* 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.fmap.layers;
+
+
+/**
+ * Estados de una capa. Cada capa tiene uno o varios estados activos en cada instante.
+ * Hay estados no compatibles entre si, es decir, no pueden estar activos a la vez en cada
+ * instante. Por ejemplo, una capa no puede estar cerrada y renderizando ya que sus datos no
+ * est�n accesibles para esa operaci�n. Los estados de una capa sir
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FLyrState implements ILayerState {	
+	private boolean open                 = false;
+	private boolean closed               = true;
+	private boolean awake                = false;
+	private boolean stopped              = false;
+	
+	private int lastBeforeStop           = UNDEFINED;
+
+	public boolean isAwake() {
+		return awake;
+	}
+	
+	public void enableAwake() throws NotAvailableStateException {
+		if(awake)
+			return;
+		if(open == true || closed == true || stopped == true) {
+			this.awake = true;
+			stopped = closed = open = false;
+			lastBeforeStop = UNDEFINED;
+		} else 
+			throw new NotAvailableStateException("Awake state not available");
+	}
+	
+	public boolean isOpen() {
+		return open;
+	}
+	
+	public void enableOpen() throws NotAvailableStateException {
+		if(stopped == true || awake == true) {
+			this.open = true;
+			stopped = closed = awake = false;
+			lastBeforeStop = UNDEFINED;
+		} else 
+			throw new NotAvailableStateException("Open state not available");
+	}
+	
+	public boolean isClosed() {
+		return closed;
+	}
+	
+	public void enableClosed() throws NotAvailableStateException {
+		if(open == true || awake == true || stopped == true) {
+			this.closed = true;
+			stopped = open = awake = false;
+			lastBeforeStop = UNDEFINED;
+		} else 
+			throw new NotAvailableStateException("Closed state not available");
+	}
+	
+	public boolean isStopped() {
+		return stopped;
+	}
+	
+	public void enableStopped() {
+		if(open == true || awake == true || closed == true) {
+			lastBeforeStop = (open == true) ? OPEN : ((closed == true) ? CLOSED : ((awake == true) ? AWAKE : UNDEFINED));
+			if(lastBeforeStop != UNDEFINED) {
+				stopped = true;
+				closed = open = awake = false;
+			}
+		}
+	}
+	
+	public void disableStopped() {
+		if(stopped == true && lastBeforeStop != UNDEFINED) {
+			switch(lastBeforeStop) {
+			case OPEN: open = true; closed = awake = false; break;
+			case CLOSED: closed = true; awake = open = false; break;
+			case AWAKE: awake = true; closed = open = false; break;
+			}
+			stopped = false;
+			lastBeforeStop = UNDEFINED;
+		} 
+	}
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrState.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IStatusRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IStatusRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IStatusRaster.java	(revision 15423)
@@ -0,0 +1,103 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.fmap.layers;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.exception.FileNotFoundInListException;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.tools.persistence.Persistent;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.gvsig.utils.XMLException;
+
+
+public interface IStatusRaster extends Persistent{
+	
+	/**
+	 * Recupera en fichero XML algunas propiedades y filtros del raster
+	 * @param xml
+	 * @throws XMLException
+	 */
+	//public void loadFromState(PersistentState state, FLyrRasterSE layer)throws PersistenceException;
+	
+	/**
+	 * Salva en fichero XML algunas propiedades y filtros de raster
+	 * @param xml
+	 * @throws XMLException
+	 */
+	public void setStateProperties(boolean loadClass, DefaultFLyrRaster layer)throws PersistenceException;
+	
+	/**
+	 * Aplica el estado almacenado al FLyrRaster pasado por par�metro
+	 * @param adapter
+	 * @throws NotSupportedExtensionException Cuando la extensi�n no est� soportada
+	 * @throws RasterDriverException Cuando se produce un error en la lectura del fichero
+	 * @throws OperationNotSupportedException 
+	 * @throws FileNotFoundInListException 
+	 * @throws FilterManagerException 
+	 * @throws InvalidSourceException 
+	 */
+	public void applyStatus(DefaultFLyrRaster layer) throws NotSupportedExtensionException, RasterDriverException, FilterTypeException, FileNotFoundInListException, OperationNotSupportedException, FilterManagerException, InvalidSourceException ;
+	
+	/**
+	 * Obtiene el listado de filtros para poder montar una pila
+	 * despu�s de la recuperaci�n desde el XML
+	 * @return
+	 */
+	public List<String> getFilters();
+	
+	/**
+	 * Obtiene el orden de renderizado de bandas cargado desde el proyecto
+	 * despu�s de hacer un setXMLEntity
+	 * @return Lista de enteros con el orden de renderizado
+	 */
+	public int[] getRenderBands();
+	
+	/**
+	 * Obtiene la lista de filtros cargada desde el proyecto despu�s de hacer un 
+	 * setXMLEntity
+	 * @return RasterFilterList
+	 * @throws FilterTypeException 
+	 */
+	public RasterFilterList getFilterList() throws FilterTypeException;
+	
+	/**
+	 * Obtiene la lista de filtros cargada desde el proyecto despu�s de hacer un 
+	 * setXMLEntity. No construye los filtros sino que devuelve una lista de par�metros
+	 * @return RasterFilterList
+	 */
+	public List<String> getFilterArguments();
+	
+	/**
+	 * Obtiene el ColorTable si hay un filtro de tabla de color en la lista
+	 * @return ColorTable
+	 * @throws FilterTypeException 
+	 */
+	public ColorTable getColorTable() throws FilterTypeException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IStatusRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/Multiresolution.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/Multiresolution.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/Multiresolution.java	(revision 15423)
@@ -0,0 +1,87 @@
+/* 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.fmap.layers;
+
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+
+/**
+ * Layers with levels of multiresolution support
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface Multiresolution {
+	/**
+	 * Returns true if the multiresolution is enabled
+	 * @return
+	 */
+	public boolean isEnabledMultiresolution();
+	
+	/**
+	 * Gets the current zoom level
+	 * @return
+	 */
+	public int getZoomLevel();
+
+	/**
+	 * Sets the current zoom level
+	 * @param zoomLevel
+	 */
+	public void setZoomLevel(int zoomLevel);
+	
+	/**
+	 * Increase the current zoom level
+	 */
+	public boolean increaseZoomLevel();
+	
+	/**
+	 * Decrease the current zoom level
+	 */
+	public boolean decreaseZoomLevel();
+
+	/**
+	 * Calculates the bounding box of a zoom level using a center defined in pixels.
+	 * It's possible to define the center in pixels because a level of resolution has
+	 * a pixel size. 
+	 * @param center 
+	 * 			center in world coordinates
+	 * @param level 
+	 * 			level of resolution
+	 * @param w 
+	 * 			width in pixels
+	 * @param h 
+	 * 			height in pixels
+	 * @return
+	 */
+	public Envelope getCoordsInLevel(Point2D center, int level, int w, int h) throws CreateEnvelopeException;
+	
+	/**
+	 * Sets a tile server to create a second level of cache. This second level will be
+	 * created if the cache structure is different to the current.
+	 * @param tileServer
+	 */
+	public void setTileServer(Class<?> tileServer) throws InitializeException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/Multiresolution.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IConfiguration.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IConfiguration.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IConfiguration.java	(revision 15423)
@@ -0,0 +1,31 @@
+/* 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.fmap.layers;
+
+public interface IConfiguration {
+	public Boolean getValueBoolean(String name, Boolean defaultValue);
+	public Double getValueDouble(String name, Double defaultValue);
+	public Float getValueFloat(String name, Float defaultValue);
+	public Integer getValueInteger(String name, Integer defaultValue);
+	public Long getValueLong(String name, Long defaultValue);
+	public String getValueString(String name, String defaultValue);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IConfiguration.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/NotAvailableStateException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/NotAvailableStateException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/NotAvailableStateException.java	(revision 15423)
@@ -0,0 +1,36 @@
+/* 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.fmap.layers;
+
+/**
+ * Excepci�n lanzada cuando se intenta poner una capa en un estado inaccesible.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class NotAvailableStateException extends Exception {
+	private static final long serialVersionUID = 1557651260026647067L;
+
+	public NotAvailableStateException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/NotAvailableStateException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ILayerState.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ILayerState.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ILayerState.java	(revision 15423)
@@ -0,0 +1,128 @@
+/* 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.fmap.layers;
+
+public interface ILayerState {
+
+	public static final int UNDEFINED    = -1;
+	public static final int OPEN         = 0;
+	public static final int CLOSED       = 1;
+	public static final int AWAKE        = 2;
+	public static final int STOPPED      = 3;
+		
+	/**
+	 * Consulta si una capa est� lecantada o no. Una capa levantada
+	 * significa que no est� open pero tampoco est� closed. Tiene asignadas los valores
+	 * a las variables para abrir los ficheros o descargar las imagenes pero la acci�n no
+	 * ser� efectiva hasta que no se haga un open. En ese momento deja de estar awake y pasa 
+	 * a open. De la misma forma est�ndo awake podemos hacer un close.
+	 * 
+	 * @return true si est� levantada y false si no lo est�. Si est� a false no sabemos nada
+	 * del estado en que se encuentra.
+	 */
+	public boolean isAwake();
+	
+	/**
+	 * Asigna el flag que dice si una capa est� levantada. Una capa levantada
+	 * significa que no est� open pero tampoco est� closed. Tiene asignadas los valores
+	 * a las variables para abrir los ficheros o descargar las imagenes pero la acci�n no
+	 * ser� efectiva hasta que no se haga un open. En ese momento deja de estar awake y pasa 
+	 * a open. De la misma forma est�ndo awake podemos hacer un close.
+	 *  
+	 *  @throws NotAvailableStateException Excepci�n lanzada si no es posible alcanzar el estado
+	 */
+	public void enableAwake() throws NotAvailableStateException;
+	
+	/**
+	 * Consulta si una capa est� abierta o no. Una capa est� abierta cuando los 
+	 * archivos a los que referencia est�n abiertos o descargados y las estructuras
+	 * de memoria de gvSIG cargadas con los datos de cabecera y propiedades, es decir lista
+	 * para renderizar o leer informaci�n. Que una capa no est� open no significa que deba
+	 * estar closed, puede estar awake.
+	 * 
+	 * @return true si est� abierta o false si no lo est�.
+	 */
+	public boolean isOpen();
+	
+	/**
+	 * Asigna una capa como abierta. Una capa est� abierta cuando los 
+	 * archivos a los que referencia est�n abiertos o descargados y las estructuras
+	 * de memoria de gvSIG cargadas con los datos de cabecera y propiedades, es decir lista
+	 * para renderizar o leer informaci�n. Que una capa no est� open no significa que deba
+	 * estar closed, puede estar awake.
+	 * 
+	 * @throws NotAvailableStateException Excepci�n lanzada si no es posible alcanzar el estado
+	 */
+	public void enableOpen() throws NotAvailableStateException;
+		
+	/**
+	 * Consulta si una capa est� cerrada o no. Una capa est� cerrada cuando no se ha asignado
+	 * todavia una fuente de datos a la misma por lo cual no ser� posible hacer ninguna operaci�n
+	 * de consulta. Que una capa no est� closed no significa que deba estar open, puede estar awake.
+	 * 
+	 * @return true si est� abierta o false si no lo est�.
+	 */
+	public boolean isClosed();
+	
+	/**
+	 * Asigna una capa como cerrada. Una capa est� cerrada cuando no se ha asignado
+	 * todavia una fuente de datos a la misma por lo cual no ser� posible hacer ninguna operaci�n
+	 * de consulta. Que una capa no est� closed no significa que deba estar open, puede estar awake.
+	 * 
+	 * @throws NotAvailableStateException Excepci�n lanzada si no es posible alcanzar el estado
+	 */
+	public void enableClosed() throws NotAvailableStateException;
+	
+	/**
+	 * Consulta el estado de detenci�n. En este estado la capa no puede ser abierta.
+	 * Existen motivos por los cuales una capa no debe ser accedida por ning�n motivo 
+	 * aunque el dataset est� abierto y las estructuras cargadas, en este caso se define un
+	 * estado de detenci�n. Cuando una capa es detenida recuerda el estado del que sal�a y lo
+	 * recupera al ser reanudada.
+	 * 
+	 * @return true si est� detenida y false si no lo est�.
+	 */
+	public boolean isStopped();
+	
+	/**
+	 * Activa la detenci�n de la capa. En este estado la capa no puede ser abierta.
+	 * Existen motivos por los cuales una capa no debe ser accedida por ning�n motivo 
+	 * aunque el dataset est� abierto y las estructuras cargadas, en este caso se define un
+	 * estado de detenci�n. Cuando una capa es detenida recuerda el estado del que sal�a y lo
+	 * recupera al ser reanudada.
+	 * 
+	 * @param stopped
+	 * @throws NotAvailableStateException
+	 */
+	public void enableStopped();
+	
+	/**
+	 * Desactiva la detenci�n de la capa. En este estado la capa no puede ser abierta.
+	 * Existen motivos por los cuales una capa no debe ser accedida por ning�n motivo 
+	 * aunque el dataset est� abierto y las estructuras cargadas, en este caso se define un
+	 * estado de detenci�n. Cuando una capa es detenida recuerda el estado del que sal�a y lo
+	 * recupera al ser reanudada.
+	 * 
+	 * @param stopped
+	 */
+	public void disableStopped();	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ILayerState.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IRasterLayerActions.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IRasterLayerActions.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IRasterLayerActions.java	(revision 15423)
@@ -0,0 +1,65 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.fmap.layers;
+
+/**
+ * Definici�n de acciones soportadas para una capa. Distintas capas que hereden de 
+ * FLyrRasterSE pueden soportar distintos tipos de acciones.
+ * @version 23/08/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface IRasterLayerActions {
+	public static int ZOOM_PIXEL_RESOLUTION = 0;
+	public static int CLIPPING              = 1;
+	public static int HISTOGRAM             = 2;
+	public static int RASTER_PROPERTIES     = 3;
+	public static int SAVEAS                = 4;
+	public static int FILTER                = 5;
+	public static int COLOR_TABLE           = 6;
+	public static int FLYRASTER_BAR_TOOLS   = 7;
+	public static int BANDS_FILE_LIST       = 8;
+	public static int BANDS_RGB             = 9;
+	public static int TRANSPARENCY          = 10;
+	public static int OPACITY               = 11;
+	public static int BRIGHTNESSCONTRAST    = 12;
+	public static int ENHANCED              = 13;
+	public static int PANSHARPENING         = 14;
+	public static int GEOLOCATION           = 15;
+	public static int CREATEOVERVIEWS       = 16;
+	public static int REPROJECT             = 17;
+	public static int SELECT_LAYER          = 18;
+	public static int SAVE_COLORINTERP      = 19;
+	public static int REMOTE_ACTIONS        = 20;
+	public static int STATS                 = 21;
+	public static int NODATA                = 22;
+	public static int TAILTRIM              = 23;
+	
+	/**
+   * Controla si una acci�n est� activa o no para una determinada capa. De esta
+   * forma una determinada capa puede desactivar una entrada del TOC que no le
+   * interese que aparezca.
+   * @param action Acci�n definida en LayerActionSupported
+   * @return true si est� activa y false si no lo est�.
+   */
+	public boolean isActionEnabled(int action);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/IRasterLayerActions.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectIteratorRasterInfo.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectIteratorRasterInfo.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectIteratorRasterInfo.java	(revision 15423)
@@ -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.fmap.layers;
+
+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 DynObjectIteratorRasterInfo 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 DynObjectIteratorRasterInfo(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/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectIteratorRasterInfo.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectSetRasterInfo.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectSetRasterInfo.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectSetRasterInfo.java	(revision 15423)
@@ -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.fmap.layers;
+
+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.DynField;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.DynObjectSet;
+import org.gvsig.tools.dynobject.impl.DefaultDynObject;
+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 DynObjectSetRasterInfo extends BaseWeakReferencingObservable
+    implements DynObjectSet, Observer {
+	private DynObjectIteratorRasterInfo   ite      = null;
+	private DynClass                      dynClass = null;
+	
+    /**
+     * Creates a new facade over a given info, with fast dynobject
+     * iteration.
+     */
+    public DynObjectSetRasterInfo() {
+        dynClass =
+            ToolsLocator.getDynObjectManager().createDynClass(
+                "RasterInfoByPoint", "Raster", "Raster point information");
+    }
+
+    /**
+     * Adds a field to the DynObject
+     * @param name
+     * @param object
+     * @param order
+     */
+    public void addField(String name, Object object, int order) {
+    	DynField field = dynClass.addDynField(name);
+    	field.setDefaultFieldValue(object);
+    	if(order != -1)
+    		field.setOrder(order);
+    	DefaultDynObject dynObject = new DefaultDynObject(dynClass);
+    	ite = new DynObjectIteratorRasterInfo(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 {
+    }
+
+    public void update(Observable observable, Object notification) {
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DynObjectSetRasterInfo.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrRaster.java	(revision 15423)
@@ -0,0 +1,411 @@
+/* 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.fmap.layers;
+
+import java.awt.Graphics2D;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.util.Historical;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.LayerListener;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.tools.task.Cancellable;
+
+/**
+ * All kind of raster layers should implement this interface.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+@SuppressWarnings("deprecation")
+public interface FLyrRaster extends FLayer {
+	/**
+	 * Sets the layer as initialized. That's implies that the layer has
+	 * the right filters and is opened,
+	 * @param initialized
+	 */
+	public void setLayerInitialized(boolean initialized);
+
+	/**
+	 * Gets the uniform resource identifier
+	 * @return
+	 */
+	public URI getURI();
+
+	/**
+	 * Returns true if a color table exists
+	 * @return
+	 */
+	public boolean existColorTable();
+
+	/**
+	 * Define la ultima leyenda valida de la capa o se pone a null para que la
+	 * capa busque una leyenda valida.
+	 * @param ct
+	 */
+	public void setLastLegend(ColorTable ct);
+
+	/**
+	 * Crea el objeto renderizador de raster
+	 * @return Rendering
+	 */
+	public Render getRender();
+
+	/**
+	 * Gets the MapContext object
+	 * @return
+	 */
+	public MapContext getMapContext();
+
+	/**
+	 * Gets the full extent
+	 * @return
+	 */
+	public Extent getFullRasterExtent();
+
+	/**
+	 * Gets the DataStore
+	 * @return
+	 */
+	public RasterDataStore getDataStore();
+
+	/**
+	 * Metodo para consultar si una capa puede ser un RGB. Suponemos que es un RGB
+	 * si el tipo de datos es de tipo byte y su interpretacion de color tiene
+	 * asignada los tres colores.
+	 * @return boolean
+	 */
+	public boolean isRGB();
+
+	/**
+	 * Returns true if the drawn is going to be tiled
+	 * @return
+	 */
+	public boolean isTiled();
+
+	/**
+	 * Gets the regions of interest
+	 * @return
+	 * @throws ROIException
+	 */
+	public List<ROI> getRois() throws ROIException;
+
+	/**
+	 * Sets the regions of interest
+	 */
+	public void setRois(List<ROI> rois);
+
+	/**
+	 * Sets the files which contain the regions of interest. This method is temporal until
+	 * after the refactoring of ROIs.
+	 * @param file
+	 * @throws RmfSerializerException
+	 */
+	public void setROIsFiles(List<File> file) throws RmfSerializerException;
+
+	/**
+	 * Gets the files which contain the regions of interest. This method is temporal until
+	 * after the refactoring of ROIs.
+	 * @return
+	 * @throws RmfSerializerException
+	 */
+	public List<File> getROIsFiles() throws RmfSerializerException;
+
+	/**
+	 * Obtiene la proyecci�n del fichero.
+	 * @return IProjection
+	 */
+	public IProjection readProjection() throws RasterDriverException;
+
+	/**
+	 * Gets the tile size
+	 * @return
+	 */
+	public int[] getTileSize();
+
+	/**
+	 * Obtiene el valor NoData asociado al raster.
+	 * @return double
+	 */
+	public NoData getNoDataValue();
+
+	/**
+	 * Returs a string with the extension of the first file
+	 */
+	public String getFileFormat();
+
+	/**
+	 * Obtiene el flag que dice si la imagen est� o no georreferenciada
+	 * @return true si est� georreferenciada y false si no lo est�.
+	 */
+	public boolean isGeoreferenced();
+
+	/**
+	 * Returns the number of bands of each dataset
+	 * @return
+	 */
+	public int[] getBandCountFromDataset();
+
+	/**
+	 * Gets the projection in well known text format
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	public String getWktProjection() throws RasterDriverException;
+
+	/**
+	 * Gets the color interpretation
+	 * @param band
+	 * @param dataset
+	 * @return
+	 */
+	public String getColorInterpretation(int band, int dataset);
+
+	/**
+	 * When a process is using information of this layer this variable will contain
+	 * the thread ID.
+	 * @param readingData
+	 */
+	public void setReadingData(String readingData);
+
+	/**
+	 * Sets the nodata value for this layer
+	 * @param noDataValue the noDataValue to set
+	 */
+	public void setNoDataValue(NoData noDataValue);
+
+	/**
+	 * Sets the minimum scale visible. Lower scales won't be drawn.
+	 *
+	 * @param minScale the scale > 0, -1 if not defined
+	 * @see #getMinScale()
+	 */
+	public void setMinScale(double minScale);
+
+	/**
+	 * Sets the maximum scale visible. Higher scales won't be drawn.
+	 *
+	 * @param maxScale the scale > 0, -1 if not defined
+	 * @see #getMaxScale()
+	 */
+	public void setMaxScale(double maxScale);
+
+	/**
+	 * Returns the maximum scale visible. Higher scales won't be drawn.
+	 *
+	 * @return the maximum scale > 0, -1 if not defined
+	 * @see #setMaxScale(double)
+	 */
+	public double getMaxScale();
+
+	/**
+	 * Returns the minimum scale visible. Lower scales won't be drawn.
+	 *
+	 * @return the minimum scale > 0, -1 if not defined
+	 * @see #setMinScale(double)
+	 */
+	public double getMinScale();
+
+	/**
+	 * @return Returns the removeRasterFlag.
+	 */
+	public boolean isRemoveRasterFlag();
+
+	/**
+	 * Asigna el valor del flag que dice si destruimos la memoria del raster
+	 * al eliminarlo del TOC o  no.
+	 * @param removeRasterFlag The removeRasterFlag to set.
+	 */
+	public void setRemoveRasterFlag(boolean removeRasterFlag);
+
+	/**
+	 * Borra de la lista de listeners el que se pasa como par�metro.
+	 *
+	 * @param o LayerListener a borrar.
+	 *
+	 * @return True si ha sido correcto el borrado del Listener.
+	 */
+	public boolean removeLayerListener(LayerListener o);
+
+	/**
+	 * @throws ReadException
+	 * @throws ReadDriverException
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage,
+	 * 		java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort,
+	 * 		com.iver.utiles.swing.threads.Cancellable)
+	 */
+	public void draw(BufferedImage image, Graphics2D g, ViewPort vp, Cancellable cancel, double scale) throws ReadException;
+
+	/**
+	 * Clones this layer
+	 * @return
+	 * @throws Exception
+	 */
+	public FLayer cloneLayer() throws Exception;
+
+	/**
+	 * Gets a layer which the source is a file
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	public FLayer getFileLayer() throws RasterDriverException;
+
+	/**
+	 * Gets the position of the alpha band
+	 * @return
+	 */
+	public int getAlphaBandNumber();
+
+	public String getName();
+
+	/**
+	 * Gets the projection
+	 * @return
+	 */
+	public IProjection getProjection();
+
+	/**
+	 * Devuelve si es reproyectable o no la capa
+	 * @return
+	 */
+	public boolean isReproyectable();
+
+	/**
+	 * Recupera del raster la matriz de transformaci�n que lo situa en cualquier parte de la vista
+	 * @return AffineTransform
+	 */
+	public AffineTransform getAffineTransform();
+
+	/**
+	 * Obtiene la lista de transformaciones que se han ido aplicando al raster.
+	 * @return Historical. Lista de AffineTransform
+	 */
+	public Historical getAffineTransformHistorical();
+
+	/**
+	 * Asigna al raster la matriz de transformaci�n para situarlo en cualquier parte de la vista
+	 * @param transf
+	 */
+	public void setAffineTransform(AffineTransform transf);
+
+	/**
+	 * Asigna al raster la matriz de transformaci�n para situarlo en cualquier parte de la vista.
+	 * Esta versi�n no guarda en el historico.
+	 * @param transf
+	 */
+	public void setAffineTransformWithoutHistorical(AffineTransform transf);
+
+	/**
+	 * Salva la georreferenciaci�n a fichero rmf.
+	 * @param fName
+	 * @throws RmfSerializerException
+	 */
+	public void saveGeoToRmf() throws RmfSerializerException;
+
+	/**
+	 * Metodo que obtiene si un punto cae dentro de los l�mites de la capa
+	 * o fuera de ellos.
+	 * @param p Punto a calcular
+	 * @return true si est� dentro de los l�mites y false si est� fuera
+	 */
+	public boolean isInside(Point2D p);
+
+	/**
+	 * Returns true if this layer is remote
+	 * @return
+	 */
+	public boolean isRemote();
+
+	/**
+	 * Gets the attribute list
+	 * <UL>
+	 * <LI>Filename</LI>
+	 * <LI>Filesize</LI>
+	 * <LI>Width</LI>
+	 * <LI>Height</LI>
+	 * <LI>Bands</LI>
+	 * </UL>
+	 * @return ArrayList<Object>
+	 */
+	public ArrayList<Object> getAttributes();
+
+	/**
+	 * Returns the full bounding box of this layer
+	 * @return
+	 */
+	public Envelope getFullEnvelope();
+
+	/**
+	 * Ajusta las coordenadas especificadas en el par�metro al �rea m�xima
+	 * del raster en p�xeles.
+	 * @param req Punto a ajustar dentro del extener del raster
+	 */
+	public Point2D adjustWorldRequest(Point2D req);
+
+	/**
+	 * Adds a new file. The behavior of this function depends on
+	 * the kind of provider and its implementation.
+	 * @param file
+	 * @throws InvalidSourceException
+	 */
+	public void addFile(File file) throws InvalidSourceException;
+
+	/**
+	 * Removes a file. The behavior of this function depends on
+	 * the kind of provider and its implementation.
+	 * @param file
+	 */
+	public void removeFile(File file);
+
+	/**
+	 * When this flag is true then renderice nodata value as transparent
+	 * @param t
+	 */
+	public void setNoDataTransparent(boolean t);
+
+	/**
+	 * Sets the layer projection
+	 * @param proj
+	 */
+	public void setProjection(IProjection proj, boolean persist) throws RmfSerializerException;
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/FLyrRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/GeorefPanListenerImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/GeorefPanListenerImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/GeorefPanListenerImpl.java	(revision 15423)
@@ -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.fmap.layers;
+
+import java.awt.Image;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.GeometryManager;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontrol.MapControl;
+import org.gvsig.fmap.mapcontrol.tools.Events.MoveEvent;
+import org.gvsig.fmap.mapcontrol.tools.Listeners.PanListener;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+
+/**
+ * Implementaci�n de la interfaz PanListener como herramienta para realizar el
+ * Pan.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GeorefPanListenerImpl implements PanListener {
+	private static final GeometryManager 	geomManager	= GeometryLocator.getGeometryManager();
+	private static final Logger 			logger 		= LoggerFactory.getLogger(GeorefPanListenerImpl.class);
+//	private final Image ipan = new ImageIcon(MapControl.class.getResource(
+//				"images/CruxCursor.png")).getImage();
+//	private Cursor cur = Toolkit.getDefaultToolkit().createCustomCursor(ipan,
+//			new Point(16, 16), "");
+	private MapControl 						mapControl;
+	private DefaultFLyrRaster 					lyrRaster 	= null;
+	private String							pathToFile 	= null;
+
+
+	/**
+	 * Crea un nuevo RectangleListenerImpl.
+	 *
+	 * @param mapControl MapControl.
+	 */
+	public GeorefPanListenerImpl(MapControl mapControl) {
+		this.mapControl = mapControl;
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.PanListener#move(java.awt.geom.Point2D,
+	 * 		java.awt.geom.Point2D)
+	 */
+	@SuppressWarnings("deprecation")
+	public void move(MoveEvent event) {
+		ViewPort vp = mapControl.getMapContext().getViewPort();
+
+		Point2D from = vp.toMapPoint(event.getFrom());
+		Point2D to = vp.toMapPoint(event.getTo());
+
+		Rectangle2D.Double r = new Rectangle2D.Double();
+		Rectangle2D extent = vp.getExtent();
+		r.x = extent.getX() - (to.getX() - from.getX());
+		r.y = extent.getY() - (to.getY() - from.getY());
+		r.width = extent.getWidth();
+		r.height = extent.getHeight();
+		Envelope env;
+		try {
+			env = geomManager.createEnvelope(r.getMinX(), r.getMinY(), r
+					.getMaxX(), r.getMaxY(), SUBTYPES.GEOM2D);
+			vp.setEnvelope(env);
+		} catch (CreateEnvelopeException e) {
+			logger.error("Error creating the envelope", e);
+		}
+		
+
+
+		// mapControl.drawMap();
+	}
+
+	/**
+	 * @see com.iver.cit.gvsig.fmap.tools.Listeners.ToolListener#cancelDrawing()
+	 */
+	public boolean cancelDrawing() {
+		return true;
+	}
+
+	/**
+	 * @return Returns the lyrRaster.
+	 */
+	public DefaultFLyrRaster getLyrRaster() {
+		return lyrRaster;
+	}
+
+	/**
+	 * @param lyrRaster The lyrRaster to set.
+	 */
+	public void setLyrRaster(DefaultFLyrRaster lyrRaster) {
+		this.lyrRaster = lyrRaster;
+	}
+
+	/**
+	 * @return Returns the pathToFile.
+	 */
+	public String getPathToFile() {
+		return pathToFile;
+	}
+
+	/**
+	 * @param pathToFile The pathToFile to set.
+	 */
+	public void setPathToFile(String pathToFile) {
+		this.pathToFile = pathToFile;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.mapcontrol.tools.Listeners.ToolListener#getImageCursor()
+	 */
+	public Image getImageCursor() {
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/GeorefPanListenerImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/RasterDrawStrategy.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/RasterDrawStrategy.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/RasterDrawStrategy.java	(revision 15423)
@@ -0,0 +1,258 @@
+/* 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.fmap.layers;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+
+/**
+ * Aplica estrategias de dibujado para las capas raster. Hace que las 
+ * capas que est�n ocultas por otras no sean dibujadas. Esta estrategia tiene que ser
+ * aplicada a capas raster de FMap por falta de eficiencia en el dibujado. Esta clase
+ * es totalmente dependiente de FMap y puede ser eliminada en caso de que este no exita.
+ * 28/11/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class RasterDrawStrategy {
+
+	/**
+	 * Cada mapContext existente lleva asociadad una estrategia de dibujado
+	 */
+	public static HashMap<MapContext, HashMap<DefaultFLyrRaster, Boolean>>        
+	                             mapContextStrategy    = new HashMap<MapContext, HashMap<DefaultFLyrRaster, Boolean>> ();
+	
+	private MapContext           mapContext            = null;
+	private DefaultFLyrRaster         lyrRaster             = null;
+
+	/**
+	 * Estructura de datos para almacenar la asociaci�n entre el extent de una capa
+	 * y su informaci�n de transparencia. Esta es necesaria para la comprobaci�n de si la 
+	 * capa con la que se est� intersectando tiene transparencia o no la tiene. Con esto 
+	 * se puede decidir si dibujar la capa actual o no.
+	 * 16/06/2008
+	 * @author Nacho Brodin nachobrodin@gmail.com
+	 */
+	public class LayerIntersection {
+		public Extent  extent          = null;
+		public boolean hasTransparency = false;
+		/**
+		 * Constructor. Asigna el Extent y la informaci�n de transparencia
+		 * @param ext Extent
+		 * @param transp Transparencia
+		 */
+		public LayerIntersection(Extent ext, boolean transp) {
+			this.extent = ext;
+			this.hasTransparency = transp;
+		} 
+	}
+	/**
+	 * Al constructor le pasamos el contexto de dibujado para la toma de decisi�n.
+	 * @param mapContext Context
+	 * @throws ExpansionFileReadException
+	 * @throws ReadDriverException
+	 */
+	public RasterDrawStrategy(MapContext mapContext, DefaultFLyrRaster lyrRaster) {
+		this.mapContext = mapContext;
+		this.lyrRaster = lyrRaster;
+	}
+	
+	/**
+	 * <P>
+	 * Estrategia de dibujado para las capas raster que hace que si
+	 * una capa est� oculta completamente por otra que no tiene transparencias entonces
+	 * esta no ser� dibujada.
+	 * </P>
+	 * <P>
+	 * La estrategia la calcula solo la primera capa raster que aparezca. El resto
+	 * de las capas la preguntaran a esta.
+	 * </P>
+	 * <P>
+	 * <code>Estrategia:</code>
+	 * Analizamos la lista de capas desde la primera que se dibuja en el TOC hasta la �ltima
+	 * <UL>
+	 * <LI>Si la capa tiene rotaci�n se dibuja siempre.</LI>
+	 * <LI>Si la capa no est� activa en el TOC no se dibuja nunca</LI>
+	 * <LI>Si la capa no es transparente y no hay extents en la lista se dibuja y se a�ade el extent a la lista</LI>
+	 * <LI>Si el extent de la capa intersecta con uno de la lista</LI>
+	 * </UL>
+	 * Comprobamos si est� detr�s de un extent de la lista. Si es as� no se dibuja
+	 * Si no est� est� detr�s de un extent comprobamos si tiene transparencias
+	 * Si no tiene transparencias a�adimos el extent a la lista
+	 * </P>
+	 * @param lyrs
+	 * @throws ReadDriverException 
+	 * @throws ExpansionFileReadException 
+	 */
+	public void stackStrategy() {
+		if(mapContext == null || lyrRaster == null)
+			return;
+		
+		ArrayList<FLayer> listLayers = new ArrayList<FLayer>();
+		FLayers lyrs = mapContext.getLayers();
+		listLayers = getLayerList(lyrs, listLayers);
+		
+		ArrayList<LayerIntersection> extentList = new ArrayList<LayerIntersection>();
+				
+		//Solo la primera capa calcula la estrategia. Las dem�s se la preguntan a esta.
+		
+		//Calculamos cual es la primera capa raster de FLayers y contamos cuantas capas raster hay
+		int posFirstRasterLayer = 0;
+		int nRasterLayers = 0;
+		boolean firstTime = true;
+		for (int i = 0; i < listLayers.size(); i++) {
+			FLayer lyr = (FLayer) listLayers.get(i);
+			if(firstTime && lyr instanceof DefaultFLyrRaster && lyr.isVisible()) {
+				posFirstRasterLayer = i;
+				firstTime = false;
+			}
+			if(lyr instanceof DefaultFLyrRaster)
+				nRasterLayers ++;
+		}
+		
+		//Si hay solo una capa raster no se calcula ninguna estrategia
+		if(nRasterLayers == 1) {
+			mapContextStrategy.put(mapContext, null);
+			return;
+		}
+		
+		//Si no es la primera capa se obtiene la estrategia que calcul� la primera capa
+		if(lyrRaster != listLayers.get(posFirstRasterLayer)) {
+			if(!(listLayers.get(posFirstRasterLayer) instanceof DefaultFLyrRaster))
+				return;
+			mapContextStrategy.put(mapContext, ((DefaultFLyrRaster)listLayers.get(posFirstRasterLayer)).getRasterStrategy());
+			return;
+		}
+		
+		HashMap<DefaultFLyrRaster, Boolean> layersToPaint = new HashMap<DefaultFLyrRaster, Boolean>();
+		
+		//Calculo de estrategia. Solo llega aqu� la primera capa.
+		//La lista de capas en FLayers est� en orden inverso a lo que aparece en el TOC, es decir, la �ltima capa
+		//del TOC es la primera de la lista de FLayers y la primera del TOC es la �ltima de la lista.
+		for (int i = (listLayers.size() - 1); i >= 0; i--) {
+			FLayer lyr = (FLayer) listLayers.get(i);
+			
+			if (!(lyr instanceof DefaultFLyrRaster))
+				continue;
+			
+			DefaultFLyrRaster rLyr = ((DefaultFLyrRaster)lyr);
+			
+			if(rLyr.getRender() == null || rLyr.getRender().getFilterList() == null || rLyr.getFullEnvelope() == null)
+				continue;
+			
+			//Si no est� activa y/o visible no se dibuja nunca 
+			if(!rLyr.isVisible()) {
+				layersToPaint.put(rLyr, new Boolean(false));
+				continue;
+			}
+			
+			//Si tiene rotaci�n se dibuja siempre
+			if(rLyr.getAffineTransform() != null) {
+				if(	rLyr.getAffineTransform().getShearX() != 0 || 
+						rLyr.getAffineTransform().getShearY() != 0) {
+					layersToPaint.put(rLyr, new Boolean(true));
+					continue;
+				}
+			}
+
+			//Si es la primera metemos el extent en la lista y se dibuja
+			//Si no es la primera y no intersecta con ning�n extent. Metemos el extent y dibujamos			
+			LayerIntersection li = areIntersecting(extentList, rLyr);
+			if((i == (listLayers.size() - 1)) || li == null) {
+				boolean colorTableAlpha = false;
+				if(rLyr.getRender().getFilterList() != null) { 
+					Render render = rLyr.getRender();
+					if(render != null) {
+						if(render.getColorTable() != null)
+							colorTableAlpha = render.getColorTable().hasAlpha();
+					}
+				}
+				extentList.add(new LayerIntersection(rLyr.getFullRasterExtent(), (rLyr.existsAlphaBand() || rLyr.isTransparent() || colorTableAlpha)));
+				layersToPaint.put(rLyr, new Boolean(true));
+				continue;
+			}
+			
+			//Si con la que intersecta no tiene transparencia no se dibuja
+			if(li != null && !li.hasTransparency) {
+				layersToPaint.put(rLyr, new Boolean(false));
+				continue;
+			}
+			
+			if(!rLyr.isTransparent())
+				li.hasTransparency = false;
+			layersToPaint.put(rLyr, new Boolean(true));			
+		}
+		
+		mapContextStrategy.put(mapContext, layersToPaint);
+	}
+	
+		
+	/**
+	 * Obtiene la lista de capas del TOC. Si hay capas agrupadas lo tiene en cuenta y mira
+	 * dentro de la agrupaci�n.
+	 * @param srcLyrs
+	 * @param destLyrs
+	 * @return
+	 */
+	public static ArrayList<FLayer> getLayerList(FLayers srcLyrs, ArrayList<FLayer> destLyrs) {
+		for (int i = 0; i < srcLyrs.getLayersCount(); i++) {
+			if(srcLyrs.getLayer(i) instanceof DefaultFLyrRaster)
+				destLyrs.add(srcLyrs.getLayer(i));
+			if(srcLyrs.getLayer(i) instanceof FLayers)
+				destLyrs = getLayerList((FLayers)srcLyrs.getLayer(i), destLyrs);
+		}
+		return destLyrs;
+	}
+	
+	/**
+	 * Comprueba si la capa que se pasa por par�metro est� oculta por alguno
+	 * de los extent de la lista
+	 * @param extentList Lista de extensiones
+	 * @param lyr Capa raster
+	 * @return 
+	 */
+	private LayerIntersection areIntersecting(ArrayList<LayerIntersection> extentList, DefaultFLyrRaster lyr) {
+		for (int i = 0; i < extentList.size(); i++) {
+			Extent ex = lyr.getFullRasterExtent();
+			Extent ex1 = ((LayerIntersection)extentList.get(i)).extent;
+			if(RasterLocator.getManager().getRasterUtils().isInside(ex, ex1))
+				return ((LayerIntersection)extentList.get(i));
+		}
+		return null;
+	}
+		
+	/**
+	 * Obtiene un TreeMap con la lista de capas que se dibujan. Si se al TreeMap se
+	 * le pasa como par�metro una capa raster y devuelve null es que no se dibuja.
+	 *  
+	 * @return TreeMap con la lista de capas a dibujar.
+	 */
+	public HashMap<DefaultFLyrRaster, Boolean> getStrategy() {
+		return (HashMap<DefaultFLyrRaster, Boolean>)mapContextStrategy.get(mapContext);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/RasterDrawStrategy.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/StatusLayerRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/StatusLayerRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/StatusLayerRaster.java	(revision 15423)
@@ -0,0 +1,352 @@
+/* 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.fmap.layers;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.fmap.dal.coverage.exception.FileNotFoundInListException;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSourceException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterListManager;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.tools.ToolsLocator;
+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;
+
+
+
+/**
+ * Esta clase almacena el estado de un raster en cuanto a las caracteristicas
+ * de opacidad, bandas y filtros. Estas caracter�sticas pueden ser salvadas a
+ * un xml y recuperadas por la capa a trav�s de las funciones setXMLEntity y
+ * getXMLEntity
+ *
+ * @deprecated
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class StatusLayerRaster implements IStatusRaster {
+
+	public static String 			defaultClass    = "org.gvsig.fmap.raster.layers.StatusLayerRaster";
+
+	//Valor de opacidad global de la imagen
+	public int						transparency    = 255;
+
+	//Rangos de transparencia
+	public ArrayList<TransparencyRange>
+	                                ranges          = new ArrayList<TransparencyRange>();
+
+	//(Selecci�n de bandas)N�mero de banda  asignado al Rojo, verde y azul
+	public int 						bandR           = 0;
+	public int 						bandG           = 1;
+	public int 						bandB           = 2;
+
+	public List<File>		        files           = new ArrayList<File>();
+
+	//Filtros para poder montar una nueva pila
+	public List<String>		        filters         = new ArrayList<String>();
+	private DefaultFLyrRaster       layer           = null;
+	private int                     alphaBandNumber = -1;
+
+	//Utilizado para la persistencia
+	private boolean 				loadClass		= false;
+
+	public void loadFromState(PersistentState state, DefaultFLyrRaster layer)throws PersistenceException {
+//		this.layer = layer;
+//		//RECUPERAR PROPIEDADES
+//
+//		//Recuperamos las propiedades de los filtros
+//		for(int i = 0; i < xml.getPropertyCount(); i++) {
+//			if(xml.getPropertyName(i).startsWith("filter."))
+//				filters.add(xml.getPropertyName(i) + "=" + xml.getPropertyValue(i));
+//		}
+//
+//		//Rangos de transparencia
+//		if (xml.contains("filter.transparency.active") && xml.getBooleanProperty("filter.transparency.active")) {
+//			int i = 0;
+//			String value = null;
+//			while(true) {
+//				if(xml.contains("filter.transparency.transparencyRange" + i)) {
+//					value = xml.getStringProperty("filter.transparency.transparencyRange" + i);
+//					int alpha = 0;
+//					if(value.indexOf("@") != 0) {
+//						try {
+//							alpha = Integer.parseInt(value.substring(value.indexOf("@") + 1, value.length()));
+//						} catch (NumberFormatException e) {
+//							alpha = 0;
+//						}
+//						if(value.indexOf("@") != -1)
+//							value = value.substring(0, value.indexOf("@"));
+//					}
+//					TransparencyRange range = new TransparencyRange(value);
+//					if(alpha != 0)
+//						range.setAlpha(alpha);
+//					ranges.add(range);
+//				} else
+//					break;
+//				i ++;
+//			}
+//		}
+//
+//		if(xml.contains("filter.transparency.bandnumber"))
+//			alphaBandNumber = xml.getIntProperty("filter.transparency.bandnumber");
+//
+//		if (xml.contains("raster.opacityLevel")) {
+//			transparency = xml.getIntProperty("raster.opacityLevel");
+//			//Esto soluciona un problema de compatibilidad entre branch v10 y HEAD. Eliminar en futuras versiones
+//			if(nameClass != null && nameClass.compareTo("com.iver.cit.gvsig.fmap.layers.StatusLayerRaster") == 0)
+//				transparency = 255 - transparency;
+//		}
+//
+//		if (xml.contains("raster.bandR"))
+//			bandR = xml.getIntProperty("raster.bandR");
+//
+//		if (xml.contains("raster.bandG"))
+//			bandG = xml.getIntProperty("raster.bandG");
+//
+//		if (xml.contains("raster.bandB"))
+//			bandB = xml.getIntProperty("raster.bandB");
+//
+//
+//		int cont = 0;
+//		while(true && cont < 50) {
+//			if (xml.contains("raster.file" + cont)) {
+//				files.add(xml.getStringProperty("raster.file" + cont));
+//				cont++;
+//			}else
+//				break;
+//		}
+	}
+
+
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		this.transparency = state.getInt("transparency");
+		this.bandR = state.getInt("bandR");
+		this.bandG = state.getInt("bandG");
+		this.bandB = state.getInt("bandB");
+		this.alphaBandNumber = state.getInt("alphaBandNumber");
+		this.loadClass = state.getBoolean("loadClass");
+
+		this.layer = (DefaultFLyrRaster)state.get("layer");
+
+		this.ranges = new ArrayList(state.getList("ranges"));
+		this.files = new ArrayList(state.getList("files"));
+		this.filters = new ArrayList(state.getList("filters"));
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("transparency", this.transparency);
+		state.set("bandR", this.bandR);
+		state.set("bandG", this.bandG);
+		state.set("bandB", this.bandB);
+		state.set("alphaBandNumber", this.alphaBandNumber);
+		state.set("loadClass",this.loadClass);
+		state.set("layer", this.layer);
+		state.set("ranges", this.ranges);
+		state.set("files", this.files);
+		state.set("filters",this.filters);
+	}
+
+	public void setStateProperties(boolean loadClass, DefaultFLyrRaster layer) throws PersistenceException {
+		this.layer = layer;
+		this.loadClass = loadClass;
+	}
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.addDefinition(StatusLayerRaster.class,
+				"StatusLayerRaster_Persistent",
+				"StatusLayerRaster Persistent definition (FIXME loadClass)", null, null);
+		definition.addDynFieldInt("transparency");
+		definition.addDynFieldInt("bandR").setMandatory(true);
+		definition.addDynFieldInt("bandG").setMandatory(true);
+		definition.addDynFieldInt("bandB").setMandatory(true);
+		definition.addDynFieldInt("alphaBandNumber");
+		definition.addDynFieldBoolean("loadClass");
+
+		definition.addDynFieldObject("layer")
+			.setClassOfValue(DefaultFLyrRaster.class);
+
+		definition.addDynFieldList("ranges")
+			.setClassOfItems(TransparencyRange.class);
+
+		definition.addDynFieldList("files")
+			.setClassOfItems(String.class);
+
+		definition.addDynFieldList("filters")
+			.setClassOfItems(String.class);
+	}
+
+	public List<String> getFilters() {
+		return this.filters;
+	}
+
+	public void applyStatus(DefaultFLyrRaster layer) throws NotSupportedExtensionException, RasterDriverException, FilterTypeException, FileNotFoundInListException, OperationNotSupportedException, FilterManagerException, InvalidSourceException {
+
+		//Eliminamos el fichero inicial y cargamos las bandas si hay para que se carguen
+		//en el orden correcto
+		if(layer instanceof DefaultFLyrRaster) {
+			if(files != null && files.size() != 0){
+				//((FLyrRasterSE)layer).delFile((String)files.get(0));
+				for (int i = 1; i < files.size(); i++)
+					((DefaultFLyrRaster)layer).addFile(files.get(i));
+			}
+		}
+
+		//Asigna las bandas
+		String[] valuesCI = new String[layer.getDataStore().getBandCount()];
+		valuesCI[bandR] = ColorInterpretation.RED_BAND;
+		valuesCI[bandG] = ColorInterpretation.GREEN_BAND;
+		valuesCI[bandB] = ColorInterpretation.BLUE_BAND;
+		ColorInterpretation ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(valuesCI);
+		if(layer.getRender() != null)
+			layer.getRender().setRenderColorInterpretation(ci);
+
+		//Asigna la transparencia
+		Transparency transp = layer.getRender().getRenderingTransparency();
+		if(transp != null && transparency != 255) {
+			transp.setOpacity(transparency);
+			transp.activeTransparency();
+		}
+
+		//Rangos de transparencia
+		if(transp != null && ranges != null) {
+			transp.setTransparencyRangeList(ranges);
+			transp.activeTransparency();
+		}
+
+		//Banda de transparencia
+		if(transp != null && alphaBandNumber != -1) {
+			transp.setTransparencyBand(alphaBandNumber);
+			transp.activeTransparency();
+		}
+
+		//Filtros
+		/*if (layer.getRender().getFilterList() != null) {
+			layer.getRender().getFilterList().createFilterListFromStrings((ArrayList<String>)filters);
+			enhancedCompV10((ArrayList<String>)filters, layer);
+			//sortFilters(layer.getRenderFilterList());
+		}*/
+
+		//Refrescamos todas las vistas
+		layer.getMapContext().invalidate();
+		/*IWindow[] w = PluginServices.getMDIManager().getAllWindows();
+		for (int i = 0; i < w.length; i++) {
+			if(w[i] != null && w[i] instanceof AbstractViewPanel)
+				((AbstractViewPanel)w[i]).getMapControl().getMapContext().invalidate();
+		}*/
+	}
+
+	/**
+	 * M�todo para mantener la compatibilidad con la v10 del realce. El realce de la v10 no
+	 * aporta suficiente informaci�n por lo que se a�ade un filtro de realce generico v1.9
+	 * @param filterArguments
+	 * @param layer
+	 * @param filterListManager
+	 * @throws FilterTypeException
+	 * @throws FilterManagerException
+	 */
+	public static void enhancedCompV10(ArrayList<String> filterArguments, DefaultFLyrRaster layer) throws FilterTypeException, FilterManagerException {
+		RasterFilterList filterList = layer.getRender().getFilterList();
+		filterList.remove("enhanced_stretch");
+		filterList.remove("tailTrim");
+
+		/*boolean removed = false;
+		RasterFilterList list = layer.getRender().getFilterList();
+		for (int i = 0; i < list.lenght(); i++) {
+			RasterFilter f = list.get(i);
+			if(f instanceof TailTrimFilter || f instanceof LinearEnhancementFilter) {
+				list.remove(f.getName());
+				removed = true;
+			}
+		}
+		if(removed)
+			list.controlTypes();*/
+
+		//Para compatibilidad de realce con proyectos antiguos
+		for (int i = 0; i < filterArguments.size(); i++) {
+			if(((String)filterArguments.get(i)).startsWith("filter.enhanced.active=true")) {
+				RasterFilterListManager enhancementManager = filterList.getManagerByID("EnhancementStretch");
+				Params params = filterList.createEmptyFilterParams();
+				params.setParam("stats", ((RasterDataStore)layer.getDataStore()).getStatistics());
+				params.setParam("remove", new Boolean(false));
+				params.setParam("renderBands", layer.getRender().getRenderColorInterpretation().buildRenderBands());
+				params.setParam("stretchs", null);//coge el LinearStretchParams por defecto
+				enhancementManager.addFilter(params);
+			}
+		}
+	}
+
+	public int[] getRenderBands() {
+		return new int[]{bandR, bandG, bandB};
+	}
+
+	public RasterFilterList getFilterList() throws FilterTypeException {
+		/*RasterManager rManager = RasterLocator.getManager();
+		try {
+			RasterFilterList filterList = layer.getRender().getFilterList();
+			if(filterList != null)
+				filterList.createFilterListFromStrings((ArrayList<String>)filters);
+			else {
+				filterList = rManager.createEmptyFilterList(Buffer.TYPE_BYTE);
+			}
+
+			return filterList;
+		} catch (NullPointerException e) {
+			return null;
+		}*/
+		return null;
+	}
+
+	public ColorTable getColorTable() throws FilterTypeException {
+		return layer.getRender().getColorTable();
+	}
+
+	public List<String> getFilterArguments() {
+		return filters;
+	}
+
+	String nameClass = null;
+	/**
+	 * Asigna el nombre de la clase que se ha leido desde el proyecto
+	 * @param nameClass
+	 */
+	public void setNameClass(String nameClass) {
+		this.nameClass = nameClass;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/StatusLayerRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultFLyrRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultFLyrRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultFLyrRaster.java	(revision 15423)
@@ -0,0 +1,1894 @@
+/* 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.fmap.layers;
+
+import java.awt.Dimension;
+import java.awt.Graphics2D;
+import java.awt.Point;
+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.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Set;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.compat.print.PrintAttributes;
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilePaletteException;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+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.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterListManager;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.grid.render.VisualPropertyEvent;
+import org.gvsig.fmap.dal.coverage.grid.render.VisualPropertyListener;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+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.RasterFileStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.util.CRSUtils;
+import org.gvsig.fmap.dal.coverage.util.ColorConversion;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.Historical;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.fmap.dal.exception.CloseException;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.Geometry.TYPES;
+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.geom.type.GeometryType;
+import org.gvsig.fmap.geom.type.GeometryTypeNotSupportedException;
+import org.gvsig.fmap.geom.type.GeometryTypeNotValidException;
+import org.gvsig.fmap.mapcontext.MapContextLocator;
+import org.gvsig.fmap.mapcontext.MapContextManager;
+import org.gvsig.fmap.mapcontext.ViewPort;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.exceptions.ReloadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLyrDefault;
+import org.gvsig.fmap.mapcontext.layers.LayerChangeSupport;
+import org.gvsig.fmap.mapcontext.layers.LayerListener;
+import org.gvsig.fmap.mapcontext.layers.Tiling;
+import org.gvsig.fmap.mapcontext.layers.operations.Classifiable;
+import org.gvsig.fmap.mapcontext.layers.operations.InfoByPoint;
+import org.gvsig.fmap.mapcontext.layers.operations.SingleLayer;
+import org.gvsig.fmap.mapcontext.rendering.legend.ILegend;
+import org.gvsig.fmap.mapcontext.rendering.legend.events.listeners.LegendListener;
+import org.gvsig.raster.fmap.legend.ColorTableLegend;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.util.RasterNotLoadException;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObjectManager;
+import org.gvsig.tools.dynobject.DynObjectSet;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.exception.BaseException;
+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;
+import org.gvsig.tools.task.impl.BaseTaskStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Raster layer
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+@SuppressWarnings("deprecation")
+public class DefaultFLyrRaster extends FLyrDefault implements FLyrRaster, Multiresolution, InfoByPoint, Classifiable,
+		IRasterLayerActions, ILayerState, VisualPropertyListener, SingleLayer {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultFLyrRaster.class);
+    
+	public static final String      PERSISTENT_NAME                = "FLyrRasterSE_Persistent";
+    public static final String      PERSISTENT_DESCRIPTION         = "FLyrRasterSE Persistent";
+    private RasterManager           rManager                       = RasterLocator.getManager();
+	private boolean                 mustTileDraw                   = false;
+	private boolean                 mustTilePrint                  = true;
+	private int                     maxTileDrawWidth               = 200;
+	private int                     maxTileDrawHeight              = 200;
+	private int                     maxTilePrintWidth              = 1500;
+	private int                     maxTilePrintHeight             = 1500;
+	private boolean                 firstLoad                      = false;
+	private boolean                 removeRasterFlag               = true;
+	protected RasterDataStore       dataStore                      = null;
+	protected Render                render                         = null;
+	private int                     posX                           = 0;
+	private int                     posY                           = 0;
+	private double                  posXWC                         = 0;
+	private int                     posYWC                         = 0;
+	private int                     r                              = 0;
+	private int                     g                              = 0;
+	private int                     b                              = 0;
+	private LayerChangeSupport      layerChangeSupport             = new LayerChangeSupport();
+	private FLyrState               state                          = new FLyrState();
+	protected ILegend               lastLegend                     = null;
+	protected ColorTable            colorTableLoadedFromProject    = null;
+	protected boolean               loadedFromProject              = false;
+	private RasterDrawStrategy      strategy                       = null;
+	static private IConfiguration   configuration                  = new DefaultLayerConfiguration();
+	protected int                   zoomLevel                      =  1;
+	public boolean                  recalcLevel                    = true;
+	private URI                  uri                            = null;
+
+	private static GeometryManager  geomManager   	               = GeometryLocator.getGeometryManager();
+	private static final Logger     logger                         = LoggerFactory.getLogger(DefaultFLyrRaster.class);
+	protected FileUtils             fileUtil                       = RasterLocator.getManager().getFileUtils();
+	protected RasterUtils           rasterUtil                     = RasterLocator.getManager().getRasterUtils();
+	protected CRSUtils              crsUtil                        = RasterLocator.getManager().getCRSUtils();
+	protected MathUtils             mathUtil                       = RasterLocator.getManager().getMathUtils();
+
+	public class RasterTaskStatus extends BaseTaskStatus {
+		Cancellable c = null;
+
+		public RasterTaskStatus(String tittle, Cancellable c) {
+			super(tittle);
+			this.c = c;
+		}
+
+		public boolean isCancellationRequested() {
+			if(c != null)
+				return this.c.isCanceled();
+			return false;
+		}
+
+		public void cancelRequest() {
+			if(c != null)
+				this.c.setCanceled(true);
+		}
+	}
+
+	/**
+	 * Lista de transformaciones afines que son aplicadas. Esta lista es
+	 * simplemente un historico que no se utiliza. Es posible utilizarlo para
+	 * recuperar transformaciones anteriores.
+	 */
+	private Historical              affineTransformList    = null;
+	protected String                readingData            = null;
+	//It is set to true if the method init has been called at least once
+	private boolean                 layerInitialize        = false;
+
+	public DefaultFLyrRaster() {
+		affineTransformList = rManager.createHistoricalService();
+	}
+
+	public static void registerDynClass() {
+		DynObjectManager manager = ToolsLocator.getDynObjectManager();
+    	DynClass dynClass = manager.add("RasterInfo", "Raster layer Info by point");
+    	dynClass.setNamespace("InfoByPoint");
+    	dynClass.addDynFieldString("File");
+    	dynClass.addDynFieldString("View Point");
+    	dynClass.addDynFieldString("Pixel Point");
+    	dynClass.addDynFieldString("RGB");
+    	dynClass.addDynFieldString("CMYK");
+    	dynClass.addDynFieldString("HSL");
+    	dynClass.addDynFieldString("Band Value");
+    	dynClass.addDynFieldString("World Point");
+	}
+
+	/**
+	 * Builds a new raster layer
+	 * @param fileName
+	 * @return
+	 * @throws RasterNotLoadException
+	 * @throws LoadLayerException
+	 */
+	public static DefaultFLyrRaster createLayer(String layerName, File file) throws LoadLayerException {
+		ProviderServices provServ = RasterLocator.getManager().getProviderServices();
+		RasterDataParameters storeParameters = provServ.createParameters(file.getName());
+		storeParameters.setURI(file.toURI());
+
+		MapContextManager mcm = MapContextLocator.getMapContextManager();
+		DefaultFLyrRaster lyr = (DefaultFLyrRaster) mcm.createLayer(layerName, storeParameters);
+
+		return lyr;
+	}
+
+	public void setName(String name) {
+		super.setName(name);
+
+		//Si la capa tiene nombre acivamos el estado awake
+		if(name != null)
+			try {
+				if(isClosed())
+					enableAwake();
+			} catch (NotAvailableStateException e) {
+				logger.error("Fallo el estado de open. Closed=" + isClosed() + " Active=" + isOpen(), this, e);
+			}
+	}
+
+	public void wakeUp(){
+		try {
+			reload();
+		    enableAwake();
+		} catch (ReloadLayerException | NotAvailableStateException e) {
+			// No se ha podido recuperar la capa con exito
+		}
+	}
+
+	public void load() throws LoadLayerException {
+		if (isStopped() || getDataStore() == null)
+			return;
+
+		enableStopped(); // Paramos la capa mientras se hace un load
+
+		boolean test = false;
+		DataStoreParameters params = getDataStore().getParameters();
+		DataStoreParameters p = params;
+		if (params != null) {
+			if(params instanceof TileDataParameters) {
+				uri = ((RasterDataParameters)params).getURI();
+				if(uri == null)
+					p = (DataStoreParameters)((TileDataParameters)params).getDataParameters();
+			}
+			if(uri == null) {
+				if(params instanceof RasterDataParameters)
+					uri = ((RasterDataParameters)p).getURI();
+			}
+		}
+
+		try {
+			if(!getDataStore().isOpen())
+				dataStore = rManager.getProviderServices().open(params);
+			else
+				dataStore.reload();
+		} catch (NotSupportedExtensionException e) {
+			throw new LoadLayerException(this.getName());
+		} catch (RasterDriverException e) {
+			throw new LoadLayerException(this.getName());
+		}
+	}
+
+	public void setLayerInitialized(boolean initialized) {
+		layerInitialize = initialized;
+	}
+
+	/**
+	 * Acciones de inicializaci�n despu�s de que la fuente de datos
+	 * de la capa est� asignada.
+	 * @throws FilePaletteException
+	 */
+	public void init() throws LoadLayerException, FilePaletteException {
+		layerInitialize = true;
+
+		if (getDataStore() == null)
+			throw new LoadLayerException("Formato no valido", new IOException());
+
+		render = getDataStore().getRender();
+		render.addVisualPropertyListener(this);
+		initFilters();
+
+		//Inicializaci�n del historico de transformaciones
+		affineTransformList.clear();
+		affineTransformList.add(this.getAffineTransform());
+
+		try {
+			if(!isOpen())
+				enableOpen();
+		} catch (NotAvailableStateException e) {
+			throw new LoadLayerException("Fallo el estado de open. Closed=" + isClosed() + " Awake=" + isAwake(), e);
+		}
+	}
+
+	public IProjection readProjection() throws RasterDriverException {
+		try {
+			crsUtil.setCRSFactory(CRSFactory.cp);
+			if( getDataStore() == null )
+				return null;
+			return crsUtil.convertWktToIProjection(getDataStore().getWktProjection());
+		} catch (Exception e) {
+			throw new RasterDriverException("Problems converting from WKT to IProjection", e);
+		} catch (Error e) {
+			e.printStackTrace();
+			return null;
+		}
+	}
+
+	/**
+	 * Crea el objeto renderizador de raster
+	 * @return Rendering
+	 */
+	public Render getRender() {
+		if (render == null) {
+			if(getDataStore() != null) {
+				render = getDataStore().getRender();
+				render.addVisualPropertyListener(this);
+			}
+		}
+		return render;
+	}
+
+	public URI getURI() {
+		return uri;
+	}
+
+	public void setNoDataTransparent(boolean t) {
+		getNoDataValue().setNoDataTransparent(t);
+		if(getRender().getRenderingTransparency() != null) {
+			getRender().getRenderingTransparency().setNoData(getDataStore().getNoDataValue());
+			getRender().getRenderingTransparency().activeTransparency();
+		}
+	}
+
+	/**
+	 * Initializes the filter list to render this raster layer
+	 * @throws FilePaletteException
+	 */
+	protected void initFilters() throws FilePaletteException {
+		if(getDataType() == null)
+			return;
+
+		RasterFilterList filterList = rManager.createEmptyFilterList(getDataType()[0]);
+		if(loadedFromProject) {
+			filterList = getDataStore().getRender().getFilterList();
+		}
+
+		if(getDataStore() == null)
+			return;
+
+		if(getDataStore().getNoDataValue() != null) {
+			getDataStore().getNoDataValue().load();
+		}
+
+		filterList.setInitDataType(getDataType()[0]);
+
+		// Quitamos la leyenda
+		lastLegend = null;
+
+		try {
+			//Si en la carga del proyecto se carg� una tabla de color asignamos esta
+			if(colorTableLoadedFromProject != null) {
+				setLastLegend(colorTableLoadedFromProject);
+				RasterFilterListManager colorTableManager = filterList.getManagerByID("ColorTable");
+				Params params = filterList.createEmptyFilterParams();
+				params.setParam("colorTable", colorTableLoadedFromProject);
+				colorTableManager.addFilter(params);
+			} else
+				//sino ponemos la tabla asociada al raster
+				if (getDataStore().getColorTable() != null) {
+					ColorTable table = getDataStore().getColorTable();
+					setLastLegend(table);
+					RasterFilterListManager colorTableManager = filterList.getManagerByID("ColorTable");
+					Params params = filterList.createEmptyFilterParams();
+					params.setParam("colorTable", table);
+					colorTableManager.addFilter(params);
+				} else //sino hace lo que dice en las preferencias
+					if(getDataStore().needEnhanced() ||
+							(loadedFromProject && filterList.get("enhanced_stretch") != null))
+						loadEnhancedOrColorTable(filterList);
+			colorTableLoadedFromProject = null;
+
+			getRender().setFilterList(filterList);
+			// Inicializo la transparencia para el render
+			/*if(!loadedFromProject) {
+				getRender().setLastTransparency(getDataStore().getTransparency().cloneTransparency());
+			}*/
+			loadedFromProject = false;
+		} catch (FilterTypeException e) {
+			//Ha habido un error en la asignaci�n de filtros por los que no se a�ade ninguno.
+			logger.error("Error a�adiendo filtros en la inicializaci�n de capa " + this.getName() + " Datatype=" + this.getDataType(), null, e);
+		} catch (FilterManagerException e) {
+			//Ha habido un error en la asignaci�n de filtros por los que no se a�ade ninguno.
+			logger.error("Error a�adiendo filtros en la inicializaci�n de capa " + this.getName() + " Datatype=" + this.getDataType(), null, e);
+		}
+	}
+
+	/**
+	 * Mira la configuracion para saber si debe cargar un realce o una tabla
+	 * de color por defecto
+	 * @param filterManager
+	 * @throws FilterTypeException
+	 * @throws FilePaletteException
+	 */
+	private void loadEnhancedOrColorTable(RasterFilterList filterList) throws FilterTypeException, FilterManagerException, FilePaletteException {
+		String colorTableName = null;
+		if(configuration != null)
+			colorTableName = configuration.getValueString("loadlayer_usecolortable", (String) null);
+
+		String palettesPath = System.getProperty("user.home") +
+		File.separator +
+		"gvSIG" + // PluginServices.getArguments()[0] +
+		File.separator + "colortable";
+
+		Statistics stats = getDataStore().getStatistics();
+		ColorTableLibrary colorTableLibrary = rManager.getDataStructFactory().getColorTableLibrary();
+
+		if (colorTableName != null)
+			try {
+				stats.calculate(RasterLibrary.statisticsScale);
+				if (getDataStore().getBandCount() == 1) {
+					ArrayList<String> fileList = colorTableLibrary.getPaletteFileList(palettesPath);
+					for (int i = 0; i < fileList.size(); i++) {
+						ArrayList<ColorItem> paletteItems = new ArrayList<ColorItem>();
+						String paletteName = colorTableLibrary.loadPalette(palettesPath, (String) fileList.get(i), paletteItems);
+						if (paletteName.equals(colorTableName)) {
+							if (paletteItems.size() <= 0)
+								continue;
+
+							ColorTable colorTable = colorTableLibrary.createColorTable();
+							colorTable.setName(paletteName);
+							colorTable.createPaletteFromColorItems(paletteItems, true);
+							colorTable.setInterpolated(true);
+
+							colorTable.createColorTableInRange(stats.getMinimun(), stats.getMaximun(), true);
+
+							setLastLegend(colorTable);
+
+							RasterFilterListManager colorTableManager = filterList.getManagerByID("ColorTable");
+							Params params = filterList.createEmptyFilterParams();
+							params.setParam("colorTable", colorTable);
+							colorTableManager.addFilter(params);
+							return;
+						}
+					}
+				}
+			} catch (FileNotOpenException e) {
+				// No podemos aplicar el filtro
+			} catch (RasterDriverException e) {
+				// No podemos aplicar el filtro
+			} catch (ProcessInterruptedException e) {
+				// El usuario ha cancelado el proceso
+			}
+
+			RasterFilterListManager enhancementManager = filterList.getManagerByID("EnhancementStretch");
+			RasterFilter f = filterList.getByName("enhanced_stretch");
+			if(f == null) {
+				Params params = filterList.createEmptyFilterParams();
+				params.setParam("stats", stats);
+				params.setParam("remove", new Boolean(false));
+				params.setParam("renderBands", getRender().getRenderColorInterpretation().buildRenderBands());
+				params.setParam("stretchs", null);//coge el LinearStretchParams por defecto
+				params.setParam("rgb", new Boolean(true));
+				enhancementManager.addFilter(params);
+			}
+	}
+
+	public boolean isReproyectable() {
+		if (getDataStore() == null)
+			return false;
+		return getDataStore().isReproyectable();
+	}
+
+	/**
+	 * @throws ReadException
+	 * @throws ReadDriverException
+	 * @see com.iver.cit.gvsig.fmap.layers.LayerOperations#draw(java.awt.image.BufferedImage,
+	 * 		java.awt.Graphics2D, com.iver.cit.gvsig.fmap.ViewPort,
+	 * 		com.iver.utiles.swing.threads.Cancellable)
+	 */
+	public void draw(BufferedImage image, Graphics2D g, ViewPort vp, Cancellable cancel, double scale) throws ReadException {
+		TaskEventManager task = rManager.getRasterTask();
+		task.setEvent(null);
+		
+		if(!layerInitialize) {
+			if (getDataStore() != null)
+				try {
+					this.init();
+				} catch (FilePaletteException e) {
+					throw new ReadException("Error in raster legend", e);
+				} catch (LoadLayerException e) {
+					throw new ReadException("Error initializing the layer", e);
+				}
+		}
+
+		try {
+			if (!isOpen())
+				return;
+
+			enableStopped();
+			// callLegendChanged(null);
+
+			//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 = vp.getEnvelope().getLength(0) / (double)vp.getImageWidth();
+				zoomLevel = getDataStore().getNearestLevel(pixelSize);
+			}
+			recalcLevel = true;
+
+			strategy = new RasterDrawStrategy(getMapContext(), this);
+			strategy.stackStrategy();
+			HashMap<DefaultFLyrRaster, Boolean> tStr = strategy.getStrategy();
+			if (tStr != null &&
+				tStr.get(this) != null &&
+				((Boolean) (tStr.get(this))).booleanValue() == false) {
+				disableStopped();
+				return;
+			}
+
+			if (isWithinScale(scale)) {
+
+				if (mustTileDraw) {
+					Point2D p = vp.getOffset();
+					Rectangle r = new Rectangle((int) p.getX(), (int) p.getY(), vp.getImageWidth(), vp.getImageHeight());
+					Tiling tiles = new Tiling(maxTileDrawWidth, maxTileDrawHeight, r);
+					tiles.setAffineTransform((AffineTransform) vp.getAffineTransform().clone());
+					for (int tileNr = 0; tileNr < tiles.getNumTiles(); tileNr++)
+						// drawing part
+						try {
+							ViewPort vport = tiles.getTileViewPort(vp, tileNr);
+							draw(image, g, vport, cancel);
+                        } catch (QueryException | ProcessInterruptedException | NoninvertibleTransformException e) {
+                            throw new ReadException(getDataStore().getFullName(), e);
+                        }
+				} else
+					try {
+						draw(image, g, vp, cancel);
+					} catch (QueryException | ProcessInterruptedException e) {
+						throw new ReadException(getDataStore().getFullName(), e);
+					}
+			}
+
+			//callLegendChanged(null);
+		} finally {
+			disableStopped();
+			task.setEvent(null);
+		}
+	}
+
+    protected void draw(BufferedImage image, Graphics2D g, ViewPort vp, Cancellable cancel)
+        throws QueryException, ProcessInterruptedException {
+		Envelope adjustedExtent = vp.getAdjustedExtent();
+		if (adjustedExtent == null)
+			return;
+		Extent e = rManager.getDataStructFactory().createExtent(adjustedExtent.getLowerCorner().getX(),
+				adjustedExtent.getUpperCorner().getY(), adjustedExtent
+						.getUpperCorner().getX(),
+				adjustedExtent
+						.getLowerCorner().getY());
+		Dimension imgSz = vp.getImageSize();
+		ViewPortData vp2 = rManager.getDataStructFactory().createViewPortData(vp.getProjection(), e, imgSz );
+		vp2.setMat(vp.getAffineTransform());
+		vp2.setDPI((int)vp.getDPI());
+		//vp2.setTime(vp.getTime());
+
+		TaskStatusManager manager = ToolsLocator.getTaskStatusManager();
+		SimpleTaskStatus taskStatus = new RasterTaskStatus("Drawing " + getName() + "...", cancel);
+		manager.add(taskStatus);
+		taskStatus.setAutoremove(true);
+
+		try {
+			if(getDataStore().isTiled()) {
+				getRender().drawTiledService(g, vp2, vp.getImageSize(), this.getCoordTrans(), taskStatus);
+			} else {
+				getRender().draw(g, vp2, this.getCoordTrans(), taskStatus);
+			}
+		} finally {
+			taskStatus.terminate();
+			taskStatus.remove();
+		}
+	}
+
+	/**
+	 * Inserta la proyecci�n.
+	 *
+	 * @param proj Proyecci�n.
+	 */
+	public void setProjection(IProjection proj) {
+		try {
+			getDataStore().setProjection(proj, true);
+			super.setProjection(proj);
+		} catch (RmfSerializerException e) {
+			logger.error("Error saving the projection", e);
+		}
+	}
+
+	public void setProjection(IProjection proj, boolean persist) {
+		try {
+			getDataStore().setProjection(proj, persist);
+			super.setProjection(proj);
+		} catch (RmfSerializerException e) {
+			logger.error("Error saving the projection", e);
+		}
+	}
+
+	public Envelope getFullEnvelope() {
+		//TODO:DEPURACION Comentamos !isOpen porque getFullExtent de FLayers da una excepci�n ya que siempre espera
+		//un extent aunque la capa no est� abierta
+		if(/*!isOpen() || */getDataStore() == null || getDataStore().getExtent() == null)
+			return null;
+
+		Rectangle2D e = getDataStore().getExtent().toRectangle2D();
+		try {
+			Envelope env = geomManager.createEnvelope(e.getX(), e.getY(), e.getMaxX(), e
+					.getMaxY(), SUBTYPES.GEOM2D);
+			
+			if(this.getCoordTrans() != null){
+			    return env.convert(getCoordTrans());
+			}
+			return env;
+		} catch (CreateEnvelopeException e1) {
+			logger.error("Error creating the envelope", e);
+			return null;
+		}
+	}
+
+	/**
+	 * Obtiene el valor del pixel del Image en la posici�n x,y
+	 * @param x Posici�n x
+	 * @param y Posici�n y
+	 * @return valor de pixel
+	 */
+//	public int[] getPixel(int pxx, int pxy) {
+//		int[] argb = { -1, -1, -1, -1 };
+//		if (!isOpen() || (image == null))
+//			return argb;
+//		if (pxx >= 0 && pxx < image.getWidth() && pxy >= 0 && pxy < image.getHeight()) {
+//			int value = image.getRGB(pxx, pxy);
+//			argb[0] = ((value & 0xff000000) >> 24);
+//			argb[1] = ((value & 0x00ff0000) >> 16);
+//			argb[2] = ((value & 0x0000ff00) >> 8);
+//			argb[3] = (value & 0x000000ff);
+//		}
+//		return argb;
+//	}
+
+	public double getMaxX() {
+		if(getFullEnvelope() != null)
+			return getFullEnvelope().getMaximum(0);
+		return -1;
+	}
+
+	public double getMaxY() {
+		if(getFullEnvelope() != null)
+			return this.getFullEnvelope().getMaximum(1);
+		return -1;
+	}
+
+	public double getMinX() {
+		if(getFullEnvelope() != null)
+			return getFullEnvelope().getMinimum(0);
+		return -1;
+	}
+
+	public double getMinY() {
+		if(getFullEnvelope() != null)
+			return getFullEnvelope().getMinimum(1);
+		return -1;
+	}
+
+	public String queryByPoint(Point p) {
+		if (!isOpen())
+			return null;
+		ColorConversion conv = rManager.getColorConversion();
+
+		String data = "<file:" + normalizeAsXMLTag(getName()) + ">\n";
+
+		ArrayList<Object> attr = getAttributes();
+		data += "  <raster\n";
+		data += "    File=\"" + getFile() + "\"\n";
+		for (int i = 0; i < attr.size(); i++) {
+			Object[] a = (Object[]) attr.get(i);
+
+			data += "    " + a[0].toString() + "=";
+			if (a[1].toString() instanceof String)
+				data += "\"" + a[1].toString() + "\"\n";
+			else
+				data += a[1].toString() + "\n";
+		}
+		data += "    Point=\"" + posX + " , " + posY + "\"\n";
+		data += "    Point_WC=\"" + mathUtil.format(posXWC, 3) + " , " + mathUtil.format(posYWC, 3) + "\"\n";
+		data += "    RGB=\"" + r + ", " + g + ", " + b + "\"\n";
+		double[] cmyk = conv.RGBtoCMYK(r & 0xff, g & 0xff, b & 0xff, 1D);
+		data += "    CMYK=\"" + mathUtil.format(cmyk[0], 4) + ", " + mathUtil.format(cmyk[1], 4) + ", " + mathUtil.format(cmyk[2], 4) + "," + mathUtil.format(cmyk[3], 4) + "\"\n";
+		double[] hsl = conv.RGBtoHSL(r & 0xff, g & 0xff, b & 0xff);
+		hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
+		hsl[2] = (int) (hsl[2] * 255. + 0.5);
+		hsl[1] = (int) (hsl[1] * 255. + 0.5);
+		data += "    HSL=\"" + mathUtil.format(hsl[0], 4) + ", " + mathUtil.format(hsl[1], 4) + ", " + mathUtil.format(hsl[2], 4) + "\"\n";
+		data += "  />\n";
+
+		data += "</file:" + normalizeAsXMLTag(getName()) + ">\n";
+		return data;
+	}
+
+	/**
+	 * Filters a string for being suitable as XML Tag, erasing
+	 * all not alphabetic or numeric characters.
+	 * @param s
+	 * @return string normalized
+	 */
+	private String normalizeAsXMLTag(String s) {
+		return s.replaceAll("[^a-zA-Z0-9]", "");
+	}
+
+	public ArrayList<Object> getAttributes() {
+		ArrayList<Object> attr = new ArrayList<Object>();
+		if(!isOpen())
+			return attr;
+		Object [][] a = {
+			{"Filename", getDataStore().getName()},
+			{"Filesize", new Long(getDataStore().getFileSize())},
+			{"Width", new Integer((int)getDataStore().getWidth())},
+			{"Height", new Integer((int)getDataStore().getHeight())},
+			{"Bands", new Integer(getDataStore().getBandCount())}
+		};
+		for (int i = 0; i < a.length; i++)
+			attr.add(a[i]);
+		return attr;
+	}
+
+	public void print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
+			double scale, PrintAttributes propeties) throws ReadException {
+
+		if (/*!isOpen() ||*/ !isVisible() || !isWithinScale(scale))
+			return;
+
+		TaskStatusManager manager = ToolsLocator.getTaskStatusManager();
+		SimpleTaskStatus taskStatus = new RasterTaskStatus("Printing raster " + getName() + "...", cancel);
+		manager.add(taskStatus);
+		taskStatus.setAutoremove(true);
+
+		if (!mustTilePrint)
+			draw(null, g, viewPort, cancel,scale);
+		else {
+			Tiling tiles = new Tiling(maxTilePrintWidth, maxTilePrintHeight, g.getClipBounds());
+			tiles.setAffineTransform((AffineTransform) viewPort.getAffineTransform().clone());
+			taskStatus.setRangeOfValues(0, tiles.getNumTiles());
+			for (int tileNr = 0; tileNr < tiles.getNumTiles(); tileNr++) {
+				// Parte que dibuja
+				try {
+					ViewPort vp = tiles.getTileViewPort(viewPort, tileNr);
+					draw(null, g, vp, cancel, scale);
+					taskStatus.setCurValue(tileNr);
+				} catch (NoninvertibleTransformException e) {
+					throw new ReadException("Error en la transformaci�n.", e);
+				} finally {
+					taskStatus.terminate();
+				}
+			}
+		}
+
+		taskStatus.terminate();
+	}
+
+	/*public void _print(Graphics2D g, ViewPort viewPort, Cancellable cancel,
+			double scale) throws ReadException {
+		if(!isOpen())
+			return;
+
+		// Para no pedir imagenes demasiado grandes, vamos
+		// a hacer lo mismo que hace EcwFile: chunkear.
+		// Llamamos a drawView con cuadraditos m�s peque�os
+		// del BufferedImage ni caso, cuando se imprime viene con null
+
+		int numW, numH;
+		int stepX, stepY;
+		int xProv, yProv;
+		int A = 1500;
+		int H = 1500;
+		int altoAux, anchoAux;
+
+		AffineTransform mat = (AffineTransform) viewPort.getAffineTransform().clone();
+
+		// Vamos a hacerlo en trozos de AxH
+		Rectangle r = g.getClipBounds();
+		numW = (r.width) / A;
+		numH = (r.height) / H;
+
+		double[] srcPts = new double[8];
+		double[] dstPts = new double[8];
+
+		yProv = r.y;
+		for (stepY = 0; stepY < numH + 1; stepY++) {
+			if ((yProv + H) > r.getMaxY())
+				altoAux = (int) r.getMaxY() - yProv;
+			else
+				altoAux = H;
+
+			xProv = r.x;
+			for (stepX = 0; stepX < numW + 1; stepX++) {
+				if ((xProv + A) > r.getMaxX())
+					anchoAux = (int) r.getMaxX() - xProv;
+				else
+					anchoAux = A;
+
+				//Rectangle newRect = new Rectangle(xProv, yProv, anchoAux, altoAux);
+
+				// Parte que dibuja
+				srcPts[0] = xProv;
+				srcPts[1] = yProv;
+				srcPts[2] = xProv + anchoAux + 1;
+				srcPts[3] = yProv;
+				srcPts[4] = xProv + anchoAux + 1;
+				srcPts[5] = yProv + altoAux + 1;
+				srcPts[6] = xProv;
+				srcPts[7] = yProv + altoAux + 1;
+
+				try {
+					mat.inverseTransform(srcPts, 0, dstPts, 0, 4);
+					Rectangle2D.Double rectCuadricula = new Rectangle2D.Double(dstPts[0], dstPts[1], dstPts[2] - dstPts[0], dstPts[5] - dstPts[3]);
+					// Extent extent = new Extent(rectCuadricula);
+
+					Dimension tam = new Dimension(anchoAux + 1, altoAux + 1);
+					ViewPort vp = (ViewPort)viewPort.clone();
+					vp.setImageSize(tam);
+					Envelope env = geomManager.createEnvelope(rectCuadricula
+							.getMinX(), rectCuadricula.getMinY(),
+							rectCuadricula.getMaxX(), rectCuadricula.getMaxY(),
+							SUBTYPES.GEOM2D);
+					vp.setEnvelope(env);
+					vp.setAffineTransform(mat);
+					draw(null, g, vp, cancel, scale);
+
+				} catch (NoninvertibleTransformException e) {
+					//throw new ReadDriverException("Error en la transformaci�n.", e);
+				} catch (ReadException e) {
+					//throw new ReadDriverException("Error en la transformaci�n.", e);
+				} catch (CreateEnvelopeException e) {
+					logger.error("Error creating the envelope", e);
+				} catch (CloneNotSupportedException e) {
+					logger.error("Error cloning the viewport", e);
+				}
+				// Fin parte que dibuja
+				xProv = xProv + A;
+			}
+			yProv = yProv + H;
+		}
+	}*/
+
+	/**
+	 * Borra de la lista de listeners el que se pasa como par�metro.
+	 *
+	 * @param o LayerListener a borrar.
+	 *
+	 * @return True si ha sido correcto el borrado del Listener.
+	 */
+    public boolean removeLayerListener(LayerListener o) {
+        if (this.isRemoveRasterFlag()) {
+            try {
+                enableClosed();
+            } catch (NotAvailableStateException e1) {
+                // No se ha podido cambiar el estado de la capa a cerrado
+            }
+        }
+
+        // Salva a RMF
+        if (getDataStore() != null)
+            // Guardamos la GeoReferenciacion de cada dataset
+            try {
+                getDataStore().saveGeoreferencingToRmf();
+            } catch (Exception e) {
+                logger.info("error_salvando_rmf", e);
+            }
+
+        if (this.isRemoveRasterFlag()) {
+            if (getDataStore() != null) {
+                URI[] uris = getUris().clone();
+
+                try {
+                    getDataStore().close();
+                } catch (CloseException e) {
+                }
+
+                dataStore = null;
+                if (render != null)
+                    render.dispose();
+                render = null;
+                // System.gc();
+                this.setRemoveRasterFlag(true);
+
+                for (int i = 0; i < uris.length; i++) {
+                    if ("FILE".equalsIgnoreCase(uris[i].getScheme())) {
+                        File file = new File(uris[i]);
+                        File dirTemp = fileUtil.getTemporalFile();
+                        if (!file.exists())
+                            continue;
+                        if (dirTemp.compareTo(file.getParentFile()) == 0) {
+                            file.delete();
+
+                            // Borramos todos los ficheros que puedan tener
+                            // relacion con el fichero actual
+                            String basefile = file.getName();
+                            File basepath = file.getParentFile();
+                            int last = basefile.lastIndexOf(".");
+                            if (last != -1)
+                                basefile = basefile.substring(0, last + 1);
+                            File[] list = basepath.listFiles();
+                            for (int j = 0; j < list.length; j++)
+                                if (list[j].getName().startsWith(basefile))
+                                    list[j].delete();
+                        }
+                    }
+                }
+            }
+        }
+        updateDrawVersion();
+        return super.layerListeners.remove(o);
+    }
+
+	public boolean isRemoveRasterFlag() {
+		return removeRasterFlag;
+	}
+
+	public void setRemoveRasterFlag(boolean removeRasterFlag) {
+		this.removeRasterFlag = removeRasterFlag;
+	}
+
+	public String getTocImageIcon() {
+		return "map-ok-ico";
+	}
+
+	public int[] getTileSize() {
+		int[] size = {maxTileDrawWidth, maxTileDrawHeight};
+		return size;
+	}
+
+	public boolean isTiled() {
+		return mustTileDraw;
+	}
+
+	public boolean isGeoreferenced() {
+		return getDataStore().isGeoreferenced();
+	}
+
+	public NoData getNoDataValue() {
+		return getDataStore().getNoDataValue();
+	}
+
+	/**
+	 * Sets the nodata value for this layer
+	 * @param nd
+	 */
+	public void setNoDataValue(NoData nd) {
+		if (getDataStore() != null)
+			getDataStore().setNoDataValue(nd);
+	}
+
+	/**
+	 * Gets the height in world coordinates of this raster layer
+	 */
+	public double getWCHeight() {
+		return getFullEnvelope().getMaximum(1);
+	}
+
+	/**
+	 * Gets the width in world coordinates of this raster layer
+	 */
+	public double getWCWidth() {
+		return getFullEnvelope().getMaximum(0);
+	}
+
+	/**
+	 * Gets the size of all files of this raster layer
+	 */
+	public long[] getFileSize() {
+		if (getDataStore() == null)
+			return null;
+
+		return getDataStore().getFileSizeByProvider();
+	}
+
+	   /**
+     * Gets the list of URIs
+     */
+    public URI[] getUris() {
+        if (getDataStore() == null)
+            return null;
+
+        return getDataStore().getURIByProvider();
+    }
+
+	/**
+	 * Returns the number of files in this raster layer
+	 */
+	public int getFileCount() {
+		return getDataStore().getProviderCount();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.fmap.layers.FLyrRaster#getFileFormat()
+	 */
+	public String getFileFormat() {
+		if(getDataStore().getSourceType() == RasterDataStore.FILE) {
+			String fName = getDataStore().getName();
+			int index = fName.lastIndexOf(".") + 1;
+			String ext = null;
+			if (index > 0)
+				ext = fName.substring(fName.lastIndexOf(".") + 1, fName.length());
+			return ext;
+		}
+		if(getDataStore().getSourceType() == RasterDataStore.POSTGIS) {
+			return "POSTGIS";
+		}
+		return null;
+	}
+
+	public int[] getDataType() {
+		return getDataStore().getDataType();
+	}
+
+	/**
+	 * Sets the filter list
+	 */
+	public void setRenderFilterList(RasterFilterList filterList) {
+		getRender().setFilterList(filterList);
+	}
+
+	public DynObjectSet getInfo(org.gvsig.fmap.geom.primitive.Point p, double tolerance) throws LoadLayerException, DataException {
+		DynObjectSetRasterInfo info = new DynObjectSetRasterInfo();
+
+		if (!isOpen()) {
+			info.addField("Layer not open", normalizeAsXMLTag(getName()), 0);
+			return info;
+		}
+
+		Point2D pReal = new Point2D.Double(p.getX(), p.getY());
+		Point2D px = new Point2D.Double();
+		if(	pReal.getX() > this.getMinX() &&
+			pReal.getX() < this.getMaxX() &&
+			pReal.getY() > this.getMinY() &&
+			pReal.getY() < this.getMaxY()) {
+			px = transformPoint(pReal);
+		}
+		//int[] rgb = getPixel((int) p.getX(), (int) p.getY());
+		//ColorConversion conv = rManager.getColorConversion();
+
+		info.addField("File", normalizeAsXMLTag(getName()), 0);
+		info.addField("View Point", "[" + p.getX() + " , " + p.getY() + "]", 1);
+		info.addField("World Point", "[" + mathUtil.format(pReal.getX(), 3) + " , " + mathUtil.format(pReal.getY(), 3) + "]", 2);
+		if (px == null)
+			info.addField("Pixel Point", "Out", 3);
+		else
+			info.addField("Pixel Point", "[" + (int) px.getX() + ",  " + (int) px.getY() + "]", 3);
+
+		//La informaci�n RGB no puede obtener de la capa
+
+		/*info.addField("RGB", "[" + rgb[1] + ",  " + rgb[2] + ",  " + rgb[3] + "]", 4);
+		double[] cmyk = conv.RGBtoCMYK(rgb[1] & 0xff, rgb[2] & 0xff, rgb[3] & 0xff, 1D);
+		info.addField("CMYK", "[" + mathUtil.format(cmyk[0], 4) + ",  " + mathUtil.format(cmyk[1], 4) + ",  " + mathUtil.format(cmyk[2], 4) + ",  " + mathUtil.format(cmyk[3], 4) + "]", 5);
+		double[] hsl = conv.RGBtoHSL(rgb[1] & 0xff, rgb[2] & 0xff, rgb[3] & 0xff);
+		hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
+		hsl[2] = (int) (hsl[2] * 255. + 0.5);
+		hsl[1] = (int) (hsl[1] * 255. + 0.5);
+		info.addField("HSL", "[" + mathUtil.format(hsl[0], 4) + ",  " + mathUtil.format(hsl[1], 4) + ",  " + mathUtil.format(hsl[2], 4) + "]", 6);*/
+
+		String data = "[";
+		try {
+			if (px != null) {
+				if(getDataType()[0] >= 0 && getDataType()[0] <= 3) {
+					for(int i = 0; i < getDataStore().getBandCount(); i++) {
+						if(getDataStore().isInside(pReal)) {
+							Point2D pxAux = transformPoint(pReal);
+							int val = ((Integer)getDataStore().getData((int)pxAux.getX(),
+									(int)pxAux.getY(), i)).intValue();
+							if(getDataType()[0] == Buffer.TYPE_BYTE)
+								data += (val & 0x000000ff) + ",  ";
+							else
+								data += val + ",  ";
+						}
+					}
+				}
+				if(getDataType()[0] == 4) {
+					for(int i = 0; i < getDataStore().getBandCount(); i++) {
+						if(getDataStore().isInside(pReal)) {
+							Point2D pxAux = transformPoint(pReal);
+							data += ((Float)getDataStore().getData((int)pxAux.getX(),
+									(int)pxAux.getY(), i)).floatValue() + ",  ";
+						}
+					}
+				}
+				if(getDataType()[0] == 5) {
+					for(int i = 0; i < getDataStore().getBandCount(); i++) {
+						if(getDataStore().isInside(pReal)) {
+							Point2D pxAux = transformPoint(pReal);
+							data += ((Double)getDataStore().getData((int)pxAux.getX(),
+									(int)pxAux.getY(), i)).doubleValue() + ",  ";
+						}
+					}
+				}
+			}
+			data +=  "]";
+			info.addField("Band Value", data, 7);
+		} catch (RasterDriverException ex) {
+			throw new LoadLayerException("Error en el acceso al dataset", ex);
+		} catch (InvalidSetViewException ex) {
+			throw new LoadLayerException("Error en la asignaci�n de la vista en getData", ex);
+		} catch (FileNotOpenException ex) {
+			throw new LoadLayerException("Fichero no abierto en el dataset", ex);
+		}
+		return info;
+	}
+
+	/**
+	 * Transforma un punto real a coordenadas pixel
+	 *
+	 * @param numberBand
+	 * @param pReal
+	 * @return
+	 * @throws LoadLayerException
+	 * @throws ReadDriverException
+	 */
+	private Point2D transformPoint(Point2D pReal) throws LoadLayerException {
+		AffineTransform at = getDataStore().getAffineTransform();
+		Point2D px = new Point2D.Double();
+		//px = new Point2D.Double(pReal.getX(), pReal.getY());
+		try {
+			at.inverseTransform(pReal, px);
+			return px;
+		} catch (NoninvertibleTransformException e) {
+			throw new LoadLayerException("Error en la transformaci�n del punto", e);
+		}
+	}
+
+	public Object getInfo(String key) {
+		if (key.equals("DriverName"))
+			return "gvSIG Raster Driver";
+		return null;
+	}
+
+	public int[] getBandCountFromDataset() {
+		return getDataStore().getBandCountByProvider();
+	}
+
+	public String getColorInterpretation(int band, int dataset) {
+		if (this.getDataStore().getColorInterpretation().get(band) == null)
+			return "Undefined";
+		return this.getDataStore().getColorInterpretation().get(band);
+	}
+
+	public String getWktProjection() throws RasterDriverException {
+		return getDataStore().getWktProjection();
+	}
+
+	public boolean isRGB() {
+		if ((getDataStore() == null) || (render == null))
+			return false;
+
+		if (getDataStore().getDataType()[0] != Buffer.TYPE_BYTE)
+			return false;
+
+		boolean R = false;
+		boolean G = false;
+		boolean B = false;
+
+		int[] renderBands = render.getRenderColorInterpretation().buildRenderBands();
+		for (int i = 0; i < renderBands.length; i++)
+			if (renderBands[i] >= 0)
+				switch (i) {
+					case 0:
+						R = true;
+						break;
+					case 1:
+						G = true;
+						break;
+					case 2:
+						B = true;
+						break;
+				}
+
+		if (R && G && B)
+			return true;
+
+		return false;
+	}
+
+	/**
+	 * Obtiene el tama�o de celda de la fuente de datos
+	 * @return double con el tama�o de celda
+	 */
+	public double getCellSize() {
+		return (getDataStore() != null) ? getDataStore().getCellSize() : 1;
+	}
+
+	public Extent getFullRasterExtent() {
+		return this.getDataStore().getExtent();
+	}
+
+
+	/**
+	 * Devuelve el fichero asociado a la capa o null si no tiene.
+	 * @return Fichero.
+	 */
+	public File getFile() {
+		if(getDataStore().getParameters() instanceof RasterFileStoreParameters)
+			return ((RasterFileStoreParameters)getDataStore().getParameters()).getFile();
+		return new File("");
+	}
+
+	/**
+	 * Consulta si un fichero es aceptado o no para este tipo de capa.
+	 * @param file Fichero a consultar
+	 * @return true si es aceptado y false si no lo es.
+	 */
+	public boolean isFileAccepted(File file) {
+		return getDataStore().isFileSupported(file.getName());
+	}
+
+	/**
+	 * Consulta si un fichero es aceptado o no para este tipo de capa.
+	 * @param file Fichero a consultar
+	 * @return true si es aceptado y false si no lo es.
+	 */
+	public static boolean isFileSupported(File file) {
+		return RasterLocator.getManager().getProviderServices().isExtensionSupported(file.getName());
+	}
+
+	public boolean existColorTable() {
+		return getRender().existColorTable();
+	}
+
+	/**
+	 * Returns true if the data store has an alpha band
+	 */
+	public boolean existsAlphaBand() {
+		if(getDataStore().getColorInterpretation() != null)
+			return getDataStore().getColorInterpretation().hasAlphaBand();
+		else
+			return false;
+	}
+
+	public int getAlphaBandNumber() {
+		if(getDataStore().getColorInterpretation() != null)
+			return getDataStore().getColorInterpretation().getBand(ColorInterpretation.ALPHA_BAND);
+		return -1;
+	}
+
+	/**
+	 * Define la ultima leyenda valida de la capa o se pone a null para que la
+	 * capa busque una leyenda valida.
+	 * @param ct
+	 */
+	public void setLastLegend(ColorTable ct) {
+		lastLegend = ColorTableLegend.createLegend(ct);
+	}
+
+	/**
+	 * Devuelve la Leyenda de la capa.
+	 * @return Leyenda.
+	 */
+	public ILegend getLegend() {
+		if (lastLegend != null)
+			return lastLegend;
+
+		return null;
+	}
+
+	public void addLegendListener(LegendListener listener) {
+		if(layerChangeSupport != null){
+			layerChangeSupport.addLayerListener(listener);
+		}
+	}
+
+	public int getShapeType() {
+		return TYPES.SURFACE;
+	}
+
+	public void removeLegendListener(LegendListener listener) {
+		if(layerChangeSupport != null)
+			layerChangeSupport.removeLayerListener(listener);
+	}
+
+	public boolean isInside(Point2D p) {
+		 return getDataStore().isInside(p);
+	}
+
+	public AffineTransform getAffineTransform() {
+	    
+	    AffineTransform storeTransformation = this.getDataStore().getAffineTransform();
+	    
+	    // If layer is projected on the fly transform affine transform
+		if(this.getCoordTrans() != null){
+		    Envelope fullEnvelope = this.getFullEnvelope();
+		    
+            double newCellSizeX =
+                (fullEnvelope.getMaximum(0) - fullEnvelope.getMinimum(0))
+                    / getDataStore().getWidth();
+            double newCellSizeY =
+                (fullEnvelope.getMaximum(1) - fullEnvelope.getMinimum(1))
+                    / getDataStore().getHeight();
+		    
+            AffineTransform layerTransformation =
+                new AffineTransform(newCellSizeX, storeTransformation.getShearY(),
+                    storeTransformation.getShearX(), -newCellSizeY, fullEnvelope.getMinimum(0),
+                    fullEnvelope.getMaximum(1));
+            return layerTransformation;
+		}
+		
+		return storeTransformation;
+	}
+
+	public void setAffineTransform(AffineTransform transf) {
+		if(transf == null)
+			return;
+		affineTransformList.add(transf);
+		getDataStore().setAffineTransform(transf);
+		updateDrawVersion();
+	}
+
+	public void setAffineTransformWithoutHistorical(AffineTransform transf) {
+		getDataStore().setAffineTransform(transf);
+		updateDrawVersion();
+	}
+
+	public Historical getAffineTransformHistorical() {
+		return this.affineTransformList;
+	}
+
+	public void saveGeoToRmf() throws RmfSerializerException {
+		if (!isOpen())
+			return;
+
+		getDataStore().saveGeoreferencingToRmf();
+
+		affineTransformList.clear();
+		affineTransformList.add(this.getAffineTransform());
+	}
+
+	public boolean isActionEnabled(int action) {
+		switch (action) {
+			case IRasterLayerActions.BANDS_FILE_LIST:
+				if (existColorTable() || getDataStore().isMosaic())
+					return false;
+				break;
+			case IRasterLayerActions.BANDS_RGB:
+				if (existColorTable())
+					return false;
+				break;
+			case IRasterLayerActions.REPROJECT:
+				if (!isReproyectable())
+					return false;
+				break;
+			case IRasterLayerActions.CREATEOVERVIEWS:
+				return overviewsSupport();
+			case IRasterLayerActions.OPACITY:
+			case IRasterLayerActions.TRANSPARENCY:
+			case IRasterLayerActions.BRIGHTNESSCONTRAST:
+			case IRasterLayerActions.ENHANCED:
+			case IRasterLayerActions.PANSHARPENING:
+			case IRasterLayerActions.SELECT_LAYER:
+			case IRasterLayerActions.SAVE_COLORINTERP:
+				return true;
+			case IRasterLayerActions.REMOTE_ACTIONS:
+				return false;
+			case IRasterLayerActions.TAILTRIM:
+			case IRasterLayerActions.GEOLOCATION:
+				if(getDataStore() == null){
+					return false;
+				}
+				return !(getDataStore().isTiled());
+		}
+		return true;
+	}
+
+	public void setVisible(boolean visibility) {
+			if((state != null) && visibility)
+				state.disableStopped();
+			else
+				enableStopped();
+
+			if(isAwake() || isClosed())
+				try {
+					this.load();
+				} catch (LoadLayerException e) {
+					e.printStackTrace();
+				}
+
+			/*
+			 * Cuando se modifica la visibilidad de una capa raster se hace un updateDrawVersion de todas las
+			 * capas raster de ese MapContext. Esto es porque la estrategia utilizada por RasterDrawStrategy hace
+			 * que se cacheen en blanco las capas raster que est�n ocultas debajo de otras. Al hacer invisibles las
+			 * de arriba la cache que estaba en blanco hace que no se pinte nada. Para evitar esto las marcamos todas
+			 * como que han sido modificadas para que se vuelvan a leer.
+			 */
+			if(getMapContext() != null) {
+				ArrayList<FLayer> listLayers = new ArrayList<FLayer>();
+				listLayers = RasterDrawStrategy.getLayerList(getMapContext().getLayers(), listLayers);
+				for (int i = 0; i < listLayers.size(); i++)
+					if(listLayers.get(i) instanceof DefaultFLyrRaster)
+						((DefaultFLyrRaster)listLayers.get(i)).updateDrawVersion();
+			}
+
+			super.setVisible(visibility);
+	}
+
+	/**
+	 * Consulta la transparencia asignada en la �ltima renderizaci�n de la capa
+	 * @return valor de transparencia
+	 */
+	public int getTransparency() {
+		try {
+			return getRender().getRenderingTransparency().getOpacity();
+		} catch (NullPointerException e) {
+			return super.getTransparency();
+		}
+	}
+
+	/**
+	 * Consulta si tiene aplicada alguna transparencia en la �ltima renderizaci�n
+	 * o no.
+	 * @return true si se aplic� alguna transparencia en la �ltima renderizaci�n.
+	 */
+	public boolean isTransparent() {
+		return getRender().getRenderingTransparency().isTransparencyActive();
+	}
+
+	/**
+	 * Asigna la transparencia de la siguiente renderizaci�n
+	 * @param valor de transparencia
+	 */
+	public void setTransparency(int trans) {
+		super.setTransparency(trans);
+		try {
+			getRender().getRenderingTransparency().setOpacity(trans);
+		} catch (NullPointerException e) {
+			//Solo asigna la transparencia a la clase padre y no a la renderizaci�n
+		}
+	}
+
+	public List<ROI> getRois() throws ROIException {
+		return getDataStore().getRois(getMapContext().getProjection());
+	}
+
+	public void setRois(List<ROI> rois) {
+		getDataStore().setRois(rois);
+	}
+
+	public void setROIsFiles(List<File> file) throws RmfSerializerException {
+		getDataStore().saveROIFileListToRmf(file);
+	}
+
+	public List<File> getROIsFiles() throws RmfSerializerException {
+		return getDataStore().getROIFileListFromRmf();
+	}
+
+	/**
+	 * Si ya tiene una estrategia de dibujado de raster calculada la devuelve, sino
+	 * devolver� null.
+	 * @return TreeMap con la lista de capas a dibujar
+	 */
+	public HashMap<DefaultFLyrRaster, Boolean> getRasterStrategy() {
+		if(strategy != null)
+			return strategy.getStrategy();
+		return null;
+	}
+
+	/**
+	 * @return the configuration
+	 */
+	static public IConfiguration getConfiguration() {
+		return configuration;
+	}
+
+	/**
+	 * @param configuration the configuration to set
+	 */
+	static public void setConfiguration(IConfiguration configuration) {
+		DefaultFLyrRaster.configuration = configuration;
+	}
+
+	public void reload() throws ReloadLayerException {
+		try {
+			super.reload();
+			load();
+			if (isStopped())
+				disableStopped();
+			if (getMapContext() != null)
+				getMapContext().invalidate();
+		} catch (LoadLayerException e) {
+			setAvailable(false);
+			throw new ReloadLayerException(getName(), e);
+		}
+	}
+
+	/**
+	 * Devuelve si la capa tiene soporte para poder generar overviews
+	 * @return
+	 */
+	public boolean overviewsSupport() {
+		if ((getDataStore() != null) && (getDataStore().overviewsSupport()))
+			return true;
+
+		return false;
+	}
+
+	/**
+	 * Devuelve si la asignacion de las bandas a renderizar representa una capa
+	 * en escala de grises
+	 * @return
+	 */
+	public boolean isRenderingAsGray() {
+		int[] renderBands = getRender().getRenderColorInterpretation().buildRenderBands();
+		if ((renderBands != null) && (renderBands.length == 3) && (renderBands[0] >= 0) &&
+				(renderBands[0] == renderBands[1]) && (renderBands[1] == renderBands[2]))
+			return true;
+		return false;
+	}
+
+	public void visualPropertyValueChanged(VisualPropertyEvent e) {
+		updateDrawVersion();
+	}
+
+	public Point2D adjustWorldRequest(Point2D req) {
+		Envelope ext = null;
+
+		ext = getFullEnvelope();
+		req.setLocation(Math.max(ext.getMinimum(0), req.getX()), Math.max(ext.getMinimum(1), req.getY()));
+		req.setLocation(Math.min(ext.getMaximum(0), req.getX()), Math.min(ext.getMaximum(1), req.getY()));
+		return req;
+	}
+
+	public FLayer cloneLayer() throws Exception {
+		RasterDataStore  ds = getDataStore().cloneDataStore();
+		DefaultFLyrRaster newLayer = new DefaultFLyrRaster();
+		newLayer.setName(getName());
+		newLayer.setOpenRasterStore(ds);
+		newLayer.firstLoad = firstLoad;
+
+		List<RasterFilter> filters = getRender().getFilterList().getStatusCloned();
+
+		//Hacemos una copia de las bandas a renderizar
+		if(getRender().getRenderColorInterpretation() != null) {
+			newLayer.getRender().setRenderColorInterpretation(getRender().getRenderColorInterpretation().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
+		newLayer.setNoDataValue(getNoDataValue());
+		if(getDataStore().getNoDataValue().isDefined())
+			newLayer.setNoDataTransparent(true);
+		newLayer.enableOpen();
+
+		return newLayer;
+	}
+
+	public FLayer getFileLayer() throws RasterDriverException {
+		try {
+			return cloneLayer();
+		} catch (Exception e) {
+		}
+		return null;
+	}
+
+	public void addFile(File file) throws InvalidSourceException {
+		getDataStore().addFile(file);
+	}
+
+	public void removeFile(File file) {
+		getDataStore().removeFile(file);
+	}
+
+	/*****************************************************/
+
+	public void disableStopped() {
+		if(state != null)
+			state.disableStopped();
+	}
+
+	public void enableAwake() throws NotAvailableStateException {
+        if(state != null) {
+            state.enableAwake();
+        }
+	}
+
+	public void enableClosed() throws NotAvailableStateException {
+		if(state != null)
+			state.enableClosed();
+	}
+
+	public void enableOpen() throws NotAvailableStateException {
+		if(state != null){
+			state.enableOpen();
+		}
+	}
+
+	public void enableStopped() {
+		if(state != null) {
+			state.enableStopped();
+		}
+	}
+
+	public boolean isAwake() {
+		return (state != null) && state.isAwake();
+	}
+
+	public boolean isClosed() {
+		return (state != null) && state.isClosed();
+	}
+
+	public boolean isOpen() {
+		return (state != null) && state.isOpen();
+	}
+
+	public boolean isStopped() {
+		return (state != null) && (state.isStopped());
+	}
+
+
+	@SuppressWarnings("rawtypes")
+	public Set getMetadataChildren() {
+		return null;
+	}
+
+	public Object getMetadataID() {
+		return getName();
+	}
+
+	public String getMetadataName() {
+		return null;
+	}
+
+	public RasterDataStore getDataStore() {
+		return this.dataStore;
+	}
+
+	public IProjection getProjection() {
+		return getDataStore().getProjection();
+	}
+
+	public void setOpenRasterStore(DataStore dataStore) throws LoadLayerException {
+		if(dataStore instanceof CoverageStoreProviderServices) {
+			try {
+				this.dataStore = rManager.getProviderServices().open(
+						((CoverageStoreProviderServices) dataStore).getProvider(),
+						dataStore.getParameters());
+			} catch (NotSupportedExtensionException e) {
+				throw new LoadLayerException("Extension not supported", e);
+			} catch (RasterDriverException e) {
+				throw new LoadLayerException("Error opening the DataStore", e);
+			}
+		} else
+			this.dataStore = (RasterDataStore) dataStore;
+		try {
+			enableAwake();
+		} catch (NotAvailableStateException e) {
+			throw new LoadLayerException("Fallo el estado de open. Closed=" + isClosed() + " Active=" + isOpen(), e);
+		}
+		if(getDataStore().getProjection() != null) {
+			try {
+				getDataStore().setProjection(getDataStore().getProjection(), false);
+				super.setProjection(getDataStore().getProjection());
+			} catch (RmfSerializerException e) {
+				//persist is false
+			}
+		}
+	}
+
+	public void setDataStore(DataStore dataStore) throws LoadLayerException {
+		setOpenRasterStore(dataStore);
+		load();
+	}
+
+	public boolean isRemote() {
+		return false;
+	}
+
+	/**
+	 * Returns true if exists a process reading data from this layer
+	 * @return
+	 */
+	public boolean isReadingData() {
+		return readingData != null;
+	}
+
+	/**
+	 * When a process is using information of this layer this variable will contain
+	 * the thread ID.
+	 * @param readingData
+	 */
+	public synchronized void setReadingData(String readingData) {
+		this.readingData = readingData;
+	}
+
+	public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel,
+			boolean fast)
+			throws LoadLayerException, DataException {
+		return null;
+	}
+
+	public DynObjectSet getInfo(Point p, double tolerance, Cancellable cancel)
+			throws LoadLayerException, DataException {
+		return null;
+	}
+
+	@Override
+	protected void doDispose() throws BaseException {
+		if(render != null)
+			render.dispose();
+		if(getDataStore() != null)
+			getDataStore().dispose();
+		finalize();
+	}
+
+	public int getZoomLevel() {
+		return zoomLevel;
+	}
+
+	public void setZoomLevel(int zoomLevel) {
+		this.zoomLevel = zoomLevel;
+	}
+
+	public boolean increaseZoomLevel() {
+		if(zoomLevel < (this.getDataStore().getZoomLevels() - 1)) {
+			zoomLevel ++;
+			recalcLevel = false;
+			return true;
+		}
+		return false;
+	}
+
+	public boolean decreaseZoomLevel() {
+		if(zoomLevel > 0) {
+			zoomLevel --;
+			recalcLevel = false;
+			return true;
+		}
+		return false;
+	}
+
+	public Envelope getCoordsInLevel(Point2D center, int level, int w, int h) throws CreateEnvelopeException {
+		Extent ex = getDataStore().getCoordsInLevel(center, level, w, h);
+		return geomManager.createEnvelope(ex.getULX(), ex.getULY(), ex.getLRX(), ex.getLRY(), SUBTYPES.GEOM2D);
+	}
+
+	public boolean isEnabledMultiresolution() {
+		return getDataStore().isTiled();
+	}
+
+	public void setTileServer(Class<?> tileServer) throws InitializeException {
+		getDataStore().setTileServer(tileServer);
+	}
+
+	@Override
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		try {
+			super.loadFromState(state);
+			this.dataStore = (RasterDataStore)state.get("rasterdatastore");
+		} catch (PersistenceRuntimeException e) {
+			logger.debug("Unable to load store from persistence in layer: " + this.getName(), e);
+			this.setAvailable(false);
+			return;
+		}
+		this.lastLegend = (ILegend)state.get("legend");
+		this.colorTableLoadedFromProject = (ColorTable)state.get("colortable");
+		if(state.get("recalcLevel") != null){
+			this.recalcLevel = state.getBoolean("recalcLevel");
+		}
+		if(state.get("zoomLevel") != null){
+			this.zoomLevel = state.getInt("zoomLevel");
+		}
+		loadedFromProject = true;
+	}
+
+	@Override
+	public void saveToState(PersistentState state) throws PersistenceException {
+		super.saveToState(state);
+
+		state.set("rasterdatastore", getDataStore());
+		state.set("legend", lastLegend);
+		state.set("colortable", getRender().getColorTable());
+		state.set("zoomLevel", zoomLevel);
+		state.set("recalcLevel", recalcLevel);
+	}
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DefaultFLyrRaster.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null,
+					null
+			);
+			definition.extend(PersistenceManager.PERSISTENCE_NAMESPACE, "FLyrDefault");
+
+			registerPersistence(definition);
+		}
+	}
+
+	public static void registerPersistence(DynStruct definition) {
+		definition.addDynFieldObject("rasterdatastore").setClassOfValue(RasterDataStore.class).setMandatory(false);
+		definition.addDynFieldObject("legend").setClassOfValue(ILegend.class).setMandatory(false);
+		definition.addDynFieldObject("colortable").setClassOfValue(ColorTable.class).setMandatory(false);
+		definition.addDynFieldInt("zoomLevel").setMandatory(false);
+		definition.addDynFieldBoolean("recalcLevel").setMandatory(false);
+	}
+
+	public GeometryType getGeometryType() throws ReadException {
+		try {
+			return GeometryLocator.getGeometryManager().getGeometryType(TYPES.SURFACE, SUBTYPES.GEOM2D);
+		} catch (GeometryTypeNotSupportedException e) {
+			throw new ReadException(getDataStore().getName(), e);
+		} catch (GeometryTypeNotValidException e) {
+			throw new ReadException(getDataStore().getName(), e);
+		}
+	}
+
+	public void setDataStore(DataStore dataStore, String domain) throws LoadLayerException {
+		setDataStore(dataStore);
+	}
+
+	protected void finalize() {
+		layerChangeSupport             = null;
+		state                          = null;
+		lastLegend                     = null;
+		colorTableLoadedFromProject    = null;
+		strategy                       = null;
+		configuration                  = null;
+		fileUtil                       = null;
+		rasterUtil                     = null;
+		crsUtil                        = null;
+		mathUtil                       = null;
+		uri                            = null;
+		affineTransformList            = null;
+		readingData                    = null;
+		dataStore                      = null;
+		render                         = null;
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/DefaultFLyrRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ROILayerRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ROILayerRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ROILayerRaster.java	(revision 15423)
@@ -0,0 +1,102 @@
+/* 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.fmap.layers;
+
+import java.awt.Color;
+
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Clase que representa una regi�n de inter�s tal y como se asocia a una 
+ * capa raster, es decir, incluyendo un nombre y el color con el que se 
+ * representa.
+ * 
+ * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
+ *
+ */
+public class ROILayerRaster {
+	
+	private ROI    roi   = null;
+	private Color  color = null;
+	private String name  = null;
+	
+	/**
+	 * Constructor.
+	 * 
+	 * @param roi
+	 * @param color
+	 * @param name
+	 */
+	public ROILayerRaster(ROI roi, Color color, String name) {
+		this.roi = roi;
+		this.color = color;
+		this.name = name;
+	}
+
+	/**
+	 * 
+	 * @return Color con el que la ROI se representa en la vista.
+	 */
+	public Color getColor() {
+		return color;
+	}
+
+	/**
+	 * 
+	 * @param color Color con el que la ROI se representa en la vista.
+	 */
+	public void setColor(Color color) {
+		this.color = color;
+	}
+
+	/**
+	 * 
+	 * @return Nombre asociado a la ROI.
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * 
+	 * @param name Nombre asociado a la ROI.
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	/**
+	 * 
+	 * @return Regi�n de Inter�s.
+	 */
+	public ROI getRoi() {
+		return roi;
+	}
+
+	/**
+	 * 
+	 * @param roi Regi�n de inter�s.
+	 */
+	public void setRoi(ROI roi) {
+		this.roi = roi;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/layers/ROILayerRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/FmapRasterLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/FmapRasterLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/FmapRasterLibrary.java	(revision 15423)
@@ -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.
+* 
+*/
+ 
+package org.gvsig.raster.fmap;
+
+import org.gvsig.fmap.dal.DALLibrary;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.raster.CoverageStore;
+import org.gvsig.fmap.mapcontext.MapContextLibrary;
+import org.gvsig.fmap.mapcontext.layers.LayerFactory;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.fmap.legend.ColorTableLegend;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.Library;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * @author <a href="mailto:jpiera@gvsig.org">Jorge Piera</a>
+ */
+public class FmapRasterLibrary extends AbstractLibrary {
+
+	@SuppressWarnings("deprecation")
+	public FmapRasterLibrary() {
+		super(FmapRasterLibrary.class, Library.TYPE.IMPL);
+		require(DALLibrary.class);
+		require(MapContextLibrary.class);
+		require(RasterLibrary.class);
+	}
+	
+	@Override
+	protected void doInitialize() throws LibraryException {
+	}
+
+	@Override
+	protected void doPostInitialize() throws LibraryException {
+		DefaultFLyrRaster.registerPersistence();
+		//StatusLayerRaster.registerPersistence();
+		ColorTableLegend.registerPersistence();
+		LayerFactory.getInstance().registerLayerToUseForStore(
+				CoverageStore.class,
+				DefaultFLyrRaster.class);
+	}
+}
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/fmap/FmapRasterLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/Queue.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/Queue.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/Queue.java	(revision 15423)
@@ -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.util;
+
+import java.util.Vector;
+
+/**
+ * A simple FIFO queue class which causes the calling thread to wait if the
+ * queue is empty and notifies threads that are waiting when it is not
+ * empty.
+ * 
+ * @author Anil V (akv@eng.sun.com)
+ */
+public class Queue {
+	private Vector<Object> vector = new Vector<Object>();
+
+	/**
+	 * Put the object into the queue.
+	 * 
+	 * @param object
+	 *            the object to be appended to the queue.
+	 */
+	public synchronized void put(Object object) {
+		vector.addElement(object);
+		notify();
+	}
+
+	/**
+	 * Pull the first object out of the queue. Wait if the queue is empty.
+	 */
+	public synchronized Object pull() {
+		while (isEmpty())
+			try {
+				wait();
+			} catch (InterruptedException ex) {
+			}
+			return get();
+	}
+
+	/**
+	 * Get the first object out of the queue. Return null if the queue is
+	 * empty.
+	 */
+	public synchronized Object get() {
+		Object object = peek();
+		if (object != null)
+			vector.removeElementAt(0);
+		return object;
+	}
+
+	/**
+	 * Peek to see if something is available.
+	 */
+	public Object peek() {
+		if (isEmpty())
+			return null;
+		return vector.elementAt(0);
+	}
+
+	/**
+	 * Is the queue empty?
+	 */
+	public boolean isEmpty() {
+		return vector.isEmpty();
+	}
+
+	/**
+	 * How many elements are there in this queue?
+	 */
+	public int size() {
+		return vector.size();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/Queue.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/ExtendedFileFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/ExtendedFileFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/ExtendedFileFilter.java	(revision 15423)
@@ -0,0 +1,195 @@
+/* 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.util;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.filechooser.FileFilter;
+
+
+/**
+ * ExtendedFileFilter es una clase para usarla junto a los JFileChooser.
+ * Ofrece una funcionalidad simple para poder agregar extensiones de manera
+ * comoda y rapida. Las descripciones ya las pone con un formato, asi que esto
+ * es opcional poner una descripci�n especifica.
+ * 
+ * Un ejemplo t�pico de como se usaria:
+ * <pre>
+ * // Usamos el JFileChooser de libUIComponents
+ * JFileChooser chooser = new JFileChooser(this.getClass().toString(), (File) null);
+ * // Desactivamos el modo de ver todos los ficheros
+ * chooser.setAcceptAllFileFilterUsed(false);
+ * // Activamos la multiseleccion
+ * chooser.setMultiSelectionEnabled(true);
+ * // Nos guardamos cada tipo de fichero en uno que contenga todos
+ * ExtendedFileFilter allFilters = new ExtendedFileFilter();
+ * for (int i = 0; i < formats.length; i++) {
+ *   ExtendedFileFilter fileFilter = new ExtendedFileFilter();
+ *   fileFilter.addExtension(formats[i]);
+ *   // Agregamos el filefilter al JFileChooser
+ *   chooser.addChoosableFileFilter(fileFilter);
+ *   // Agregamos el mismo filtro a un ExtendedFileFilter global 
+ *   allFilters.addExtension(formats[i]);
+ * }
+ * // Poner una descripcion (OPCIONAL) para todos los ficheros.
+ * allFilters.setDescription(PluginServices.getText(this, "todos_soportados"));
+ * // Lo a�adimos
+ * chooser.addChoosableFileFilter(allFilters);
+ * // Y lo dejamos seleccionado por defecto
+ * chooser.setFileFilter(allFilters);
+ * </pre>
+ * 
+ * @version 21/11/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ExtendedFileFilter extends FileFilter {
+	String description = null;
+
+	ArrayList<String> extensions = new ArrayList<String>();
+
+	/**
+	 * Constructor de un ExtendedFileFilter
+	 */
+	public ExtendedFileFilter() {
+	}
+
+	/**
+	 * Construye un ExtendedFileFilter con una extensi�n ya agregada
+	 * @param extension
+	 */
+	public ExtendedFileFilter(String extension) {
+		addExtension(extension);
+	}
+
+	/**
+	 * A�ade una extensi�n a la lista de extensiones soportadas
+	 * @param extension
+	 */
+	public void addExtension(String extension) {
+		if (extension == null)
+			return;
+
+		extensions.add(extension);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
+	 */
+	public boolean accept(File f) {
+		if (f.isDirectory())
+			return true;
+
+		String s = f.getName();
+		int i = s.lastIndexOf('.');
+
+		if (i > 0 && i < s.length() - 1) {
+			String extension = s.substring(i + 1).toLowerCase();
+			for (int j = 0; j < extensions.size(); j++) {
+				if (extensions.get(j).toString().toLowerCase().equals(extension))
+					return true;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Normaliza el nombre de un fichero, a�adiendo la extension si fuera
+	 * necesario
+	 * @param file
+	 * @return
+	 */
+	public String getNormalizedFilename(File file) {
+		String s = file.getName();
+		int i = s.lastIndexOf('.');
+
+		if (i > 0 && i < s.length() - 1) {
+			String extension = s.substring(i + 1).toLowerCase();
+			for (int j = 0; j < extensions.size(); j++) {
+				if (extensions.get(j).toString().toLowerCase().equals(extension))
+					return file.toString();
+			}
+		}
+
+		return file.toString() + "." + extensions.get(0).toString().toLowerCase();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.filechooser.FileFilter#getDescription()
+	 */
+	public String getDescription() {
+		String format1 = "";
+		String format2 = "";
+		for (int j = 0; j < extensions.size(); j++) {
+			if (format1.length() != 0) {
+				format1 = format1 + ", ";
+				format2 = format2 + "; ";
+			}
+			// Files JPG, GIF, ... (*.jpg; *.gif ...)
+			if (j >= 4) {
+				format1 = "...";
+				format2 = "...";
+				break;
+			}
+			format1 = format1 + extensions.get(j).toString().toUpperCase();
+			format2 = format2 + "*." + extensions.get(j).toString().toLowerCase();
+		}
+		if (description == null)
+			return "files" + " " + format1 + " (" + format2 + ")";
+
+		return description + " (" + format2 + ")";
+	}
+
+	/**
+	 * Especifica la descripcion del item
+	 * @param description the description to set
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Borra una extension de la lista de extensiones
+	 * @param extension
+	 */
+	public void removeExtension(String extension){
+		extensions.remove(extension);
+ }
+
+	/**
+	 * Borra todas las extensiones existentes
+	 */
+	public void clearExtensions(){
+		extensions.clear();
+	}
+
+	/**
+	 * Devuelve una lista con las extensiones disponibles
+	 * @return
+	 */
+	public ArrayList<String> getExtensions(){
+		return extensions;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/ExtendedFileFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/GenericBasePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/GenericBasePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/GenericBasePanel.java	(revision 15423)
@@ -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.util;
+
+/**
+ * Clase no abstracta para instanciar un BasePanel generico
+ * 18/08/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class GenericBasePanel extends BasePanel {
+	private static final long serialVersionUID = 1L;
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+	}	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/GenericBasePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/BasePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/BasePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/BasePanel.java	(revision 15423)
@@ -0,0 +1,162 @@
+/* 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.util;
+
+import java.awt.Component;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+
+import javax.swing.AbstractButton;
+import javax.swing.JPanel;
+
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Clase base para los paneles gr�ficos. 
+ * 
+ * 17/07/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class BasePanel extends JPanel {
+	private static final long    serialVersionUID         = -8877600252349334979L;
+	private boolean	             enableValueChangedEvent  = true;
+	
+	public static final int      KEYLISTENER              = 0;
+	public static final int      ACTIONLISTENER           = 1;
+	public static final int      MOUSELISTENER            = 2;
+	private static final Logger  logger                   = LoggerFactory.getLogger(DefaultFLyrRaster.class);
+	
+	/**
+	 * Obtiene una instancia de una clase generica que hereda de BasePanel
+	 * @return BasePanel
+	 */
+	public static BasePanel getInstance() {
+		return new GenericBasePanel();
+	}
+	
+	/**
+	 * Obtiene la traducci�n de la cadena de texto
+	 * @param parent Ventana padre
+	 * @param text Cadena a traducir
+	 * @return Cadena de texto traducida
+	 */
+	public String getText(Object parent, String key) {
+		 if (key == null)
+	            return null;
+	        String translation = org.gvsig.i18n.Messages.getText(key, false);
+	        if (translation != null)
+	            return translation;
+	        else {
+	            logger.debug("Can't find translation for ''{1}''.", key);
+	            return key;
+	        }
+	}
+	
+	/**
+	 * Obtiene la traducci�n de la cadena de texto
+	 * @param text Cadena a traducir
+	 * @return Cadena de texto traducida
+	 */
+	public String getText(String text) {
+		return getText(this, text);
+	}
+	
+	/**
+	 * Asigna el valor para la activaci�n y desactivaci�n del evento de cambio de valor en
+	 * las cajas de texto.
+	 * @param enableValueChangedEvent
+	 */
+	public void setEnableValueChangedEvent(boolean enableValueChangedEvent) {
+		this.enableValueChangedEvent = enableValueChangedEvent;
+	}
+	
+	/**
+	 * Obtiene el valor para la activaci�n y desactivaci�n del evento de cambio de valor en
+	 * las cajas de texto.
+	 * @param enableValueChangedEvent
+	 */
+	public boolean isEnableValueChangedEvent() {
+		return this.enableValueChangedEvent;
+	}
+	
+	/**
+	 * Obtiene la lista de componentes del panel. Si dentro tiene alg�n BasePanel
+	 * consulta la lista de componentes de este y la devuelve.
+	 * @return
+	 */
+	public ArrayList<Component> getComponentList() {
+		ArrayList<Component> listComp = new ArrayList<Component>();
+		for (int i = 0; i < this.getComponentCount(); i++) {
+			if(getComponent(i) instanceof BasePanel) {
+				ArrayList<Component> list = ((BasePanel)getComponent(i)).getComponentList();
+				for (int j = 0; j < list.size(); j++) 
+					listComp.add(list.get(j));
+			} else
+				listComp.add(getComponent(i));
+		}
+		return listComp;
+	}
+	
+	/**
+	 * Registra un listener en todos los componentes contenidos en este panel.
+	 * @param type Tipo de listener definido por las variables est�ticas en esta clase
+	 * @param listener Objeto listener del tipo correcto
+	 */
+	public void registerListener(int type, Object listener) {
+		ArrayList<Component> listComp = getComponentList();
+		if(type == KEYLISTENER) {
+			if(listener instanceof KeyListener) {
+				for (int i = 0; i < listComp.size(); i++)
+					if(listComp.get(i) instanceof Component)
+						((Component)listComp.get(i)).addKeyListener((KeyListener)listener);
+			}
+		}
+		if(type == ACTIONLISTENER) {
+			if(listener instanceof ActionListener) {
+				for (int i = 0; i < listComp.size(); i++)
+					if(listComp.get(i) instanceof AbstractButton)
+						((AbstractButton)listComp.get(i)).addActionListener((ActionListener)listener);
+			}
+		}
+		if(type == MOUSELISTENER) {
+			if(listener instanceof MouseListener) {
+				for (int i = 0; i < listComp.size(); i++)
+					if(listComp.get(i) instanceof Component)
+						((Component)listComp.get(i)).addMouseListener((MouseListener)listener);
+			}
+		}
+	}
+	
+	/**
+	 * Traducci�n centralizada de los componentes de una panel
+	 */
+	protected abstract void translate();
+	
+	/**
+	 * Acciones de inicializaci�n
+	 */
+	protected abstract void init();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/BasePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/CancelTaskImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/CancelTaskImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/CancelTaskImpl.java	(revision 15423)
@@ -0,0 +1,71 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.util;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.tools.task.Cancellable;
+
+/**
+ * All tasks which use libRemoteServices need an object that implements ICancellable
+ * to cancel processes.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+@SuppressWarnings("deprecation")
+public class CancelTaskImpl implements ICancellable {
+	private boolean       cancel = false;
+	private Cancellable   c      = null;
+	
+	public CancelTaskImpl() {
+	}
+	
+	public CancelTaskImpl(Cancellable c) {
+		this.c = c;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.compat.net.ICancellable#getID()
+	 */
+	public Object getID() {
+		return this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.compat.net.ICancellable#isCanceled()
+	 */
+	public boolean isCanceled() {
+		if(c != null)
+			return c.isCanceled();
+		return cancel;
+	}
+	
+	/**
+	 * Cancel the task
+	 * @param cancel
+	 */
+	public void setCanceled(boolean cancel) {
+		if(c != null)
+			c.setCanceled(cancel);
+		this.cancel = cancel;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/CancelTaskImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/LayerVisualStatusList.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/LayerVisualStatusList.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/LayerVisualStatusList.java	(revision 15423)
@@ -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.util;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.IRasterLayerActions;
+
+/**
+ * Clase para almacenar estados visuales de una capa raster. Estos estados deben ser locales
+ * a cada funcionalidad para que no interfieran entre ellos. Luego es posible tener una lista de
+ * estados globales para restaurar el que nos convenga.
+ * 07/10/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class LayerVisualStatusList {
+	private ArrayList<LayerVisualStatus> list = new ArrayList<LayerVisualStatus>();
+	
+	/**
+	 * Clase que contiene el estado visual de una capa raster.
+	 * 07/10/2008
+	 * @author Nacho Brodin nachobrodin@gmail.com
+	 */
+	public class LayerVisualStatus {
+		private List<RasterFilter>         filterStatus = null;
+		private Transparency               transparency = null;
+		
+		/**
+		 * Obtiene el estado de la lista de filtros
+		 * @return Array con el estado de la lista de filtros
+		 */
+		public List<RasterFilter> getFilterStatus() {
+			return filterStatus;
+		}
+		
+		/**
+		 * Asigna el estado de la lista de filtros
+		 * @return Array con el estado de la lista de filtros
+		 */
+		public void setFilterStatus(List<RasterFilter> filterStatus) {
+			this.filterStatus = filterStatus;
+		}
+		
+		/**
+		 * Obtiene el estado de la transparencia
+		 * @return Transparency
+		 */
+		public Transparency getTransparency() {
+			return transparency;
+		}
+		
+		/**
+		 * Asigna el estado de la transparencia
+		 * @param Transparency
+		 */
+		public void setTransparency(Transparency transparency) {
+			this.transparency = transparency;
+		}
+	}
+	
+	/**
+	 * Limpia la pila de elementos
+	 */
+	public void clear() {
+		list.clear();
+	}
+	
+	/**
+	 * Salva un estado al final de la lista
+	 * @param status 
+	 */
+	public void add(LayerVisualStatus status) {
+		list.add(status);
+	}
+	
+	/**
+	 * Recupera el �ltimo estado introducido en la lista
+	 * @return StatusLayer
+	 */
+	public LayerVisualStatus getLast() {
+		return (LayerVisualStatus)list.get(list.size() - 1);
+	}
+	
+	/**
+	 * Recupera el estado de la posici�n i
+	 * @return StatusLayer
+	 */
+	public LayerVisualStatus get(int i) {
+		return (LayerVisualStatus)list.get(i);
+	}
+		
+	
+	/**
+	 * Saca de la lista el �ltimo estado y lo asigna a la capa indicada.
+	 * @param lyr Capa raster
+	 */
+	public void restoreVisualStatus(FLyrRaster lyr) {
+		Render rendering = lyr.getRender();
+		LayerVisualStatus status = getLast();
+		if(status != null) {
+			if(rendering.getFilterList() != null)
+				rendering.getFilterList().setStatus(status.filterStatus);
+			lyr.getRender().setLastTransparency(status.transparency);
+			if(((IRasterLayerActions)lyr).isActionEnabled(IRasterLayerActions.REMOTE_ACTIONS))
+				lyr.getRender().getFilterList().setStatus(status.filterStatus);
+		}
+	}
+	
+	/**
+	 * Obtiene de la capa su estado de visualizaci�n y lo salva en la lista
+	 * @param lyr Capa raster
+	 */
+	public void getVisualStatus(FLyrRaster lyr) {
+		LayerVisualStatus status = new LayerVisualStatus();
+		status.transparency = lyr.getRender().getRenderingTransparency();
+		status.filterStatus = lyr.getRender().getFilterList().getStatusCloned();
+		add(status);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/LayerVisualStatusList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/RasterNotLoadException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/RasterNotLoadException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/RasterNotLoadException.java	(revision 15423)
@@ -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.util;
+
+
+/**
+ * Excepci�n producida cuando no es posible cargar un raster en la vista de gvSIG.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterNotLoadException extends Exception {
+	private static final long serialVersionUID = -3022090543908771484L;
+
+	public RasterNotLoadException(String msg){
+		super(msg);
+	}
+
+	public RasterNotLoadException(String msg, Throwable cause){
+        super(msg, cause);
+    }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap/src/main/java/org/gvsig/raster/util/RasterNotLoadException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.fmap
___________________________________________________________________
Added: svn:ignore
   + target

.settings

.classpath

.project


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/pom.xml	(revision 15423)
@@ -0,0 +1,424 @@
+<?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.mainplugin</artifactId>
+    <packaging>jar</packaging>
+    <name>Raster base support</name>
+    <description>Basic libraries for raster support</description>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.raster</artifactId>
+        <version>2.2.4-SNAPSHOT</version>
+    </parent>
+    <dependencies>
+         <dependency>
+             <groupId>org.gvsig</groupId>
+             <artifactId>org.gvsig.about.api</artifactId>
+             <scope>compile</scope>
+        </dependency>
+    	<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.cache.lib.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.cache.lib.impl</artifactId>
+            <scope>runtime</scope>
+		</dependency>
+		<dependency>
+        	<groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+			<groupId>org.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.lib.impl</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.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.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.timesupport.lib.api</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.timesupport.lib.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <scope>runtime</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.swing.impl</artifactId>
+			<scope>runtime</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.algorithm</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.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.jpotrace</artifactId>
+	        <scope>compile</scope>
+	    </dependency>
+	    <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.jpotrace</artifactId>
+            <classifier>${native_classifier}</classifier>
+            <type>tar.gz</type>
+            <scope>runtime</scope>
+        </dependency>
+    </dependencies>
+    
+    <profiles>
+    
+    	<profile>
+			<id>gvsig-install</id>
+			<activation>
+				<activeByDefault>true</activeByDefault>
+			</activation>
+		</profile>   
+	 
+	   <!-- *************** -->
+       <!-- LINUX PROFILE   -->
+       <!-- *************** -->
+        
+    
+        <profile>
+            <id>linux-profile</id>
+            <activation>
+                 <property>
+					<name>native-platform</name>
+					<value>linux</value>
+				</property>
+           </activation>
+           <properties>
+           		<gvsig.package.info.operatingSystem>lin</gvsig.package.info.operatingSystem>
+        		<gvsig.package.info.architecture>x86</gvsig.package.info.architecture>
+			</properties>
+			<build>
+          		<plugins>
+            		<plugin>
+                		<artifactId>maven-assembly-plugin</artifactId>
+                		<configuration>
+                    		<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+                    		<appendAssemblyId>false</appendAssemblyId>
+                		</configuration>
+                		<executions>
+                  			<execution>
+                    			<id>gvsig-plugin-package</id>
+                    			<phase>package</phase>
+                    			<goals>
+                        			<goal>single</goal>
+                    			</goals>
+                    			<configuration>
+                      				<finalName>gvSIG-desktop-${gvsig.package.info.gvSIGVersion}-${project.artifactId}-${gvsig.package.info.version}-${buildNumber}-${gvsig.package.info.state}-${gvsig.package.info.operatingSystem}-${gvsig.package.info.architecture}-${gvsig.package.info.javaVM}.gvspkg</finalName>
+                      				<descriptors>
+                        				<descriptor>src/main/assembly/gvsig-plugin-package-lin.xml</descriptor>
+                      				</descriptors>
+                    			</configuration>
+                  			</execution>
+                		</executions>
+            		</plugin>
+            		
+            		<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+								<id>unpack-dependencies</id>
+								<phase>generate-sources</phase>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <configuration>
+				    				<executable>sh</executable>
+                                    <arguments>
+										<argument>${basedir}/unpack-dependencies.sh</argument>
+										<argument>${user.home}/.m2/repository/org/gvsig/org.gvsig.jpotrace/${potrace.version}</argument>
+										<argument>${depman.dir}</argument>
+                                    </arguments>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+            	</plugins>
+            </build>
+        </profile>
+        
+       <!-- **************** -->
+       <!-- LINUX 64 PROFILE -->
+       <!-- **************** -->
+        
+        <profile>
+            <id>linux64-profile</id>
+            <activation>
+                 <property>
+					<name>native-platform</name>
+					<value>linux64</value>
+				</property>
+           </activation>
+           <properties>
+           		<gvsig.package.info.operatingSystem>lin</gvsig.package.info.operatingSystem>
+        		<gvsig.package.info.architecture>x86_64</gvsig.package.info.architecture>
+			</properties>
+			<build>
+          		<plugins>
+            		<plugin>
+                		<artifactId>maven-assembly-plugin</artifactId>
+                		<configuration>
+                    		<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+                    		<appendAssemblyId>false</appendAssemblyId>
+                		</configuration>
+                		<executions>
+                  			<execution>
+                    			<id>gvsig-plugin-package</id>
+                    			<phase>package</phase>
+                    			<goals>
+                        			<goal>single</goal>
+                    			</goals>
+                    			<configuration>
+                      				<finalName>gvSIG-desktop-${gvsig.package.info.gvSIGVersion}-${project.artifactId}-${gvsig.package.info.version}-${buildNumber}-${gvsig.package.info.state}-${gvsig.package.info.operatingSystem}-${gvsig.package.info.architecture}-${gvsig.package.info.javaVM}.gvspkg</finalName>
+                      				<descriptors>
+                        				<descriptor>src/main/assembly/gvsig-plugin-package-lin64.xml</descriptor>
+                      				</descriptors>
+                    			</configuration>
+                  			</execution>
+                		</executions>
+            		</plugin>
+            		
+            		<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+								<id>unpack-dependencies</id>
+								<phase>generate-sources</phase>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <configuration>
+				    				<executable>sh</executable>
+                                    <arguments>
+										<argument>${basedir}/unpack-dependencies.sh</argument>
+										<argument>${user.home}/.m2/repository/org/gvsig/org.gvsig.jpotrace/${potrace.version}</argument>
+										<argument>${depman.dir}</argument>
+                                    </arguments>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+            	</plugins>
+            </build>
+        </profile>
+        
+        <!-- *************** -->
+        <!-- FEDORA PROFILE  -->
+        <!-- *************** -->
+        
+        <profile>
+            <id>fedora11-profile</id>
+            <activation>
+              <property>
+                <name>native-platform</name>
+                <value>fedora11</value>
+              </property>
+            </activation>
+            <properties>
+           	  <gvsig.package.info.categories>Raster</gvsig.package.info.categories>
+              <gvsig.package.info.operatingSystem>fedora11</gvsig.package.info.operatingSystem>
+              <gvsig.package.info.architecture>x86</gvsig.package.info.architecture>
+            </properties>
+            <build>
+          		<plugins>
+            		<plugin>
+                		<artifactId>maven-assembly-plugin</artifactId>
+                		<configuration>
+                    		<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+                    		<appendAssemblyId>false</appendAssemblyId>
+                		</configuration>
+                		<executions>
+                  			<execution>
+                    			<id>gvsig-plugin-package</id>
+                    			<phase>package</phase>
+                    			<goals>
+                        			<goal>single</goal>
+                    			</goals>
+                    			<configuration>
+                      				<finalName>gvSIG-desktop-${gvsig.package.info.gvSIGVersion}-${project.artifactId}-${gvsig.package.info.version}-${buildNumber}-${gvsig.package.info.state}-${gvsig.package.info.operatingSystem}-${gvsig.package.info.architecture}-${gvsig.package.info.javaVM}.gvspkg</finalName>
+                      				<descriptors>
+                        				<descriptor>src/main/assembly/gvsig-plugin-package-fedora11.xml</descriptor>
+                      				</descriptors>
+                    			</configuration>
+                  			</execution>
+                		</executions>
+            		</plugin>
+            	</plugins>
+            </build>
+        </profile>
+        
+        <!-- *************** -->
+        <!-- WINDOWS PROFILE -->
+        <!-- *************** -->
+         
+        <profile>
+            <id>windows-profile</id>
+            <activation>
+                <property>
+					<name>native-platform</name>
+					<value>win</value>
+				</property>
+            </activation>
+            <properties>
+           		<gvsig.package.info.operatingSystem>win</gvsig.package.info.operatingSystem>
+        		<gvsig.package.info.architecture>x86</gvsig.package.info.architecture>
+			</properties>
+			<build>
+          		<plugins>
+            		<plugin>
+                		<artifactId>maven-assembly-plugin</artifactId>
+                		<configuration>
+                    		<ignoreDirFormatExtensions>true</ignoreDirFormatExtensions>
+                    		<appendAssemblyId>false</appendAssemblyId>
+                		</configuration>
+                		<executions>
+                  			<execution>
+                    			<id>gvsig-plugin-package</id>
+                    			<phase>package</phase>
+                    			<goals>
+                        			<goal>single</goal>
+                    			</goals>
+                    			<configuration>
+                      				<finalName>gvSIG-desktop-${gvsig.package.info.gvSIGVersion}-${project.artifactId}-${gvsig.package.info.version}-${buildNumber}-${gvsig.package.info.state}-${gvsig.package.info.operatingSystem}-${gvsig.package.info.architecture}-${gvsig.package.info.javaVM}.gvspkg</finalName>
+                      				<descriptors>
+                        				<descriptor>src/main/assembly/gvsig-plugin-package-win.xml</descriptor>
+                      				</descriptors>
+                    			</configuration>
+                  			</execution>
+                		</executions>
+            		</plugin>
+            		
+            		<plugin>
+						<groupId>org.codehaus.mojo</groupId>
+						<artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+								<id>unpack-dependencies</id>
+								<phase>generate-sources</phase>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <configuration>
+				    				<executable>sh</executable>
+                                    <arguments>
+										<argument>${basedir}/unpack-dependencies.sh</argument>
+										<argument>${user.home}/.m2/repository/org/gvsig/org.gvsig.jpotrace/${potrace.version}</argument>
+										<argument>${depman.dir}</argument>
+                                    </arguments>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+            	</plugins>
+            </build>
+        </profile>
+    </profiles>
+    
+    <properties>
+    	<gvsig.package.info.state>final</gvsig.package.info.state>
+    	<gvsig.package.info.categories>Raster</gvsig.package.info.categories>
+    	<gvsig.package.info.official>true</gvsig.package.info.official>
+    	<gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/Raster/pool</gvsig.package.info.poolURL>
+    </properties>
+</project>

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/unpack-dependencies.sh
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/unpack-dependencies.sh	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/unpack-dependencies.sh	(revision 15423)
@@ -0,0 +1,33 @@
+#!/bin/bash
+
+#set -x
+
+dep_dir=$1;
+dest_dir=$2;
+
+if [ ! -d $dest_dir ]; then mkdir $dest_dir; fi;
+if [ ! -d $dep_dir ]; then exit 0; fi 
+
+if [ ! -d $dest_dir/unpacked ]; then
+	mkdir $dest_dir/unpacked;
+fi
+
+# Get all natives sdk bundle files
+files=$(find $dep_dir -type f -name *.tar.gz)
+
+for i in $files; do
+	filename=`basename $i`
+	filedest="$dest_dir/unpacked/$filename"
+	
+	#echo FileName: "$filename"
+	#echo FileDest: "$filedest"
+	
+    # Overwrite only if the file is newer than the one stored as unpacked
+	if [ ! -f "$filedest" ] || [ "$i" -nt "$filedest" ]; then
+		echo "Expanding $i in $dest_dir"
+		cp "$i" "$dest_dir/unpacked"
+		tar xzf "$i" -C "$dest_dir"
+	else
+		echo "$i not newer than the one available in $dest_dir/unpacked, not expanding it"
+	fi
+done
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Fri Mar 28 13:59:39 CET 2014
+buildNumber=12

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/buildNumber.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/config.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/config.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/config.xml	(revision 15423)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+ <depends plugin-name="org.gvsig.app.mainplugin" />
+ <depends plugin-name="org.gvsig.app.document.table.app.mainplugin" />
+	<resourceBundle name="text"/>
+	<libraries library-dir="lib"/>
+	<extensions>
+		<extension class-name="org.gvsig.raster.mainplugin.RasterMainPluginExtension"
+			description=""
+			active="true"
+			priority="1">
+		</extension>
+		<extension class-name="org.gvsig.raster.mainplugin.GenericToolBarExtension"
+			description=""
+			active="true"
+			priority="1">
+		</extension>
+	</extensions>
+</plugin-config>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/config.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-multispectral-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-multispectral-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-raster-export.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-raster-export.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-layer-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-layer-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/layer-properties-raster.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/layer-properties-raster.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/ico.sol.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/ico.sol.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-process-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-process-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-transgeo-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-transgeo-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-dataset-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-dataset-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-enhanced-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/action/menu-enhanced-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/map-ok-ico.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/images/map-ok-ico.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text.properties	(revision 15423)
@@ -0,0 +1,7 @@
+capa_raster=Capa Raster
+process_raster=Procesos Raster
+multispectral=Multiespectral
+enhanced=Realce
+transformaciones_geograficas=Transformaciones geograficas
+raster_export=Exportar Raster
+dataset_raster=Conjunto de datos raster
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_zh.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_zh.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_en.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_en.properties	(revision 15423)
@@ -0,0 +1,7 @@
+capa_raster=Raster layer
+process_raster=Raster process
+multispectral=Multispectral
+enhanced=Enhanced
+transformaciones_geograficas=Geographic transformations
+raster_export=Export to raster
+dataset_raster=Raster dataset
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_en.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_gl.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_gl.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_ca.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_ca.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_pt.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_pt.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_cs.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_cs.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_fr.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_fr.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_de.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_de.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_eu.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_eu.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_it.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_it.properties
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/scripting/lib/gvsig_raster.py
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/scripting/lib/gvsig_raster.py	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/resources-plugin/scripting/lib/gvsig_raster.py	(revision 15423)
@@ -0,0 +1,612 @@
+from gvsig import *
+from org.gvsig.fmap.dal import DALLocator
+from org.gvsig.fmap.mapcontext import MapContextLocator
+from org.gvsig.fmap.dal.coverage import RasterLocator
+from org.gvsig.fmap.dal.coverage.store.parameter import NewRasterStoreParameters
+from org.gvsig.fmap.dal.coverage.dataset import Buffer
+from org.gvsig.fmap.dal.serverexplorer.filesystem import FilesystemServerExplorer
+from org.gvsig.raster.fmap.layers import FLyrRaster
+from java.lang import Byte,Short,Integer,Float,Double
+from java.io import File
+from java.awt.geom import AffineTransform
+import os
+
+from os.path import splitext
+
+global sourceFileName
+sourceFileName = []
+sourceFileName.append(None)
+
+
+##
+#
+# Loads the raster layer given the filepath
+#
+# @params rasterfile the filename of the input layer
+#
+# @returns None loads the raster layer 
+def loadRasterLayer (rasterfile, mode = "r" ):
+    ## Load a Raster file in a Layer
+    sourceFileName[0]=rasterfile
+    if not isinstance (rasterfile,File):
+        rasterfile = File(rasterfile)
+
+    name, ext = splitext(rasterfile.getName())
+
+    view = currentView()
+  
+    # Get the manager to use
+    dalManager = DALLocator.getDataManager()
+    mapContextManager = MapContextLocator.getMapContextManager()
+
+    if ext.lower() == ".ecw" or ext.lower() == ".jp2" :
+        # FIXME
+        pass
+    elif ext.lower() == ".mrsid":
+        # FIXME
+        pass
+    else:
+        # Create the parameters to open the raster store based in GDAL
+        params = dalManager.createStoreParameters("Gdal Store")
+        params.setFile(rasterfile)
+
+    # Create the raster store
+    dataStore = dalManager.createStore(params)
+
+    # Create a raster layer based in this raster store
+    layer = mapContextManager.createLayer(name, dataStore);
+
+    view.addLayer(layer)
+    return layer
+
+
+## @cond FALSE
+rasterLayerExtensions = dict ()
+
+
+class RasterLayerExtensions(object):
+    ##This class hold aditional properties and operations need to manage the scripting raster layer
+    def __init__(self, store=None):
+        self.store = store
+        self.buffer = None
+        self.query = None
+        self.values = None
+        self.kernel = None
+        self.setElem = None
+        self.getElem = None
+
+    def prepareQuery(self):
+        ## See RasterManager in javadocs for more info
+        self.query = RasterLocator.getManager().createQuery();
+        ## See RasterQuery in javadocs for more
+        self.query.setAllDrawableBands()
+        self.query.setAreaOfInterest()
+        self.buffer = None
+        self.values = None
+        self.kernel = None
+
+    def loadStore (self,rasterfile, mode = "r" ):
+        if not isinstance(rasterfile,File):
+            rasterfile = File(rasterfile)
+
+        name, ext = splitext(rasterfile.getName())
+
+        dalManager = DALLocator.getDataManager()
+
+        if ext.lower() == ".ecw" or ext.lower() == ".jp2" :
+           # FIXME
+           pass
+        elif ext.lower() == ".mrsid":
+           # FIXME
+           pass
+        else:
+           # Create the parameters to open the raster store based in GDAL
+           params = dalManager.createStoreParameters("Gdal Store")
+           params.setFile(rasterfile)
+
+        # Create the raster store
+        dataStore = dalManager.createStore(params)
+        return dataStore
+
+    def createBuffer(self):
+        if sourceFileName[0] == None:
+            self.buffer = self.store.query(self.getQuery())
+        else:
+            queryStore = self.loadStore(sourceFileName[0])
+            self.buffer = queryStore.query(self.getQuery())
+        #print self.buffer.getBandCount()
+
+    def createNewBuffer(self,width, height, bandcount, datatype):
+        if self.store != None:
+            raise RuntimeException("Can't create a new buffer associated to a store")
+
+        # FIXME: workaround to work with a jython bug passing byte, short and
+        # double values as parameters
+        if datatype in (Buffer.TYPE_BYTE, Buffer.TYPE_SHORT, Buffer.TYPE_INT):
+            datatype = Buffer.TYPE_INT
+        else:
+            datatype = Buffer.TYPE_FLOAT
+        # End workaround
+
+        #print "---->>>>Buffer", datatype, width, height, bandcount
+        self.buffer = RasterLocator.getManager().createBuffer(
+            int(datatype),
+            int(width),
+            int(height),
+            int(0 if bandcount is None else bandcount),
+            True
+        )
+        self.prepareBuffer(self.buffer)
+
+    def prepareBuffer(self, buffer):
+        def setElemByte(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Byte(data).byteValue())
+
+        def setElemShort (buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Short(data).shortValue())
+
+        def setElemInt(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Integer(data).intValue())
+
+        def setElemFloat(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Float(data).floatValue())
+
+        def setElemDouble(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Double(data).doubleValue())
+
+        t = buffer.getDataType()
+        if t == Buffer.TYPE_BYTE:
+            self.getElem = buffer.getElemByte
+            self.setElem = setElemByte
+        elif t == Buffer.TYPE_SHORT or t == Buffer.TYPE_USHORT:
+            self.getElem = buffer.getElemShort
+            self.setElem = setElemShort
+        elif t == Buffer.TYPE_INT:
+            self.getElem = buffer.getElemInt
+            self.setElem = setElemInt
+        elif t == Buffer.TYPE_FLOAT:
+            self.getElem = buffer.getElemFloat
+            self.setElem = setElemFloat
+        elif t == Buffer.TYPE_DOUBLE:
+            self.getElem = buffer.getElemDouble
+            self.setElem = setElemDouble
+        #print buffer.getBandCount()
+        self.values = [0 for count in range(buffer.getBandCount())]
+        self.kernel = [[self.values for count in range(3)] for count in range(3)]
+
+    def getQuery(self):
+        if self.query == None:
+            self.prepareQuery()
+        return self.query
+
+    def getBuffer(self, store):
+        if self.buffer == None:
+            self.createBuffer()
+            self.prepareBuffer(self.buffer)
+        return self.buffer
+
+    def setValue(self, band, line, col, data):
+        t = self.buffer.getDataType()
+        if t == Buffer.TYPE_BYTE:
+           self.buffer.setElem(line, col, band, Byte(data).byteValue())
+        elif t == Buffer.TYPE_SHORT or t == Buffer.TYPE_USHORT:
+            self.buffer.setElem(line, col, band, Short(data).shortValue())
+        elif t == Buffer.TYPE_INT:
+            self.buffer.setElem(line, col, band, Integer(data).intValue())
+        elif t == Buffer.TYPE_FLOAT:
+            self.buffer.setElem(line, col, band, Float(data).floatValue())
+        elif t == Buffer.TYPE_DOUBLE:
+            self.buffer.setElem(line, col, band, Double(data).doubleValue())
+
+    def getValue(self, band, row, column):
+        if self.getElem == None:
+            self.createBuffer()
+            self.prepareBuffer(self.buffer)
+        return self.getElem(row, column, band)
+
+    def getBandValues(self, row, column):
+        if self.getElem == None:
+            self.createBuffer()
+            self.prepareBuffer(self.buffer)
+        for b in xrange(self.buffer.getBandCount()):
+            self.values[b] = self.getElem(row, column, b)
+        return self.values
+    
+    def setBandValues(self,row,column,values):
+        for b in xrange(self.buffer.getBandCount()):
+            self.setElem(self.buffer, row, column, b, values[b])
+
+    def saveBuffer(self,filename):
+        manager = DALLocator.getDataManager ()
+        eparams = manager.createServerExplorerParameters(FilesystemServerExplorer.NAME)
+        eparams.setDynValue("initialpath",os.path.dirname(sourceFileName[0]))
+        serverExplorer = manager.openServerExplorer(eparams.getExplorerName(),eparams)
+
+        sparams = serverExplorer.getAddParameters("Gdal Store")
+        sparams.setDestination(os.path.dirname(sourceFileName[0]),filename)
+        sparams.setBuffer(self.buffer)
+        #at = AffineTransform(1, 0, 0, -1, 0, 0)
+        #sparams.setAffineTransform(at);
+
+        serverExplorer.add("Gdal Store", sparams, True)
+
+## @endcond
+
+##
+#
+# Represents a raster layer.
+#
+class RasterLayer(FLyrRaster):
+    TYPE_BYTE = Buffer.TYPE_BYTE
+    TYPE_SHORT = Buffer.TYPE_SHORT
+    TYPE_INT = Buffer.TYPE_INT
+    TYPE_FLOAT = Buffer.TYPE_FLOAT
+    TYPE_DOUBLE = Buffer.TYPE_DOUBLE
+
+    @staticmethod
+    ## @cond FALSE
+    def getExtensions(self):
+        ## This is a internal method, don't use it.
+
+        global rasterLayerExtensions
+        extensions = rasterLayerExtensions.get(self.hashCode(), None)
+        if extensions == None:
+            extensions = RasterLayerExtensions(self.getDataStore())
+            rasterLayerExtensions[self.hashCode()] = extensions
+        return extensions
+    ## @endcond
+
+    @staticmethod
+    ##
+    #
+    # Return the number of bands of the raster
+    #
+    # @param self The raster layer object
+    #
+    # @return the number of bands of the raster layer
+    #
+    def getBandsCount(self):
+        return self.getDataStore().getBandCount()
+
+    @staticmethod
+    ##
+    #
+    # Return the width in points/pixels of the raster
+    #
+    # @param self The raster layer object
+    #
+    # @return the width of the raster
+    #
+    def getWidth(self):
+        return self.getDataStore().getWidth()
+
+    @staticmethod
+    ##
+    #
+    # Return the height in points/pixels of the raster
+    #
+    # @param self The raster layer object
+    #
+    # @return the height of the raster
+    def getHeight(self):
+        return self.getDataStore().getHeight()
+
+    @staticmethod
+    ##
+    #
+    # Return the data type of the raster
+    #
+    # TYPE_BYTE = Byte datatype
+    #
+    # TYPE_USHORT  = Unsigned Short datatype
+    #
+    # TYPE_SHORT = Signed Short datatype
+    #
+    # TYPE_INT = Integer datatype
+    #
+    # TYPE_FLOAT = Float Datatype
+    #
+    # TYPE_DOUBLE = Double Datatype
+    #
+    # @param self The raster layer object
+    #
+    # @return the datatype of the raster layer
+    def getDataType(self):
+        return self.getDataStore().getDataType()
+
+    @staticmethod
+    ##
+    #
+    # Return the value of a point of a "band" from "row" and "coulmn" of
+    # the Raster.
+    #
+    # This method use with care, it has a strong overhead. Use instead
+    # the method "walk" to go over the raster.
+    #
+    # @param band band from which the value should be retrieved
+    # @param row row in the raster from which the value should be retrieved
+    # @param column column in the raster from which the value should be retrieved
+    #
+    # @return the value of a point/pixel of a "band" from "row" and "column" of the Raster
+    #
+    def getData(self, band, row, column):
+        return self.getExtensions().getValue(band, row, column)
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point call to the function
+    # "operation" and pass as argument a tuple with the values of
+    # the point for each band.
+    #
+    # This method don't return any value
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on the raster point-by-point
+    #
+    # @return None
+    #
+    def walk(self, operation):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        sourceExtension = RasterLayerExtensions()
+        sourceExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        
+        for band in xrange(store.getBandCount()):
+            for line in xrange(store.getHeight()):
+                for column in xrange(store.getWidth()):
+                    operation(extension.getBandValues(line, column))
+                    
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point, taking the neighbour points
+    # as a kernel(3x3) call to the function "operation" and pass as argument a
+    # tuple with the values of all the points in the kernel for each band.
+    #
+    # This method don't return any value
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on the raster by a kernel(3x3).
+    #
+    # @return None
+    #
+    def walkKernel(self, operation):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        sourceExtension = RasterLayerExtensions()
+        sourceExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        
+        k=0
+        l=0
+        values = [0 for count in xrange(store.getBandCount())]
+        values = [[values for count in xrange(3)] for count in xrange(3)]
+        outValues = list()
+        for band in xrange(store.getBandCount()):
+            for line in xrange(1,store.getHeight()-1):
+                for column in xrange(1,store.getWidth()-1):
+                    
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            values[i][j]=extension.getBandValues(k,l)
+                            j=j+1
+                        i=i+1
+                    operation(values)
+                    
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point call to the function "filter1"
+    # and pass as argument a tuple with the values of all the points in the
+    # kernel for each band.
+    #
+    # The function "filter1" must be such that it takes a tuple, modifies its value
+    # and returns a new tuple.
+    #
+    # This method saves the newly created(filter applied) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param filter1 any filter which modifies the raster layer point-by-point
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    # @param targetbandcount number of bands in the output layer
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def filter(self, filter1, targetfilename, targetdatatype=None, targetbandcount=None):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        targetExtension = RasterLayerExtensions()
+        #targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), targetbandcount, targetdatatype)
+
+        for band in xrange(store.getBandCount()):
+            for line in xrange(store.getHeight()):
+                for column in xrange(store.getWidth()):
+                    values = filter1(extension.getBandValues(line,column))
+                    targetExtension.setBandValues(line, column, values)
+
+        targetExtension.saveBuffer(targetfilename)
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point, taking the neighbour points
+    # as a kernel(3x3) call to the function "filter1" and pass as argument
+    # a tuple with the values of all the points in the kernel for each band.
+    #
+    # The function "filter1" must be such that it takes a tuple of multi-dimension,
+    # modifies its value and returns a new tuple having dimensions same as input.
+    #
+    # This method saves the newly created(filter applied) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param filter1 any filter which modifies the raster layer using a kernel(3x3).
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    # @param targetbandcount number of bands in the output layer
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def filterKernel(self, filter1, targetfilename, targetdatatype=None, targetbandcount=None):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        targetExtension = RasterLayerExtensions()
+        #targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), targetbandcount, targetdatatype)
+
+        k=0
+        l=0
+        values = [0 for count in xrange(store.getBandCount())]
+        values = [[values for count in xrange(3)] for count in xrange(3)]
+        outValues = list()
+        for band in xrange(store.getBandCount()):
+            for line in xrange(1,store.getHeight()-1):
+                for column in xrange(1,store.getWidth()-1):
+                    
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            values[i][j]=extension.getBandValues(k,l)
+                            j=j+1
+                        i=i+1
+                    outValues = filter1(values)
+                    targetExtension.setBandValues(line, column, outValues)
+
+        targetExtension.saveBuffer(targetfilename)
+                    
+    @staticmethod
+    ##
+    #
+    # Go over the raster layer and for each point call to the function "operation" and
+    # pass as arguments two tuples (One corresponding to the first layer at that point,
+    # the other corresponding to the second layer at the same point) with the values of
+    # each point for each band.
+    #
+    # The function "operation" must be such that it takes two tuples as input, performs
+    # operations involving both of them and returns a new tuple.
+    #
+    # This method saves the newly created(from the two rasters) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on both the raster layers at a respective point/pixel.
+    # @param layer2 the layer which forms the second input to the "operation" function.
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def operation(self, operation, layer2, targetfilename, targetdatatype=None):
+        layer1Extension = self.getExtensions()
+        layer2Extension = layer2.getExtensions()
+
+        layer1Store = self.getDataStore()
+        layer2Store = layer2.getDataStore()
+
+        bandCount = layer1Store.getBandCount()
+        layerWidth = layer1Store.getWidth()
+        layerHeight = layer1Store.getHeight()
+        targetExtension = RasterLayerExtensions()
+        resultValues = list()
+        #targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, layer1Store.getDataType())
+        targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, targetdatatype)
+
+        for band in xrange(bandCount):
+            for line in xrange(layerHeight):
+                for column in xrange(layerWidth):
+                    layer1Values = layer1Extension.getBandValues(line, column)
+                    layer2Values = layer2Extension.getBandValues(line, column)
+                    resultValues = operation(layer1Values, layer2Values)
+                    targetExtension.setBandValues(line, column, resultValues)
+
+        targetExtension.saveBuffer(targetfilename)
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster layer and for each point, taking the neighbour points as a
+    # kernel(3x3) call to the function "operation" and pass as arguments two tuples
+    # (One corresponding to the first layer at that point, the other corresponding
+    # to the second layer at the same point) with the values of all the points of the
+    # kernel for each band.
+    #
+    # The function "operation" must be such that it takes two tuples of multiple
+    # dimensions as input, performs operations involving both of them and returns a
+    # new tuple having dimensions same as input tuples.
+    #
+    # This method saves the newly created(from the two rasters) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on both the raster layers at a respective point/pixel but involving kernel(3x3)[neighbour points].
+    # @param layer2 the layer which forms the second input to the "operation" function.
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def operationKernel(self, operation, layer2, targetfilename, targetdatatype=None):
+        layer1Extension = self.getExtensions()
+        layer2Extension = self.getExtensions()
+
+        layer1Store = self.getDataStore()
+        layer2Store = layer2.getDataStore()
+
+        bandCount = layer1Store.getBandCount()
+        layerWidth = layer1Store.getWidth()
+        layerHeight = layer1Store.getHeight()
+        targetExtension = RasterLayerExtensions()
+        #targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, layer1Store.getDataType())targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, layer1Store.getDataType())
+        targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, targetdatatype)
+
+        k=0
+        l=0
+        values1 = [[[None for count in range(bandCount)] for count in range(3)] for count in range(3)]
+        values2 = [[[None for count in range(bandCount)] for count in range(3)] for count in range(3)]
+        outValues = list()
+        for band in xrange(bandCount):
+            for line in xrange(1,layerHeight-1):
+                for column in xrange(1,layerWidth-1):
+
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            values1[i][j]=layer1Extension.getBandValues(k,l)
+                            #print i,j,values1[i][j]
+                            #print values1
+                            values2[i][j]=layer2Extension.getBandValues(k,l)
+                            j=j+1
+                        i=i+1
+
+                    outValues = operation(values1, values2)
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            targetExtension.setBandValues(k,l, outValues[i][j])
+                            j=j+1
+                        i=i+1
+
+        targetExtension.saveBuffer(targetfilename)
+        
+
+#
+# Inject new methods in the class FLyrRaster
+#
+FLyrRaster.getExtensions = RasterLayer.getExtensions
+FLyrRaster.getBandsCount = RasterLayer.getBandsCount
+FLyrRaster.getWidth = RasterLayer.getWidth
+FLyrRaster.getHeight = RasterLayer.getHeight
+FLyrRaster.getDataType = RasterLayer.getDataType
+FLyrRaster.getData = RasterLayer.getData
+FLyrRaster.walk = RasterLayer.walk
+FLyrRaster.walkKernel = RasterLayer.walkKernel
+FLyrRaster.filter = RasterLayer.filter
+FLyrRaster.filterKernel = RasterLayer.filterKernel
+FLyrRaster.operation = RasterLayer.operation
+FLyrRaster.operationKernel = RasterLayer.operationKernel
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-win.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-win.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-win.xml	(revision 15423)
@@ -0,0 +1,54 @@
+<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>
+   		
+        <!-- Sin migrar la vectorización de momento -->
+        
+        <file>
+  			<source>${user.home}/.depman/bin/jpotrace001.dll</source>
+            <outputDirectory>install/files</outputDirectory>
+        </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.swing.api:jar</include>
+			<include>org.gvsig:org.gvsig.raster.swing.impl:jar</include>
+			<include>org.gvsig:org.gvsig.raster.cache.lib.api:jar</include>
+			<include>org.gvsig:org.gvsig.raster.cache.lib.impl:jar</include>
+			<include>org.gvsig:org.gvsig.raster.lib.api:jar</include>
+			<include>org.gvsig:org.gvsig.raster.lib.impl:jar</include>
+			<include>org.gvsig:org.gvsig.raster.algorithm:jar</include>
+			<include>org.gvsig:org.gvsig.raster.fmap:jar</include>
+			<include>org.gvsig:org.gvsig.jpotrace:jar</include>
+			<!-- <include>org.gvsig:org.gvsig.timesupport.lib.api:jar</include>
+			<include>org.gvsig:org.gvsig.timesupport.lib.impl:jar</include>-->
+			<include>org.joda:joda-time:jar</include>
+	  </includes>
+	</dependencySet>
+  </dependencySets>
+</assembly>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-win.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-fedora11.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-fedora11.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-fedora11.xml	(revision 15423)
@@ -0,0 +1,47 @@
+<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.swing.api:jar</include>
+			<include>org.gvsig:org.gvsig.raster.swing.impl:jar</include>
+			<include>org.gvsig:org.gvsig.raster.cache.lib.api:jar</include>
+			<include>org.gvsig:org.gvsig.raster.cache.lib.impl:jar</include>
+			<include>org.gvsig:org.gvsig.raster.lib.api:jar</include>
+			<include>org.gvsig:org.gvsig.raster.lib.impl:jar</include>
+			<include>org.gvsig:org.gvsig.raster.algorithm:jar</include>
+			<include>org.gvsig:org.gvsig.raster.fmap:jar</include>
+			<include>org.gvsig:org.gvsig.jpotrace:jar</include>
+			<!-- <include>org.gvsig:org.gvsig.timesupport.lib.api:jar</include>
+			<include>org.gvsig:org.gvsig.timesupport.lib.impl:jar</include>-->
+			<include>org.joda:joda-time:jar</include>
+	  </includes>
+	</dependencySet>
+  </dependencySets>
+</assembly>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-fedora11.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin.xml	(revision 15423)
@@ -0,0 +1,51 @@
+<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>
+    	<file>
+            <source>${user.home}/.depman/lib/libjpotrace2.0.0.so</source>
+            <outputDirectory>install/files/native</outputDirectory>
+        </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>src/main/resources-plugin</directory>
+      <outputDirectory>.</outputDirectory>
+    </fileSet>
+  </fileSets>
+
+
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>false</useProjectArtifact>
+	  <useTransitiveDependencies>true</useTransitiveDependencies>
+      <outputDirectory>lib</outputDirectory>
+      <includes> 
+		<include>org.gvsig:org.gvsig.raster.swing.api:jar</include>
+		<include>org.gvsig:org.gvsig.raster.swing.impl:jar</include>
+		<include>org.gvsig:org.gvsig.raster.cache.lib.api:jar</include>
+		<include>org.gvsig:org.gvsig.raster.cache.lib.impl:jar</include>
+		<include>org.gvsig:org.gvsig.raster.lib.api:jar</include>
+		<include>org.gvsig:org.gvsig.raster.lib.impl:jar</include>
+		<include>org.gvsig:org.gvsig.raster.algorithm:jar</include>
+		<include>org.gvsig:org.gvsig.raster.fmap:jar</include>
+		<include>org.gvsig:org.gvsig.jpotrace:jar</include>
+		<!-- <include>org.gvsig:org.gvsig.timesupport.lib.api:jar</include>
+		<include>org.gvsig:org.gvsig.timesupport.lib.impl:jar</include>-->
+		<include>org.joda:joda-time:jar</include>
+	  </includes>
+	</dependencySet>
+  </dependencySets>
+</assembly>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin64.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin64.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin64.xml	(revision 15423)
@@ -0,0 +1,51 @@
+<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>
+    	<file>
+            <source>${user.home}/.depman/lib64/libjpotrace2.0.0.so</source>
+            <outputDirectory>install/files/native</outputDirectory>
+        </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>src/main/resources-plugin</directory>
+      <outputDirectory>.</outputDirectory>
+    </fileSet>
+  </fileSets>
+
+
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>false</useProjectArtifact>
+	  <useTransitiveDependencies>true</useTransitiveDependencies>
+      <outputDirectory>lib</outputDirectory>
+      <includes> 
+		<include>org.gvsig:org.gvsig.raster.swing.api:jar</include>
+		<include>org.gvsig:org.gvsig.raster.swing.impl:jar</include>
+		<include>org.gvsig:org.gvsig.raster.cache.lib.api:jar</include>
+		<include>org.gvsig:org.gvsig.raster.cache.lib.impl:jar</include>
+		<include>org.gvsig:org.gvsig.raster.lib.api:jar</include>
+		<include>org.gvsig:org.gvsig.raster.lib.impl:jar</include>
+		<include>org.gvsig:org.gvsig.raster.algorithm:jar</include>
+		<include>org.gvsig:org.gvsig.raster.fmap:jar</include>
+		<include>org.gvsig:org.gvsig.jpotrace:jar</include>
+		<!-- <include>org.gvsig:org.gvsig.timesupport.lib.api:jar</include>
+		<include>org.gvsig:org.gvsig.timesupport.lib.impl:jar</include>-->
+		<include>org.joda:joda-time:jar</include>
+	  </includes>
+	</dependencySet>
+  </dependencySets>
+</assembly>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/assembly/gvsig-plugin-package-lin64.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/CreateLayerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/CreateLayerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/CreateLayerPanel.java	(revision 15423)
@@ -0,0 +1,237 @@
+/* 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.mainplugin.beans.createlayer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+/**
+ * Panel para unificar las propiedades de generacion de capas nuevas en ficheros
+ * o solo en visualizacion.
+ * 
+ * @version 10/03/2008
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class CreateLayerPanel {
+	private JPanel        panel         = null;
+	private JRadioButton  jRBOnlyView   = null;
+	private JRadioButton  jRBNewLayer   = null;
+	private NewLayerPanel panelNewLayer = null;
+	private FLyrRaster    lyr           = null;
+
+	/**
+	 * Constructor de un CreateLayerPanel
+	 */
+	public CreateLayerPanel(FLyrRaster lyr) {
+		this.lyr = lyr;
+		initialize();
+		translate();
+	}
+	
+	/**
+	 * Disables the new layer option. It is useful for remote
+	 * services
+	 */
+	public void disableNewLayer() {
+		getRadioOnlyView().setSelected(true);
+		getRadioNewLayer().setEnabled(false);
+	}
+	
+	/**
+	 * Devuelve el panel principal
+	 * @return
+	 */
+	public JPanel getJPanel() {
+		if (panel == null) {
+			panel = new JPanel();
+		}
+		return panel;
+	}
+
+	/**
+	 * Seccion donde ir�n todas las traducciones invariables del componente
+	 */
+	private void translate() {
+		getRadioOnlyView().setText(PluginServices.getText(this, "solo_visualizacion"));
+		getRadioNewLayer().setText(PluginServices.getText(this, "capa_nueva"));
+	}
+	
+	/**
+	 * Inicializar el panel de CreateLayer
+	 */
+	private void initialize() {
+		ButtonGroup buttonGroup1;
+		GridBagConstraints gridBagConstraints;
+
+		getJPanel().setLayout(new GridBagLayout());
+		
+		buttonGroup1 = new ButtonGroup();
+		buttonGroup1.add(getRadioOnlyView());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getRadioOnlyView(), gridBagConstraints);
+
+		buttonGroup1.add(getRadioNewLayer());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getRadioNewLayer(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getPanelNewLayer().getJPanel(), gridBagConstraints);
+	}
+	
+	public NewLayerPanel getPanelNewLayer() {
+		if (panelNewLayer == null)
+			panelNewLayer = new NewLayerPanel(lyr);
+		return panelNewLayer;
+	}
+	
+	/**
+	 * Poner los estados de los RadioButton en caso de que cambien de valor
+	 * @param evt
+	 */
+	private void jRBNewLayerStateChanged(ItemEvent evt) {
+		if (getRadioNewLayer().getSelectedObjects() != null) {
+			getPanelNewLayer().getRadioFileGenerate().setEnabled(true);
+			getPanelNewLayer().getRadioOpenMemory().setEnabled(true);
+			if (getPanelNewLayer().getRadioOpenMemory().getSelectedObjects() != null)
+				getPanelNewLayer().setFilenameEnabled(true);
+			else
+				getPanelNewLayer().setFilenameEnabled(false);
+		} else {
+			getPanelNewLayer().getRadioFileGenerate().setEnabled(false);
+			getPanelNewLayer().getRadioOpenMemory().setEnabled(false);
+			getPanelNewLayer().setFilenameEnabled(false);
+		}
+	}
+
+	/**
+	 * Especifica si se generara solo en la vista o se guardara en un fichero
+	 * @param enabled
+	 */
+	public void setOnlyView(boolean enabled) {
+		getRadioOnlyView().setSelected(enabled);
+	}
+
+	/**
+	 * Devuelve el JRadioButton de Solo vista
+	 * @return
+	 */
+	private JRadioButton getRadioOnlyView() {
+		if (jRBOnlyView == null) {
+			jRBOnlyView = new JRadioButton();
+			jRBOnlyView.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBOnlyView.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return jRBOnlyView;
+	}
+	
+	/**
+	 * Devuelve el JRadioButton de nueva capa
+	 * @return
+	 */
+	private JRadioButton getRadioNewLayer() {
+		if (jRBNewLayer == null) {
+			jRBNewLayer = new JRadioButton();
+			jRBNewLayer.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBNewLayer.setMargin(new Insets(0, 0, 0, 0));
+			jRBNewLayer.addItemListener(new ItemListener() {
+				public void itemStateChanged(ItemEvent evt) {
+					jRBNewLayerStateChanged(evt);
+				}
+			});
+			jRBNewLayer.setSelected(true);
+		}
+		return jRBNewLayer;
+	}
+	
+	/**
+	 * This method initializes jPNameFile
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public JPanel getFileNamePanel() {
+		return getPanelNewLayer().getFileNamePanel();
+	}
+	
+	/**
+	 * Establece el texto de la etiqueta del nombre de fichero
+	 * @param text
+	 */
+	public void setLabelFilename(String text) {
+		getPanelNewLayer().setLabelFilename(text);
+	}
+	
+	public boolean isNewLayerSelected() {
+		return getRadioNewLayer().isSelected();
+	}
+
+	public boolean isOnlyViewSelected() {
+		return getRadioOnlyView().isSelected();
+	}
+	
+	/**
+	 * Asigna un valor para el par�metro que informa de si el raster de salida hay
+	 * que comprimirlo o no. Este valor es necesario cuando el raster de salida 
+	 * es mayor de 4G ya que no se puede crear un tiff tan grande.
+	 * @param compress true para comprimir el raster de salida y false para no hacerlo.
+	 */
+	public void setCompress(boolean compress) {
+		getPanelNewLayer().setCompress(compress);
+	}
+	
+	/**
+	 * Devuelve la ruta del fichero donde se va a guardar, en caso de guardarse
+	 * en memoria, calcula el nombre sin preguntar y devuelve la ruta.
+	 * @return
+	 */
+	public String getFileSelected() {
+		return getPanelNewLayer().getFileSelected();
+	}
+	
+	public void updateNewLayerText() {
+		getPanelNewLayer().updateNewLayerText();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/CreateLayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/SelectDirectoryPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/SelectDirectoryPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/SelectDirectoryPanel.java	(revision 15423)
@@ -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.mainplugin.beans.createlayer;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.swing.JFileChooser;
+
+
+/**
+ * Panel para la selecci�n de directorios.
+ * 
+ * 13/05/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SelectDirectoryPanel extends JPanel implements ActionListener {
+	private static final long  serialVersionUID     = 1L;
+	private JTextField         directoryTextField   = null;
+	private JLabel             jLabelDirectory      = null;
+	private JButton            jBChooseDirectory    = null;
+	private ActionListener     listener             = null;
+	
+	/**
+	 * Constructor. 
+	 * Inicializa los componentes gr�ficos
+	 */
+	public SelectDirectoryPanel() {
+		init();
+	}
+	
+	/**
+	 * This method initializes jPNameFile
+	 * @return javax.swing.JPanel
+	 */
+	private void init() {
+		GridBagConstraints gridBagConstraints = null;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(2, 5, 5, 2);
+		add(getJLabelDirectory(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new java.awt.Insets(2, 2, 5, 2);
+		add(getDirectoryTextField(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.insets = new java.awt.Insets(2, 2, 5, 5);
+		add(getJBChooseDirectory(), gridBagConstraints);
+
+		getJBChooseDirectory().addActionListener(this);
+	}
+	
+	public void setListener(ActionListener listener) {
+		this.listener = listener;
+	}
+	
+	/**
+	 * Obtiene el bot�n de asignaci�n de directorio
+	 * @return JButton
+	 */
+	public JButton getJBChooseDirectory() {
+		if (jBChooseDirectory == null) {
+			jBChooseDirectory = new JButton(PluginServices.getText(this, "cambiar_ruta"));
+			jBChooseDirectory.setEnabled(false);
+		}
+		return jBChooseDirectory;
+	}
+	
+	/**
+	 * Obtiene la etiqueta con la ruta
+	 * @return JLabel
+	 */
+	public JLabel getJLabelDirectory() {
+		if (jLabelDirectory == null) {
+			jLabelDirectory = new JLabel(PluginServices.getText(this, "ruta") + ":");
+			jLabelDirectory.setEnabled(false);
+		}
+		return jLabelDirectory;
+	}
+	
+	/**
+	 * Obtiene el campo de texto con la ruta de directorio
+	 * @return JTextField
+	 */
+	public JTextField getDirectoryTextField() {
+		if (directoryTextField  == null) {
+			directoryTextField = new JTextField();
+			directoryTextField.setText(JFileChooser.getLastPath(this.getClass().getName(), (File) null).toString());
+			directoryTextField.setEditable(false);
+			directoryTextField.setEnabled(false);
+			directoryTextField.setPreferredSize(new Dimension(200, directoryTextField.getPreferredSize().height));
+		}
+		return directoryTextField;
+	}
+	
+	/**
+	 * Accion que sucede cuando se pulsa el boton de cambiar directorio
+	 */
+	public void actionPerformed(ActionEvent e) {
+		JFileChooser chooser = new JFileChooser(this.getClass().getName(), new File(getDirectoryTextField().getText()));
+		chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+		chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_directorio"));
+
+		if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+			getDirectoryTextField().setText(chooser.getSelectedFile().toString());
+		else
+			chooser.setLastPath(new File(getDirectoryTextField().getText()));
+		
+		if(listener != null)
+			listener.actionPerformed(new ActionEvent(this, 0, getPath()));
+	}
+	
+	/**
+	 * Obtiene la ruta al directorio.
+	 * @return String
+	 */
+	public String getPath() {
+		return getDirectoryTextField().getText();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/SelectDirectoryPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/WritableFolderPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/WritableFolderPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/WritableFolderPanel.java	(revision 15423)
@@ -0,0 +1,146 @@
+package org.gvsig.raster.mainplugin.beans.createlayer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+
+import org.cresques.Messages;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.raster.mainplugin.RasterMainPluginUtils;
+import org.gvsig.raster.mainplugin.beans.createlayer.SelectDirectoryPanel;
+import org.gvsig.raster.swing.basepanel.AbstractButtonsPanel;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+
+/**
+ * Panel to select a writable folder
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WritableFolderPanel extends AbstractButtonsPanel implements ActionListener, IWindow {
+	private static final long           serialVersionUID       = 1L;
+	private SelectDirectoryPanel        selectDirectoryPanel   = null;
+	private JCheckBox                   allFiles               = null;
+	private Point                       posWindow              = null;
+	private int                         widthWindow            = 320;
+	private int                         heightWindow           = 140;
+	private String                      defaultFolder          = null;
+	private String                      layerName              = null;
+	private ActionListener              listener               = null;
+	
+	public WritableFolderPanel(String defaultFolder, ActionListener listener, String layerName) {
+		this.defaultFolder = defaultFolder;
+		this.layerName = layerName;
+		setListener(listener);
+		posWindow = RasterMainPluginUtils.iwindowPosition(widthWindow, heightWindow);
+		initGUI();
+		PluginServices.getMDIManager().addWindow(this);
+	}
+	
+	private void initGUI() {
+		JButton accept = getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT);
+		JButton cancel = getButtonsPanel().getButton(IButtonsPanel.BUTTON_CANCEL);
+		getButtonsPanel().getButton(IButtonsPanel.BUTTON_APPLY).setVisible(false);
+		accept.setEnabled(false);
+		accept.addActionListener(this);
+		cancel.addActionListener(this);
+		
+		this.setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1;
+		JLabel label = new JLabel();
+		label.setText("<html><p>" + Messages.getText("folder_not_writable") + "</p></html>");
+		
+		gbc.gridy = 0;
+		this.add(new JLabel("<html><p>" + layerName + "</p><BR></html>"), gbc);
+		
+		gbc.gridy = 1;
+		this.add(label, gbc);
+		
+		gbc.gridy = 2;
+		this.add(getSelectDirectoryPanel(), gbc);
+		
+		gbc.gridy = 3;
+		this.add(getCheckOption(), gbc);
+		
+		getSelectDirectoryPanel().setListener(this);
+	}
+	
+	public boolean aplyAllFiles() {
+		return getCheckOption().isSelected();
+	}
+	
+	public JCheckBox getCheckOption() {
+		if (allFiles == null)
+			allFiles = new JCheckBox(Messages.getText("apply_all"));
+		return allFiles;
+	}
+	
+	public SelectDirectoryPanel getSelectDirectoryPanel() {
+		if(selectDirectoryPanel == null) {
+			selectDirectoryPanel = new SelectDirectoryPanel();
+			selectDirectoryPanel.getJLabelDirectory().setVisible(false);
+			selectDirectoryPanel.getJBChooseDirectory().setEnabled(true);
+			selectDirectoryPanel.getDirectoryTextField().setText(defaultFolder);
+		}
+		return selectDirectoryPanel;
+	}
+	
+	public void setListener(ActionListener listener) {
+		this.listener = listener;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT)) {
+			if(listener != null)
+				listener.actionPerformed(new ActionEvent(getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT), IButtonsPanel.BUTTON_ACCEPT, ""));
+			PluginServices.getMDIManager().closeWindow(this);
+		}
+		
+		if(e.getSource() == getButtonsPanel().getButton(IButtonsPanel.BUTTON_CANCEL)) {
+			if(listener != null)
+				listener.actionPerformed(new ActionEvent(getButtonsPanel().getButton(IButtonsPanel.BUTTON_CANCEL), IButtonsPanel.BUTTON_CANCEL, ""));
+			PluginServices.getMDIManager().closeWindow(this);
+		}
+		
+		if(e.getSource() == getSelectDirectoryPanel()) {
+			File f = new File(getSelectDirectoryPanel().getPath());
+			if(f.exists() && f.isDirectory() && f.canWrite()) {
+				getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT).setEnabled(true);
+				if(listener != null)
+					listener.actionPerformed(new ActionEvent(getChangeFolderButton(), 0, getSelectDirectoryPanel().getPath()));
+			} else {
+				getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT).setEnabled(false);
+			}
+		}
+	}
+	
+	public JButton getChangeFolderButton() {
+		return getSelectDirectoryPanel().getJBChooseDirectory();
+	}
+	
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
+		m_viewinfo.setTitle(Messages.getText("warning"));
+		m_viewinfo.setHeight(heightWindow);
+		m_viewinfo.setWidth(widthWindow);
+		if (posWindow != null) {
+			m_viewinfo.setX((int) posWindow.getX());
+			m_viewinfo.setY((int) posWindow.getY());
+		}
+		return m_viewinfo;
+	}
+	
+	public Object getWindowProfile() {
+		return WindowInfo.DIALOG_PROFILE;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/WritableFolderPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/NewLayerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/NewLayerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/NewLayerPanel.java	(revision 15423)
@@ -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.mainplugin.beans.createlayer;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.filechooser.FileFilter;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.Utilities;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.PropertyEvent;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.util.ExtendedFileFilter;
+
+/**
+ *
+ * @version 18/06/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class NewLayerPanel implements PropertyListener {
+	private JPanel       panel              = null;
+	private JRadioButton jRBFileGenerate    = null;
+	private JRadioButton jRBOpenMemory      = null;
+	private JTextField   filenameTextField  = null;
+	private JLabel       labelFilename      = null;
+	private JPanel       panelNameFile      = null;
+	private boolean      compress           = false;
+	private FLyrRaster   lyr                = null;
+	protected FileUtils  fileUtil           = RasterLocator.getManager().getFileUtils();
+	
+	/**
+	 * Constructor de un CreateLayerPanel
+	 */
+	public NewLayerPanel(FLyrRaster lyr) {
+		this.lyr = lyr;
+		initialize();
+		translate();
+	}
+
+	/**
+	 * Devuelve el panel principal
+	 * @return
+	 */
+	public JPanel getJPanel() {
+		if (panel == null) {
+			panel = new JPanel();
+		}
+		return panel;
+	}
+
+	private void initialize() {
+		ButtonGroup buttonGroup2;
+		GridBagConstraints gridBagConstraints;
+
+		getJPanel().setLayout(new GridBagLayout());
+
+		getJPanel().setBorder(BorderFactory.createTitledBorder(""));
+		buttonGroup2 = new ButtonGroup();
+		buttonGroup2.add(getRadioFileGenerate());
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		gridBagConstraints.weightx = 1.0;
+		getJPanel().add(getRadioFileGenerate(), gridBagConstraints);
+
+		buttonGroup2.add(getRadioOpenMemory());
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getRadioOpenMemory(), gridBagConstraints);
+	}
+
+	/**
+	 * Seccion donde ir�n todas las traducciones invariables del componente
+	 */
+	private void translate() {
+		getRadioFileGenerate().setText(PluginServices.getText(this, "generar_fichero"));
+		getRadioOpenMemory().setText(PluginServices.getText(this, "abrir_memoria"));
+		getLabelFilename().setText(PluginServices.getText(this, "nombre_capa") + ":");
+	}
+
+	/**
+	 * Devuelve el JRadioButton de generar fichero
+	 * @return
+	 */
+	public JRadioButton getRadioFileGenerate() {
+		if (jRBFileGenerate == null) {
+			jRBFileGenerate = new JRadioButton();
+			jRBFileGenerate.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBFileGenerate.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return jRBFileGenerate;
+	}
+
+	/**
+	 * Devuelve el JRadioButton de Abrir en memoria
+	 * @return
+	 */
+	public JRadioButton getRadioOpenMemory() {
+		if (jRBOpenMemory == null) {
+			jRBOpenMemory = new JRadioButton();
+			jRBOpenMemory.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBOpenMemory.setMargin(new Insets(0, 0, 0, 0));
+
+			jRBOpenMemory.addItemListener(new ItemListener() {
+				public void itemStateChanged(ItemEvent evt) {
+					jRBOpenMemoryStateChanged(evt);
+				}
+			});
+			jRBOpenMemory.setSelected(true);
+		}
+		return jRBOpenMemory;
+	}
+
+	/**
+	 * This method initializes filenameTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getFilenameTextField() {
+		if (filenameTextField == null) {
+			filenameTextField = new JTextField();
+			filenameTextField.setPreferredSize(new Dimension(150, filenameTextField.getPreferredSize().height));
+			fileUtil.addOnlyLayerNameListener(this);
+		}
+		return filenameTextField;
+	}
+
+	/**
+	 * This method initializes jPNameFile
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public JPanel getFileNamePanel() {
+		if (panelNameFile == null) {
+			panelNameFile = new JPanel();
+			panelNameFile.add(getLabelFilename());
+			panelNameFile.add(getFilenameTextField());
+			updateNewLayerText();
+		}
+		return panelNameFile;
+	}
+
+	private JLabel getLabelFilename() {
+		if (labelFilename == null) {
+			labelFilename = new JLabel();
+		}
+		return labelFilename;
+	}
+
+	/**
+	 * Establece si esta habilitado o no el cuadro de texto de entrada de nombre de
+	 * fichero
+	 * @param value
+	 */
+	public void setFilenameEnabled(boolean value) {
+		getFilenameTextField().setEnabled(value);
+		getLabelFilename().setEnabled(value);
+	}
+
+	/**
+	 * Poner los estados de los RadioButton en caso de que cambien de valor
+	 * @param evt
+	 */
+	protected void jRBOpenMemoryStateChanged(ItemEvent evt) {
+		if (getRadioOpenMemory().getSelectedObjects() != null) {
+			setFilenameEnabled(true);
+		} else {
+			setFilenameEnabled(false);
+		}
+	}
+
+	/**
+	 * Especificar el nombre de la nueva capa para el recuadro de texto asignando
+	 * en cada llamada un nombre consecutivo.
+	 */
+	public void updateNewLayerText() {
+		getFilenameTextField().setText(fileUtil.getOnlyLayerName());
+	}
+
+	/**
+	 * Establece el texto de la etiqueta del nombre de fichero
+	 * @param text
+	 */
+	public void setLabelFilename(String text) {
+		getLabelFilename().setText(text);
+	}
+
+	/**
+	 * Asigna un valor para el par�metro que informa de si el raster de salida hay
+	 * que comprimirlo o no. Este valor es necesario cuando el raster de salida
+	 * es mayor de 4G ya que no se puede crear un tiff tan grande.
+	 * @param compress true para comprimir el raster de salida y false para no hacerlo.
+	 */
+	public void setCompress(boolean compress) {
+		this.compress = compress;
+	}
+
+	/**
+	 * Devuelve la ruta del fichero donde se va a guardar, en caso de guardarse
+	 * en memoria, calcula el nombre sin preguntar y devuelve la ruta.
+	 * @return
+	 */
+	public String getFileSelected() {
+		String path = "";
+		if (getRadioFileGenerate().isSelected()) {
+			JFileChooser chooser = new JFileChooser("NEW_LAYER_RASTER_PANEL", JFileChooser.getLastPath("NEW_LAYER_RASTER_PANEL", null));
+			chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_fichero"));
+
+			// A�adimos las extensiones que hayan sido registradas en el driver
+			ArrayList<String> extList = new ArrayList<String>();
+			try {
+				extList = RasterLocator.getManager().getProviderServices().getExtensionsSupported(
+							lyr.getDataStore().getDataType()[0], 
+							lyr.getDataStore().getBandCount());
+			} catch (RasterDriverException e2) {
+				RasterSwingLibrary.messageBoxError("error_extensiones_soportadas", chooser, e2);
+				return null;
+			}
+
+			FileFilter selected = null;
+			for (int i = 0; i < extList.size(); i++) {
+				FileFilter filter = new ExtendedFileFilter((String) extList.get(i));
+				if (extList.get(i).equals("tif")) {
+					selected = filter;
+				}
+				chooser.addChoosableFileFilter(filter);
+			}
+			if (selected != null)
+				chooser.setFileFilter(selected);
+
+			// Cargamos el panel de propiedades en el selector
+			chooser.setAcceptAllFileFilterUsed(false);
+
+			IWindow w = PluginServices.getMDIManager().getActiveWindow();
+
+			if (!(w instanceof Component))
+				w = null;
+
+ 			if (chooser.showSaveDialog((Component) w) != JFileChooser.APPROVE_OPTION)
+ 				return null;
+
+			JFileChooser.setLastPath("NEW_LAYER_RASTER_PANEL", chooser.getSelectedFile());
+
+			ExtendedFileFilter fileFilter = (ExtendedFileFilter) chooser.getFileFilter();
+			path = fileFilter.getNormalizedFilename(chooser.getSelectedFile());
+		} else {
+
+			String file = getFilenameTextField().getText();
+			if (file.compareTo(fileUtil.getOnlyLayerName()) == 0)
+				fileUtil.usesOnlyLayerName();
+
+			if (!compress)
+				path = Utilities.createTempDirectory() + File.separator + file + ".tif";
+			else
+				path = Utilities.createTempDirectory() + File.separator + file + ".jp2";
+			updateNewLayerText();
+		}
+		return path;
+	}
+
+	/**
+	 * Cuando alguien ha cambiado la propiedad del nombre de la
+	 * capa se actualiza autom�ticamente
+	 */
+	public void actionValueChanged(PropertyEvent e) {
+		updateNewLayerText();
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/NewLayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/GenericToolBarExtension.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/GenericToolBarExtension.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/GenericToolBarExtension.java	(revision 15423)
@@ -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.mainplugin;
+
+import java.awt.Dimension;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.andami.ui.mdiFrame.MDIFrame;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.mainplugin.toolbar.GenericToolBarMenuItem;
+import org.gvsig.raster.mainplugin.toolbar.GenericToolBarPanel;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+/**
+ * Extension para la barra de herramientas generica
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano
+ */
+public class GenericToolBarExtension extends Extension {
+	private GenericToolBarPanel toolBar = null;
+
+	/**
+	 * Crea y devuelve la barra de herramientas
+	 * @return
+	 */
+	private GenericToolBarPanel getGenericToolBarPanel() {
+		if (toolBar == null) {
+			MDIFrame f = (MDIFrame) PluginServices.getMainFrame();
+			if (f == null)
+				return null;
+			toolBar = new GenericToolBarPanel();
+			toolBar.setVisible(true);
+			f.addToolBarControl(getClass(), toolBar, "RasterToolBar");
+		} else {
+			toolBar.setPreferredSize(new Dimension(300, getToolbarHeight()));
+		}
+
+		return toolBar;
+	}
+
+	/**
+	 * Obtenemos el alto de cualquier toolbar que este visible en gvSIG y no sea
+	 * nuestro para poder asignarselo al GenericToolBar como PreferredSize. En
+	 * caso de no encontrar ninguno que cumpla las condiciones, se devolver� 24
+	 * @return
+	 */
+	private int getToolbarHeight() {
+		if ((PluginServices.getMainFrame() == null) ||
+				(PluginServices.getMainFrame().getToolbars() == null) ||
+				(PluginServices.getMainFrame().getToolbars().length <= 0))
+			return 24;
+
+		for (int i = 0; i < PluginServices.getMainFrame().getToolbars().length; i++) {
+			if ((PluginServices.getMainFrame().getToolbars()[i].getHeight() > 16) &&
+					((Object) PluginServices.getMainFrame().getToolbars()[i] != (Object) toolBar))
+				return PluginServices.getMainFrame().getToolbars()[i].getHeight();
+		}
+		return 24;
+	}
+
+	public void initialize() {
+		registerIcons();
+		
+		 Messages.addResourceFamily("org.gvsig.raster.mainplugin.i18n.text",
+				 GenericToolBarExtension.class.getClassLoader(),
+				 GenericToolBarExtension.class.getClass().getName()); 
+		
+		// Creaci�n del punto de extensi�n para registrar paneles en el cuadro de propiedades.
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add("GenericToolBarGroup");
+		point.setDescription("Punto de extension para los grupos de menus del GenericToolBarPanel");
+
+		point.append("RasterLayer", "", new GenericToolBarMenuItem(Messages.getText("capa_raster"), IconThemeHelper.getImageIcon("menu-layer-icon")));
+		//point.append("RasterProcess", "", new GenericToolBarMenuItem(Messages.getText("process_raster"), IconThemeHelper.getImageIcon("menu-process-icon")));
+		point.append("Dataset", "", new GenericToolBarMenuItem(Messages.getText("dataset_raster"), IconThemeHelper.getImageIcon("menu-dataset-icon")));
+		point.append("Multispectral", "", new GenericToolBarMenuItem(Messages.getText("multispectral"), IconThemeHelper.getImageIcon("menu-multispectral-icon")));
+		point.append("Enhanced", "", new GenericToolBarMenuItem(Messages.getText("enhanced"), IconThemeHelper.getImageIcon("menu-enhanced-icon")));
+		point.append("GeoRaster", "", new GenericToolBarMenuItem(Messages.getText("transformaciones_geograficas"), IconThemeHelper.getImageIcon("menu-transgeo-icon")));
+		point.append("RasterExport", "", new GenericToolBarMenuItem(Messages.getText("raster_export"), IconThemeHelper.getImageIcon("menu-raster-export")));
+
+		point = extensionPoints.add("GenericToolBarMenu");
+		point.setDescription("Punto de extension para los submenus del GenericToolBarPanel");
+	}
+	
+	private void registerIcons() {	
+		//Actions
+		IconThemeHelper.registerIcon("action", "menu-layer-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-process-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-transgeo-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-dataset-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-raster-export", this);
+		IconThemeHelper.registerIcon("action", "menu-multispectral-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-enhanced-icon", this);
+	}
+	
+	@Override
+	public void postInitialize() {
+		super.postInitialize();
+		if (getGenericToolBarPanel() != null)
+			getGenericToolBarPanel().reloadMenuGroup();
+	}
+
+	public boolean isEnabled() {
+		return false;
+	}
+
+	/**
+	 * Establece si la barra de herramientas esta visible
+	 * @param enabled
+	 */
+	private void setToolBarVisible(boolean enabled) {
+		if (getGenericToolBarPanel() == null)
+			return;
+
+		toolBar.setVisible(enabled);
+	}
+
+	@SuppressWarnings("deprecation")
+	public boolean isVisible() {
+		setToolBarVisible(true);
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null || !(f instanceof AbstractViewPanel)) {
+			//setToolBarVisible(false);
+			return false;
+		}
+		
+		if (getGenericToolBarPanel() != null)
+			getGenericToolBarPanel().setLayers(null);
+		AbstractViewPanel vista = (AbstractViewPanel) f;
+		ViewDocument model = vista.getModel();
+		MapContext mapa = model.getMapContext();
+		if (mapa.getLayers().getLayersCount() > 0) {
+			if (getGenericToolBarPanel() != null) {
+				getGenericToolBarPanel().setLayers(mapa.getLayers());
+			}
+		}
+		
+		//setToolBarVisible(true);
+		return true;
+
+		/*if (f instanceof AbstractViewPanel) {
+			AbstractViewPanel vista = (AbstractViewPanel) f;
+			ViewDocument model = vista.getModel();
+			MapContext mapa = model.getMapContext();
+			if (mapa.getLayers().getLayersCount() > 0) {
+				setToolBarVisible(true);
+				if (getGenericToolBarPanel() != null) {
+					getGenericToolBarPanel().setLayers(mapa.getLayers());
+				}
+				return true;
+			}
+		}
+
+		setToolBarVisible(false);
+		return false;*/
+	}
+
+	public void execute(String actionCommand) {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/GenericToolBarExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/properties/RasterPropertiesTocMenuEntry.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/properties/RasterPropertiesTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/properties/RasterPropertiesTocMenuEntry.java	(revision 15423)
@@ -0,0 +1,144 @@
+/* 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.mainplugin.properties;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.app.panelGroup.PanelGroupDialog;
+import org.gvsig.app.panelGroup.loaders.PanelGroupLoaderFromExtensionPoint;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.gui.beans.panelGroup.PanelGroupManager;
+import org.gvsig.gui.beans.panelGroup.tabbedPanel.TabbedPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.mainplugin.RasterMainPluginUtils;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+/**
+ * Entrada en del men� contextual del TOC correspondiente al cuadro de
+ * propiedades del raster
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterPropertiesTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private RasterPropertiesTocMenuEntry singleton  = null;
+	private FLayer                              lyr        = null;
+
+	/**
+	 * Variable para controlar si los eventos de los paneles se deben interpretar.
+	 * En la carga inicial se deben desactivar todos los eventos
+	 */
+	public static boolean                     enableEvents = false;
+	
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private RasterPropertiesTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public RasterPropertiesTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new RasterPropertiesTocMenuEntry();
+		return singleton;
+	}	
+
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 10;
+	}
+
+	public String getText() {
+		return Messages.getText("propiedades_raster");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+		if (selectedItems[0] instanceof ILayerState) {
+			if (!((ILayerState) selectedItems[0]).isOpen())
+				return false;
+			return true;
+		}
+		return false;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+		if (selectedItems[0] instanceof FLyrRaster)
+			return true;
+		return false;
+	}
+
+	/**
+	 * Gestiona la apertura del dialogo de propiedades de raster cuando se pulsa
+	 * la opci�n asignando a este las propiedades iniciales.
+	 */
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return;
+
+		lyr = selectedItems[0];
+		PanelGroupDialog properties = null;
+		try {
+			enableEvents = false;
+
+			PanelGroupManager manager = PanelGroupManager.getManager();
+
+			manager.registerPanelGroup(TabbedPanel.class);
+			manager.setDefaultType(TabbedPanel.class);
+
+			TabbedPanel panelGroup = (TabbedPanel) manager.getPanelGroup(lyr);
+			PanelGroupLoaderFromExtensionPoint loader = new PanelGroupLoaderFromExtensionPoint("RasterSEPropertiesDialog");
+
+			properties = new PanelGroupDialog(lyr.getName() ,Messages.getText("propiedades_raster"), 550, 450, (byte) (WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE), panelGroup);
+			properties.loadPanels(loader);
+			enableEvents = true;
+			RasterMainPluginUtils.addWindow(properties);
+		} catch (Exception e) {
+			RasterSwingLibrary.messageBoxInfo("error_props_tabs", properties, e);
+		} finally  {
+			enableEvents = true;
+		}
+	}
+	
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("layer-properties-raster");
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/properties/RasterPropertiesTocMenuEntry.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginExtension.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginExtension.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginExtension.java	(revision 15423)
@@ -0,0 +1,83 @@
+/* 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.mainplugin;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.mainplugin.properties.RasterPropertiesTocMenuEntry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+
+/**
+ * Main plugin for raster
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterMainPluginExtension extends Extension {
+
+	public void initialize() {
+        Messages.addResourceFamily("org.gvsig.raster.mainplugin.i18n.text",
+        		RasterMainPluginExtension.class.getClassLoader(),
+        		RasterMainPluginExtension.class.getClass().getName()); 
+        
+        IconThemeHelper.registerIcon(null, "map-ok-ico", this);
+        IconThemeHelper.registerIcon("action", "layer-properties-raster", this);
+        
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = null;
+		
+		//Registro punto de extensi�n del cuadro de propiedades
+		if (!extensionPoints.has("RasterSEPropertiesDialog")) {
+			point = extensionPoints.add("RasterSEPropertiesDialog");
+			point.setDescription("Raster Properties registrable panels (register instances of javax.swing.JPanel)");
+		}
+
+		//Entradas del men� del toc de raster
+		if (!extensionPoints.has("View_TocActions")) {
+			point = extensionPoints.add("View_TocActions");
+		}
+		point = extensionPoints.get("View_TocActions");
+		point.append("RasterSEProperties", "Raster Properties", RasterPropertiesTocMenuEntry.getSingleton());
+		
+		//A�ade las propiedades de raster a la barra de herramientas. Si nadie registra paneles estar� vacio
+		//cuando se abra
+		
+		point = extensionPoints.add("GenericToolBarMenu");
+		point.append("RasterProperties", "", RasterPropertiesTocMenuEntry.getSingleton());
+	}
+	
+	public void execute(String actionCommand) {
+		
+	}
+
+	public boolean isEnabled() {
+		return false;
+	}
+
+	public boolean isVisible() {
+		return false;
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginExtension.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarMenuItem.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarMenuItem.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarMenuItem.java	(revision 15423)
@@ -0,0 +1,116 @@
+/* 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.mainplugin.toolbar;
+
+import java.util.Map;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.tools.extensionpoint.ExtensionBuilder;
+
+/**
+ * Clase que implementa un IGenericToolBarMenuItem para evitar tener que crear
+ * clases para items de menu sencillas
+ *
+ * @version 06/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class GenericToolBarMenuItem implements IGenericToolBarMenuItem, ExtensionBuilder {
+	private String text  = "";
+	private int    order = 0;
+	private int    groupOrder = 0;
+	private Icon   icon  = null;
+	private String group = "";
+
+	public GenericToolBarMenuItem(String text, Icon icon) {
+		this(text, icon, "", 0);
+	}
+
+	public GenericToolBarMenuItem(String text) {
+		this(text, IconThemeHelper.getImageIcon("blank-icon"), "", 0);
+	}
+
+	public GenericToolBarMenuItem(String text, Icon icon, String group, int order) {
+		this.text = text;
+		this.order = order;
+		this.icon = icon;
+		this.group = group;
+	}
+
+	public GenericToolBarMenuItem(String text, Icon icon, String group) {
+		this(text, icon, group, 0);
+	}
+
+	public GenericToolBarMenuItem(String text, Icon icon, int order) {
+		this(text, icon, "", 0);
+	}
+
+	public String getGroup() {
+		return group;
+	}
+
+	public int getOrder() {
+		return order;
+	}
+
+	public String getText() {
+		return text;
+	}
+
+	public Icon getIcon() {
+		return icon;
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	public int getGroupOrder() {
+		return groupOrder;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {}
+
+	public Object create() {
+		return this;
+	}
+
+	public Object create(Object[] args) {
+		return this;
+	}
+
+	@SuppressWarnings("rawtypes")
+	public Object create(Map args) {
+		return this;
+	}
+
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarMenuItem.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/BinarySearch.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/BinarySearch.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/BinarySearch.java	(revision 15423)
@@ -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.
+* 
+*/
+package org.gvsig.raster.mainplugin.toolbar;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Vector;
+
+import org.gvsig.gui.beans.comboboxconfigurablelookup.ILookUp;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.JComboBoxConfigurableLookUp;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.StringComparator;
+/**
+ * Clase para reimplementar una nueva busqueda para el componente
+ * {@link JComboBoxConfigurableLookUp}
+ * 
+ * @version 13/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class BinarySearch implements ILookUp {
+	public List<Object> doLookUpConsideringCaseSensitive(String text, Vector<Object> sortOrderedItems, StringComparator comp) {
+		Vector<Object> list = new Vector<Object>();
+		for (int i = 0; i < sortOrderedItems.size(); i++)
+			if (sortOrderedItems.get(i).toString().indexOf(text) != -1)
+				list.add(sortOrderedItems.get(i));
+		return Arrays.asList(list.toArray());
+	}
+
+	public List<Object> doLookUpIgnoringCaseSensitive(String text, Vector<Object> sortOrderedItems, StringComparator comp) {
+		Vector<Object> list = new Vector<Object>();
+		for (int i = 0; i < sortOrderedItems.size(); i++)
+			if (sortOrderedItems.get(i).toString().toLowerCase().indexOf(text.toLowerCase()) != -1)
+				list.add(sortOrderedItems.get(i));
+		return Arrays.asList(list.toArray());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/BinarySearch.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/IGenericToolBarMenuItem.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/IGenericToolBarMenuItem.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/IGenericToolBarMenuItem.java	(revision 15423)
@@ -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.mainplugin.toolbar;
+
+import javax.swing.Icon;
+
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+
+/**
+ * Interfaz que debe implementar quien quiera aparecer en la barra de
+ * herramientas gen�rica.
+ * 
+ * @version 06/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface IGenericToolBarMenuItem {
+	/**
+	 * Devuelve el nombre del grupo al que pertenece el item de menu
+	 * @return
+	 */
+	public String getGroup();
+	
+	/**
+	 * Devuelve el orden en el que aparecer� en el men�
+	 * @return
+	 */
+	public int getOrder();
+
+	/**
+	 * Devuelve el orden en el que aparecer� en el men�
+	 * @return
+	 */
+	public int getGroupOrder();
+	
+	/**
+	 * Devuelve el texto que se ver� en el men�
+	 * @return
+	 */
+	public String getText();
+	
+	/**
+	 * Devuelve el icono del item del menu
+	 * @return
+	 */
+	public Icon getIcon();
+
+	/**
+	 * Dice si es visible el item de menu para dicha entrada
+	 * @param item
+	 * @param selectedItems
+	 * @return
+	 */
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems);
+	
+	/**
+	 * Dice si el item actual esta habilitado
+	 * @param item
+	 * @param selectedItems
+	 * @return
+	 */
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems);
+	
+	/**
+	 * Metodo que sera invocado cuando el item del menu sea presionado
+	 * @param item
+	 * @param selectedItems
+	 */
+	public void execute(ITocItem item, FLayer[] selectedItems);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/IGenericToolBarMenuItem.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/ButtonItems.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/ButtonItems.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/ButtonItems.java	(revision 15423)
@@ -0,0 +1,103 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.mainplugin.toolbar;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JButton;
+
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.gui.beans.controls.combobutton.ComboButton;
+/**
+ * Clase para gestionar y ordenar los items de un ComboButton
+ *  
+ * @version 13/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ButtonItems {
+	private ComboButton comboButton = null;
+	private FLayer[] layers = null;
+	private List<IGenericToolBarMenuItem> arrayList = new ArrayList<IGenericToolBarMenuItem>();
+	private List<String> arrayKeys = new ArrayList<String>();
+
+	public ButtonItems(ComboButton comboButton, FLayer[] layers) {
+		this.comboButton = comboButton;
+		this.layers = layers;
+	}
+	
+	/**
+	 * A�ade un item al ComboButton
+	 * @param menuItem
+	 * @param key
+	 */
+	public void addButton(IGenericToolBarMenuItem menuItem, String key) {
+		int pos = 0;
+		boolean find = false;
+		for (int i = 0; i < arrayList.size(); i++) {
+			pos = i;
+			IGenericToolBarMenuItem aux = (IGenericToolBarMenuItem) arrayList.get(i);
+			if (aux.getGroupOrder() > menuItem.getGroupOrder()) {
+				find = true;
+				break;
+			}
+			if (aux.getGroupOrder() == menuItem.getGroupOrder()) {
+				if (aux.getOrder() > menuItem.getOrder()) {
+					find = true;
+					break;
+				}
+			}
+		}
+		if (!find)
+			pos = arrayList.size();
+		arrayList.add(pos, menuItem);
+		arrayKeys.add(pos, key);
+	}
+	
+	/**
+	 * Refresca los items del ComboButton
+	 */
+	public void refresh() {
+		String actionCommand = comboButton.getActionCommand();
+		comboButton.clearButtons();
+		int group = -1;
+		for (int i = 0; i < arrayList.size(); i++) {
+			IGenericToolBarMenuItem aux = (IGenericToolBarMenuItem) arrayList.get(i);
+
+			if ((group != -1) && (group != aux.getGroupOrder()))
+				comboButton.addSeparator();
+
+			JButton button2 = new JButton(aux.getText(), aux.getIcon());
+
+			if (!aux.isVisible(null, layers))
+				button2.setEnabled(false);
+
+			if (!aux.isEnabled(null, layers))
+				button2.setEnabled(false);
+			
+			button2.setActionCommand((String) arrayKeys.get(i));
+			comboButton.addButton(button2);
+			group = aux.getGroupOrder();
+		}
+		comboButton.setSelectedItem(actionCommand);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/ButtonItems.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarPanel.java	(revision 15423)
@@ -0,0 +1,333 @@
+/* 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.mainplugin.toolbar;
+
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JToolBar;
+
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.DefaultComboBoxConfigurableLookUpModel;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.JComboBoxConfigurableLookUp;
+import org.gvsig.gui.beans.controls.IControl;
+import org.gvsig.gui.beans.controls.combobutton.ComboButton;
+import org.gvsig.gui.beans.controls.combobutton.ComboButtonEvent;
+import org.gvsig.gui.beans.controls.combobutton.ComboButtonListener;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+/**
+ * Componente que contiene los objetos visuales de la barra de herramientas
+ * generica
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class GenericToolBarPanel extends JToolBar implements ComboButtonListener, ActionListener, MouseListener, ItemListener, IControl {
+	private static final long serialVersionUID = -4382962282970490523L;
+	private JComboBoxConfigurableLookUp jCBCLU = null;
+	private ComboButton buttonGroup = new ComboButton();
+	private ComboButton buttonMenu = new ComboButton();
+	private FLayers lastLayers = null;
+
+	public GenericToolBarPanel() {
+		super("GenericToolBarPanel");
+		initialize();
+	}
+
+	/**
+	 * Especifica que las capas de la vista han cambiado.
+	 * @param layers
+	 */
+	public void setLayers(FLayers layers) {
+		lastLayers = layers;
+
+		getComboBoxConfigurableLookUp().setBlockPopupHided(true);
+		getComboBoxConfigurableLookUp().removeAllItems();
+
+		if(layers != null) {
+			List<FLayer> lyrs = getLayerList(layers, null);
+			for (int i = 0; i < lyrs.size(); i++)
+				getComboBoxConfigurableLookUp().addItem(((FLayer)lyrs.get(i)).getName());
+
+			if (layers.getActives().length > 0)
+				getComboBoxConfigurableLookUp().setSelectedItem(layers.getActives()[0].getName());
+			else if (layers.getLayersCount() > 0)
+				getComboBoxConfigurableLookUp().setSelectedItem(layers.getLayer(0).getName());
+		}
+		reloadSubMenu();
+		getComboBoxConfigurableLookUp().setBlockPopupHided(false);
+	}
+	
+	/**
+	 * Devuelve un combo de busqueda de items.
+	 * @return
+	 */
+	private JComboBoxConfigurableLookUp getComboBoxConfigurableLookUp() {
+		if (jCBCLU == null) {
+			jCBCLU = new JComboBoxConfigurableLookUp();
+			jCBCLU.setOnlyOneColorOnText(true);
+			jCBCLU.setPrototypeDisplayValue(" ");
+			if (jCBCLU.getModel() instanceof DefaultComboBoxConfigurableLookUpModel) {
+				((DefaultComboBoxConfigurableLookUpModel) jCBCLU.getModel()).setShowAllItemsInListBox(false);
+				((DefaultComboBoxConfigurableLookUpModel) jCBCLU.getModel()).setLookUpAgent(new BinarySearch());
+				((DefaultComboBoxConfigurableLookUpModel) jCBCLU.getModel()).setCaseSensitive(false);
+				jCBCLU.setToForceSelectAnItem(true);
+				jCBCLU.setDisplayAllItemsWithArrowButton(true);
+			}
+			jCBCLU.addActionListener(this);
+		}
+		return jCBCLU;
+	}
+
+	private void initialize() {
+		buttonGroup.addComboButtonClickedListener(this);
+		buttonGroup.setName("Menu principal");
+		buttonGroup.setMargin(new Insets(0, 0, 0, 0));
+		buttonGroup.setAlwaysMenuOnClick(true);
+		reloadMenuGroup();
+		add(buttonGroup);
+
+		buttonMenu.addComboButtonClickedListener(this);
+		buttonMenu.setName("Submenus");
+		buttonMenu.addMouseListener(this);
+		buttonMenu.setMargin(new Insets(0, 0, 0, 0));
+		reloadMenuGroup();
+		add(buttonMenu);
+
+		add(getComboBoxConfigurableLookUp());
+		this.setRollover(true);
+	}
+
+	/**
+	 * Recarga los items del menu global dejando seleccionado el item que habia
+	 * previamente, en caso de que exista
+	 */
+	public void reloadMenuGroup() {
+		FLayer[] layers = new FLayer[] { getLayerSelected() };
+		ButtonItems buttonItems = new ButtonItems(buttonGroup, layers);
+
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("GenericToolBarGroup");
+		Iterator<?> iterator = point.iterator();
+		while (iterator.hasNext()) {
+			ExtensionPoint.Extension extension = (ExtensionPoint.Extension) iterator.next();
+			Object object;
+			try {
+				object = extension.create();
+			} catch (Exception e) {
+				throw new RuntimeException(e);
+			}
+			if (object instanceof IGenericToolBarMenuItem)
+				buttonItems.addButton((IGenericToolBarMenuItem) object, extension.getName());
+		}
+		buttonItems.refresh();
+		reloadSubMenu();
+	}
+
+	/**
+	 * Recarga los items del submenu dejando seleccionado el item que habia
+	 * previamente, en caso de que exista
+	 */
+	public void reloadSubMenu() {
+		FLayer[] layers = new FLayer[] { getLayerSelected() };
+		ButtonItems buttonItems = new ButtonItems(buttonMenu, layers);
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add("GenericToolBarMenu");
+		Iterator<?> iterator = point.iterator();
+		while (iterator.hasNext()) {
+			ExtensionPoint.Extension entry = (ExtensionPoint.Extension) iterator.next();
+			Object object;
+			try {
+				object = entry.create();
+			} catch (Exception e) {
+				throw new RuntimeException(e);
+			}
+			if (object instanceof IGenericToolBarMenuItem) {
+				IGenericToolBarMenuItem item = (IGenericToolBarMenuItem) object;
+				if (!buttonGroup.getActionCommand().equals(item.getGroup()))
+					continue;
+				buttonItems.addButton(item, entry.getName());
+			}
+		}
+		buttonItems.refresh();
+	}
+
+	/**
+	 * Devuelve el layer seleccionado en el combobox
+	 * @return
+	 */
+	public FLayer getLayerSelected() {
+		if (lastLayers == null)
+			return null;
+		List<FLayer> lyrs = getLayerList(lastLayers, null);
+		for (int i = 0; i < lyrs.size(); i++)
+			if (((FLayer)lyrs.get(i)).getName().equals(getComboBoxConfigurableLookUp().getEditor().getItem()))
+				return (FLayer)lyrs.get(i);
+		return null;
+	}
+	
+	public static List<FLayer> getLayerList(FLayers srcLyrs, List<FLayer> destLyrs) {
+		if(srcLyrs == null)
+			return null;
+		if(destLyrs == null)
+			destLyrs = new ArrayList<FLayer>();
+		for (int i = 0; i < srcLyrs.getLayersCount(); i++) {
+			if(srcLyrs.getLayer(i) instanceof FLayers)
+				destLyrs = getLayerList((FLayers)srcLyrs.getLayer(i), destLyrs);
+			else 
+				destLyrs.add(srcLyrs.getLayer(i));
+		}
+		return destLyrs;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getComboBoxConfigurableLookUp()) {
+//			selectLayerInTOC(lastLayers, (String) getComboBoxConfigurableLookUp().getSelectedItem());
+		}
+	}
+
+	public void actionComboButtonClicked(ComboButtonEvent e) {
+		if (e.getSource() == buttonGroup) {
+			reloadSubMenu();
+			return;
+		}
+		if (e.getSource() == buttonMenu) {
+			ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager();
+			ExtensionPoint point=extensionPoints.add("GenericToolBarMenu");
+			Iterator<?> iterator = point.iterator();
+			while (iterator.hasNext()) {
+				ExtensionPoint.Extension entry = (ExtensionPoint.Extension) iterator
+						.next();
+				if (!entry.getName().equals(
+						((JButton) e.getSource()).getActionCommand()))
+					continue;
+				Object object;
+				try {
+					object = entry.create();
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					throw new RuntimeException(e1);
+				}
+				if (object instanceof IGenericToolBarMenuItem) {
+					IGenericToolBarMenuItem item = (IGenericToolBarMenuItem) object;
+
+					FLayer[] layers = new FLayer[] { getLayerSelected() };
+					if (!item.isVisible(null, layers))
+						continue;
+					if (!item.isEnabled(null, layers))
+						continue;
+
+					if (getLayerSelected() != null) {
+						item.execute(null, new FLayer[] { getLayerSelected() });
+					} else
+						item.execute(null, null);
+					reloadSubMenu();
+					return;
+				}
+			}
+			return;
+		}
+	}
+
+	/**
+	 * Selecciona una capa en el TOC
+	 * @param layers
+	 * @param nameLayer
+	 */
+//	private void selectLayerInTOC(FLayers layers, String nameLayer) {
+//		if (layers == null)
+//			return;
+//		for (int i = 0; i < layers.getLayersCount(); i++) {
+//			if (layers.getLayer(i) instanceof FLayers) {
+//				selectLayerInTOC((FLayers) layers.getLayer(i), nameLayer);
+//			} else {
+//				if (layers.getLayer(i) instanceof FLayer) {
+//					FLayer layer = ((FLayer) layers.getLayer(i));
+//					if (layer.getName().equals(nameLayer) && !layer.isActive()) {
+//						layer.setActive(true);
+//					}
+//				}
+//			}
+//		}
+//	}
+
+	/**
+	 * Recargo el menu cada vez que entra el raton en el boton, para ahorrar tiempo en
+	 * la visualizacion del mismo
+	 */
+	public void mouseEntered(MouseEvent e) {
+		this.reloadSubMenu();
+	}
+
+	public void itemStateChanged(ItemEvent e) {
+//		if (e.getStateChange() != ItemEvent.SELECTED)
+//			return;
+//
+//		FLayer layer = getLayerSelected();
+//
+//		if (layer == null)
+//			return;
+//
+//		FLayers layers = lastLayers;
+//		for(int i = 0; i < layers.getLayersCount(); i++)
+//			layers.getLayer(i).setActive(false);
+//
+//		layer.setActive(true);
+//		View view = (View) PluginServices.getMDIManager().getActiveWindow();
+//		JScrollBar verticalBar = view.getTOC().getJScrollPane().getVerticalScrollBar();
+//		double widthPerEntry = verticalBar.getMaximum() / layer.getMapContext().getLayers().getLayersCount();
+//		verticalBar.setValue((int)widthPerEntry * (layer.getMapContext().getLayers().getLayersCount() - pos - 1));
+	}
+
+	public void mouseClicked(MouseEvent e) {}
+	public void mouseExited(MouseEvent e) {}
+	public void mousePressed(MouseEvent e) {}
+	public void mouseReleased(MouseEvent e) {}
+
+	public void addActionListener(ActionListener listener) {
+		
+	}
+
+	public Object getValue() {
+		return null;
+	}
+
+	public void removeActionListener(ActionListener listener) {
+		
+	}
+
+	public Object setValue(Object value) {
+		return null;
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginUtils.java	(revision 15423)
@@ -0,0 +1,412 @@
+/* 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.mainplugin;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.Project;
+import org.gvsig.app.project.ProjectManager;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Param;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+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.MapContextLocator;
+import org.gvsig.fmap.mapcontext.MapContextManager;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponent;
+import org.gvsig.gui.beans.propertiespanel.PropertyStruct;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.util.RasterNotLoadException;
+
+/**
+ * Herramientas de uso general y que son dependientes de gvSIG, FMap o de
+ * libUIComponents. En caso de no serlo existe una clase independiente de
+ * cualquier proyecto dentro de libRaster para este tipo de funciones.
+ *
+ * @version 31/05/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterMainPluginUtils {
+
+	/**
+	 * Obtiene la lista de capas del TOC y devuelve las raster. Si hay capas agrupadas lo tiene en cuenta y mira
+	 * dentro de la agrupaci�n.
+	 * @param srcLyrs FLayers de la vista
+	 * @param destLyrs Lista de capas 
+	 * @return ArrayList con la lista de capas raster agrupadas o no. El orden en que aparecen
+	 * en la lista es de abajo a arriba las que aparecen en el TOC.
+	 */
+	public static ArrayList<FLayer> getRasterLayerList(FLayers srcLyrs, ArrayList<FLayer> destLyrs) {
+		if(destLyrs == null)
+			destLyrs = new ArrayList<FLayer>();
+		for (int i = 0; i < srcLyrs.getLayersCount(); i++) {
+			if(srcLyrs.getLayer(i) instanceof DefaultFLyrRaster)
+				destLyrs.add(srcLyrs.getLayer(i));
+			if(srcLyrs.getLayer(i) instanceof FLayers)
+				destLyrs = getLayerList((FLayers)srcLyrs.getLayer(i), destLyrs);
+		}
+		return destLyrs;
+	}
+	
+	/**
+	 * Obtiene la lista de capas del TOC y devuelve las raster. Si hay capas agrupadas lo tiene en cuenta y mira
+	 * dentro de la agrupaci�n.
+	 * @param srcLyrs FLayers de la vista
+	 * @param destLyrs Lista de capas 
+	 * @return ArrayList con la lista de capas raster agrupadas o no. El orden en que aparecen
+	 * en la lista es de abajo a arriba las que aparecen en el TOC.
+	 */
+	public static ArrayList<FLayer> getLayerList(FLayers srcLyrs, ArrayList<FLayer> destLyrs) {
+		if(srcLyrs == null)
+			return null;
+		if(destLyrs == null)
+			destLyrs = new ArrayList<FLayer>();
+		for (int i = 0; i < srcLyrs.getLayersCount(); i++) {
+			if(srcLyrs.getLayer(i) instanceof FLayers)
+				destLyrs = getLayerList((FLayers)srcLyrs.getLayer(i), destLyrs);
+			else 
+				destLyrs.add(srcLyrs.getLayer(i));
+		}
+		return destLyrs;
+	}
+	
+	/**
+	 * Obtiene el nombre de la vista donde est� cargada la capa que se pasa por par�metro
+	 * @param layer Capa cargada en una vista
+	 * @return Nombre de la vista donde est� cargada la capa.
+	 */
+	public static String getView(FLayer layer) {
+//		Project p = ((ProjectExtension) PluginServices.getExtension(ProjectExtension.class)).getProject();
+		Project p = ProjectManager.getInstance().getCurrentProject();
+		return p.getViewName(layer);	
+	}
+	
+	/**
+	 * A�ade una ventana al gestor de ventanas
+	 * @param window
+	 */
+	public static void addWindow(IWindow window) {
+		PluginServices.getMDIManager().addWindow(window);
+	}
+	
+	/**
+	 * Elimina una ventana al gestor de ventanas
+	 * @param window
+	 */
+	public static void closeWindow(IWindow window) {
+		PluginServices.getMDIManager().closeWindow(window);
+	}
+	
+	/**
+	 * Selecciona los controles del panel de propiedades a partir de los par�mtros
+	 * obtenidos del driver. Este m�todo realiza una transformaci�n entre Params
+	 * obtenido del driver de escritura y los par�metros del panel de propiedades.
+	 * @param panel Panel de propiedades
+	 * @param params Par�metros del driver
+	 * @param notTakeIntoAccount Nombre de par�metros que no hay que tener en cuenta. Si es null se tienen en cuenta todos.
+	 */
+	public static void loadPropertiesFromWriterParams(PropertiesComponent pComp, Params params, String[] notTakeIntoAccount) {
+		for (int i = 0; i < params.getNumParams(); i++) {
+			Param p = params.getParam(i);
+			String name = Messages.getText(p.getId());
+			String key = p.getId();
+
+			//Miramos si el par�metro coincide con  alguno en la lista de parametros que no hay que
+			//tener en cuenta. Si es as� no lo a�adimos
+			if(notTakeIntoAccount != null && notTakeIntoAccount.length > 0) {
+				boolean jump = false;
+				for (int j = 0; j < notTakeIntoAccount.length; j++) {
+					if (key.equals(notTakeIntoAccount[j]))
+						jump = true;
+				}
+				if(jump)
+					continue;
+			}
+
+			Object[] types = null;
+			int selectedValue = 0;
+
+			switch (p.getType()) {
+				case Params.CHECK:
+					pComp.addValue(name, key, p.getDefaultValue(), types);
+					break;
+				case Params.CHOICE:
+					ArrayList<String> list = new ArrayList<String>();
+					for (int j = 0; j < p.getList().length; j++) {
+						list.add(p.getList()[j]);
+						if (p.getDefaultValue() instanceof Integer)
+							if (((Integer) p.getDefaultValue()).intValue() == j)
+								selectedValue = j;
+					}
+					types = new Object[] { new Integer(PropertiesComponent.TYPE_COMBO), list };
+					pComp.addValue(name, key, new Integer(selectedValue), types);
+					break;
+				case Params.SLIDER:
+					types = new Object[] { new Integer(PropertiesComponent.TYPE_SLIDER), new Integer(p.getList()[0]), new Integer(p.getList()[1]) };
+					pComp.addValue(name, key, p.getDefaultValue(), types);
+					break;
+				default:
+					pComp.addValue(Messages.getText(((Param)params.getParam(i)).getId()), params.getParam(i).getId(), params.getParam(i).getDefaultValue(), null);
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Carga los par�metros del escritor WriterParams con los valores obtenidos
+	 * de la ventana de propiedades.
+	 */
+	@SuppressWarnings("unchecked")
+	public static void loadWriterParamsFromPropertiesPanel(PropertiesComponent pComp, Params params) {
+		ArrayList<PropertyStruct> values = pComp.getValues();
+		for (int iParam = 0; iParam < params.getNumParams(); iParam++) {
+			Param p = params.getParam(iParam);
+			for (int iValue = 0; iValue < values.size(); iValue++) {
+				PropertyStruct prop = values.get(iValue);
+				if (p.getId().compareTo(prop.getKey()) == 0) {
+					switch (p.getType()) {
+						case Params.CHECK:
+							p.setDefaultValue((Boolean) prop.getNewValue());
+							break;
+						case Params.CHOICE:
+							p.setDefaultValue(((Integer) prop.getNewValue()));//p.list[((Integer) prop.getNewValue()).intValue()];
+							break;
+						case Params.SLIDER:
+							try {
+								p.setDefaultValue((Integer)prop.getNewValue());
+							} catch (NumberFormatException e) {}
+					}
+					break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Funci�n que devuelve true si se tiene permiso de escritura en la ruta
+	 * indicada en el par�metro path y false si no los tiene.
+	 * @param path Ruta a comprobar los permisosv
+	 * @param pluginObject si es distinto de null se obtiene un mensaje de
+	 *          advertencia y sirve como par�metro para getText de la traducci�n.
+	 *          Si es null no se mostrar� ventana de advertencia
+	 * @return true si se tiene permiso de escritura en la ruta indicada en el
+	 *         par�metro path y false si no los tiene.
+	 */
+	public static boolean canWrite(String path, Object pluginObject) {
+		File f = new File(path);
+		if(f.exists() && f.canWrite())
+			return true;
+		else {
+			if(pluginObject != null)
+				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),
+						PluginServices.getText(pluginObject, "error_escritura"));
+			return false;
+		}
+	}
+
+	/**
+	 * Carga una capa raster en una vista de gvSIG.
+	 * @param viewName Nombre de la vista donde ha de cargarse. Si vale null se cargar� en la
+	 * primera vista que encuentre que est� activa. Si no hay ninguna saltar� una excepci�n.
+	 * @param fileName Nombre del fichero a cargar. No debe ser nulo nunca.
+	 * @param layerName Nombre de la capa. Si es null se asignar� el nombre del
+	 * fichero sin extensi�n.
+	 * @throws RasterNotLoadException Excepci�n que se lanza cuando no se ha podido cargar la capa
+	 * por alg�n motivo.
+	 */
+	@SuppressWarnings("deprecation")
+	public static FLayer loadLayer(String viewName, String fileName, String layerName) throws RasterNotLoadException {
+		if(fileName ==  null)
+			return null;
+
+		//Seleccionamos la vista de gvSIG
+		AbstractViewPanel theView = null;
+		try {
+			IWindow[] allViews = PluginServices.getMDIManager().getAllWindows();
+			if(viewName != null) {
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel
+						&& (((AbstractViewPanel) allViews[i]).getDocument().getName().equals(viewName) ||
+							PluginServices.getMDIManager().getWindowInfo((AbstractViewPanel) allViews[i]).getTitle().equals(viewName)))
+						theView = (AbstractViewPanel) allViews[i];
+				}
+			} else {
+				IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel && ((AbstractViewPanel)allViews[i]) == activeWindow) //En la primera vista activa
+						theView = (AbstractViewPanel) allViews[i];
+				}
+				if(theView == null) {
+					for (int i = 0; i < allViews.length; i++) {
+						if (allViews[i] instanceof AbstractViewPanel) //En la primera vista
+							theView = (AbstractViewPanel) allViews[i];
+					}
+				}
+			}
+
+			if (theView == null)
+				throw new RasterNotLoadException("Imposible cargar la capa.");
+		} catch (ClassCastException ex) {
+			throw new RasterNotLoadException("No se puede hacer un casting de esa IWindow a View.");
+		}
+
+		theView.getMapControl().getMapContext().beginAtomicEvent();
+
+		DefaultFLyrRaster lyr = null;
+		try {
+			ProviderServices provServ = RasterLocator.getManager().getProviderServices();
+			RasterDataParameters storeParameters = provServ.createNotTiledParameters(fileName);
+			storeParameters.setSRS(theView.getProjection());
+			
+			MapContextManager mcm = MapContextLocator.getMapContextManager();
+			DataManager dataManager = DALLocator.getDataManager();
+			DataStore dataStore = null;
+			try {
+				dataStore = dataManager.createStore(storeParameters);
+			} catch (ValidateDataParametersException e) {
+				throw new RasterNotLoadException("Error al cargar la capa.");
+			} catch (InitializeException e) {
+				throw new RasterNotLoadException("Error al cargar la capa.");
+			} catch (ProviderNotRegisteredException e) {
+				throw new RasterNotLoadException("Error al cargar la capa.");
+			}
+			
+			lyr = new DefaultFLyrRaster();
+			
+			if(layerName == null) {
+				int endIndex = fileName.lastIndexOf(".");
+				if (endIndex < 0)
+					endIndex = fileName.length();
+				
+				layerName = fileName.substring(fileName.lastIndexOf(File.separator) + 1, endIndex);
+			}
+			
+			lyr = (DefaultFLyrRaster) mcm.createLayer(layerName, dataStore);
+
+		} catch (LoadLayerException e) {
+			throw new RasterNotLoadException("Error al cargar la capa.");
+		} catch (InitializeException e) {
+			throw new RasterNotLoadException("Error creating parameters.");
+		} catch (ProviderNotRegisteredException e) {
+			throw new RasterNotLoadException("Error creating parameters.");
+		}
+		theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
+		theView.getMapControl().getMapContext().invalidate();
+		theView.getMapControl().getMapContext().endAtomicEvent();
+		return lyr;
+	}
+	
+	/**
+	 * Carga una capa raster en una vista de gvSIG.
+	 * @param viewName Nombre de la vista donde ha de cargarse. Si vale null se cargar� en la
+	 * primera vista que encuentre que est� activa. Si no hay ninguna saltar� una excepci�n.
+	 * @param fileName Nombre del fichero a cargar. No debe ser nulo nunca.
+	 * @param layerName Nombre de la capa. Si es null se asignar� el nombre del
+	 * fichero sin extensi�n.
+	 * @throws RasterNotLoadException Excepci�n que se lanza cuando no se ha podido cargar la capa
+	 * por alg�n motivo.
+	 */
+	public static FLayer loadLayer(String viewName, FLayer lyr) throws RasterNotLoadException {
+		if(lyr ==  null)
+			return null;
+
+		//Seleccionamos la vista de gvSIG
+		AbstractViewPanel theView = null;
+		try {
+			IWindow[] allViews = PluginServices.getMDIManager().getAllWindows();
+			if(viewName != null) {
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel
+						&& PluginServices.getMDIManager().getWindowInfo((AbstractViewPanel) allViews[i]).getTitle().equals(viewName))
+						theView = (AbstractViewPanel) allViews[i];
+				}
+			} else {
+				IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel && ((AbstractViewPanel)allViews[i]) == activeWindow) //En la primera vista activa
+						theView = (AbstractViewPanel) allViews[i];
+				}
+				if(theView == null) {
+					for (int i = 0; i < allViews.length; i++) {
+						if (allViews[i] instanceof AbstractViewPanel) //En la primera vista
+							theView = (AbstractViewPanel) allViews[i];
+					}
+				}
+			}
+
+			if (theView == null)
+				throw new RasterNotLoadException("Imposible cargar la capa.");
+		} catch (ClassCastException ex) {
+			throw new RasterNotLoadException("No se puede hacer un casting de esa IWindow a View.");
+		}
+
+		theView.getMapControl().getMapContext().beginAtomicEvent();
+		theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
+		theView.getMapControl().getMapContext().invalidate();
+		theView.getMapControl().getMapContext().endAtomicEvent();
+		return lyr;
+	}
+	
+	/**
+	 * Calculo de las coordenadas de una ventana IWindow para que quede centrada sobre el 
+	 * MainFrame. Estas coordenadas solo valen para un IWindow ya que andami mete las ventanas
+	 * con coordenadas relativas a su ventanta principal.
+	 * @param widthWindow Ancho de la ventana a a�adir
+	 * @param heightWindow Alto de la ventana a a�adir
+	 * @return Array con el ancho y el alto 
+	 */
+	public static Point iwindowPosition(int widthWindow, int heightWindow) {
+		int posWindowX = 0;
+		int posWindowY = 0;
+		Dimension dim = null;
+		Point pos = null;
+		if(PluginServices.getMainFrame() instanceof Component) {
+			dim = ((Component)PluginServices.getMainFrame()).getSize();
+			pos = ((Component)PluginServices.getMainFrame()).getLocation();
+			if(dim != null && pos != null) {
+				posWindowX = ((dim.width >> 1) - (widthWindow >> 1));
+				posWindowY = ((dim.height >> 1) - (heightWindow >> 1) - 70);
+				return new Point(posWindowX, posWindowY);
+			}
+		}
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationListener.java	(revision 15423)
@@ -0,0 +1,32 @@
+/* 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.mainplugin.config;
+
+import java.util.EventListener;
+
+public interface ConfigurationListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando cambia un valor de configuracion.
+	 * @param e
+	 */
+	public void actionConfigurationChanged(ConfigurationEvent e);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/Configuration.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/Configuration.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/Configuration.java	(revision 15423)
@@ -0,0 +1,343 @@
+/* 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.mainplugin.config;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.fmap.layers.IConfiguration;
+import org.gvsig.utils.XMLEntity;
+
+/**
+ * La clase <code>Configuration</code> sirve para poder leer y escribir valores en el entorno
+ * de raster a nivel de configuraci�n. Para leer o escribir hay que usar los
+ * metodos getValue y setValue, estos metodos lanzan eventos en el caso de
+ * cambiar el valor que habia establecido. Forma de uso:<p>
+ *
+ * En la lectura es recomendable pasar un valor por defecto en el get, para que
+ * si no existe o si existe pero no corresponde el tipo de datos devolvera el
+ * valor por defecto<p>
+ *
+ * <code>Boolean valor = Configuration.getValue("valorBooleano", Boolean.valueOf(true));</code><p>
+ *
+ * <code>Configuration.setValue("valorBooleano", Boolean.valueOf(false));</code><p>
+ *
+ * Solo se pueden usar los siguientes tipos de datos:<br>
+ *  - <b>Boolean</b>, <b>Double</b>, <b>Float</b>, <b>Integer</b>, <b>Long</b>
+ *  y <b>String</b>.<p>
+ *
+ * Otra funcionalidad que tiene, es que puedes agregar un manejador de eventos
+ * para controlar los cambios de las variables y actuar en consecuencia si cambia
+ * la que deseas.
+ *
+ * @version 07/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class Configuration implements IConfiguration {
+	static private Configuration singleton              = new Configuration();
+	private ArrayList<ConfigurationListener>            
+	                             actionCommandListeners = new ArrayList<ConfigurationListener>();
+	private XMLEntity            xml                    = null;
+	private HashMap<String, Object>
+	                             hashMap                = new HashMap<String, Object>();
+
+	/**
+	 * Constructor privado. Nos aseguramos de que nadie pueda crear una instancia
+	 * desde fuera, la configuraci�n es �nica para todos.
+	 */
+	private Configuration() {
+		try {
+			PluginServices ps = PluginServices.getPluginServices("org.gvsig.raster.mainplugin");
+			xml = ps.getPersistentXML();
+		} catch (NullPointerException e) {
+			//No est� inicializado Configuration
+			xml = new XMLEntity();
+		}
+	}
+
+	/**
+	 * Devuelve un valor Boolean para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Boolean getValue(String key, Boolean defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Boolean.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		try {
+			getXMLEntity().putProperty(key, defaultValue.booleanValue());
+		} catch(NullPointerException e) {
+			//No est� inicializada la configuraci�n. Devuelve el default
+		}
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Double para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Double getValue(String key, Double defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Double.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.doubleValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Float para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Float getValue(String key, Float defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Float.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.floatValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Integer para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Integer getValue(String key, Integer defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Integer.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.intValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Long para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Long getValue(String key, Long defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Long.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.longValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor String para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public String getValue(String key, String defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return getXMLEntity().getStringProperty(key);
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue);
+		return defaultValue;
+	}
+
+	/**
+	 * Guarda el valor por defecto en caso de que no exista
+	 * @param key
+	 * @param defaultValue
+	 */
+	private void saveDefaultValue(String key, Object defaultValue) {
+		if (hashMap.get(key) == null)
+			hashMap.put(key, defaultValue);
+	}
+
+	/**
+	 * Devuelve el valor por defecto de un key
+	 * @param key
+	 * @return
+	 */
+	static public Object getDefaultValue(String key) {
+		return singleton.hashMap.get(key);
+	}
+
+	/**
+	 * Guarda en la configuracion el Objeto pasado por parametro asociado a dicho
+	 * key
+	 * @param key
+	 * @param value
+	 */
+	private void putProperty(String key, Object value) {
+		if (Integer.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Integer) value).intValue());
+			return;
+		}
+		if (Double.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Double) value).doubleValue());
+			return;
+		}
+		if (Float.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Float) value).floatValue());
+			return;
+		}
+		if (Boolean.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Boolean) value).booleanValue());
+			return;
+		}
+		if (Long.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Long) value).longValue());
+			return;
+		}
+		if (String.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, (String) value);
+			return;
+		}
+		getXMLEntity().putProperty(key, value);
+	}
+
+	/**
+	 * Establece un valor en la configuracion
+	 * @param uri
+	 * @param value
+	 */
+	static public void setValue(String key, Object value) {
+		if (value == null) {
+			getXMLEntity().remove(key);
+			singleton.callConfigurationChanged(key, value);
+			return;
+		}
+
+		String oldValue = getValue(key, value.toString());
+
+		singleton.putProperty(key, value);
+
+		if (!oldValue.equals(value.toString()))
+			singleton.callConfigurationChanged(key, value);
+	}
+
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	static public void addValueChangedListener(ConfigurationListener listener) {
+		if (!singleton.actionCommandListeners.contains(listener))
+			singleton.actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	static public void removeValueChangedListener(ConfigurationListener listener) {
+		singleton.actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Invocar a los eventos asociados al componente
+	 */
+	private void callConfigurationChanged(String key, Object value) {
+		Iterator<ConfigurationListener> iterator = actionCommandListeners.iterator();
+		while (iterator.hasNext()) {
+			ConfigurationListener listener = iterator.next();
+			listener.actionConfigurationChanged(new ConfigurationEvent(this, key, value));
+		}
+	}
+
+	/**
+	 * Devuelve una instancia unica al XMLEntity de Configuration
+	 * @return
+	 */
+	static private XMLEntity getXMLEntity() {
+		return singleton.xml;
+	}
+	
+	/**
+	 * Devuelve una instancia al unico objeto de configuraci�n que puede existir.
+	 * @return
+	 */
+	static public Configuration getSingleton() {
+		return singleton;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueBoolean(java.lang.String, java.lang.Boolean)
+	 */
+	public Boolean getValueBoolean(String name, Boolean defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueString(java.lang.String, java.lang.String)
+	 */
+	public String getValueString(String name, String defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueDouble(java.lang.String, java.lang.Double)
+	 */
+	public Double getValueDouble(String name, Double defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueFloat(java.lang.String, java.lang.Float)
+	 */
+	public Float getValueFloat(String name, Float defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueInteger(java.lang.String, java.lang.Integer)
+	 */
+	public Integer getValueInteger(String name, Integer defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueLong(java.lang.String, java.lang.Long)
+	 */
+	public Long getValueLong(String name, Long defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/Configuration.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationEvent.java	(revision 15423)
@@ -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.mainplugin.config;
+
+import java.util.EventObject;
+/**
+ * Estado del evento de configuraci�n para las preferencias de Raster.
+ * 
+ * @version 26/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ConfigurationEvent extends EventObject {
+	private static final long serialVersionUID = 7016236098872059L;
+	private String key;
+	private Object value;
+
+	/**
+	 * Constructor de un ConfigurationEvent
+	 * @param source
+	 * @param key
+	 * @param value
+	 */
+	public ConfigurationEvent(Object source, String key, Object value) {
+		super(source);
+		this.key = key;
+		this.value = value;
+	}
+
+	/**
+	 * @return the key
+	 */
+	public String getKey() {
+		return key;
+	}
+
+	/**
+	 * @return the value
+	 */
+	public Object getValue() {
+		return value;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationEvent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.mainplugin
___________________________________________________________________
Added: svn:ignore
   + target

.settings

.classpath

.project


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/resources/README.txt
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/resources/README.txt	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/resources/README.txt	(revision 15423)
@@ -0,0 +1,8 @@
+Put into this folder the resources needed by your classes.
+
+This folder is added to the 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 classes.
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/resources/README.txt
___________________________________________________________________
Added: svn:mime-type
   + text/plain

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/java/org/gvsig/raster/main/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/java/org/gvsig/raster/main/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/java/org/gvsig/raster/main/package.html	(revision 15423)
@@ -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 package documentation</title>
+</head>
+<body>
+
+	<p>Raster library testing and demo application.</p>
+
+</body>
+</html>
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/java/org/gvsig/raster/main/Main.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/java/org/gvsig/raster/main/Main.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/java/org/gvsig/raster/main/Main.java	(revision 15423)
@@ -0,0 +1,103 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.main;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+
+import javax.swing.AbstractAction;
+import javax.swing.Action;
+import javax.swing.JButton;
+import javax.swing.JFrame;
+import javax.swing.JMenu;
+import javax.swing.JMenuBar;
+import javax.swing.JMenuItem;
+import javax.swing.JToolBar;
+import javax.swing.WindowConstants;
+
+import org.gvsig.tools.library.impl.DefaultLibrariesInitializer;
+
+/**
+ * Main executable class for testing the Raster library.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class Main {
+
+    //private static final Logger LOG = LoggerFactory.getLogger(Main.class);
+
+    //private RasterManager manager;
+ 
+
+    public static void main(String args[]) {
+        new DefaultLibrariesInitializer().fullInitialize();
+        Main main = new Main();
+        main.show();
+    }
+
+    @SuppressWarnings("serial")
+    public void show() {
+        //manager = RasterLocator.getManager();
+
+        Action showCookie = new AbstractAction("Get a Raster") {
+
+            public void actionPerformed(ActionEvent e) {
+               
+            }
+        };
+
+        Action exit = new AbstractAction("Exit") {
+
+            public void actionPerformed(ActionEvent e) {
+                System.exit(0);
+            }
+        };
+
+        JFrame frame = new JFrame("Raster example app");
+        frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE);
+
+        // Create the menu bar.
+        JMenuBar menuBar = new JMenuBar();
+
+        // Build the menu.
+        JMenu menuFile = new JMenu("File");
+        menuFile.add(new JMenuItem(showCookie));
+        menuFile.add(new JMenuItem(exit));
+
+        menuBar.add(menuFile);
+
+        JToolBar toolBar = new JToolBar();
+        toolBar.add(new JButton(showCookie));
+        toolBar.add(new JButton(exit));
+
+        frame.setPreferredSize(new Dimension(200, 100));
+        frame.setJMenuBar(menuBar);
+        frame.add(toolBar, BorderLayout.PAGE_START);
+
+        // Display the window.
+        frame.pack();
+        frame.setVisible(true);
+    }
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/main/java/org/gvsig/raster/main/Main.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestSaveSerialToRmf.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestSaveSerialToRmf.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestSaveSerialToRmf.java	(revision 15423)
@@ -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.fmap.dal.series;
+
+import java.io.File;
+import java.text.ParseException;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+/**
+ * Saves serial information to rmf file
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestSaveSerialToRmf extends BaseTestCase {
+	private String            path1    = baseDir + "serie1.tif";
+	private String            path2    = baseDir + "serie2.tif";
+	private String            path3    = baseDir + "serie3.tif";
+	private RasterDataStore   f1       = null;	
+	private RasterDataStore   f2       = null;
+	private RasterDataStore   f3       = null;
+	//private RasterQuery       query    = null;
+	protected Buffer          buf1     = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestSaveSerialToRmf running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		File a = new File(baseDir + "serie1.rmf");
+		if(a.exists())
+			a.delete();
+		a = new File(baseDir + "serie2.rmf");
+		if(a.exists())
+			a.delete();
+		a = new File(baseDir + "serie3.rmf");
+		if(a.exists())
+			a.delete();
+		
+		try {
+			f1 = manager.open(path1);
+			f2 = manager.open(path2);
+			f3 = manager.open(path3);
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		TimeSeries serialInfo = null;
+		try {
+			serialInfo = f1.getTimeSerials(); //Lo da vacio pq antes hemos borrado el rmf
+			serialInfo.setName("Katrina");
+			serialInfo.setDescription("Evoluci�n del katrina");
+			serialInfo.createNewTimeInterval("25/8/2005-00:05:00", "27/8/2005-14:36:00");
+			f1.setTimeSerials(serialInfo);   //Salvamos la serie
+			
+			serialInfo.setName("Katrina2");
+			serialInfo.setDescription("Evoluci�n del katrina en otra serie");
+			serialInfo.createNewTimeInterval(152322, 152400);
+			f1.setTimeSerials(serialInfo);   //Salvamos la serie
+			
+			//------------------------------------
+			
+			serialInfo = f2.getTimeSerials();
+			serialInfo.setName("Katrina");
+			serialInfo.setDescription("Evoluci�n del katrina");
+			serialInfo.createNewTimeValue("28/8/2005-00:05:00");
+			f2.setTimeSerials(serialInfo);
+			
+			serialInfo.setName("Katrina2");
+			serialInfo.setDescription("Evoluci�n del katrina en otra serie");
+			serialInfo.createNewTimeValue(152438);
+			f2.setTimeSerials(serialInfo);   //Salvamos la serie
+			
+			//------------------------------------
+			
+			serialInfo = f3.getTimeSerials();
+			serialInfo.setName("Katrina");
+			serialInfo.setDescription("Evoluci�n del katrina");
+			serialInfo.createNewTimeValue("29/8/2005");
+			f3.setTimeSerials(serialInfo);
+			
+			serialInfo.setName("Katrina2");
+			serialInfo.setDescription("Evoluci�n del katrina en otra serie");
+			serialInfo.createNewTimeValue(152550.0);
+			f3.setTimeSerials(serialInfo);   //Salvamos la serie
+			
+		} catch (RmfSerializerException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		} catch (ParseException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+		
+		/*query = manager.createQuery();
+		query.setAllDrawableBands();
+		try {
+			query.setAreaOfInterest(f1.getExtent().getMin().getX(), f1.getExtent().getMax().getY(), f1.getExtent().width(), f1.getExtent().height());
+			buf1 = f1.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		
+		System.out.println("R:" + (buf1.getElemByte(0, 0, 0) & 0xff));
+		System.out.println("G:" + (buf1.getElemByte(0, 0, 1) & 0xff));
+		System.out.println("B:" + (buf1.getElemByte(0, 0, 2) & 0xff));*/
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestSaveSerialToRmf.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestReadDataTDataStore.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestReadDataTDataStore.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestReadDataTDataStore.java	(revision 15423)
@@ -0,0 +1,176 @@
+/* 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.series;
+
+import java.text.ParseException;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.TimeException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+/**
+ * Saves serial information to rmf file
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestReadDataTDataStore extends BaseTestCase {
+	private String            path1    = baseDir + "serie1.tif";
+	private String            path2    = baseDir + "serie2.tif";
+	private String            path3    = baseDir + "serie3.tif";
+	private RasterDataStore   f1       = null;	
+	private RasterDataStore   f2       = null;
+	private RasterDataStore   f3       = null;
+	//private RasterQuery       query    = null;
+	protected Buffer          buf1     = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestSaveSerialToRmf running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			f2 = manager.open(path2);
+			f3 = manager.open(path3);
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		/*try {
+			RasterDataStore store = new DefaultTRasterStore(f1);
+			store.addTemporalDataStore(f2);
+			store.addTemporalDataStore(f3);*/
+			
+			//Selecci�n temporal por valor
+			
+			/*TimeInfo tInfo = new DefaultTimeInfo();
+			tInfo.addValue("29/8/2005"); //Blue
+			store.setTime(tInfo);
+			
+			Buffer buf = readData(store);
+			byte[] data = new byte[3];
+			buf.getElemByte(0, 0, data);
+			assertEquals(0, data[0]);
+			assertEquals(0, data[1]);
+			assertEquals(-1, data[2]);
+			System.out.println("RGB:" + data[0] + ", " + data[1] + ", " + data[2]);*/
+			
+			
+			//Selecci�n temporal por rango
+			
+			/*tInfo = new DefaultTimeInfo();
+			tInfo.addValue("26/8/2005-10:05:00"); //Red
+			tInfo.addValue("26/8/2005-12:36:00");
+			store.setTime(tInfo);
+			
+			buf = readData(store);
+			data = new byte[3];
+			buf.getElemByte(0, 0, data);
+			assertEquals(-1, data[0]);
+			assertEquals(0, data[1]);
+			assertEquals(0, data[2]);
+			System.out.println("RGB:" + data[0] + ", " + data[1] + ", " + data[2]);
+			
+			//Tests para los intervalos numericos
+			tInfo = new DefaultTimeInfo();
+			tInfo.addValue(152438); //Green
+			store.selectSerial("Katrina2");
+			store.setTime(tInfo);
+			
+			buf = readData(store);
+			data = new byte[3];
+			buf.getElemByte(0, 0, data);
+			assertEquals(0, data[0]);
+			assertEquals(-1, data[1]);
+			assertEquals(0, data[2]);
+			System.out.println("RGB:" + data[0] + ", " + data[1] + ", " + data[2]);
+			
+			tInfo = new DefaultTimeInfo();
+			tInfo.addValue(152340); //Red
+			store.setTime(tInfo);
+			
+			buf = readData(store);
+			data = new byte[3];
+			buf.getElemByte(0, 0, data);
+			assertEquals(-1, data[0]);
+			assertEquals(0, data[1]);
+			assertEquals(0, data[2]);
+			System.out.println("RGB:" + data[0] + ", " + data[1] + ", " + data[2]);
+			
+			tInfo = new DefaultTimeInfo();
+			tInfo.addValue(152550); //Red
+			store.setTime(tInfo);
+			
+			buf = readData(store);
+			data = new byte[3];
+			buf.getElemByte(0, 0, data);
+			assertEquals(0, data[0]);
+			assertEquals(0, data[1]);
+			assertEquals(-1, data[2]);
+			System.out.println("RGB:" + data[0] + ", " + data[1] + ", " + data[2]);
+			
+		} catch (ParseException e) {
+			e.printStackTrace();
+		} catch (TimeException e) {
+			e.printStackTrace();
+		} catch (OperationNotSupportedException e) {
+			e.printStackTrace();
+		}*/
+		
+	}
+	
+	private Buffer readData(RasterDataStore store) {
+		RasterQuery query = manager.createQuery();
+		query.setAllDrawableBands();
+		try {
+			query.setAreaOfInterest(0, 0, (int)store.getWidth(), (int)store.getHeight());
+			return store.query(query);
+		} catch (InvalidSetViewException e1) {
+			e1.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/series/TestReadDataTDataStore.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestBandList.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestBandList.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestBandList.java	(revision 15423)
@@ -0,0 +1,103 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.dataset;
+
+import junit.framework.TestCase;
+
+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.exception.BandNotFoundInListException;
+import org.gvsig.raster.impl.datastruct.BandListImpl;
+import org.gvsig.raster.impl.datastruct.DatasetBandImpl;
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestBandList extends TestCase {
+	private boolean  showCode = false;
+	private BandList bandList = null;
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	protected void setUp() throws Exception {
+		System.err.println("TestBandList running...");
+		bandList = new BandListImpl();
+		for (int i = 0; i < 5; i++) {
+			try {
+				DatasetBand band = new DatasetBandImpl("fileName", i, Buffer.TYPE_BYTE, 5);
+				bandList.addBand(band, i);
+			} catch (BandNotFoundInListException ex) {
+				// No a�adimos la banda
+			}
+		}
+	}
+
+	public void testStack() {
+		bandList.clearDrawableBands();
+		bandList.addDrawableBand(0, 1);
+		bandList.addDrawableBand(1, 4);
+		bandList.addDrawableBand(2, 3);
+
+		bandList.clearDrawableBands();
+		bandList.addDrawableBand(0, 3);
+		bandList.addDrawableBand(1, 2);
+		bandList.addDrawableBand(2, 4);
+		bandList.addDrawableBand(3, 4);
+		if (showCode)
+			print();
+	}
+
+//	private void test2() {
+//		assertEquals(bandList.getBandCount(), 5);
+//		assertEquals(bandList.getDrawableBandsCount(), 4);
+//		for (int i = 0; i < bandList.getBandCount(); i++) {
+//
+//			assertEquals((((Band) bandList.getBand(i)).getDataType()), 0);
+//			assertEquals((((Band) bandList.getBand(i)).getFileName()), "fileName");
+//			assertEquals((((Band) bandList.getBand(i)).getPosition()), i);
+//		}
+//	}
+
+	/**
+	 * Muestra la lista de bandas en modo texto
+	 */
+	public void print() {
+		System.out.println("BandCount: " + bandList.getBandCount());
+		System.out.println("DrawableBandsCount: " + bandList.getDrawableBandsCount());
+		for (int i = 0; i < bandList.getBandCount(); i++) {
+			System.out.println("");
+			System.out.println("***********************");
+			System.out.println("Band: " + i);
+			System.out.println("DataType: " + ((DatasetBand) bandList.getBand(i)).getDataType());
+			System.out.println("FileName: " + ((DatasetBand) bandList.getBand(i)).getFileName());
+			System.out.println("Position: " + ((DatasetBand) bandList.getBand(i)).getPosition());
+			if (((DatasetBand) bandList.getBand(i)).getBufferBandListToDraw() != null) {
+				System.out.print("Band Dst: ");
+				for (int j = 0; j < ((DatasetBand) bandList.getBand(i)).getBufferBandListToDraw().length; j++)
+					System.out.print(((DatasetBand) bandList.getBand(i)).getBufferBandListToDraw()[j] + " ");
+			}
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestBandList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineEcw.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineEcw.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineEcw.java	(revision 15423)
@@ -0,0 +1,184 @@
+/* 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;
+
+import java.io.File;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.raster.ermapper.io.ErmapperProvider;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+
+/**
+ * Test para validar la lectura por l�neas de un ecw.
+ * Muestrea valores sobre toda la extensi�n leida y comprueba que el resultado sea correcto
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestReadLineEcw extends BaseTestCase {
+	private String path1 = baseDir + "miniraster30x30.jp2";
+	
+	private RasterDataStore   f1      = null;	
+	private DefaultRasterProvider      f2      = null;
+	protected Buffer           raster  = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestReadLineEcw running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			DataManager dm = DALLocator.getDataManager();
+			FilesystemStoreParameters p = (FilesystemStoreParameters)dm.createStoreParameters(ErmapperProvider.NAME);
+			p.setFile(new File(path1));
+			f2 = (DefaultRasterProvider)loadProvider(p, (DataStoreProviderServices)f1);
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+		
+	}
+	
+	public void testStack() {
+		try {
+			Object line = null;
+			for(int iBand = 0; iBand < f1.getBandCount(); iBand ++) {
+				for(int iLine = 0; iLine < f1.getHeight(); iLine ++) {
+					line = ((ErmapperProvider)f2).readCompleteLine(iLine, iBand);
+					if(f1.getDataType()[iBand] == Buffer.TYPE_BYTE){
+						byte[] b = (byte[])line;
+						//printByteLine(b, iLine);
+						if(iBand == 0 && iLine == 0)
+							testLine0_Banda0(b);
+						if(iBand == 0 && iLine == 9)
+							testLine9_Banda0(b);
+						if(iBand == 0 && iLine == 19)
+							testLine19_Banda0(b);
+						if(iBand == 0 && iLine == 29)
+							testLine29_Banda0(b);
+						
+						if(iBand == 2 && iLine == 0)
+							testLine0_Banda2(b);
+						if(iBand == 2 && iLine == 9)
+							testLine9_Banda2(b);
+						if(iBand == 2 && iLine == 19)
+							testLine19_Banda2(b);
+						if(iBand == 2 && iLine == 29)
+							testLine29_Banda2(b);
+					}
+				}
+			}
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (GridException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+	}
+	
+	/*private void printByteLine(byte[] line, int nLine){
+		System.out.print("L�nea: " + nLine + "| ");
+		for (int i = 0; i < line.length; i++)
+			System.out.print((int)(line[i] & 0x000000ff) + " ");
+		System.out.println();
+	}*/
+	
+	public void testLine0_Banda0(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 43);
+		assertEquals((int)(line[9] & 0x000000ff), 83);
+		assertEquals((int)(line[19] & 0x000000ff), 75);
+		assertEquals((int)(line[29] & 0x000000ff), 255);
+	}
+	
+	public void testLine9_Banda0(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 118);
+		assertEquals((int)(line[9] & 0x000000ff), 81);
+		assertEquals((int)(line[19] & 0x000000ff), 105);
+		assertEquals((int)(line[29] & 0x000000ff), 114);
+	}
+	
+	public void testLine19_Banda0(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 70);
+		assertEquals((int)(line[9] & 0x000000ff), 49);
+		assertEquals((int)(line[19] & 0x000000ff), 63);
+		assertEquals((int)(line[29] & 0x000000ff), 147);
+	}
+	
+	public void testLine29_Banda0(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 175);
+		assertEquals((int)(line[9] & 0x000000ff), 129);
+		assertEquals((int)(line[19] & 0x000000ff), 15);
+		assertEquals((int)(line[29] & 0x000000ff), 126);
+	}
+	
+	public void testLine0_Banda2(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 26);
+		assertEquals((int)(line[9] & 0x000000ff), 68);
+		assertEquals((int)(line[19] & 0x000000ff), 70);
+		assertEquals((int)(line[29] & 0x000000ff), 246);
+	}
+	
+	public void testLine9_Banda2(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 96);
+		assertEquals((int)(line[9] & 0x000000ff), 93);
+		assertEquals((int)(line[19] & 0x000000ff), 93);
+		assertEquals((int)(line[29] & 0x000000ff), 102);
+	}
+	
+	public void testLine19_Banda2(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 81);
+		assertEquals((int)(line[9] & 0x000000ff), 46);
+		assertEquals((int)(line[19] & 0x000000ff), 63);
+		assertEquals((int)(line[29] & 0x000000ff), 123);
+	}
+	
+	public void testLine29_Banda2(byte[] line)throws InvalidSetViewException, FileNotOpenException, GridException{
+		assertEquals((int)(line[0] & 0x000000ff), 147);
+		assertEquals((int)(line[9] & 0x000000ff), 110);
+		assertEquals((int)(line[19] & 0x000000ff), 14);
+		assertEquals((int)(line[29] & 0x000000ff), 111);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineEcw.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineMrSID.java	(revision 15423)
@@ -0,0 +1,46 @@
+/* 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;
+
+import junit.framework.TestCase;
+/**
+ * Test para validar la lectura por l�neas de un fichero MrSID.
+ * Muestrea valores sobre toda la extensi�n leida y comprueba que el resultado
+ * sea correcto
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * TODO: Falta por hacer TestReadLineMrSID
+ */
+public class TestReadLineMrSID extends TestCase {
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestReadLineMrSID running...");
+	}
+	
+	public void testStack(){
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatisticMultiFile.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatisticMultiFile.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatisticMultiFile.java	(revision 15423)
@@ -0,0 +1,161 @@
+/* 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;
+
+import java.io.File;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.raster.gdal.io.GdalProvider;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+import org.gvsig.raster.impl.store.DefaultMultiRasterStore;
+/**
+ * Prueba el calculo de estadisticas para un dataset con multiples ficheros.
+ * Comprueba que los valores obtenidos en las estadisticas son correctos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestStatisticMultiFile extends BaseTestCase {
+	private String path1 = baseDir + "band1-30x28byte.tif";
+	private String path2 = baseDir + "band2-30x28byte.tif";
+	private String path3 = baseDir + "band3-30x28byte.tif";
+
+	private DefaultRasterProvider      f1       = null;	
+	private DefaultRasterProvider      f2       = null;
+	private DefaultRasterProvider      f3       = null;
+	protected Buffer           raster   = null;
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	protected void doSetUp() throws Exception {
+		System.err.println("TestStatisticMultiFile running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void testStack() {
+		DefaultMultiRasterStore grmf = new DefaultMultiRasterStore();
+		
+		try {
+			deleteRMF(path1);
+			deleteRMF(path2);
+			deleteRMF(path3);
+			DataManager dm = DALLocator.getDataManager();
+			
+			FilesystemStoreParameters p = (FilesystemStoreParameters)dm.createStoreParameters(GdalProvider.NAME);
+			p.setFile(new File(path1));
+			f1 = (DefaultRasterProvider)loadProvider(p, (DataStoreProviderServices)grmf);
+			
+			FilesystemStoreParameters p1 = (FilesystemStoreParameters)dm.createStoreParameters(GdalProvider.NAME);
+			p.setFile(new File(path2));
+			f2 = (DefaultRasterProvider)loadProvider(p1, (DataStoreProviderServices)grmf);
+			
+			FilesystemStoreParameters p2 = (FilesystemStoreParameters)dm.createStoreParameters(GdalProvider.NAME);
+			p.setFile(new File(path3));
+			f3 = (DefaultRasterProvider)loadProvider(p2, (DataStoreProviderServices)grmf);
+			
+		} catch (ProviderNotRegisteredException e) {
+			e.printStackTrace();
+		} catch (InitializeException e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			grmf.addDataStore(f1);
+			grmf.addDataStore(f2);
+			grmf.addDataStore(f3);
+		} catch (OperationNotSupportedException e1) {
+			// TODO Auto-generated catch block
+			e1.printStackTrace();
+		}
+		try {
+			grmf.getStatistics().calculate();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		//			print(grmf);
+		dataTestB1(grmf.getStatistics());
+		dataTestB2(grmf.getStatistics());
+		dataTestB3(grmf.getStatistics());
+	}
+
+	private void dataTestB1(Statistics stats){
+		assertEquals(new Double(stats.getMaxByteUnsigned()[0]), new Double(249.0));
+		assertEquals(new Double(stats.getMinByteUnsigned()[0]), new Double(82.0));
+		assertEquals(new Double(stats.getSecondMaxByteUnsigned()[0]), new Double(211.0));
+		assertEquals(new Double(stats.getSecondMinByteUnsigned()[0]), new Double(83.0));
+		assertEquals((int)stats.getMean()[0], 119);
+		assertEquals((int)stats.getVariance()[0], 584);
+	}
+	
+	private void dataTestB2(Statistics stats){
+		assertEquals(new Double(stats.getMaxByteUnsigned()[1]), new Double(234.0));
+		assertEquals(new Double(stats.getMinByteUnsigned()[1]), new Double(49.0));
+		assertEquals(new Double(stats.getSecondMaxByteUnsigned()[1]), new Double(216.0));
+		assertEquals(new Double(stats.getSecondMinByteUnsigned()[1]), new Double(50.0));
+		assertEquals((int)stats.getMean()[1], 102);
+		assertEquals((int)stats.getVariance()[1], 1107);
+	}
+	
+	private void dataTestB3(Statistics stats){
+		assertEquals(new Double(stats.getMaxByteUnsigned()[2]), new Double(255.0));
+		assertEquals(new Double(stats.getMinByteUnsigned()[2]), new Double(28.0));
+		assertEquals(new Double(stats.getSecondMaxByteUnsigned()[2]), new Double(250.0));
+		assertEquals(new Double(stats.getSecondMinByteUnsigned()[2]), new Double(34.0));
+		assertEquals((int)stats.getMean()[2], 115);
+		assertEquals((int)stats.getVariance()[2], 2833);
+	}
+
+	public void print(RasterDataStore grmf) {
+		for (int iBand = 0; iBand < grmf.getStatistics().getBandCount(); iBand++) {
+			System.out.println("Band " + iBand);
+			System.out.println("...Max: " + grmf.getStatistics().getMax()[iBand]);
+			System.out.println("...Min: " + grmf.getStatistics().getMin()[iBand]);
+			System.out.println("...SecondMax: " + grmf.getStatistics().getSecondMax()[iBand]);
+			System.out.println("...SecondMin: " + grmf.getStatistics().getSecondMin()[iBand]);
+			System.out.println("...Mean: " + grmf.getStatistics().getMean()[iBand]);
+			System.out.println("...Variance: " + grmf.getStatistics().getVariance()[iBand]);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatisticMultiFile.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelEcw.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelEcw.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelEcw.java	(revision 15423)
@@ -0,0 +1,115 @@
+/* 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;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+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.RasterDriverException;
+import org.gvsig.raster.impl.store.DefaultMultiRasterStore;
+
+/**
+ * Este test que obtiene la informaci�n de un �nico pixel. Repetira esta
+ * operaci�n sobre varios pixels sobre una misma imagen comprobado que los resultados
+ * sean correctos, es decir para la posici�n seleccionada existe ese pixel obtenido.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestDataByPixelEcw extends BaseTestCase {
+	private String             path1   = baseDir + "miniraster30x30.jp2";
+	private DefaultMultiRasterStore       f       = null;	
+	protected Buffer           raster  = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestDataByPixelEcw running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f = (DefaultMultiRasterStore)manager.open(path1);
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+		
+	}
+	
+	public void testStack(){
+		try {
+			testPixelsValues();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+	}
+	
+	public void testPixelsValues()throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		assertEquals(((Integer)f.getData(1, 1, 0)).intValue(), 73);
+		assertEquals(((Integer)f.getData(1, 1, 1)).intValue(), 87);
+		assertEquals(((Integer)f.getData(1, 1, 2)).intValue(), 72);
+		
+		assertEquals(((Integer)f.getData(18, 16, 0)).intValue(), 61);
+		assertEquals(((Integer)f.getData(18, 16, 1)).intValue(), 74);
+		assertEquals(((Integer)f.getData(18, 16, 2)).intValue(), 57);
+		
+		assertEquals(((Integer)f.getData(17, 23, 0)).intValue(), 172);
+		assertEquals(((Integer)f.getData(17, 23, 1)).intValue(), 154);
+		assertEquals(((Integer)f.getData(17, 23, 2)).intValue(), 140);
+		
+		assertEquals(((Integer)f.getData(23, 3, 0)).intValue(), 188);
+		assertEquals(((Integer)f.getData(23, 3, 1)).intValue(), 186);
+		assertEquals(((Integer)f.getData(23, 3, 2)).intValue(), 189);
+		
+		assertEquals(((Integer)f.getData(29, 29, 0)).intValue(), 126);
+		assertEquals(((Integer)f.getData(29, 29, 1)).intValue(), 134);
+		assertEquals(((Integer)f.getData(29, 29, 2)).intValue(), 111);
+		
+		assertEquals(((Integer)f.getData(0, 29, 0)).intValue(), 175);
+		assertEquals(((Integer)f.getData(0, 29, 1)).intValue(), 175);
+		assertEquals(((Integer)f.getData(0, 29, 2)).intValue(), 147);
+		
+		assertEquals(((Integer)f.getData(0, 0, 0)).intValue(), 43);
+		assertEquals(((Integer)f.getData(0, 0, 1)).intValue(), 53);
+		assertEquals(((Integer)f.getData(0, 0, 2)).intValue(), 26);
+		
+		assertEquals(((Integer)f.getData(29, 0, 0)).intValue(), 255);
+		assertEquals(((Integer)f.getData(29, 0, 1)).intValue(), 252);
+		assertEquals(((Integer)f.getData(29, 0, 2)).intValue(), 246);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelEcw.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelMrSID.java	(revision 15423)
@@ -0,0 +1,46 @@
+/* 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;
+
+import junit.framework.TestCase;
+/**
+ * Este test que obtiene la informaci�n de un �nico pixel. Repetira esta
+ * operaci�n sobre varios pixels sobre una misma imagen comprobado que los resultados
+ * sean correctos, es decir para la posici�n seleccionada existe ese pixel obtenido.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * TODO: Falta por hacer TestDataByPixelMrSID
+ */
+public class TestDataByPixelMrSID extends TestCase {
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestDataByPixelMrSID running...");
+	}
+	
+	public void testStack(){
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadBlockMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadBlockMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadBlockMrSID.java	(revision 15423)
@@ -0,0 +1,136 @@
+/* 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;
+
+import java.io.File;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+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.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+import org.gvsig.raster.lizardtech.io.LizardTechProvider;
+
+/**
+ * Test del uso de la funci�n readBlock de MrSID. Cargar� un dataset del formato mrsid y recorrer� todo
+ * el raster con la llamada readBlock. El resultado de los datos leidos con esta llamada ser�n 
+ * comparados a los leidos con setAreaOfInterest
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestReadBlockMrSID extends BaseTestCase {
+	private String path1 = baseDir + "q101866.sid";
+	private RasterDataStore   f1       = null;	
+	private DefaultRasterProvider      f2       = null;	
+	private RasterQuery        query   = null;
+	protected Buffer           buf1  = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestReadBlockMrSID running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			DataManager dm = DALLocator.getDataManager();
+			FilesystemStoreParameters p = (FilesystemStoreParameters)dm.createStoreParameters(LizardTechProvider.NAME);
+			p.setFile(new File(path1));
+			f2 = (DefaultRasterProvider)loadProvider(p, (DataStoreProviderServices)f1);
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		query = manager.createQuery();
+		query.setAllDrawableBands();
+		try {
+			query.setAreaOfInterest(f1.getExtent().getMin().getX(), f1.getExtent().getMax().getY(), f1.getExtent().width(), f1.getExtent().height());
+			buf1 = f1.query(query);
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		} catch (InvalidSetViewException e1) {
+			e1.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		
+		int block = 100;
+		int nblocks = (int)Math.ceil(f1.getHeight() / block);
+		try {
+			int line = 0;
+			int initBand = 0;
+			int column = 0;
+			for (int i = 0; i < nblocks; i++) {
+				byte[][][] buf = (byte[][][])f2.readBlock(i * block, block);
+				initBand = i * block;
+				for (int band = 0; band < buf.length; band++) {
+					line = initBand;
+					for (int row = 0; row < buf[band].length; row++) {
+						column = 0;
+						for (int col = 0; col < buf[band][row].length; col++) {
+							//try {
+							assertEquals(buf[band][row][col], buf1.getElemByte(line, column, band));
+							/*} catch (AssertionFailedError e) {
+								System.out.println(band + " " + line + " " + column);
+								
+							}*/
+							column ++;
+						}
+						line ++;
+					}
+					
+				}
+			}
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadBlockMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterMrSID.java	(revision 15423)
@@ -0,0 +1,108 @@
+/* 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;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+/**
+ * Test que compara los resultados de la llamada getWindowRaster en coordenadas pixel 
+ * y coordenadas reales para comprobar que producen el mismo resultado para la misma extensi�n.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestGetWindowRasterMrSID extends BaseTestCase {
+	private String path1 = baseDir + "q101866.sid";
+	private RasterDataStore   f1       = null;	
+	private RasterDataStore   f2       = null;	
+	private RasterQuery        query   = null;
+	protected Buffer           buf1  = null;
+	protected Buffer           buf2  = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestGetWindowRasterMrSID running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			f2 = manager.open(path1);
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		query = manager.createQuery();
+		query.setAllDrawableBands();
+		try {
+			query.setAreaOfInterest(f1.getExtent().getMin().getX(), f1.getExtent().getMax().getY(), f1.getExtent().width(), f1.getExtent().height());
+			buf1 = f1.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			query.setAreaOfInterest(0, 0, (int)f2.getWidth(), (int)f2.getHeight());
+			buf2 = f2.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		
+		for (int band = 0; band < buf1.getBandCount(); band++) {
+			for (int row = 0; row < buf1.getHeight(); row++) {
+				for (int col = 0; col < buf1.getWidth(); col++) {
+					//try {
+					assertEquals(buf1.getElemByte(row, col, band), buf2.getElemByte(row, col, band));
+					//System.out.println(buf1.getElemByte(row, col, band) + " " + buf2.getElemByte(row, col, band));
+					/*} catch (AssertionFailedError e) {
+						System.out.println(band + " " + line + " " + column);
+						
+					}*/
+				}
+			}
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestHistogramSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestHistogramSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestHistogramSerializer.java	(revision 15423)
@@ -0,0 +1,106 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.dataset;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+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.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.raster.impl.datastruct.serializer.HistogramRmfSerializer;
+
+/**
+ * Test para comprobar la construcci�n de un histograma desde un XML. Este test calcula el histograma
+ * de un raster y lo convierte a XML. Despu�s crear� un objeto Histogram a partir del XML. Finalmente
+ * se comparar� el Histograma original con el final.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestHistogramSerializer extends BaseTestCase {
+	private String path = baseDir + "miniraster30x30.jp2";
+	private RasterDataStore   f       = null;	
+	protected Buffer           raster  = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestHistogramSerializer running...");
+		//int[] drawableBands = {0, 1, 2};
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+			return;
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+			return;
+		}
+		
+	}
+	
+	public void testStack() {
+		
+		try {
+			HistogramComputer dsh = f.getHistogramComputer();
+			BufferHistogram hist1 = null;
+			hist1 = dsh.getBufferHistogram();
+			
+			HistogramRmfSerializer serial1 = new HistogramRmfSerializer(hist1);
+			String s = serial1.write();
+			//System.out.println(s);
+			
+			HistogramRmfSerializer serial2 = new HistogramRmfSerializer();
+			try {
+				serial2.read(s);
+			} catch (ParsingException e) {
+				e.printStackTrace();
+			}
+			BufferHistogram hist2 = (BufferHistogram)serial2.getResult();
+			
+			assertEquals(hist1.getNumBands(), hist2.getNumBands());
+			for (int iBand = 0; iBand < hist1.getNumBands(); iBand++) {
+				for(int i = 0; i < hist1.getNumValues(); i++) 
+					assertEquals((long)hist1.getHistogramValue(iBand, i), (long)hist2.getHistogramValue(iBand, i));	
+			}
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (HistogramException e) {
+			e.printStackTrace();
+		}
+		
+		
+	}
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestHistogramSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestWriterParams.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestWriterParams.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestWriterParams.java	(revision 15423)
@@ -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.fmap.dal.coverage.dataset.io;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.impl.store.ParamsImpl.ParamImpl;
+
+
+/**
+ * Prueba para la inserci�n y extracci�n de par�metros de los driver de escritura.
+ * Lee primero los valores asignados en la inicializaci�n y luego hace algunas
+ * variaciones comprobando que los resultados sean correctos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestWriterParams extends BaseTestCase {
+	private RasterWriter grw = null;
+	private ParamsImpl wp = null;
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	protected void doSetUp() throws Exception {
+		System.err.println("TestWriterParams running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		//Extensi�n gestionada por gdal
+		try {
+			grw = manager.createWriter("prueba.tif");
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		wp = (ParamsImpl)grw.getParams();
+	}
+
+	public void testStack(){
+		ParamImpl param;
+//		String blockSize = "512";
+//		Param param = wp.getParamById("blocksize");
+//		blockSize = param.list[((Integer) param.defaultValue).intValue()];
+
+		String photometric = "RGB";
+		param = (ParamsImpl.ParamImpl)wp.getParamById("photometric");
+		photometric = param.getList()[((Integer) param.getDefaultValue()).intValue()];
+
+		String interleave = "BAND";
+		param = (ParamsImpl.ParamImpl)wp.getParamById("interleave");
+		interleave = param.getList()[((Integer) param.getDefaultValue()).intValue()];
+
+		String compression = "NONE";
+		param = (ParamsImpl.ParamImpl)wp.getParamById("compression");
+		compression = param.getList()[((Integer) param.getDefaultValue()).intValue()];
+
+		String tfw = (String) ((ParamsImpl.ParamImpl)wp.getParamById("tfw")).getDefaultValue().toString();
+
+//		assertEquals(blockSize, "512");
+//		assertEquals(georef, "true");
+		assertEquals(photometric, "RGB");
+		assertEquals(interleave, "BAND");
+		assertEquals(compression, "NONE");
+		assertEquals(tfw, "false");
+
+		wp.changeParamValue("blocksize", "6"/*"256"*/);
+		//wp.changeParamValue("georef", "false");
+		wp.changeParamValue("photometric", "1"/*"MINISBLACK"*/);
+		wp.changeParamValue("interleave", "1"/*"PIXEL"*/);
+		wp.changeParamValue("compression", "0"/*LZW*/);
+		wp.changeParamValue("tfw", "true");
+
+//		param = wp.getParamById("blocksize");
+//		blockSize = param.list[((Integer)param.defaultValue).intValue()];
+		param = (ParamsImpl.ParamImpl)wp.getParamById("photometric");
+		photometric = param.getList()[Integer.parseInt((String) param.getDefaultValue())];
+		param = (ParamsImpl.ParamImpl)wp.getParamById("interleave");
+		interleave = param.getList()[Integer.parseInt((String) param.getDefaultValue())];
+		param = (ParamsImpl.ParamImpl)wp.getParamById("compression");
+		compression = param.getList()[Integer.parseInt((String) param.getDefaultValue())];
+		tfw = (String) ((ParamsImpl.ParamImpl)wp.getParamById("tfw")).getDefaultValue().toString();
+
+//		assertEquals(blockSize, "256");
+//		assertEquals(georef, "false");
+		assertEquals(photometric, "MINISBLACK");
+		assertEquals(interleave, "PIXEL");
+		assertEquals(compression, "LZW");
+		assertEquals(tfw, "true");
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestWriterParams.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestGdalWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestGdalWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestGdalWriter.java	(revision 15423)
@@ -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.fmap.dal.coverage.dataset.io;
+
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.raster.impl.buffer.DefaultDataServerWriter;
+
+/**
+ * Test para salvar un raster a tif variando sus par�metros.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestGdalWriter extends BaseTestCase {
+	private String path1 = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	private String out = baseDir + "testGdalWriter";
+	private Buffer buf = null;
+	private RasterDataStore   d       = null;	
+	private RasterQuery        query   = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestGdalWriter running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			d = manager.open(path1);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(new int[]{0, 1, 2});
+		try {
+			query.setAreaOfInterest(0, 0, (int)d.getWidth(), (int)d.getHeight());
+			buf = d.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		try {
+			File f = new File(out + ".tif");
+			f.delete();
+			f = new File(out + ".tfw");
+			f.delete();
+			convertBufferToTif(out + ".tif", d.getAffineTransform(), buf);
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * Funci�n para pruebas.
+	 * Convierte los ficheros generados por la funci�n cachear en ficheros tif para comprobar que est�n
+	 * bien generados.
+	 * @param grf
+	 * @param pageBuffer
+	 * @param pageLines
+	 * @throws IOException
+	 */
+	private void convertBufferToTif(String fileName, AffineTransform at, Buffer buffer)throws IOException, ProcessInterruptedException {
+		DataServerWriter dataWriter1 = new DefaultDataServerWriter(buffer);
+		RasterWriter grw = null;
+		try {
+			Params params = manager.createWriter(fileName).getParams();
+			params.changeParamValue("blocksize", "7");//posici�n 7 del array -> 512
+			params.changeParamValue("tfw", "true");
+			params.changeParamValue("interleave", new Integer(1));//posici�n 1 del array -> PIXEL
+			grw = manager.createWriter(dataWriter1, 
+											fileName,
+											buffer.getBandCount(),
+											at,
+											buffer.getWidth(), 
+											buffer.getHeight(), 
+											buffer.getDataType(),
+											params,
+											null);
+			
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		grw.dataWrite();
+		grw.writeClose();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/TestGdalWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfWrite.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfWrite.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfWrite.java	(revision 15423)
@@ -0,0 +1,204 @@
+/* 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.rmf;
+
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.datastruct.GeoPoint;
+import org.gvsig.raster.impl.datastruct.GeoPointList;
+import org.gvsig.raster.impl.datastruct.DefaultNoData;
+import org.gvsig.raster.impl.datastruct.DefaultViewPortData;
+import org.gvsig.raster.impl.datastruct.serializer.ColorTableRmfSerializer;
+import org.gvsig.raster.impl.datastruct.serializer.HistogramRmfSerializer;
+import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+import org.gvsig.raster.impl.store.DefaultMultiRasterStore;
+import org.gvsig.raster.impl.store.QueryableRaster;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreStatistics;
+import org.gvsig.raster.impl.store.rmf.RmfBlocksManager;
+import org.gvsig.raster.impl.store.serializer.ColorInterpretationRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoInfoRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoPointListRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.StatisticsRmfSerializer;
+import org.gvsig.raster.lizardtech.io.LizardTechProvider;
+/**
+ * Test de escritura de ficheros rmf.
+ * Escribe un fichero rmf con distintos bloques y a continuaci�n le pasa un
+ * test de lectura para comprobar que se ha generado bien.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestRmfWrite extends BaseTestCase {
+	private RmfBlocksManager blocksManager = null;
+	private String           path          = baseDir + "miniRaster25x24.tif";
+	private String           pathGif       = baseDir + "gifTransparente.gif";
+	private String           pathJpg       = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	private BufferHistogram  histogram     = null;
+	private ColorTable       colorTable    = null;
+	private RasterDataStore f             = null;
+	private DefaultRasterProvider    f2            = null;
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		System.err.println("TestRmfWrite running...");
+
+		RasterDataStore f1 = null;
+		try {
+			deleteRMF(path);
+			deleteRMF(pathGif);
+			deleteRMF(pathJpg);
+			f = manager.open(path);
+			f1 = manager.open(pathGif);
+			
+			DefaultMultiRasterStore grmf = new DefaultMultiRasterStore();
+
+			DataManager dm = DALLocator.getDataManager();
+			FilesystemStoreParameters p = (FilesystemStoreParameters)dm.createStoreParameters(LizardTechProvider.NAME);
+			p.setFile(new File(pathJpg));
+			f2 = (DefaultRasterProvider)loadProvider(p, (DataStoreProviderServices)grmf);
+			
+		} catch (NotSupportedExtensionException e) {
+			return;
+		} catch (RasterDriverException e) {
+			return;
+		}
+
+		try {
+			histogram = f.getHistogramComputer().getBufferHistogram();
+			colorTable = f1.getColorTable();
+			f.getStatistics().calculate();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (HistogramException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void testStack() throws Exception {
+		deleteRMF(baseDir + "writetest.rmf");
+		blocksManager = new RmfBlocksManager(baseDir + "writetest.rmf");
+
+		// Histograma
+		HistogramRmfSerializer ser = new HistogramRmfSerializer(histogram);
+		blocksManager.addClient(ser);
+
+		// Tabla de color
+		// colorTable.setName("Prueba Tabla de Color");
+		ColorTableRmfSerializer ser1 = new ColorTableRmfSerializer(colorTable);
+		blocksManager.addClient(ser1);
+
+		// Estadisticas
+		DataStoreStatistics stat = ((QueryableRaster)f).getProvider(0).getStatistics();
+		stat.setTailTrimValue(3.0, new Double(10.0));
+		stat.setTailTrimValue(4.0, new Double(16.0));
+		StatisticsRmfSerializer ser2 = new StatisticsRmfSerializer(stat);
+		blocksManager.addClient(ser2);
+
+		// Georreferenciaci�n
+		GeoInfoRmfSerializer ser3 = new GeoInfoRmfSerializer(f2);
+		blocksManager.addClient(ser3);
+
+		// Puntos de control
+		GeoPoint p1 = new GeoPoint();
+		p1.pixelPoint = new Point2D.Double(10, 10);
+		p1.mapPoint = new Point2D.Double(34223.3, 2344.2);
+		p1.leftViewPort = new DefaultViewPortData();
+		p1.leftViewPort.setExtent(new ExtentImpl(30032.3, 2103.3, 50023.3, 1234.3));
+		p1.rightViewPort = new DefaultViewPortData();
+		p1.rightViewPort.setExtent(new ExtentImpl(30032.3, 2103.3, 50023.3, 1234.3));
+		p1.leftCenterPoint = new Point2D.Double(24223.3, 3244.2);
+		p1.rightCenterPoint = new Point2D.Double(2433.3, 6244.2);
+		GeoPoint p2 = new GeoPoint();
+		p2.pixelPoint = new Point2D.Double(10, 10);
+		p2.mapPoint = new Point2D.Double(34223.3, 2344.2);
+		p2.leftViewPort = new DefaultViewPortData();
+		p2.leftViewPort.setExtent(new ExtentImpl(30032.3, 2103.3, 50023.3, 1234.3));
+		p2.rightViewPort = new DefaultViewPortData();
+		p2.rightViewPort.setExtent(new ExtentImpl(30032.3, 2103.3, 50023.3, 1234.3));
+		p2.leftCenterPoint = new Point2D.Double(24223.3, 3244.2);
+		p2.rightCenterPoint = new Point2D.Double(2433.3, 6244.2);
+
+		p1.leftViewPort.pxSize = new Point2D.Double(32, 34);
+
+		GeoPointList list = new GeoPointList();
+		list.add(p1);
+		list.add(p2);
+		GeoPointListRmfSerializer ser4 = new GeoPointListRmfSerializer(list, p1.leftViewPort);
+		blocksManager.addClient(ser4);
+
+		// Valor NoData
+		NoDataRmfSerializer ser5 = new NoDataRmfSerializer(new DefaultNoData(5450.0, 2));
+		blocksManager.addClient(ser5);
+
+		// Interpretaci�n de color
+		ColorInterpretation ci = f.getColorInterpretation();
+		ci.setColorInterpValue(0, DataStoreColorInterpretation.BLUE_BAND);
+		ci.setColorInterpValue(2, DataStoreColorInterpretation.RED_BAND);
+		ColorInterpretationRmfSerializer ser6 = new ColorInterpretationRmfSerializer((DataStoreColorInterpretation)f.getColorInterpretation());
+		blocksManager.addClient(ser6);
+
+		try {
+			blocksManager.write();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		// Pasamos el test de lectura para comprobar que se ha generado bien
+		TestRmfRead t = new TestRmfRead();
+		t.file = "writetest.rmf";
+		t.start();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfWrite.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfRead.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfRead.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfRead.java	(revision 15423)
@@ -0,0 +1,309 @@
+/* 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.rmf;
+
+import java.awt.geom.AffineTransform;
+import java.io.File;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.HistogramClass;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.datastruct.DefaultNoData;
+import org.gvsig.raster.impl.datastruct.GeoPoint;
+import org.gvsig.raster.impl.datastruct.GeoPointList;
+import org.gvsig.raster.impl.datastruct.serializer.ColorTableRmfSerializer;
+import org.gvsig.raster.impl.datastruct.serializer.HistogramRmfSerializer;
+import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+import org.gvsig.raster.impl.store.DefaultMultiRasterStore;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreStatistics;
+import org.gvsig.raster.impl.store.rmf.IRmfBlock;
+import org.gvsig.raster.impl.store.rmf.RmfBlocksManager;
+import org.gvsig.raster.impl.store.serializer.ColorInterpretationRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoInfoRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoPointListRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.StatisticsRmfSerializer;
+import org.gvsig.raster.lizardtech.io.LizardTechProvider;
+/**
+ * Test de lectura para ficheros rmf. Obtiene distintos tipos de bloques y
+ * comprueba que el objeto que han de generar es correcto.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestRmfRead extends BaseTestCase {
+	private RmfBlocksManager blocksManager = null;
+	public String            file    = "readtest.rmf";
+	private DefaultRasterProvider      f2       = null;	
+	protected Buffer           raster  = null;
+	private String           path1   = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		System.err.println("TestRmfRead running...");
+		
+		deleteRMF(path1);
+		DefaultMultiRasterStore grmf = new DefaultMultiRasterStore();
+
+		DataManager dm = DALLocator.getDataManager();
+		FilesystemStoreParameters p = (FilesystemStoreParameters)dm.createStoreParameters(LizardTechProvider.NAME);
+		p.setFile(new File(path1));
+		f2 = (DefaultRasterProvider)loadProvider(p, (DataStoreProviderServices)grmf);
+	}
+
+	public void testStack(){
+		blocksManager = new RmfBlocksManager(baseDir + file);
+		if (!blocksManager.checkRmf())
+			assertEquals(0, 1);
+		HistogramRmfSerializer ser = new HistogramRmfSerializer();
+		ColorTableRmfSerializer ser1 = new ColorTableRmfSerializer();
+		StatisticsRmfSerializer ser2 = new StatisticsRmfSerializer();
+		GeoInfoRmfSerializer ser3 = new GeoInfoRmfSerializer(f2);
+		GeoPointListRmfSerializer ser4 = new GeoPointListRmfSerializer();
+		NoDataRmfSerializer ser5 = new NoDataRmfSerializer();
+		ColorInterpretationRmfSerializer ser6 = new ColorInterpretationRmfSerializer((DataStoreColorInterpretation)f2.getColorInterpretation());
+
+		blocksManager.addClient(ser);
+		blocksManager.addClient(ser1);
+		blocksManager.addClient(ser2);
+		blocksManager.addClient(ser3);
+		blocksManager.addClient(ser4);
+		blocksManager.addClient(ser5);
+		blocksManager.addClient(ser6);
+
+		try {
+			blocksManager.read(null);
+			for (int i = 0; i < blocksManager.getClientsCount(); i++) {
+				IRmfBlock client = blocksManager.getClient(i);
+				if (client instanceof HistogramRmfSerializer)
+					testHistogram((BufferHistogram) client.getResult());
+				if (client instanceof ColorTableRmfSerializer) {
+					ColorTable colorTable = (ColorTable) client.getResult();
+					colorTable.setInterpolated(false);
+					testColorTable(colorTable);
+				}
+				if (client instanceof StatisticsRmfSerializer)
+					testStatistics((DataStoreStatistics) client.getResult());
+				if (client instanceof NoDataRmfSerializer)
+					testNoData((DefaultNoData) client.getResult());
+//				if (client instanceof GeoInfoRmfSerializer)
+//					testGeoInfo((RasterDataset) client.getResult());
+				if (client instanceof GeoPointListRmfSerializer)
+					testGeoPoints((GeoPointList) client.getResult());
+				if (client instanceof ColorInterpretationRmfSerializer) {
+					DataStoreColorInterpretation ci = (DataStoreColorInterpretation) client.getResult();
+					testColorInterpretation(ci);
+				}
+			}
+
+		} catch (ParsingException e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	public void testColorInterpretation(DataStoreColorInterpretation ci) {
+		for (int j = 0; j < ci.length(); j++) {
+			String value = ci.get(j);
+//			System.out.println(value);
+			if (j == 0)
+				assertEquals(value, "Red");
+			if (j == 1)
+				assertEquals(value, "Green");
+			if (j == 2)
+				assertEquals(value, "Blue");
+		}
+	}
+
+	public void testHistogram(BufferHistogram h) {
+		BufferHistogram h2 = BufferHistogramImpl.convertHistogramToRGB(h);
+
+		HistogramClass[][] classes = h2.getHistogram();
+		for (int iBand = 0; iBand < classes.length; iBand++)
+			for (int iValue = 0; iValue < classes[iBand].length; iValue++) {
+				assertEquals((int) classes[iBand][iValue].getMin(), iValue);
+				assertEquals((int) classes[iBand][iValue].getMax(), iValue + 1);
+			}
+
+		assertEquals((int) h.getHistogramValue(0, 0), 16);
+		assertEquals((int) h.getHistogramValue(0, 1), 4);
+		assertEquals((int) h.getHistogramValue(0, 23), 6);
+		assertEquals((int) h.getHistogramValue(0, 48), 4);
+
+		assertEquals((int) h.getHistogramValue(1, 0), 2);
+		assertEquals((int) h.getHistogramValue(1, 4), 1);
+		assertEquals((int) h.getHistogramValue(1, 7), 8);
+		assertEquals((int) h.getHistogramValue(1, 20), 4);
+
+		assertEquals((int) h.getHistogramValue(2, 0), 25);
+		assertEquals((int) h.getHistogramValue(2, 2), 1);
+		assertEquals((int) h.getHistogramValue(2, 13), 4);
+		assertEquals((int) h.getHistogramValue(2, 21), 2);
+	}
+
+	public void testColorTable(ColorTable ct) {
+
+//		byte[][] color = ct.getColorTableByBand();
+
+//		assertEquals(ct.getName(), "Prueba Tabla de Color");
+
+		assertEquals(ct.getRGBAByBand(15)[0] & 0xff, 95);
+		assertEquals(ct.getRGBAByBand(15)[1] & 0xff, 95);
+		assertEquals(ct.getRGBAByBand(15)[2] & 0xff, 95);
+
+		assertEquals(ct.getRGBAByBand(22)[0] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(22)[1] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(22)[2] & 0xff, 0);
+
+		assertEquals(ct.getRGBAByBand(24)[0] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(24)[1] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(24)[2] & 0xff, 0);
+
+		assertEquals(ct.getRGBAByBand(28)[0] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(28)[1] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(28)[2] & 0xff, 0);
+
+		assertEquals(ct.getRGBAByBand(0)[0] & 0xff, 255);
+		assertEquals(ct.getRGBAByBand(0)[1] & 0xff, 255);
+		assertEquals(ct.getRGBAByBand(0)[2] & 0xff, 255);
+
+		assertEquals(ct.getRGBAByBand(1)[0] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(1)[1] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(1)[2] & 0xff, 0);
+
+		assertEquals(ct.getRGBAByBand(2)[0] & 0xff, 0);
+		assertEquals(ct.getRGBAByBand(2)[1] & 0xff, 102);
+		assertEquals(ct.getRGBAByBand(2)[2] & 0xff, 255);
+
+//		System.out.println(ct.getName());
+//		for (int i = 0; i < color.length; i++) {
+//			System.out.println((color[i][0] & 0xff) + " " + (color[i][1] & 0xff) + " " + (color[i][2] & 0xff));
+//		}
+	}
+
+	public void testNoData(DefaultNoData noData) {
+		assertEquals((int) noData.getValue(), 5450);
+		assertEquals(noData.getType(), 2);
+	}
+
+	public void testStatistics(DataStoreStatistics ds) {
+		int bandCount = ds.getBandCount();
+		double[] max = ds.getMaxByteUnsigned();
+		double[] min = ds.getMinByteUnsigned();
+		double[] secondMax = ds.getSecondMaxByteUnsigned();
+		double[] secondMin = ds.getSecondMinByteUnsigned();
+		double[] mean = ds.getMean();
+		double[] variance = ds.getVariance();
+
+		assertEquals(bandCount, 3);
+		for (int i = 0; i < bandCount; i++)
+			switch (i) {
+				case 0:
+					assertEquals((int) max[i], 250);
+					assertEquals((int) min[i], 0);
+					assertEquals((int) secondMax[i], 248);
+					assertEquals((int) secondMin[i], 1);
+					assertEquals((int) mean[i], 95);
+					assertEquals((int) variance[i], 3050);
+					break;
+				case 1:
+					assertEquals((int) max[i], 255);
+					assertEquals((int) min[i], 0);
+					assertEquals((int) secondMax[i], 254);
+					assertEquals((int) secondMin[i], 3);
+					assertEquals((int) mean[i], 105);
+					assertEquals((int) variance[i], 2689);
+					break;
+				case 2:
+					assertEquals((int) max[i], 254);
+					assertEquals((int) min[i], 0);
+					assertEquals((int) secondMax[i], 250);
+					assertEquals((int) secondMin[i], 1);
+					assertEquals((int) mean[i], 85);
+					assertEquals((int) variance[i], 3218);
+					break;
+			}
+
+//		System.out.println(ct.getName());
+//		System.out.println(ct.getType());
+//		for (int i = 0; i < color.length; i++) {
+//			System.out.print(range[i] + ": ");
+//			System.out.println(color[i][0] + " " + color[i][1] + " " + color[i][2]);
+//		}
+	}
+
+	public void testGeoInfo(RasterDataStore dataset) {
+	//TODO: TEST: Terminar test de acceso a la georreferenciaci�n.
+//		String proj = "";
+//		if(dataset.getProjection() != null)
+//			proj = dataset.getProjection().getAbrev();
+		AffineTransform at = dataset.getAffineTransform();
+
+		assertEquals((int) at.getTranslateX(), 5000);
+		assertEquals((int) at.getTranslateY(), 5000);
+		assertEquals((int) at.getScaleX(), 2);
+		assertEquals((int) at.getScaleY(), -2);
+	}
+
+	public void testGeoPoints(GeoPointList gpList) {
+		GeoPoint p = gpList.get(0);
+
+		assertEquals((int) p.pixelPoint.getX(), 10);
+		assertEquals((int) p.pixelPoint.getY(), 10);
+		assertEquals((int) p.mapPoint.getX(), 34223);
+		assertEquals((int) p.mapPoint.getY(), 2344);
+
+		assertEquals(p.active, true);
+
+//		assertEquals((int) p.leftCenterPoint.getX(), 24223);
+//		assertEquals((int) p.leftCenterPoint.getY(), 3244);
+//		assertEquals((int) p.rightCenterPoint.getX(), 2433);
+//		assertEquals((int) p.rightCenterPoint.getY(), 6244);
+//
+//		assertEquals((int) p.leftViewPort.getExtent().minX(), 30032);
+//		assertEquals((int) p.leftViewPort.getExtent().maxY(), 2103);
+//
+//		assertEquals((int) p.rightViewPort.getExtent().minX(), 30032);
+//		assertEquals((int) p.rightViewPort.getExtent().maxY(), 2103);
+
+		assertEquals((int) p.zoomLeft, 1);
+		assertEquals((int) p.zoomRight, 1);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/io/rmf/TestRmfRead.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatistics.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatistics.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatistics.java	(revision 15423)
@@ -0,0 +1,186 @@
+/* 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;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+/**
+ * Este test prueba el calculo de estadisticas de un dataset.
+ * Comprueba que los valores obtenidos en las estadisticas son correctos.
+ *
+ * Algunos costes del calculo de estadistica en el raster completo
+ *
+ * Ordenador: AMD Athlon(tm) XP 1800+ 1540MHz, 256KB Cach�, 500M RAM
+ * 	Coste 1:
+ * 		Raster: 17910x16062, 275M (GTiff), 1 Banda byte
+ * 		Tiempo: 74.295 segs (sgtes igual)
+ * 	Coste 2:
+ * 		Raster: 8955x8031, 69M (GTiff), 1 Banda byte
+ *  	Tiempo: 18.905 segs (sgtes 3.362s)
+ *  Coste 3:
+ * 		Raster: 812x586, 2.8M (GTiff), 3 Banda short
+ *  	Tiempo: 0.925 segs (sgtes 0.152s)
+ *  Coste 4:
+ * 		Raster: 870x870, 210K (Jpeg), 3 Banda byte
+ *  	Tiempo: 0.318 segs (sgtes 0.255s)
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestStatistics extends BaseTestCase {
+	private String path1 = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	private String path2 = baseDir + "wcs16bits.tif";
+
+	private RasterDataStore   f1       = null;	
+	private RasterDataStore   f2       = null;
+	protected Buffer           raster   = null;
+	private Statistics         stats1   = null;
+	private Statistics         stats2   = null;
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	protected void doSetUp() throws Exception {
+		System.err.println("TestStatistics running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			deleteRMF(path1);
+			deleteRMF(path2);
+			f1 = manager.open(path1);
+			f2 = manager.open(path2);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		stats1 = f1.getStatistics();
+		stats2 = f2.getStatistics();
+	}
+
+	public void testStack(){
+		try {
+			stats1.calculate();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+//		print(stats1);
+		dataTestB1(stats1);
+		dataTestB2(stats1);
+		dataTestB3(stats1);
+		try {
+			stats2.calculate();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+//		print(stats2);
+		dataTestB1_2(stats2);
+		dataTestB2_2(stats2);
+		dataTestB3_2(stats2);
+	}
+
+	private void dataTestB1(Statistics stats){
+		assertEquals(new Double(stats.getMaxByteUnsigned()[0]), new Double(255.0));
+		assertEquals(new Double(stats.getMinByteUnsigned()[0]), new Double(0.0));
+		assertEquals(new Double(stats.getSecondMaxByteUnsigned()[0]), new Double(254.0));
+		assertEquals(new Double(stats.getSecondMinByteUnsigned()[0]), new Double(1.0));
+		assertEquals((int)stats.getMean()[0], 109);
+		assertEquals((int)stats.getVariance()[0], 6125);
+	}
+	
+	private void dataTestB2(Statistics stats){
+		assertEquals(new Double(stats.getMaxByteUnsigned()[1]), new Double(255.0));
+		assertEquals(new Double(stats.getMinByteUnsigned()[1]), new Double(0.0));
+		assertEquals(new Double(stats.getSecondMaxByteUnsigned()[1]), new Double(254.0));
+		assertEquals(new Double(stats.getSecondMinByteUnsigned()[1]), new Double(1.0));
+		assertEquals((int)stats.getMean()[1], 111);
+		assertEquals((int)stats.getVariance()[1], 5722);
+	}
+	
+	private void dataTestB3(Statistics stats){
+		assertEquals(new Double(stats.getMaxByteUnsigned()[2]), new Double(255.0));
+		assertEquals(new Double(stats.getMinByteUnsigned()[2]), new Double(0.0));
+		assertEquals(new Double(stats.getSecondMaxByteUnsigned()[2]), new Double(254.0));
+		assertEquals(new Double(stats.getSecondMinByteUnsigned()[2]), new Double(1.0));
+		assertEquals((int)stats.getMean()[2], 98);
+		assertEquals((int)stats.getVariance()[2], 5495);
+	}
+
+	private void dataTestB1_2(Statistics stats){
+		assertEquals(new Double(stats.getMax()[0]), new Double(1269.0));
+		assertEquals(new Double(stats.getMin()[0]), new Double(0.0));
+		assertEquals(new Double(stats.getSecondMax()[0]), new Double(1235.0));
+		assertEquals(new Double(stats.getSecondMin()[0]), new Double(6.0));
+		assertEquals((int)stats.getMean()[0], 71);
+		assertEquals((int)stats.getVariance()[0], 22678);
+	}
+
+	private void dataTestB2_2(Statistics stats){
+		assertEquals(new Double(stats.getMax()[1]), new Double(1525.0));
+		assertEquals(new Double(stats.getMin()[1]), new Double(0.0));
+		assertEquals(new Double(stats.getSecondMax()[1]), new Double(1522.0));
+		assertEquals(new Double(stats.getSecondMin()[1]), new Double(14.0));
+		assertEquals((int)stats.getMean()[1], 104);
+		assertEquals((int)stats.getVariance()[1], 37907);
+	}
+
+	private void dataTestB3_2(Statistics stats){
+		assertEquals(new Double(stats.getMax()[2]), new Double(888.0));
+		assertEquals(new Double(stats.getMin()[2]), new Double(0.0));
+		assertEquals(new Double(stats.getSecondMax()[2]), new Double(884.0));
+		assertEquals(new Double(stats.getSecondMin()[2]), new Double(13.0));
+		assertEquals((int)stats.getMean()[2], 75);
+		assertEquals((int)stats.getVariance()[2], 17437);
+	}
+
+	public void print(Statistics stats) {
+		for (int iBand = 0; iBand < f1.getBandCount(); iBand++) {
+			System.out.println("Band " + iBand);
+			System.out.println("...Max: " + stats.getMax()[iBand]);
+			System.out.println("...Min: " + stats.getMin()[iBand]);
+			System.out.println("...SecondMax: " + stats.getSecondMax()[iBand]);
+			System.out.println("...SecondMin: " + stats.getSecondMin()[iBand]);
+			System.out.println("...Mean: " + stats.getMean()[iBand]);
+			System.out.println("...Variance: " + stats.getVariance()[iBand]);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestStatistics.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineGdal.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineGdal.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineGdal.java	(revision 15423)
@@ -0,0 +1,46 @@
+/* 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;
+
+import junit.framework.TestCase;
+/**
+ * Test para validar la lectura por l�neas de un fichero tratado con gdal.
+ * Muestrea valores sobre toda la extensi�n leida y comprueba que el resultado
+ * sea correcto
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * TODO: Falta por hacer TestReadLineGdal
+ */
+public class TestReadLineGdal extends TestCase {
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestReadLineGdal running...");
+	}
+	
+	public void testStack(){
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestReadLineGdal.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterBufferSizeMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterBufferSizeMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterBufferSizeMrSID.java	(revision 15423)
@@ -0,0 +1,115 @@
+/* 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;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+
+/**
+ * Test que compara los resultados de la llamada getWindowRaster en coordenadas pixel 
+ * y coordenadas reales para comprobar que producen el mismo resultado para la misma extensi�n
+ * y el mismo tama�o de buffer.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestGetWindowRasterBufferSizeMrSID extends BaseTestCase {
+	private String path1 = baseDir + "q101866.sid";
+	private RasterDataStore   f1       = null;	
+	private RasterDataStore   f2       = null;
+	private RasterQuery        query    = null;
+	protected Buffer           buf1     = null;
+	protected Buffer           buf2     = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestGetWindowRasterBufferSizeMrSID running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			f2 = manager.open(path1);
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		query = manager.createQuery();
+		query.setAllDrawableBands();
+		try {
+			Extent extent = RasterLocator.getManager().getDataStructFactory().createExtent(f1.getExtent().getMin().getX(), f1.getExtent().getMin().getY(), f1.getExtent().getMax().getX(), f1.getExtent().getMax().getY());
+			query.setAreaOfInterest(extent, 100, 100);
+			buf1 = f1.query(query);
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		} catch (InvalidSetViewException e1) {
+			e1.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			query.setAreaOfInterest(0, 0, (int)f2.getWidth(), (int)f2.getHeight(), 100, 100);
+			buf2 = f2.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+		
+		for (int band = 0; band < buf1.getBandCount(); band++) {
+			for (int row = 0; row < buf1.getHeight(); row++) {
+				for (int col = 0; col < buf1.getWidth(); col++) {
+					//try {
+					assertEquals(buf1.getElemByte(row, col, band), buf2.getElemByte(row, col, band));
+					//System.out.println(buf1.getElemByte(row, col, band) + " " + buf2.getElemByte(row, col, band));
+					/*} catch (AssertionFailedError e) {
+						System.out.println(band + " " + line + " " + column);
+						
+					}*/
+				}
+			}
+		}
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestGetWindowRasterBufferSizeMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestCompositeTilesSimplification.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestCompositeTilesSimplification.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestCompositeTilesSimplification.java	(revision 15423)
@@ -0,0 +1,128 @@
+/* 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;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestCompositeTilesSimplification extends BaseTestCase {
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	public void testStack() throws Exception {
+		doSetUp();
+		System.err.println("TestCompositeTilesSimplification running...");
+		Integer[][] result = null;
+
+		Integer[][] values = new Integer[10][10];
+		for (int row = 3; row < 5; row++)
+			for (int col = 3; col < 5; col++)
+				values[row][col] = new Integer(new String(row + "" + col));
+			
+		result = compress(values);
+		show(result);
+		
+		values = new Integer[10][10];
+		for (int row = 0; row < 5; row++)
+			for (int col = 0; col < 5; col++)
+				values[row][col] = new Integer(new String(row + "" + col));
+		
+		result = compress(values);
+		show(result);
+		
+		values = new Integer[10][10];
+		for (int row = 5; row < 10; row++)
+			for (int col = 5; col < 10; col++)
+				values[row][col] = new Integer(new String(row + "" + col));
+		
+		result = compress(values);
+		show(result);
+	}
+	
+	private Integer[][] compress(Integer[][] values) {
+		int n = values.length;
+		int m = values[0].length;
+		int posInitX = 0;
+		int posInitY = 0;
+		
+		int nRows = n, nCols = m;
+		//Contador de filas
+		boolean first = true;
+		for (int row = 0; row < n; row++) {
+			boolean isNull = true;
+			for (int col = 0; col < m; col++) {
+				if(values[row][col] != null) {
+					isNull = false;
+					if(first) {
+						posInitX = col;
+						first = false;
+					}
+				}
+			}			
+			if(isNull)
+				nRows --;
+		}
+		
+		//Contador de columnas
+		first = true;
+		for (int col = 0; col < m; col++) {
+			boolean isNull = true;
+			for (int row = 0; row < n; row++) {
+				if(values[row][col] != null) {
+					isNull = false;
+					if(first) {
+						posInitY = row;
+						first = false;
+					}
+				}
+			}			
+			if(isNull)
+				nCols --;
+		}
+		System.out.println("Rows:" + nRows + " Cols:" + nCols );
+		//Copia de datos
+		Integer[][] result = new Integer[nRows][nCols];
+		
+		System.out.println("posInitX:" + posInitX + " posInitY:" + posInitY );
+		
+		for (int row = 0; row < result.length; row++) 
+			for (int col = 0; col < result[row].length; col++) 
+				result[row][col] = values[row + posInitY][col + posInitX];
+		return result;
+	}
+	
+	private void show(Integer[][] result) {
+		for (int row = 0; row < result.length; row++) { 
+			for (int col = 0; col < result[row].length; col++) { 
+				System.out.print(result[row][col].intValue() + " ");
+			}
+			System.out.println();
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestCompositeTilesSimplification.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelGdal.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelGdal.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelGdal.java	(revision 15423)
@@ -0,0 +1,46 @@
+/* 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;
+
+import junit.framework.TestCase;
+/**
+ * Este test que obtiene la informaci�n de un �nico pixel. Repetira esta
+ * operaci�n sobre varios pixels sobre una misma imagen comprobado que los resultados
+ * sean correctos, es decir para la posici�n seleccionada existe ese pixel obtenido.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * TODO: Falta por hacer TestDataByPixelGdal
+ */
+public class TestDataByPixelGdal extends TestCase{
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestDataByPixelGdal running...");
+	}
+	
+	public void testStack(){
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/dataset/TestDataByPixelGdal.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasourceSelectingBands.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasourceSelectingBands.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasourceSelectingBands.java	(revision 15423)
@@ -0,0 +1,168 @@
+/* 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.grid;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.impl.grid.GridImpl;
+
+/**
+ * Este test prueba el acceso a datos a traves de un grid.
+ * A partir de una fuente de datos (cargada en el constructor del Grid). 
+ * 1-F32 Monobanda: Se har� una petici�n del extent completo de la fuente seleccionando tres bandas.
+ * 2-Comprobamos el tipo de datos el ancho y el alto
+ * 3-Modifica algunos valores del grid y se comprueba que las modificaciones han sido efectivas.
+ * 4-Cambiamos la banda a operar y obtenemos un dato comprobando que tiene que devolver NoData
+ * 
+ * 1-RGB: Se har� una petici�n del extent completo de la fuente seleccionando tres bandas.
+ * 2-Comprobamos el tipo de datos el ancho y el alto
+ * 3-Modifica algunos valores del grid y se comprueba que las modificaciones han sido efectivas.
+ * 4-Cambiamos la banda a operar y obtenemos un dato comprobando que el valor que devuelve es correcto
+ * 5 -Comprobamos que si nos salimos devuelve un NoData
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestGridReadingFullDatasourceSelectingBands extends BaseTestCase {
+	private String path1               = baseDir + "miniRaster28x25F32.tif";
+	private String path2               = baseDir + "miniRaster25x24.tif";
+	private RasterDataStore   f1       = null;
+	private RasterDataStore   f2       = null;
+	protected Buffer          buf1     = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TGReadingFullDatasourceSelectingBands running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			f2 = manager.open(path2);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		int[] drawableBands = {0, 1, 2};
+		try {
+			Grid g = new GridImpl(f1, drawableBands);
+			g.setNoDataValue(-99999);
+			assertEquals(g.getDataType(), 4); //Tipo float
+			assertEquals(g.getNY(), 25); //Alto
+			assertEquals(g.getNX(), 28); //Ancho
+
+			testCellBufferFloat(g, 0);
+			g.setCellValue(0, 0, (float)31.22);
+			g.setCellValue(2, 2, (float)31.22);
+			g.setCellValue(3, 8, (float)31.22);
+			g.setCellValue(10, 15, (float)31.22);
+			testCellBufferFloat(g, 0);
+			assertEquals((int)g.getCellValueAsFloat(0, 0), 31);
+			assertEquals((int)g.getCellValueAsFloat(2, 2), 31);
+			assertEquals((int)g.getCellValueAsFloat(3, 8), 31);
+			assertEquals((int)g.getCellValueAsFloat(10, 15), 31);
+//			g.setBandToOperate(2);
+			assertEquals((int)g.getCellValueAsFloat(1000, 1000), -99999);
+			
+			g = new GridImpl(f2, drawableBands);
+			g.setNoDataValue(-99999);
+			assertEquals(g.getDataType(), 0); //Tipo byte
+			assertEquals(g.getNY(), 24); //Alto
+			assertEquals(g.getNX(), 25); //Ancho
+			testCellBufferByte(g, 0);
+			g.setCellValue(0, 0, (byte)31);
+			g.setCellValue(2, 2, (byte)31);
+			g.setCellValue(3, 8, (byte)31);
+			g.setCellValue(10, 15, (byte)31);
+			testCellBufferByte(g, 0);
+			assertEquals(g.getCellValueAsByte(0, 0), 31);
+			assertEquals(g.getCellValueAsByte(2, 2), 31);
+			assertEquals(g.getCellValueAsByte(3, 8), 31);
+			assertEquals(g.getCellValueAsByte(10, 15), 31);
+			g.setBandToOperate(2);
+			assertEquals((int)g.getCellValueAsByte(10, 15), 107);
+			
+			//Comprobamos que si nos salimos devuelve un NoData
+			assertEquals((int)g.getCellValueAsFloat(100, 100), -99999);
+			assertEquals((int)g.getCellValueAsFloat(-1, 10), -99999);
+			assertEquals((int)g.getCellValueAsFloat(1000, 2310), -99999);
+			
+		} catch (RasterBufferInvalidException e1) {
+			e1.printStackTrace();
+		} catch (RasterBufferInvalidAccessException e2) {
+			e2.printStackTrace();
+		} catch (OutOfGridException e3) {
+			e3.printStackTrace();
+		} catch (GridException e3) {
+			e3.printStackTrace();
+		}
+	}
+		
+	/**
+	 * Compara todos los elementos del buffer con los del grid para comprobar
+	 * la correcci�n de la lectura.
+	 * @param g
+	 * @throws RasterBufferInvalidAccessException
+	 */
+	private void testCellBufferFloat(Grid g, int band) throws RasterBufferInvalidAccessException, GridException {
+		int nCols = (int)f1.getWidth();
+		int nRows = (int)f1.getHeight(); 
+		for(int i = 0; i < nRows; i ++) {
+			for(int j = 0; j < nCols; j ++)
+				assertEquals((int)g.getCellValueAsFloat(j, i), (int)g.getRasterBuf().getElemFloat(i, j, band));
+		}
+	}
+
+	/**
+	 * Compara todos los elementos del buffer con los del grid para comprobar
+	 * la correcci�n de la lectura.
+	 * @param g
+	 * @throws RasterBufferInvalidAccessException
+	 */
+	private void testCellBufferByte(Grid g, int band) throws RasterBufferInvalidAccessException, GridException {
+		int nCols = (int)f2.getWidth();
+		int nRows = (int)f2.getHeight(); 
+		for(int i = 0; i < nRows; i ++) {
+			for(int j = 0; j < nCols; j ++)
+				assertEquals((int)g.getCellValueAsByte(j, i), (int)g.getRasterBuf().getElemByte(i, j, band));
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasourceSelectingBands.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/RasterFilterForTest.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/RasterFilterForTest.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/RasterFilterForTest.java	(revision 15423)
@@ -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.fmap.dal.coverage.grid.filter;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.raster.impl.store.ParamsImpl;
+
+/**
+ * Filtro para de prueba para el test TestRasterFilterList
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+
+public class RasterFilterForTest extends BaseRasterFilter {
+	public static String[] names = new String[] {"test"};
+
+	public RasterFilterForTest() {
+		setName(names[0]);
+	}
+
+	public String getGroup() {
+		return null;
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public int getOutRasterDataType() {
+		return 0;
+	}
+
+	public Object getResult(String name) {
+		return null;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		return params;
+	}
+
+	public void post() {
+	}
+
+	public void pre() {
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public boolean isVisible() {
+		return false;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/RasterFilterForTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/UITestConvolution.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/UITestConvolution.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/UITestConvolution.java	(revision 15423)
@@ -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.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.grid.filter;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.impl.grid.filter.convolution.ConvolutionUI;
+/**
+ * Clase para poder ver la ventana de las Tablas de color
+ *
+ * @version 28/09/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class UITestConvolution {
+	private JFrame 			frame = new JFrame();
+
+	public UITestConvolution() {
+		super();
+		initialize();
+	}
+
+	public static void main(String[] args){
+		new UITestConvolution();
+	}
+
+	private void initialize() {
+		ConvolutionUI ui = new ConvolutionUI(null);
+		frame.setContentPane(ui);
+		frame.setSize(new java.awt.Dimension(220, 190));
+		frame.setResizable(true);
+		frame.setTitle("Convolution");
+		frame.setVisible(true);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/UITestConvolution.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestRasterFilterList.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestRasterFilterList.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestRasterFilterList.java	(revision 15423)
@@ -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.fmap.dal.coverage.grid.filter;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList;
+/**
+ * Este test prueba la lista de filtros.
+ * Mete n filtros en la lista y asigna prioridades para comprobar luego que la lista
+ * est� en el orden correcto. Se comprueban las operaciones de eliminar filtro por
+ * prioridad, por nombre y por objeto y sustituir filtro por posici�n y por nombre.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestRasterFilterList extends BaseTestCase {
+	private boolean               show       = false;
+	private int                   nFilters   = 7;
+	private RasterFilterForTest[] filterList = null;
+	private RasterFilterList      list       = null;
+
+	protected void doSetUp() throws Exception {
+		System.err.println("TestRasterFilterList running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		list = new DefaultRasterFilterList();
+		try {
+			initList();
+		} catch (FilterTypeException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	public void testStack() {
+		if (show)
+			System.out.println("Lista completa");
+		for (int i = 0; i < list.lenght(); i++) {
+			if (show)
+				System.out.println(" Name: " + ((RasterFilter) list.get(i)).getName());
+			assertEquals(((RasterFilter) list.get(i)).getName(), "filtro" + (i + 1));
+		}
+		try {
+			initList();
+
+			list.remove("filtro5");
+
+			list.remove("filtro2");
+			if (show)
+				System.out.println("Completa menos filtros 5 y 2");
+			for (int i = 0; i < list.lenght(); i++) {
+				if (show)
+					System.out.println(" Name: " + ((RasterFilter) list.get(i)).getName());
+				switch (i) {
+					case 0:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro1");
+						break;
+					case 1:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro3");
+						break;
+					case 2:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro4");
+						break;
+					case 3:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro6");
+						break;
+					case 4:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro7");
+						break;
+				}
+			}
+
+			initList();
+			RasterFilter rf = new RasterFilterForTest();
+			rf.setName("filtroNew");
+			list.replace(rf, "filtro3");
+			if (show)
+				System.out.println("Completa reemplazando el filtro3 por filtroNew");
+			for (int i = 0; i < list.lenght(); i++) {
+				if (show)
+					System.out.println("Name: " + ((RasterFilter) list.get(i)).getName());
+				switch (i) {
+					case 0:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro1");
+						break;
+					case 1:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro2");
+						break;
+					case 2:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtroNew");
+						break;
+					case 3:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro4");
+						break;
+					case 4:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro5");
+						break;
+					case 5:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro6");
+						break;
+					case 6:
+						assertEquals(((RasterFilter) list.get(i)).getName(), "filtro7");
+						break;
+				}
+			}
+
+			initList();
+			list.remove(RasterFilterForTest.class);
+			if (show)
+				System.out.println("Eliminar por clase");
+			for (int i = 0; i < list.lenght(); i++)
+				if (show)
+					System.out.println("Name: " + ((RasterFilter) list.get(i)).getName());
+			assertEquals(list.lenght(), 0);
+		} catch (FilterTypeException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Crea la lista
+	 * @throws FilterTypeException
+	 */
+	private void initList() throws FilterTypeException {
+		list.clear();
+		filterList = new RasterFilterForTest[nFilters];
+		for (int i = 0; i < nFilters; i++) {
+			filterList[i] = new RasterFilterForTest();
+			filterList[i].setName("filtro" + (i + 1));
+		}
+
+		for (int i = 0; i < nFilters; i++)
+			list.add(filterList[i]);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestRasterFilterList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestControlTypes.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestControlTypes.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestControlTypes.java	(revision 15423)
@@ -0,0 +1,109 @@
+/* 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.grid.filter;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.grid.filter.enhancement.BrightnessContrastListManager;
+import org.gvsig.raster.impl.grid.filter.enhancement.EnhancementStretchListManager;
+import org.gvsig.raster.impl.grid.filter.enhancement.LinearStretchEnhancementFilter;
+import org.gvsig.raster.impl.grid.filter.enhancement.DefaultLinearStretchParams;
+/**
+ * Dada una pila de filtros con filtros de tipos heterogeneos. Elimina uno del 
+ * medio y ejecuta controlTypes de RasterFilterListManager. Despu�s comprueba 
+ * que los tipo siguen siendo correctos.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestControlTypes extends BaseTestCase {
+	private RasterFilterList		list = new DefaultRasterFilterList();
+	private String path1 = baseDir + "miniRaster28x25F32.tif";
+	private RasterDataStore f1 = null;
+
+	protected void doSetUp() throws Exception {
+		System.err.println("TestControlTypes running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	public void testStack() {
+		Buffer buf = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_DOUBLE, 10, 10, 3, true);
+		list.setInitRasterBuf(buf);
+		RasterFilterListManagerImpl fmanager = new RasterFilterListManagerImpl(list);
+		EnhancementStretchListManager m0 = (EnhancementStretchListManager) fmanager.getManagerByClass(EnhancementStretchListManager.class);
+		BrightnessContrastListManager m1 = (BrightnessContrastListManager)fmanager.getManagerByClass(BrightnessContrastListManager.class);
+
+		try {
+			// Metemos Short, Short, Byte, Byte
+			list.clear();
+			buf = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_SHORT, 10, 10, 3, true);
+			list.setInitRasterBuf(buf);
+			m1.addContrastFilter(12);
+			m1.addBrightnessFilter(10);
+			try {
+				m0.addEnhancedStretchFilter(DefaultLinearStretchParams.createStandardParam(new int[] { 0, 1, 2 }, 0.0, f1.getStatistics(), true), f1.getStatistics(), new int[] { 0, 1, 2 }, false);
+			} catch (FileNotOpenException e) {
+				e.printStackTrace();
+			} catch (RasterDriverException e) {
+				e.printStackTrace();
+			}
+			m1.addBrightnessFilter(10);
+
+			// Eliminamos el filtro de realce
+			list.remove(LinearStretchEnhancementFilter.names[0]);
+			fmanager.controlTypes();
+
+			// Ahora los tres que quedan deben ser byte
+			for (int i = 0; i < list.lenght(); i++)
+				assertEquals(list.getOutDataType(), Buffer.TYPE_BYTE);
+		} catch (FilterTypeException exc) {
+
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/filter/TestControlTypes.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridInstanciation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridInstanciation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridInstanciation.java	(revision 15423)
@@ -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.fmap.dal.coverage.grid;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.impl.grid.GridExtentImpl;
+import org.gvsig.raster.impl.grid.GridImpl;
+
+/**
+ * 
+ * 10/06/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class TestGridInstanciation extends BaseTestCase {
+	private String path1 = baseDir + "miniRaster28x25F32.tif";
+	private String outImage = "prueba.asc";
+	private RasterDataStore f1 = null;
+	private Grid grid = null; 
+	
+    public void start() throws Exception {
+        this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("GridInstanciationTest running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			Extent ext = f1.getExtent();
+			GridExtent windowExtent = new GridExtentImpl(ext, 5, -5);		
+			grid = new GridImpl(f1, new int[]{0, 1, 2}, windowExtent);
+			
+			grid.loadWriterData();
+			grid.exportToArcViewASCIIFile(outImage);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (RasterBufferInvalidException e) {
+			e.printStackTrace();
+		} catch (GridException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridInstanciation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridOperations.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridOperations.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridOperations.java	(revision 15423)
@@ -0,0 +1,156 @@
+/* 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.grid;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridCell;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.raster.impl.grid.GridExtentImpl;
+import org.gvsig.raster.impl.grid.GridImpl;
+
+/**
+ * Testea las operaciones de Grid. Las operaciones testeadas son las siguiente:
+ * <UL>
+ * <LI>Multiplica el grid por un valor</LI>
+ * <LI>Suma de grids</LI>
+ * <LI>Sobreescritura de un grid con los datos de otro</LI>
+ * <LI>Ordenar celdas</LI>
+ * <LI>Media, m�nimo y m�ximo de un grid</LI>
+ * </UL>
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestGridOperations extends BaseTestCase {
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TGOperations running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	public void testStack(){
+		try {
+			GridExtent layerExtent = new GridExtentImpl(1000, 1000, 1500, 1500, 100);
+			Grid g1 = new GridImpl(layerExtent, layerExtent, Buffer.TYPE_INT, new int[]{0, 1, 2});
+			init(g1);
+			
+			//Multiplicar por un entero
+			g1.multiply(2);
+			int[][] m1 = new int[][]{{0, 2, 4, 6, 8}, {2, 4, 6, 8, 10}, {4, 6, 8, 10, 12}, {6, 8, 10, 12, 14}, {8, 10, 12, 14, 16}};
+			compare(m1, g1);
+					
+			//Sumar dos grids
+			Grid g2 = new GridImpl(layerExtent, layerExtent, Buffer.TYPE_INT, new int[]{0, 1, 2});
+			init(g1);
+			init(g2);
+			g1.add(g2);
+			compare(m1, g1);
+			
+			//Sobreescritura
+			g2.assign(g1);
+			compare(m1, g1);
+			//print(g1);
+			
+			//Celdas ordenadas
+			GridCell[] cells = g1.getSortedArrayOfCells();
+			int[] values = new int[]{0, 2, 2, 4, 4, 4, 6, 6, 6, 6, 8, 8, 8, 8, 8, 10, 10, 10, 10, 12, 12, 12, 14, 14, 16};
+			compareArray(values, cells);
+			
+			//Media de un grid (getMeanValue)
+			init(g1);
+			g1.setBandToOperate(0);
+			g1.getStatistics().calcFullStatistics();
+			assertEquals((int)g1.getStatistics().getMeanValue(), 4);
+			assertEquals((int)g1.getStatistics().getMinValue(), 0);
+			assertEquals((int)g1.getStatistics().getMaxValue(), 8);
+			
+			
+		} catch (RasterBufferInvalidException e1) {
+			e1.printStackTrace();
+		}  catch (OutOfGridException e3) {
+			e3.printStackTrace();
+		} catch (RasterBufferInvalidAccessException e) {
+			e.printStackTrace();
+		} catch (GridException e) {
+			e.printStackTrace();
+		} catch (BandAccessException e) {
+			e.printStackTrace();
+		} catch (FileNotOpenException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	private void init(Grid g) throws OutOfGridException{
+		for (int i = 0; i < g.getNX(); i++) {
+			for (int j = 0; j < g.getNY(); j++)
+				g.setCellValue(j, i, (int)(j + i));
+		}
+	}
+	
+	private void compare(int[][] m, Grid g) throws RasterBufferInvalidAccessException, GridException {
+		for(int line = 0; line < g.getNY(); line++){
+			for(int col = 0; col < g.getNX(); col++)
+				assertEquals(g.getCellValueAsInt(col, line), m[line][col]);
+		}
+	}
+	
+	private void compareArray(int[] a, GridCell[] cells) throws RasterBufferInvalidAccessException {
+		for (int i = 0; i < cells.length; i++) 
+			assertEquals((int)cells[i].getValue(), (int)cells[i].getValue());
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 * @throws RasterBufferInvalidAccessException 
+	 */
+	/*private void print(Grid g) throws RasterBufferInvalidAccessException {
+		for(int line = 0; line < g.getNY(); line++){
+			for(int col = 0; col < g.getNX(); col++)
+				System.out.print(g.getCellValueAsInt(col, line) + " ");
+			System.out.println();
+		}
+		System.out.println();
+	}*/
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridOperations.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/roi/TestRasterROI.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/roi/TestRasterROI.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/roi/TestRasterROI.java	(revision 15423)
@@ -0,0 +1,137 @@
+/* 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.grid.roi;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.grid.Grid;
+import org.gvsig.raster.impl.grid.GridExtentImpl;
+import org.gvsig.raster.impl.grid.GridImpl;
+import org.gvsig.raster.impl.grid.roi.RasterROI;
+
+public class TestRasterROI extends BaseTestCase {
+	
+	Grid grid = null;
+	GridExtent extent = null;
+	int cellSize = 1;
+	double xMin = 0;
+	double xMax = 10;
+	double yMin = 0;
+	double yMax = 10;
+	RasterROI rasterROI = null;
+	
+	protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		int bands[] = {0};
+		extent = new GridExtentImpl();
+		extent.setCellSize(cellSize);
+		extent.setXRange(xMin, xMax);
+		extent.setYRange(yMin, yMax);
+		try {
+			grid = new GridImpl(extent, extent, Buffer.TYPE_DOUBLE, bands);
+			for (int x = 0; x<5; x++)
+				for (int y = 0; y<5; y++){
+					grid.setCellValue(x, y, 0.0);
+				}
+			for (int x = 5; x<xMax; x++)
+				for (int y = 0; y<5; y++){
+					grid.setCellValue(x, y, 1.0);
+				}
+			for (int x = 0; x<5; x++)
+				for (int y = 5; y<10; y++){
+					grid.setCellValue(x, y, 2.0);
+				}
+			for (int x = 5; x<10; x++)
+				for (int y = 5; y<10; y++){
+					grid.setCellValue(x, y, 3.0);
+				}
+		} catch (RasterBufferInvalidException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		} catch (OutOfGridException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+		
+	}
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	public void testStack() {
+		
+		rasterROI = new RasterROI(grid);
+		rasterROI.addPoint(0,0);
+		rasterROI.addPoint(0,1);
+		rasterROI.addPoint(1,0);
+		rasterROI.addPoint(1,1);
+		
+
+		try {
+			assertEquals(0.0,rasterROI.getMaxValue(),0.0);
+			assertEquals(0.0,rasterROI.getMeanValue(),0.0);
+			assertEquals(0.0,rasterROI.getMinValue(),0.0);
+		} catch (GridException e) {
+			e.printStackTrace();
+		}
+		
+		rasterROI.clear();
+		rasterROI.addPoint(8,8);
+		rasterROI.addPoint(9,8);
+		rasterROI.addPoint(8,9);
+		rasterROI.addPoint(9,9);
+		
+		try {
+			assertEquals(3.0,rasterROI.getMaxValue(),0.0);
+			assertEquals(3.0,rasterROI.getMeanValue(),0.0);
+			assertEquals(3.0,rasterROI.getMinValue(),0.0);
+		} catch (GridException e) {
+			e.printStackTrace();
+		}
+		
+		rasterROI.clear();
+		rasterROI.addPoint(4,4);
+		rasterROI.addPoint(5,4);
+		rasterROI.addPoint(4,5);
+		rasterROI.addPoint(5,5);
+		
+		try {
+			assertEquals(3.0,rasterROI.getMaxValue(),0.0);
+			assertEquals(1.5,rasterROI.getMeanValue(),0.0);
+			assertEquals(0.0,rasterROI.getMinValue(),0.0);	
+		} catch (GridException e) {
+			e.printStackTrace();
+		}
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/roi/TestRasterROI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasource.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasource.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasource.java	(revision 15423)
@@ -0,0 +1,167 @@
+/* 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.grid;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.impl.grid.GridImpl;
+
+/**
+ * Este test prueba el acceso a datos a traves de un grid.
+ * A partir de una fuente de datos (cargada en el constructor del Grid). 
+ * 1-F32 Monobanda: Se har� una petici�n del extent completo de la fuente seleccionando tres bandas.
+ * 2-Comprobamos el tipo de datos el ancho y el alto
+ * 3-Modifica algunos valores del grid y se comprueba que las modificaciones han sido efectivas.
+ * 4-Cambiamos la banda a operar y obtenemos un dato comprobando que tiene que devolver NoData
+ * 
+ * 1-RGB: Se har� una petici�n del extent completo de la fuente seleccionando tres bandas.
+ * 2-Comprobamos el tipo de datos el ancho y el alto
+ * 3-Modifica algunos valores del grid y se comprueba que las modificaciones han sido efectivas.
+ * 4-Cambiamos la banda a operar y obtenemos un dato comprobando que el valor que devuelve es correcto
+ * 5 -Comprobamos que si nos salimos devuelve un NoData
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestGridReadingFullDatasource extends BaseTestCase {
+	private String path1 = baseDir + "miniRaster28x25F32.tif";
+	private String path2 = baseDir + "miniRaster25x24.tif";
+	private RasterDataStore   f1       = null;
+	private RasterDataStore   f2       = null;
+	protected Buffer           buf1     = null;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TGReadingFullDatasourceSelectingBands running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f1 = manager.open(path1);
+			f2 = manager.open(path2);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		try {
+			Grid g = new GridImpl(f1);
+			g.setNoDataValue(-99999);
+			assertEquals(g.getDataType(), 4); //Tipo float
+			assertEquals(g.getNY(), 25); //Alto
+			assertEquals(g.getNX(), 28); //Ancho
+
+			testCellBufferFloat(g, 0);
+			g.setCellValue(0, 0, (float)31.22);
+			g.setCellValue(2, 2, (float)31.22);
+			g.setCellValue(3, 8, (float)31.22);
+			g.setCellValue(10, 15, (float)31.22);
+			testCellBufferFloat(g, 0);
+			assertEquals((int)g.getCellValueAsFloat(0, 0), 31);
+			assertEquals((int)g.getCellValueAsFloat(2, 2), 31);
+			assertEquals((int)g.getCellValueAsFloat(3, 8), 31);
+			assertEquals((int)g.getCellValueAsFloat(10, 15), 31);
+//			g.setBandToOperate(2);
+			assertEquals((int)g.getCellValueAsFloat(10000, 10000), -99999);
+			
+			g = new GridImpl(f2);
+			g.setNoDataValue(-99999);
+			assertEquals(g.getDataType(), 0); //Tipo byte
+			assertEquals(g.getNY(), 24); //Alto
+			assertEquals(g.getNX(), 25); //Ancho
+			testCellBufferByte(g, 0);
+			g.setCellValue(0, 0, (byte)31);
+			g.setCellValue(2, 2, (byte)31);
+			g.setCellValue(3, 8, (byte)31);
+			g.setCellValue(10, 15, (byte)31);
+			testCellBufferByte(g, 0);
+			assertEquals(g.getCellValueAsByte(0, 0), 31);
+			assertEquals(g.getCellValueAsByte(2, 2), 31);
+			assertEquals(g.getCellValueAsByte(3, 8), 31);
+			assertEquals(g.getCellValueAsByte(10, 15), 31);
+			g.setBandToOperate(2);
+			assertEquals((int)g.getCellValueAsByte(10, 15), 107);
+			
+			//Comprobamos que si nos salimos devuelve un NoData
+			assertEquals((int)g.getCellValueAsFloat(100, 100), -99999);
+			assertEquals((int)g.getCellValueAsFloat(-1, 10), -99999);
+			assertEquals((int)g.getCellValueAsFloat(1000, 2310), -99999);
+			
+		} catch (RasterBufferInvalidException e1) {
+			e1.printStackTrace();
+		} catch (RasterBufferInvalidAccessException e2) {
+			e2.printStackTrace();
+		} catch (OutOfGridException e3) {
+			e3.printStackTrace();
+		} catch (GridException e3) {
+			e3.printStackTrace();
+		}
+	}
+		
+	/**
+	 * Compara todos los elementos del buffer con los del grid para comprobar
+	 * la correcci�n de la lectura.
+	 * @param g
+	 * @throws RasterBufferInvalidAccessException
+	 */
+	private void testCellBufferFloat(Grid g, int band) throws RasterBufferInvalidAccessException, GridException {
+		int nCols = (int)f1.getWidth();
+		int nRows = (int)f1.getHeight(); 
+		for(int i = 0; i < nRows; i ++) {
+			for(int j = 0; j < nCols; j ++)
+				assertEquals((int)g.getCellValueAsFloat(j, i), (int)g.getRasterBuf().getElemFloat(i, j, band));
+		}
+	}
+
+	/**
+	 * Compara todos los elementos del buffer con los del grid para comprobar
+	 * la correcci�n de la lectura.
+	 * @param g
+	 * @throws RasterBufferInvalidAccessException
+	 */
+	private void testCellBufferByte(Grid g, int band) throws RasterBufferInvalidAccessException, GridException {
+		int nCols = (int)f2.getWidth();
+		int nRows = (int)f2.getHeight(); 
+		for(int i = 0; i < nRows; i ++) {
+			for(int j = 0; j < nCols; j ++)
+				assertEquals((int)g.getCellValueAsByte(j, i), (int)g.getRasterBuf().getElemByte(i, j, band));
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridReadingFullDatasource.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/render/TestFormatArrayRender.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/render/TestFormatArrayRender.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/render/TestFormatArrayRender.java	(revision 15423)
@@ -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.fmap.dal.coverage.grid.render;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.raster.impl.grid.render.DefaultRender;
+import org.gvsig.raster.impl.store.DefaultMultiRasterStore;
+
+
+/**
+ * Test para probar la funcionalidad de formateo de array de renderizaci�n
+ * AUTO:OK
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestFormatArrayRender extends BaseTestCase {
+	private DefaultRender r = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("FormatArrayRenderTest running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		r = new DefaultRender(new DefaultMultiRasterStore());
+	}
+	
+	public void testStack(){
+		int[] out = r.formatArrayRenderBand(new int[]{0, 1, 2});
+		validation(out, new int[]{0, 1, 2});
+		//show(out);
+		out = r.formatArrayRenderBand(new int[]{-1, 1, 2});
+		validation(out, new int[]{1, 2});
+		//show(out);
+		out = r.formatArrayRenderBand(new int[]{-1, 0, -1});
+		validation(out, new int[]{0});
+		//show(out);
+		out = r.formatArrayRenderBand(new int[]{-1, -1, 0, 3, -1, 1, -1});
+		validation(out, new int[]{0, 3, 1});
+		//show(out);
+	}
+	
+	private void validation(int[] a, int[] b){
+		if(a.length != b.length)
+			fail();
+		for(int i = 0; i < a.length; i++)
+			assertEquals(a[i], b[i]);
+	}
+	
+	/*private void show(int[] out){
+		for(int i = 0; i < out.length; i++)
+			System.out.print(out[i] + " ");
+		System.out.println();
+	}*/
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/render/TestFormatArrayRender.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridEmptyBufferForWrite.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridEmptyBufferForWrite.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridEmptyBufferForWrite.java	(revision 15423)
@@ -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.fmap.dal.coverage.grid;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.raster.impl.grid.GridExtentImpl;
+import org.gvsig.raster.impl.grid.GridImpl;
+import org.gvsig.raster.impl.grid.GridInterpolated;
+/**
+ * Este test prueba el acceso a datos a traves de un grid.
+ * 
+ * 1-Crear� un buffer vacio para escritura con la extensi�n pasado por
+ *   par�metro. El extent completo ser� igual que el extent de la vista asignada
+ *   (SIN INTERPOLACI�N).
+ * 2-Comprueba que se calcule bien el n�mero de pixels
+ * 3-Asigna datos al grid
+ * 4-Los recupera comprobando que est�n bien asignados
+ * 
+ * 1-Crear� un buffer vacio para escritura con la extensi�n pasado por
+ *   par�metro. El extent completo ser� distinto que el extent de la vista
+ *   asignada (CON INTERPOLACI�N).
+ * 2-Comprueba que se calcule bien el n�mero de pixels
+ * 3-Asigna datos al grid
+ * 4-Los recupera con distintos m�todos de interpolaci�n comprobando que est�n
+ *   bien asignados
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestGridEmptyBufferForWrite extends BaseTestCase {
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TGEmptyBufferForWrite running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	public void testStack() {
+		try {
+			// SIN INTERPOLACI�N
+			GridExtent layerExtent = new GridExtentImpl(1000, 1000, 1500, 1500, 50);
+			Grid g = new GridImpl(layerExtent, layerExtent, Buffer.TYPE_INT, new int[] { 0, 1, 2 });
+
+			// Tama�o en pixels
+			assertEquals(layerExtent.getNX(), 10);
+			assertEquals(layerExtent.getNY(), 10);
+			assertEquals(g.getNX(), 10);
+			assertEquals(g.getNY(), 10);
+
+			for (int i = 0; i < g.getNX(); i++) {
+				for (int j = 0; j < g.getNY(); j++)
+					g.setCellValue(j, i, (int) (j * i));
+			}
+			// print(g);
+			for (int i = 0; i < g.getNX(); i++) {
+				for (int j = 0; j < g.getNY(); j++)
+					assertEquals(g.getCellValueAsInt(j, i), (int) (j * i));
+			}
+
+			// CON INTERPOLACI�N
+			GridExtent windowExtent = new GridExtentImpl(1125, 1125, 1375, 1375, 50);
+			layerExtent = new GridExtentImpl(1000, 1000, 1500, 1500, 50);
+			g = new GridImpl(layerExtent, windowExtent, Buffer.TYPE_INT, new int[] { 0, 1, 2 });
+
+			// Tama�o en pixels
+			assertEquals(layerExtent.getNX(), 10);
+			assertEquals(layerExtent.getNY(), 10);
+			assertEquals(g.getNX(), 5);
+			assertEquals(g.getNY(), 5);
+
+			for (int i = 0; i < g.getLayerNX(); i++) {
+				for (int j = 0; j < g.getLayerNY(); j++)
+					g.setCellValue(j, i, (int) (j * i));
+			}
+			g.setInterpolationMethod(GridInterpolated.INTERPOLATION_BicubicSpline);
+			int[][] m1 = new int[][] { { 9, 12, 15, 18, 21 }, { 12, 16, 20, 24, 28 }, { 15, 20, 25, 30, 35 }, { 18, 24, 30, 36, 42 }, { 21, 28, 35, 42, 49 } };
+			// print(g);
+			compare(m1, g);
+
+			g.setInterpolationMethod(GridInterpolated.INTERPOLATION_NearestNeighbour);
+			// print(g);
+			int[][] m2 = new int[][] { { 9, 12, 15, 18, 21 }, { 12, 16, 20, 24, 28 }, { 15, 20, 25, 30, 35 }, { 18, 24, 30, 36, 42 }, { 21, 28, 35, 42, 49 } };
+			compare(m2, g);
+
+			g.setInterpolationMethod(GridInterpolated.INTERPOLATION_Bilinear);
+			// print(g);
+			int[][] m3 = new int[][] { { 9, 12, 15, 18, 21 }, { 12, 16, 20, 24, 28 }, { 15, 20, 25, 30, 35 }, { 18, 24, 30, 36, 42 }, { 21, 28, 35, 42, 49 } };
+			compare(m3, g);
+
+			g.setInterpolationMethod(GridInterpolated.INTERPOLATION_BSpline);
+			// print(g);
+			int[][] m4 = new int[][] { { 9, 11, 14, 18, 21 }, { 12, 15, 19, 23, 27 }, { 14, 20, 24, 29, 35 }, { 18, 23, 30, 36, 41 }, { 21, 27, 35, 42, 49 } };
+			compare(m4, g);
+
+			g.setInterpolationMethod(GridInterpolated.INTERPOLATION_InverseDistance);
+			// print(g);
+			int[][] m5 = new int[][] { { 9, 12, 15, 18, 21 }, { 12, 16, 20, 24, 28 }, { 15, 20, 25, 30, 35 }, { 18, 24, 30, 36, 42 }, { 21, 28, 35, 42, 49 } };
+			compare(m5, g);
+
+		} catch (RasterBufferInvalidException e1) {
+			e1.printStackTrace();
+		} catch (OutOfGridException e3) {
+			e3.printStackTrace();
+		} catch (RasterBufferInvalidAccessException e) {
+			e.printStackTrace();
+		} catch (GridException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	private void compare(int[][] m, Grid g) throws RasterBufferInvalidAccessException, GridException {
+		for (int line = 0; line < g.getNY(); line++) {
+			for (int col = 0; col < g.getNX(); col++)
+				assertEquals(g.getCellValueAsInt(col, line), m[line][col]);
+		}
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 * @throws RasterBufferInvalidAccessException 
+	 */
+	/*private void print(Grid g) throws RasterBufferInvalidAccessException {
+		for(int line = 0; line < g.getNY(); line++){
+			for(int col = 0; col < g.getNX(); col++)
+				System.out.print(g.getCellValueAsInt(col, line) + " ");
+			System.out.println();
+		}
+		System.out.println();
+	}*/
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/grid/TestGridEmptyBufferForWrite.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/BaseTestCase.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/BaseTestCase.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/BaseTestCase.java	(revision 15423)
@@ -0,0 +1,313 @@
+/* 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;
+
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FileNotFoundInListException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.MultiRasterStore;
+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.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.dal.spi.DataStoreProvider;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.raster.cache.tile.impl.TileCacheDefaultImplLibrary;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.timesupport.impl.TimeSupportDefaultImplLibrary;
+import org.gvsig.tools.junit.AbstractLibraryAutoInitTestCase;
+/**
+ * Clase base para todos los tests. Contiene m�todos de uso com�n.
+ * Los errores no se capturan. Se lanzan en una traza por consola.
+ *
+ * 07/05/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class BaseTestCase extends AbstractLibraryAutoInitTestCase {
+	/**
+	 * Directorio donde est�n las imagenes de pruebas
+	 */
+	protected String                  baseDir               = "./src/test/resources/";
+	/**
+	 * Directorio para la generaci�n de imagenes temporales en los tests
+	 */
+	protected String                  tempDir               = "/tmp";
+
+	protected RasterDataStore         dataStore             = null;
+	protected String                  out                   = null;
+	protected long                    t1, t2;
+	protected static DefaultRasterManager    manager               = null;
+
+	protected void doSetUp() throws Exception {
+		manager = (DefaultRasterManager)RasterLocator.getManager();
+		new TileCacheDefaultImplLibrary();
+		new TimeSupportDefaultImplLibrary();
+	}
+
+	/**
+	 * Resetea el contador de tiempo
+	 */
+	protected void resetTime() {
+		t1 = System.currentTimeMillis();
+	}
+
+	/**
+	 * Obtiene el tiempo transcurrido desde que se reseteo el tiempo
+	 * @return
+	 */
+	protected double getTime() {
+		t2 = System.currentTimeMillis();
+		return ((t2 - t1) / 1000D);
+	}
+
+	/**
+	 * Abre el dataset
+	 * @param s
+	 */
+	protected RasterDataStore open(String s) {
+		try {
+			dataStore = ((DefaultRasterManager)manager).open(s);
+			return dataStore;
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * Abre el dataset
+	 * @param s
+	 */
+	protected RasterDataStore open(String[] s) {
+		try {
+			if(s == null)
+				return null;
+			for (int i = 0; i < s.length; i++)
+				if(i == 0)
+					dataStore = ((DefaultRasterManager)manager).open(s[0]);
+				else
+					((MultiRasterStore)dataStore).addDataStore(new String[]{s[i]});
+			return dataStore;
+		} catch (NotSupportedExtensionException e1) {
+			e1.printStackTrace();
+		} catch (RasterDriverException e1) {
+			e1.printStackTrace();
+		} catch (FileNotFoundInListException e2) {
+			e2.printStackTrace();
+		} catch (OperationNotSupportedException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * Borra el RMF de un fichero raster
+	 * @param file
+	 */
+	protected void deleteRMF(String file) {
+		int last = file.lastIndexOf(".");
+		if (last == -1)
+			last = file.length();
+
+		File fichero = new File(file.substring(0, last) + ".rmf");
+		fichero.delete();
+	}
+
+	/**
+	 * Obtiene un nombre aleatorio para fichero temporal
+	 * @return
+	 */
+	public String getFileTemp() {
+		out = tempDir + "/test-" + System.currentTimeMillis();
+		return out;
+	}
+
+	/**
+	 * Crea un objeto de interpretaci�n de color
+	 * @param nBands
+	 * @return
+	 */
+	protected ColorInterpretation getColorInterpretation(int nBands) {
+		String[] ci = new String[nBands];
+		if(nBands == 1)
+			ci[0] = ColorInterpretation.GRAY_BAND;
+		else
+			for (int j = 0; j < ci.length; j++)
+				switch (j) {
+				case 0: ci[j] = ColorInterpretation.RED_BAND; break;
+				case 1: ci[j] = ColorInterpretation.GREEN_BAND; break;
+				case 2: ci[j] = ColorInterpretation.BLUE_BAND; break;
+				default: ci[j] = ColorInterpretation.UNDEF_BAND; break;
+				}
+		return manager.createColorInterpretation(ci);
+	}
+
+	/**
+	 * Compara un dataset completo (ds2) con una parte de otro dataset (ds1)
+	 * @param ds1
+	 * @param ds2
+	 * @param coordsDs1 Coordenada x, y del dataset 1 a partir de la cual empieza la comparaci�n
+	 * @param step Proporci�n de tama�o del dataset 2 con respecto al 1. Si el step es 2 quiere decir que el
+	 * dataset 2 es el doble que el 1
+	 * @param drawableBands
+	 * @param dataType
+	 */
+	protected void compareDatasets(RasterDataStore ds1, RasterDataStore ds2, Point2D coordsDs1, int step, int[] drawableBands, int dataType) {
+		RasterQuery query1 = manager.createQuery();
+		query1.setDrawableBands(drawableBands);
+		RasterQuery query2 = manager.createQuery();
+		query2.setDrawableBands(drawableBands);
+		try {
+			query1.setAreaOfInterest((int)coordsDs1.getX(), (int)coordsDs1.getY(), (int)(ds2.getWidth() / step), (int)(ds2.getHeight() / step));
+			Buffer buf1 = ds1.query(query1);
+			query2.setAreaOfInterest();
+			Buffer buf2 = ds2.query(query2);
+			for (int band = 0; band < buf1.getBandCount(); band++)
+				for (int row = 0; row < (buf2.getHeight() / step); row++)
+					for (int col = 0; col < (buf2.getWidth() / step); col++)
+						switch (dataType) {
+						case Buffer.TYPE_BYTE: assertEquals(buf1.getElemByte(row, col, band), buf2.getElemByte(row * step, col * step, band)); break;
+						case Buffer.TYPE_SHORT: assertEquals(buf1.getElemShort(row, col, band), buf2.getElemShort(row * step, col * step, band)); break;
+						case Buffer.TYPE_INT: assertEquals(buf1.getElemInt(row, col, band), buf2.getElemInt(row * step, col * step, band)); break;
+						case Buffer.TYPE_FLOAT: assertEquals((int)buf1.getElemFloat(row, col, band), (int)buf2.getElemFloat(row * step, col * step, band)); break;
+						case Buffer.TYPE_DOUBLE: assertEquals((int)buf1.getElemDouble(row, col, band), (int)buf2.getElemDouble(row * step, col * step, band)); break;
+						}
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Compara la banda de un dataset completo (ds2) con una parte de otro dataset (ds1)
+	 * @param banda del dataset 1 que corresponde con el dataset 2
+	 * @param ds1
+	 * @param ds2
+	 * @param coordsDs1 Coordenada x, y del dataset 1 a partir de la cual empieza la comparaci�n
+	 * @param step Proporci�n de tama�o del dataset 2 con respecto al 1. Si el step es 2 quiere decir que el
+	 * dataset 2 es el
+	 * @param drawableBands
+	 * @param dataType
+	 */
+	protected void compareDatasets(int band, RasterDataStore ds1, RasterDataStore ds2, Point2D coordsDs1, int step, int[] drawableBands, int dataType) {
+		RasterQuery query1 = manager.createQuery();
+		query1.setDrawableBands(drawableBands);
+		RasterQuery query2 = manager.createQuery();
+		query2.setDrawableBands(drawableBands);
+
+		try {
+			query1.setAreaOfInterest((int)coordsDs1.getX(), (int)coordsDs1.getY(), (int)(ds2.getWidth() / step), (int)(ds2.getHeight() / step));
+			Buffer buf1 = ds1.query(query1);
+			query2.setAreaOfInterest();
+			Buffer buf2 = ds2.query(query2);
+			for (int row = 0; row < buf2.getHeight(); row++)
+				for (int col = 0; col < buf2.getWidth(); col++)
+					switch (dataType) {
+					case Buffer.TYPE_BYTE: assertEquals(buf1.getElemByte(row, col, band), buf2.getElemByte(row * step, col * step, 0)); break;
+					case Buffer.TYPE_SHORT: assertEquals(buf1.getElemShort(row, col, band), buf2.getElemShort(row * step, col * step, 0)); break;
+					case Buffer.TYPE_INT: assertEquals(buf1.getElemInt(row, col, band), buf2.getElemInt(row * step, col * step, 0)); break;
+					case Buffer.TYPE_FLOAT: assertEquals((int)buf1.getElemFloat(row, col, band), (int)buf2.getElemFloat(row * step, col * step, 0)); break;
+					case Buffer.TYPE_DOUBLE: assertEquals((int)buf1.getElemDouble(row, col, band), (int)buf2.getElemDouble(row * step, col * step, 0)); break;
+					}
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Detiene la ejecuci�n del thread actual durante n milisegundos
+	 * @param n Numero de milisegundos detenido
+	 */
+	protected void pause(int n) {
+		try {
+			Thread.sleep(n);
+		} catch (InterruptedException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	protected RasterProvider loadProvider(FilesystemStoreParameters params, DataStoreProviderServices storeServices) throws ProviderNotRegisteredException, InitializeException {
+		DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+		DataStoreProvider prov = null;
+
+		if(params.getFile() != null) {
+			//We have to locate a provider's name which manages the selected file
+			//A FilesystemServerExplorer will give a getProviderNames service
+			FilesystemServerExplorerParameters paramsExplorer = (FilesystemServerExplorerParameters)dataManager.createServerExplorerParameters(FilesystemServerExplorer.NAME);
+			FilesystemServerExplorer serverExplorer = null;
+			try {
+				paramsExplorer.setRoot(File.separator);
+				serverExplorer = (FilesystemServerExplorer)dataManager.openServerExplorer(FilesystemServerExplorer.NAME, paramsExplorer);
+			} catch (ValidateDataParametersException e) {
+				throw new InitializeException(e);
+			}
+
+			//Gets the list of provider's name to manage the file
+			ArrayList<String> provName = serverExplorer.getProviderNameList(params.getFile());
+			if(provName.size() > 0) {
+				for (int i = 0; i < provName.size(); i++) {
+					//Gets the first provider what is not a TileProvider
+					if(provName.get(i).compareTo("Tile Store") != 0) {
+						DataStoreParameters newparams = dataManager.createStoreParameters(provName.get(i));
+						((FilesystemStoreParameters)newparams).setFile(params.getFile()); 
+						prov = dataManager.createProvider(storeServices, newparams);
+					}
+				}
+			}
+		}
+
+		if(prov != null && prov instanceof RasterProvider) {
+			if(((RasterProvider)prov).isRotated())
+				throw new InitializeException("Rotation not supported tiling files", new Throwable());
+
+			return (RasterProvider)prov;
+		}
+		
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/BaseTestCase.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferEcw.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferEcw.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferEcw.java	(revision 15423)
@@ -0,0 +1,154 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+/**
+ * Este test prueba el acceso a datos a traves de un DataSource sin resampleo
+ * para un ECW con coordenadas reales.
+ *
+ * Lee el raster completo y comprueba que los datos leidos sean correctos
+ * comparando los valores de las cuatro esquinas y algunos valores dentro de la imagen.
+ * Se lee un �rea m�s grande que el extent completo del raster para comprobar que el ajuste
+ * al extent lo hace correctamente.
+ *
+ * Despu�s hace selecciona un �rea dentro de la imagen de 2x2 y compara que los valores
+ * leidos sean correctos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestDSDoubleAdjustToExtentBufferEcw extends BaseTestCase {
+	private String        path    = baseDir + "miniraster30x30.jp2";
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+    @Override
+    protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		System.err.println("TDSDoubleAdjustToExtentBufferEcw running...");
+	}
+
+	public void testStack() {
+		RasterDataStore f;
+		int[] drawableBands = { 0, 1, 2 };
+		try {
+			deleteRMF(path);
+			f = manager.open(path);
+		} catch (RasterDriverException e) {
+			return;
+		} catch (NotSupportedExtensionException e) {
+			return;
+		}
+		RasterQuery query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		Buffer buf = null;
+		//Se selecciona un �rea mayor que el extent para probar que lo ajusta a este
+		try {
+			Extent extent = RasterLocator.getManager().getDataStructFactory().createExtent(645860.0, 4923870.0, 645986.0, 4923744.0);
+			query.setAreaOfInterest(extent, 10, 10);
+			buf = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+//		print(ds.getRasterBuf());
+		//dataTest1(buf);
+
+		try {
+			Extent extent = RasterLocator.getManager().getDataStructFactory().createExtent(645860.0, 4923870.0, 645986.0, 4923744.0);
+			query.setAreaOfInterest(extent, 2, 2);
+			buf = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+//		print(ds.getRasterBuf());
+		dataTest2(buf);
+	}
+
+	@SuppressWarnings("unused")
+	private void dataTest1(Buffer raster) {
+		int band0[] = { 43, 14, 87, 166, 174, 109, 90, 93, 190, 143, 85, 93, 103, 112, 138, 94, 138, 192, 180, 196, 99, 209, 41, 98, 168, 170, 89, 141, 158, 199, 108, 71, 67, 92, 131, 176, 243, 98, 163, 141, 157, 170, 94, 159, 233, 114, 144, 62, 147, 173, 159, 173, 184, 94, 56, 18, 69, 78, 83, 115, 95, 37, 80, 57, 68, 68, 55, 59, 58, 101, 69, 44, 24, 58, 115, 40, 58, 56, 68, 111, 84, 117, 55, 88, 170, 135, 169, 99, 74, 42, 114, 223, 171, 67, 216, 104, 167, 83, 66, 45 };
+		int band1[] = { 53, 15, 109, 154, 164, 111, 109, 93, 189, 151, 89, 102, 107, 111, 142, 100, 143, 195, 178, 190, 100, 192, 61, 108, 154, 172, 99, 149, 160, 206, 122, 74, 81, 94, 136, 195, 248, 105, 173, 141, 158, 162, 98, 158, 226, 114, 132, 66, 150, 176, 168, 172, 175, 105, 82, 39, 85, 89, 73, 104, 92, 51, 80, 71, 88, 84, 71, 74, 68, 106, 82, 62, 37, 74, 129, 49, 78, 67, 89, 126, 100, 132, 71, 107, 164, 145, 154, 108, 85, 48, 130, 210, 164, 66, 209, 115, 160, 85, 90, 61 };
+		int band2[] = { 26, 11, 82, 145, 165, 97, 86, 71, 191, 135, 74, 75, 85, 110, 117, 82, 115, 186, 179, 183, 91, 181, 43, 85, 139, 178, 78, 133, 152, 206, 98, 61, 71, 109, 118, 181, 244, 82, 144, 117, 144, 159, 83, 155, 231, 98, 108, 60, 136, 163, 146, 170, 162, 111, 102, 41, 62, 60, 64, 68, 97, 26, 74, 50, 64, 70, 47, 48, 56, 70, 54, 35, 19, 50, 91, 35, 48, 52, 62, 101, 73, 91, 35, 80, 140, 119, 140, 91, 58, 36, 112, 202, 146, 66, 192, 81, 131, 71, 63, 37 };
+		compareRaster(raster, band0, band1, band2);
+	}
+
+	private void dataTest2(Buffer raster) {
+		int band0[] = { 43, 109, 159, 18 };
+		int band1[] = { 53, 111, 168, 39 };
+		int band2[] = { 26, 97, 146, 41 };
+		compareRaster(raster, band0, band1, band2);
+	}
+
+	public void compareRaster(Buffer raster, int band0[], int band1[], int band2[]) {
+		int cont = 0;
+		for (int line = 0; line < raster.getHeight(); line++)
+			for (int col = 0; col < raster.getWidth(); col++) {
+				assertEquals((raster.getElemByte(line, col, 0) & 0xff), band0[cont]);
+				assertEquals((raster.getElemByte(line, col, 1) & 0xff), band1[cont]);
+				assertEquals((raster.getElemByte(line, col, 2) & 0xff), band2[cont]);
+				cont++;
+			}
+	}
+
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 */
+	public void print(Buffer raster) {
+		System.out.println("");
+		for (int band = 0; band < 3; band++) {
+			System.out.print("int band" + band + "[] = { ");
+			int cont = 0;
+			for (int line = 0; line < raster.getHeight(); line++)
+				for (int col = 0; col < raster.getWidth(); col++) {
+					if (cont != 0)
+						System.out.print(", ");
+					System.out.print(((raster.getElemByte(line, col, band) & 0xff)));
+					cont++;
+				}
+			System.out.println("};");
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferEcw.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferMrSID.java	(revision 15423)
@@ -0,0 +1,22 @@
+/* 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.buffer;

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntEcw.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntEcw.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntEcw.java	(revision 15423)
@@ -0,0 +1,179 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+
+/**
+ * Este test prueba el acceso a datos a traves de un DataSource sin resampleo
+ * para un ECW con coordenadas pixel. 
+ * 
+ * Lee el raster completo y comprueba que los datos leidos sean correctos 
+ * comparando los valores de las cuatro esquinas y algunos valores dentro de la imagen.
+ * Despu�s hace selecciona un �rea dentro de la imagen de 2x2 y compara que los valores
+ * leidos sean correctos.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestDSIntEcw extends BaseTestCase {
+	private String path = baseDir + "miniraster30x30.jp2";	
+	private RasterDataStore       f              = null;	
+	private RasterQuery            query          = null;
+	protected Buffer               raster         = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TDSIntEcw running...");
+		//System.out.println("TestDataSource (Pixel Coord) [Ecw] running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		int[] drawableBands = {0, 1, 2};
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			return;
+		} catch (RasterDriverException e) {
+			return;
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAreaOfInterest(0, 0, 30, 30);
+			raster = f.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		dataTest1();
+		//print();
+		
+		try {
+			query.setAreaOfInterest(10, 10, 2, 2);
+			raster = f.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		dataTest2();
+		//print();
+	}
+	
+	private void dataTest2(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 123);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 147);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 111);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 1, 0) & 0xff), 117);
+		assertEquals((int)(raster.getElemByte(0, 1, 1) & 0xff), 148);
+		assertEquals((int)(raster.getElemByte(0, 1, 2) & 0xff), 91);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(1, 0, 0) & 0xff), 187);
+		assertEquals((int)(raster.getElemByte(1, 0, 1) & 0xff), 190);
+		assertEquals((int)(raster.getElemByte(1, 0, 2) & 0xff), 173);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(1, 1, 0) & 0xff), 214);
+		assertEquals((int)(raster.getElemByte(1, 1, 1) & 0xff), 213);
+		assertEquals((int)(raster.getElemByte(1, 1, 2) & 0xff), 211);
+	}
+	
+	private void dataTest1(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 43);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 53);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 26);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 29, 0) & 0xff), 255);
+		assertEquals((int)(raster.getElemByte(0, 29, 1) & 0xff), 252);
+		assertEquals((int)(raster.getElemByte(0, 29, 2) & 0xff), 246);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(29, 0, 0) & 0xff), 175);
+		assertEquals((int)(raster.getElemByte(29, 0, 1) & 0xff), 175);
+		assertEquals((int)(raster.getElemByte(29, 0, 2) & 0xff), 147);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(29, 29, 0) & 0xff), 126);
+		assertEquals((int)(raster.getElemByte(29, 29, 1) & 0xff), 134);
+		assertEquals((int)(raster.getElemByte(29, 29, 2) & 0xff), 111);
+		
+		assertEquals((int)(raster.getElemByte(6, 6, 0) & 0xff), 61);
+		assertEquals((int)(raster.getElemByte(6, 6, 1) & 0xff), 84);
+		assertEquals((int)(raster.getElemByte(6, 6, 2) & 0xff), 64);
+		
+		assertEquals((int)(raster.getElemByte(6, 23, 0) & 0xff), 168);
+		assertEquals((int)(raster.getElemByte(6, 23, 1) & 0xff), 171);
+		assertEquals((int)(raster.getElemByte(6, 23, 2) & 0xff), 164);
+		
+		assertEquals((int)(raster.getElemByte(23, 6, 0) & 0xff), 46);
+		assertEquals((int)(raster.getElemByte(23, 6, 1) & 0xff), 64);
+		assertEquals((int)(raster.getElemByte(23, 6, 2) & 0xff), 26);
+		
+		assertEquals((int)(raster.getElemByte(23, 23, 0) & 0xff), 54);
+		assertEquals((int)(raster.getElemByte(23, 23, 1) & 0xff), 57);
+		assertEquals((int)(raster.getElemByte(23, 23, 2) & 0xff), 36);
+		
+		assertEquals((int)(raster.getElemByte(11, 13, 0) & 0xff), 203);
+		assertEquals((int)(raster.getElemByte(11, 13, 1) & 0xff), 182);
+		assertEquals((int)(raster.getElemByte(11, 13, 2) & 0xff), 181);
+		
+		assertEquals((int)(raster.getElemByte(22, 21, 0) & 0xff), 71);
+		assertEquals((int)(raster.getElemByte(22, 21, 1) & 0xff), 97);
+		assertEquals((int)(raster.getElemByte(22, 21, 2) & 0xff), 62);
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 */
+	/*private void print(){
+		IBuffer raster = ds.getRasterBuf();
+		for(int line = 0; line < raster.getHeight(); line++){
+			for(int col = 0; col < raster.getWidth(); col++)
+				System.out.print("(" + (int)(raster.getElemByte(line, col, 0) & 0xff) + " " + (int)(raster.getElemByte(line, col, 1) & 0xff) + " " + (int)(raster.getElemByte(line, col, 2) & 0xff) + ")");
+			System.out.println();
+		}
+	}*/
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntEcw.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntMrSID.java	(revision 15423)
@@ -0,0 +1,22 @@
+/* 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.buffer;

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestBufferInterpolation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestBufferInterpolation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestBufferInterpolation.java	(revision 15423)
@@ -0,0 +1,254 @@
+/* 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.buffer;
+
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.DefaultDataServerWriter;
+
+/**
+ * Test para probar las interpolaciones de un buffer de datos completo. El test crear� un 
+ * buffer a partir de una imagen de 870x870 y aplicar� una reducci�n usando los m�todos
+ * de interpolaci�n implementados. Despu�s comparar� el resultado con imagenes ya generadas
+ * y correctas que se encuentran en el directorio de test-images. 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestBufferInterpolation extends BaseTestCase {
+	private String path = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	private RasterDataStore       f              = null;	
+	private RasterQuery            query          = null;
+	protected Buffer               buf            = null;
+	private int                    size = 50;
+	
+	private String fileNeighbour1 = baseDir + "neighbour50x50.tif";
+	private String fileBilinear1 = baseDir + "bilinear50x50.tif";
+	private String fileInverseDistance1 = baseDir + "inverseDistance50x50.tif";
+	private String fileBSpline1 = baseDir + "bspline50x50.tif";
+	//private String fileBicubicSpline1 = baseDir + "bicubicspline50x50.tif";
+	
+	private String fileNeighbour = "/tmp/neighbour.tif";
+	private String fileBilinear = "/tmp/bilinear.tif";
+	private String fileInverseDistance = "/tmp/invdistance.tif";
+	private String fileBSpline = "/tmp/bspline.tif";
+	private String fileBicubicSpline = "/tmp/bicubicspline.tif";
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		System.err.println("TestBufferInterpolation running...");
+		int[] drawableBands = {0, 1, 2};
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			return;
+		} catch (RasterDriverException e) {
+			return;
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAreaOfInterest(0, 0, (int)f.getWidth(), (int)f.getHeight());
+			buf = f.query(query);
+		} catch (InvalidSetViewException e1) {
+			e1.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			Buffer b1 = buf.getAdjustedWindow(size, size, Buffer.INTERPOLATION_NearestNeighbour);
+			convertBufferToTif(fileNeighbour, f.getAffineTransform(), b1);
+			b1 = buf.getAdjustedWindow(size, size, Buffer.INTERPOLATION_Bilinear);
+			convertBufferToTif(fileBilinear, f.getAffineTransform(), b1);
+			b1 = buf.getAdjustedWindow(size, size, Buffer.INTERPOLATION_InverseDistance);
+			convertBufferToTif(fileInverseDistance, f.getAffineTransform(), b1);
+			b1 = buf.getAdjustedWindow(size, size, Buffer.INTERPOLATION_BSpline);
+			convertBufferToTif(fileBSpline, f.getAffineTransform(), b1);
+			b1 = buf.getAdjustedWindow(size, size, Buffer.INTERPOLATION_BicubicSpline);
+			convertBufferToTif(fileBicubicSpline, f.getAffineTransform(), b1);
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}  
+		
+	}
+	
+	public void testStack(){
+		compareResult(fileNeighbour, fileNeighbour1);
+		compareResult(fileBilinear, fileBilinear1);
+		compareResult(fileInverseDistance, fileInverseDistance1);
+		compareResult(fileBSpline, fileBSpline1);
+		//compareResult(fileBicubicSpline, fileBicubicSpline1);
+		File file1 = new File(fileNeighbour);
+		File file2 = new File(fileBilinear);
+		File file3 = new File(fileInverseDistance);
+		File file4 = new File(fileBSpline);
+		//File file5 = new File(fileBicubicSpline);
+		if(file1.exists())
+			file1.delete();
+		if(file2.exists())
+			file2.delete();
+		if(file3.exists())
+			file3.delete();
+		if(file4.exists())
+			file4.delete();
+		//if(file5.exists())
+		//	file5.delete();
+	}
+	
+	/**
+	 * Compara dos ficheros raster
+	 * @param f1
+	 * @param f2
+	 */
+	private void compareResult(String f1, String f2) {
+		int[] drawableBands = {0, 1, 2};
+		RasterDataStore d1 = null;
+		RasterDataStore d2 = null;
+		try {
+			d1 = ((DefaultRasterManager)manager).open(f1);
+			d2 = ((DefaultRasterManager)manager).open(f2);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+			return;
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+			return;
+		}
+		RasterQuery query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		Buffer b1 = null;
+		try {
+			query.setAreaOfInterest(0, 0, (int)d1.getWidth(), (int)d1.getHeight());
+			b1 = d1.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		
+		Buffer b2 = null;
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAreaOfInterest(0, 0, (int)d2.getWidth(), (int)d2.getHeight());
+			b2 = d2.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		for (int k = 0; k < b1.getBandCount(); k++) {
+			for (int i = 0; i < b1.getHeight(); i++) {
+				for (int j = 0; j < b1.getWidth(); j++) {
+					switch(b1.getDataType()) {
+					case Buffer.TYPE_BYTE:
+						assertEquals(b1.getElemByte(i, j, k), b2.getElemByte(i, j, k));
+						break;
+					case Buffer.TYPE_SHORT:
+						assertEquals(b1.getElemShort(i, j, k), b2.getElemShort(i, j, k));
+						break;
+						
+					case Buffer.TYPE_INT:
+						assertEquals(b1.getElemInt(i, j, k), b2.getElemInt(i, j, k));
+						break;
+						
+					case Buffer.TYPE_FLOAT:
+						assertEquals((int)b1.getElemFloat(i, j, k), (int)b2.getElemFloat(i, j, k));
+						break;
+						
+					case Buffer.TYPE_DOUBLE:
+						assertEquals((int)b1.getElemDouble(i, j, k), (int)b2.getElemDouble(i, j, k));
+						break;
+					}
+				}
+			}
+		}
+	}
+	
+	/**
+	 * Funci�n para pruebas.
+	 * Convierte los ficheros generados por la funci�n cachear en ficheros tif para comprobar que est�n
+	 * bien generados.
+	 * @param grf
+	 * @param pageBuffer
+	 * @param pageLines
+	 * @throws IOException
+	 */
+	private void convertBufferToTif(String fileName, AffineTransform at, Buffer buffer)throws IOException, ProcessInterruptedException, RasterDriverException {
+		DataServerWriter dataWriter1 = new DefaultDataServerWriter(buffer);
+		RasterWriter grw = null;
+		try {
+			Params params = manager.createWriter(fileName).getParams();
+			params.changeParamValue("blocksize", "7"); //posici�n 7 del array -> 512
+			params.changeParamValue("tfw", "false");
+			params.changeParamValue("interleave", new Integer(1));//posici�n 1 del array -> PIXEL
+			grw = manager.createWriter(dataWriter1, 
+											fileName,
+											buffer.getBandCount(),
+											at,
+											buffer.getWidth(), 
+											buffer.getHeight(), 
+											buffer.getDataType(),
+											params,
+											null);
+			
+		} catch (NotSupportedExtensionException e) {
+			throw new RasterDriverException("");
+		}
+		grw.dataWrite();
+		grw.writeClose();
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestBufferInterpolation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestSaveAndLoadPages.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestSaveAndLoadPages.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestSaveAndLoadPages.java	(revision 15423)
@@ -0,0 +1,146 @@
+/* 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.buffer.cache;
+
+import java.io.IOException;
+import java.util.Date;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.impl.buffer.cache.CacheDataServer;
+import org.gvsig.raster.impl.buffer.cache.PageBandBuffer;
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestSaveAndLoadPages extends BaseTestCase {
+	private boolean            show    = false;
+	private String             path    = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	private RasterDataStore   f       = null;	
+	private RasterQuery        query   = null;
+	protected Buffer           raster  = null;
+	private int                pages   = 10;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TestSaveAndLoadPages running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		int[] drawableBands = {0, 1, 2};
+		
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAreaOfInterest(0, 0, (int)f.getWidth(), (int)f.getHeight());
+			raster = f.query(query);
+		} catch (InvalidSetViewException e1) {
+			e1.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		
+		int h =  (int)f.getHeight() / pages;
+		PageBandBuffer[] pbWriterList = new PageBandBuffer[h];
+		CacheDataServer[] cds = new CacheDataServer[h];
+				
+		long t2, t3, t4;
+				long t1 = new Date().getTime();
+				
+		//Salvamos los PageBuffer
+		byte[] data = new byte[3];
+		for (int i = 0; i < pages; i++) {
+			pbWriterList[i] = new PageBandBuffer((int)f.getDataType()[0], (int)f.getWidth(), h, 3, true, i);
+			cds[i] = new CacheDataServer(null, 0, i);
+			for (int k = 0; k < f.getWidth(); k++) {
+				for (int j = 0; j < h; j++) {
+					raster.getElemByte((i * h) + j, k, data);
+					pbWriterList[i].setElemByte(j, k, data);
+				}	
+			}
+			try {
+				cds[i].savePage(pbWriterList[i]);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+		}
+		
+		t2 = new Date().getTime();
+		if (show)
+			System.out.println("Time: Cargar PageBuffers y salvar a disco: " + ((t2 - t1) / 1000D) + ", secs.");
+		
+		//Recuperamos las p�ginas
+		PageBandBuffer[] pbReaderList = new PageBandBuffer[h];
+		for (int i = 0; i < pages; i++) {
+			pbReaderList[i] = new PageBandBuffer((int)f.getDataType()[0], (int)f.getWidth(), h, 3, true, i);
+			cds[i].loadPage(pbReaderList[i]);
+		}
+		
+		t3 = new Date().getTime();
+		if (show)
+			System.out.println("Time: Recuperar p�ginas de disco: " + ((t3 - t2) / 1000D) + ", secs.");
+		
+		//Comparamos
+		byte[] a = new byte[3];
+		byte[] b = new byte[3];
+		for (int i = 0; i < pages; i++) {
+			for (int k = 0; k < f.getWidth(); k++) {
+				for (int j = 0; j < h; j++) {
+					pbReaderList[i].getElemByte(j, k, a);
+					pbWriterList[i].getElemByte(j, k, b);
+					for (int t = 0; t < 3; t++) 
+						assertEquals(a[t], b[t]);
+				}
+			}
+		}
+
+		t4 = new Date().getTime();
+		if (show)
+			System.out.println("Time: Comparaciones: " + ((t4 - t3) / 1000D) + ", secs.");
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestSaveAndLoadPages.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterCache.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterCache.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterCache.java	(revision 15423)
@@ -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.fmap.dal.coverage.buffer.cache;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.impl.buffer.cache.RasterCache;
+/**
+ * Test de comparativa de datos cacheados con datos sin cachear. 
+ * Leemos un raster 1..n veces cacheandolo por p�ginas. Una vez cacheado recorreremos
+ * la cache recuperando los datos y comparandolos con los originales para comprobar que no
+ * ha habido perdida y que lo que se obtiene es igual a lo inicial.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestRasterCache extends BaseTestCase {
+	private String             path    = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	private RasterDataStore   f       = null;	
+	private RasterQuery        query   = null;
+	protected Buffer           raster  = null;
+
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TestRasterCache running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		int[] drawableBands = { 0, 1, 2 };
+		//N�mero de veces que cacheamos la imagen. Esto hace que el n�mero de l�neas totales se multiplique por este n�mero
+		int nTimes = 1;
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		
+		try {
+			query.setAreaOfInterest(0, 0, (int)f.getWidth(), (int)f.getHeight());
+			raster = f.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+
+		// Salvamos los PageBuffer
+		//Buffer buf = ds.getRasterBuf();
+		
+		//Reducimos el tama�o de la cach� para poder trabajar con un volumen de datos reducido
+		long cacheSize = RasterLibrary.cacheSize;
+		double pageSize = RasterLibrary.pageSize;
+		RasterLibrary.cacheSize = 1;
+		RasterLibrary.pageSize = 0.2;
+
+		RasterCache rc = new RasterCache(f.getDataType()[0], 
+				(int)f.getWidth(), 
+				(int)f.getHeight() * nTimes, 3);
+//		rc.getCache().getCacheStruct().show();
+
+		// Cargamos la cach�
+		byte[] data = new byte[3];
+		for (int i = 0; i < nTimes; i++) {
+			for (int line = 0; line < f.getHeight(); line++) {
+				for (int col = 0; col < f.getWidth(); col++) {
+					raster.getElemByte(line, col, data);
+					rc.setElemByte(line + ((int)f.getHeight() * i), col, data);
+				}
+			}
+		}
+
+		// Obtenemos los datos y comparamos
+		byte[] dataA = new byte[3];
+		byte[] dataB = new byte[3];
+		for (int i = 0; i < nTimes; i++) {
+			for (int line = 0; line < f.getHeight(); line++) {
+				for (int col = 0; col < f.getWidth(); col++) {
+					raster.getElemByte(line, col, dataA);
+					rc.getElemByte(line + ((int)f.getHeight() * i), col, dataB);
+					assertEquals(dataA[0], dataB[0]);
+					assertEquals(dataA[1], dataB[1]);
+					assertEquals(dataA[2], dataB[2]);
+				}
+			}
+		}
+		RasterLibrary.cacheSize = cacheSize;
+		RasterLibrary.pageSize = pageSize;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterCache.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestAssignInterchangeBandsCache.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestAssignInterchangeBandsCache.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestAssignInterchangeBandsCache.java	(revision 15423)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.buffer.cache;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.buffer.cache.RasterCache;
+/**
+ * Test para probar la operaci�n de asignar una constante a una banda de un buffer cacheado y
+ * el intercambio de 2 bandas para el mismo buffer. Con esto se prueban las operaciones de assign, getBand,
+ * assignBand, assignBandToNotValid, interchangeBands y getBandBuffer
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestAssignInterchangeBandsCache extends BaseTestCase {
+
+	private RasterCache rc = null;
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+    @Override
+    protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		System.err.println("TestBandOperationCache running...");
+		rc = new RasterCache(Buffer.TYPE_BYTE, 6000, 5000, 3);
+	}
+
+	public void testStack() {
+//		long t2, t3, t4;
+//		long t1 = new Date().getTime();
+		rc.setNotValidValue(40);
+		rc.assign(0, (byte) 20);
+		rc.assign(1, (byte) 30);
+		rc.assignBandToNotValid(2);
+//		t2 = new Date().getTime();
+//		System.out.println("Time: asignar buffer a un valor cte: " + ((t2 - t1) / 1000D) + ", secs.");
+
+		rc.interchangeBands(0, 1);
+		testValues(30, 20, 40);
+
+//		t3 = new Date().getTime();
+//		System.out.println("Time: asserts del valor por banda cacheado: " + ((t3 - t2) / 1000D) + ", secs.");
+
+		Buffer buf = rc.getBandBuffer(2);
+		testValue((int) rc.getNotValidValue(), buf);
+
+//		t4 = new Date().getTime();
+//		System.out.println("Time: getBandBuffer: " + ((t4 - t3) / 1000D) + ", secs.");
+	}
+
+	private void testValues(int v1, int v2, int v3) {
+		for (int row = 0; row < rc.getHeight(); row++)
+			for (int col = 0; col < rc.getWidth(); col++) {
+				assertEquals(v1, rc.getElemByte(row, col, 0));
+				assertEquals(v2, rc.getElemByte(row, col, 1));
+				assertEquals(v3, rc.getElemByte(row, col, 2));
+			}
+	}
+
+	private void testValue(int value, Buffer buf) {
+		for (int row = 0; row < buf.getHeight(); row++)
+			for (int col = 0; col < buf.getWidth(); col++)
+				assertEquals(value, buf.getElemByte(row, col, 0));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestAssignInterchangeBandsCache.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterReadOnlyBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterReadOnlyBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterReadOnlyBuffer.java	(revision 15423)
@@ -0,0 +1,127 @@
+/* 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.buffer.cache;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.raster.impl.buffer.DefaultDataServerWriter;
+
+/**
+ * Test para la prueba de buffer de solo lectura.
+ * Genera una imagen con las bandas alteradas usando un buffer de solo lectura.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestRasterReadOnlyBuffer extends BaseTestCase {
+	private String             path = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	private RasterDataStore   f       = null;	
+	private RasterQuery        query   = null;
+	protected Buffer           raster  = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TestRasterReadOnlyHugeBuffer running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		//Cargamos un buffer sin cachear
+		
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		//Reducimos el tama�o de la cach� para poder trabajar con un volumen de datos reducido
+		long cacheSize = RasterLibrary.cacheSize;
+		double pageSize = RasterLibrary.pageSize;
+		RasterLibrary.cacheSize = 1;
+		RasterLibrary.pageSize = 0.2;
+		
+		query = manager.createQuery();
+		query.setReadOnly(true);
+		int[] drawableBands = {2, 1, 0};
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAreaOfInterest(0, 0, (int)f.getWidth(), (int)f.getHeight());
+			raster = f.query(query);
+		} catch (InvalidSetViewException e1) {
+			e1.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		
+		try {
+			DefaultDataServerWriter writerBufferServer = new DefaultDataServerWriter(raster);
+			RasterWriter grw = manager.createWriter(writerBufferServer, "/tmp/out.tif",
+					raster.getBandCount(), f.getAffineTransform(), raster.getWidth(),
+					raster.getHeight(), raster.getDataType(), manager.createWriter("/tmp/out.tif").getParams(), null);
+			grw.dataWrite();
+			grw.writeClose();
+		} catch(NotSupportedExtensionException e) {
+
+		} catch(RasterDriverException e) {
+
+		} catch(ProcessInterruptedException e) {
+
+		} catch(IOException e) {
+
+		}
+		
+		RasterLibrary.cacheSize = cacheSize;
+		RasterLibrary.pageSize = pageSize;
+	}
+	
+	public void testStack(){
+		/*for (int iBand = 0; iBand < buf.getBandCount(); iBand++)
+			for (int iRow = 0; iRow < buf.getHeight(); iRow++) 
+				for (int iCol = 0; iCol < buf.getWidth(); iCol++) {
+					byte a = buf.getElemByte(iRow, iCol, iBand);
+					byte b = bufCache.getElemByte(iRow, iCol, iBand);
+					//if(a != b)
+						//System.out.println(iRow + " " + iCol + " " + a + " " + b);
+					assertEquals(a, b);
+				}*/
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestRasterReadOnlyBuffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestStructCache.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestStructCache.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestStructCache.java	(revision 15423)
@@ -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.fmap.dal.coverage.buffer.cache;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.buffer.cache.CacheStruct;
+/**
+ * Test para comprobar la inicializaci�n de la cach�. El constructor de CacheStruct es el 
+ * encargado de crear la estructura de cache. Esta clase comprueba que esta creaci�n
+ * sea correcta. Comprueba altura de p�gina, n�mero de estas, y tama�o de las mismas, as�
+ * como el de la cache completa.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestStructCache extends BaseTestCase {
+	private boolean     showCode = false;
+	private CacheStruct cs       = null;
+
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TestStructCache running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		// Test para los siguientes valores
+		// Cach� size = 20M
+		// Pags Per Group = 5
+		// Page size = 2M
+
+		cs = new CacheStruct(3, Buffer.TYPE_BYTE, 2048, 2048, 20, 2);
+		if (showCode)
+			print(cs, "Size = 20M; Pags Per Group = 5; Page size = 2M", 2048, 2048, Buffer.TYPE_BYTE);
+		assertEquals(cs.getHPag(), 256);
+		assertEquals(cs.getNBands(), 3);
+		assertEquals(cs.getCacheSize(), 23592960);
+		assertEquals(cs.getPagsPerGroup(), 5);
+		assertEquals(cs.getPagSize(), 1572864);
+		assertEquals(cs.getNPags(), 15);
+		assertEquals(cs.getNGroups(), 3);
+		if (showCode)
+			System.out.println("**********************************************");
+
+		cs = new CacheStruct(4, Buffer.TYPE_INT, 5000, 5000, 20, 2);
+		if (showCode)
+			print(cs, "Size = 20M; Pags Per Group = 5; Page size = 2M", 5000, 5000, Buffer.TYPE_INT);
+		assertEquals(cs.getHPag(), 16);
+		assertEquals(cs.getNBands(), 4);
+		assertEquals(cs.getCacheSize(), 25600000);
+		assertEquals(cs.getPagsPerGroup(), 5);
+		assertEquals(cs.getPagSize(), 1280000);
+		assertEquals(cs.getNPags(), 20);
+		assertEquals(cs.getNGroups(), 4);
+		if (showCode)
+			System.out.println("**********************************************");
+
+		cs = new CacheStruct(3, Buffer.TYPE_FLOAT, 42000, 42000, 20, 2);
+		if (showCode)
+			print(cs, "Size = 20M; Pags Per Group = 5; Page size = 2M", 42000, 42000, Buffer.TYPE_FLOAT);
+		assertEquals(cs.getHPag(), 4);
+		assertEquals(cs.getNBands(), 3);
+		assertEquals(cs.getCacheSize(), 20160000);
+		assertEquals(cs.getPagsPerGroup(), 5);
+		assertEquals(cs.getPagSize(), 2016000);
+		assertEquals(cs.getNPags(), 10);
+		assertEquals(cs.getNGroups(), 2);
+		if (showCode)
+			System.out.println("**********************************************");
+
+		cs = new CacheStruct(1, Buffer.TYPE_FLOAT, 105000, 105000, 20, 2);
+		if (showCode)
+			print(cs, "Size = 20M; Pags Per Group = 5; Page size = 2M", 105000, 105000, Buffer.TYPE_FLOAT);
+		assertEquals(cs.getHPag(), 4);
+		assertEquals(cs.getNBands(), 1);
+		assertEquals(cs.getCacheSize(), 25200000);
+		assertEquals(cs.getPagsPerGroup(), 5);
+		assertEquals(cs.getPagSize(), 1680000);
+		assertEquals(cs.getNPags(), 15);
+		assertEquals(cs.getNGroups(), 3);
+		if (showCode)
+			System.out.println("**********************************************");
+	}
+	
+	public void print(CacheStruct cs, String initValues, int w, int h, int type) {
+		System.out.println(initValues);
+		System.out.println("W x H = " + w + " x " + h);
+		cs.show();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/cache/TestStructCache.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentEcw.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentEcw.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentEcw.java	(revision 15423)
@@ -0,0 +1,183 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+
+/**
+ * Este test prueba el acceso a datos a traves de un DataSource sin resampleo
+ * para un ECW con coordenadas reales. 
+ * 
+ * Lee el raster completo y comprueba que los datos leidos sean correctos 
+ * comparando los valores de las cuatro esquinas y algunos valores dentro de la imagen.
+ * Se lee un �rea m�s grande que el extent completo del raster para comprobar que el ajuste
+ * al extent lo hace correctamente.
+ * 
+ * Despu�s hace selecciona un �rea dentro de la imagen de 2x2 y compara que los valores
+ * leidos sean correctos.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestDSDoubleAdjustToExtentEcw extends BaseTestCase {
+	private String path = baseDir + "miniraster30x30.jp2";	
+	private RasterDataStore       f              = null;	
+	private RasterQuery            query          = null;
+	protected Buffer               raster         = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TDSDoubleAdjustToExtentEcw running...");
+		//System.out.println("TestDataSource (Real Coord) Adjust To Extent [Ecw] running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		int[] drawableBands = {0, 1, 2};
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			return;
+		} catch (RasterDriverException e) {
+			return;
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		//Se selecciona un �rea mayor que el extent para probar que lo ajusta a este 
+		try {
+			query.setAreaOfInterest(645860.0, 4923870.0, 130, 130);
+			raster = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		dataTest1();
+		//print();
+		
+		try {
+			query.setAreaOfInterest(645889.0, 4923858.0, 5, 5);
+			raster = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		dataTest2();
+		//print();
+	}
+	
+	private void dataTest2(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 121);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 135);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 110);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 1, 0) & 0xff), 235);
+		assertEquals((int)(raster.getElemByte(0, 1, 1) & 0xff), 224);
+		assertEquals((int)(raster.getElemByte(0, 1, 2) & 0xff), 192);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(1, 0, 0) & 0xff), 102);
+		assertEquals((int)(raster.getElemByte(1, 0, 1) & 0xff), 104);
+		assertEquals((int)(raster.getElemByte(1, 0, 2) & 0xff), 83);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(1, 1, 0) & 0xff), 95);
+		assertEquals((int)(raster.getElemByte(1, 1, 1) & 0xff), 77);
+		assertEquals((int)(raster.getElemByte(1, 1, 2) & 0xff), 99);
+	}
+	
+	private void dataTest1(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 43);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 53);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 26);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 29, 0) & 0xff), 255);
+		assertEquals((int)(raster.getElemByte(0, 29, 1) & 0xff), 252);
+		assertEquals((int)(raster.getElemByte(0, 29, 2) & 0xff), 246);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(29, 0, 0) & 0xff), 175);
+		assertEquals((int)(raster.getElemByte(29, 0, 1) & 0xff), 175);
+		assertEquals((int)(raster.getElemByte(29, 0, 2) & 0xff), 147);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(29, 29, 0) & 0xff), 126);
+		assertEquals((int)(raster.getElemByte(29, 29, 1) & 0xff), 134);
+		assertEquals((int)(raster.getElemByte(29, 29, 2) & 0xff), 111);
+		
+		assertEquals((int)(raster.getElemByte(6, 6, 0) & 0xff), 61);
+		assertEquals((int)(raster.getElemByte(6, 6, 1) & 0xff), 84);
+		assertEquals((int)(raster.getElemByte(6, 6, 2) & 0xff), 64);
+		
+		assertEquals((int)(raster.getElemByte(6, 23, 0) & 0xff), 168);
+		assertEquals((int)(raster.getElemByte(6, 23, 1) & 0xff), 171);
+		assertEquals((int)(raster.getElemByte(6, 23, 2) & 0xff), 164);
+		
+		assertEquals((int)(raster.getElemByte(23, 6, 0) & 0xff), 46);
+		assertEquals((int)(raster.getElemByte(23, 6, 1) & 0xff), 64);
+		assertEquals((int)(raster.getElemByte(23, 6, 2) & 0xff), 26);
+		
+		assertEquals((int)(raster.getElemByte(23, 23, 0) & 0xff), 54);
+		assertEquals((int)(raster.getElemByte(23, 23, 1) & 0xff), 57);
+		assertEquals((int)(raster.getElemByte(23, 23, 2) & 0xff), 36);
+		
+		assertEquals((int)(raster.getElemByte(11, 13, 0) & 0xff), 203);
+		assertEquals((int)(raster.getElemByte(11, 13, 1) & 0xff), 182);
+		assertEquals((int)(raster.getElemByte(11, 13, 2) & 0xff), 181);
+		
+		assertEquals((int)(raster.getElemByte(22, 21, 0) & 0xff), 71);
+		assertEquals((int)(raster.getElemByte(22, 21, 1) & 0xff), 97);
+		assertEquals((int)(raster.getElemByte(22, 21, 2) & 0xff), 62);
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 */
+	/*private void print(){
+		IBuffer raster = ds.getRasterBuf();
+		for(int line = 0; line < raster.getHeight(); line++){
+			for(int col = 0; col < raster.getWidth(); col++)
+				System.out.print("(" + (int)(raster.getElemByte(line, col, 0) & 0xff) + " " + (int)(raster.getElemByte(line, col, 1) & 0xff) + " " + (int)(raster.getElemByte(line, col, 2) & 0xff) + ")");
+			System.out.println();
+		}
+	}*/
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentEcw.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentMrSID.java	(revision 15423)
@@ -0,0 +1,22 @@
+/* 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.buffer;

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestNotAdjustToExtent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestNotAdjustToExtent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestNotAdjustToExtent.java	(revision 15423)
@@ -0,0 +1,136 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+/**
+ * Prueba del acceso a datos usando el flag setAdjustToExtent a false. Esto consigue que 
+ * no se ajuste la petici�n a los margenes del raster sino que se dibuje dentro y el resto 
+ * se rellene con valores NoData.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestNotAdjustToExtent extends BaseTestCase {
+
+	private String path = baseDir + "miniRaster25x24.tif";
+	private RasterDataStore       f              = null;
+	private RasterQuery            query          = null;
+	protected Buffer               raster         = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TestAdjustToExtent running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	
+	public void testStack(){
+		int[] drawableBands = {0, 1, 2};
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+			return;
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+			return;
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAdjustToExtent(false);
+			Extent extent = RasterLocator.getManager().getDataStructFactory().createExtent(645800.0, 4923860.0, 645830.0, 4923830);
+			query.setAreaOfInterest(extent, 10, 10); //Superior izquierda
+			//ds.setAreaOfInterest(645841.0, 4923860.0, 645871.0, 4923830, 10, 10); //Superior derecha
+			//ds.setAreaOfInterest(645841.0, 4923837.0, 645871.0, 4923807.0, 10, 10); //Inferior derecha
+			//ds.setAreaOfInterest(645800.0, 4923837.0, 645830.0, 4923807.0, 10, 10); //Inferior izquierda
+			//ds.setAreaOfInterest(645810.0, 4923860.0, 645862.0, 4923807.0, 10, 10); //Centro
+			raster = f.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+			return;
+		}
+		//print();
+		dataTest1();
+		
+	}
+		
+	private void dataTest1(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(4, 7, 0) & 0xff), 97);
+		assertEquals((int)(raster.getElemByte(4, 7, 1) & 0xff), 101);
+		assertEquals((int)(raster.getElemByte(4, 7, 2) & 0xff), 68);
+		
+		//Prueba de escritura en disco
+//		WriterBufferServer writerBufferServer = new WriterBufferServer();
+//		writerBufferServer.setBuffer(raster, -1);
+//		
+//		try {
+//			GeoRasterWriter geoRasterWriter = GeoRasterWriter.getWriter(writerBufferServer, "/tmp/test.tif", 3, new AffineTransform(1, 0, 0, -1, 0, 0), raster.getWidth(), raster.getHeight(), raster.getDataType(), GeoRasterWriter.getWriter("test.tif").getParams(), null);
+//			geoRasterWriter.dataWrite();
+//			geoRasterWriter.writeClose();
+//		} catch (NotSupportedExtensionException e) {
+//			e.printStackTrace();
+//		} catch (RasterDriverException e) {
+//			e.printStackTrace();
+//		} catch (IOException e) {
+//			e.printStackTrace();
+//		} catch (ProcessInterruptedException e) {
+//			e.printStackTrace();
+//		}
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 */
+	/*private void print(){
+		IBuffer raster = ds.getRasterBuf();
+		for(int line = 0; line < raster.getHeight(); line++){
+			for(int col = 0; col < raster.getWidth(); col++)
+				System.out.print("(" + (int)(raster.getElemByte(line, col, 0) & 0xff) + " " + (int)(raster.getElemByte(line, col, 1) & 0xff) + " " + (int)(raster.getElemByte(line, col, 2) & 0xff) + ")");
+			System.out.println();
+		}
+	}*/
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestNotAdjustToExtent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferGdal.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferGdal.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferGdal.java	(revision 15423)
@@ -0,0 +1,181 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+
+/**
+ * Este test prueba el acceso a datos a traves de un DataSource sin resampleo
+ * para un raster leido con Gdal con coordenadas pixel. 
+ * 
+ * Lee el raster completo y comprueba que los datos leidos sean correctos 
+ * comparando los valores de las cuatro esquinas y algunos valores dentro de la imagen.
+ * Despu�s hace selecciona un �rea dentro de la imagen de 2x2 y compara que los valores
+ * leidos sean correctos.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestDSDoubleAdjustToExtentBufferGdal extends BaseTestCase {
+	private String             path    = baseDir + "miniRaster25x24.tif";	
+	private RasterDataStore    f       = null;	
+	private RasterQuery        query   = null;
+	protected Buffer           raster  = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TDSDoubleAdjustToExtentBufferGdal running...");
+		//System.out.println("TestDataSource (Real Coord) Adjust To Extent With Buffer [Gdal] running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		int[] drawableBands = {0, 1, 2};
+		try {
+			f = manager.open(path);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+			return;
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+			return;
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		try {
+			Extent extent = RasterLocator.getManager().getDataStructFactory().createExtent(645817.0, 4923851.0, 645853.0, 4923815.0);
+			query.setAreaOfInterest(extent, 10, 10);
+			raster = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		//print();
+		dataTest1();
+		
+		try {
+			Extent extent = RasterLocator.getManager().getDataStructFactory().createExtent(645826.9, 4923844.0, 645838.3, 4923833.3);
+			query.setAreaOfInterest(extent, 2, 2);
+			raster = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		dataTest2();
+		//print();
+	}
+	
+	private void dataTest2(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 24);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 37);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 7);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 1, 0) & 0xff), 70);
+		assertEquals((int)(raster.getElemByte(0, 1, 1) & 0xff), 78);
+		assertEquals((int)(raster.getElemByte(0, 1, 2) & 0xff), 55);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(1, 0, 0) & 0xff), 97);
+		assertEquals((int)(raster.getElemByte(1, 0, 1) & 0xff), 115);
+		assertEquals((int)(raster.getElemByte(1, 0, 2) & 0xff), 73);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(1, 1, 0) & 0xff), 65);
+		assertEquals((int)(raster.getElemByte(1, 1, 1) & 0xff), 75);
+		assertEquals((int)(raster.getElemByte(1, 1, 2) & 0xff), 51);
+	}
+	
+	private void dataTest1(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 97);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 101);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 68);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 9, 0) & 0xff), 58);
+		assertEquals((int)(raster.getElemByte(0, 9, 1) & 0xff), 85);
+		assertEquals((int)(raster.getElemByte(0, 9, 2) & 0xff), 42);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(9, 0, 0) & 0xff), 164);
+		assertEquals((int)(raster.getElemByte(9, 0, 1) & 0xff), 158);
+		assertEquals((int)(raster.getElemByte(9, 0, 2) & 0xff), 144);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(9, 9, 0) & 0xff), 135);
+		assertEquals((int)(raster.getElemByte(9, 9, 1) & 0xff), 126);
+		assertEquals((int)(raster.getElemByte(9, 9, 2) & 0xff), 127);
+		
+		assertEquals((int)(raster.getElemByte(6, 6, 0) & 0xff), 120);
+		assertEquals((int)(raster.getElemByte(6, 6, 1) & 0xff), 127);
+		assertEquals((int)(raster.getElemByte(6, 6, 2) & 0xff), 96);
+		
+		assertEquals((int)(raster.getElemByte(2, 3, 0) & 0xff), 24);
+		assertEquals((int)(raster.getElemByte(2, 3, 1) & 0xff), 37);
+		assertEquals((int)(raster.getElemByte(2, 3, 2) & 0xff), 7);
+		
+		assertEquals((int)(raster.getElemByte(5, 4, 0) & 0xff), 88);
+		assertEquals((int)(raster.getElemByte(5, 4, 1) & 0xff), 103);
+		assertEquals((int)(raster.getElemByte(5, 4, 2) & 0xff), 82);
+		
+		assertEquals((int)(raster.getElemByte(9, 2, 0) & 0xff), 157);
+		assertEquals((int)(raster.getElemByte(9, 2, 1) & 0xff), 143);
+		assertEquals((int)(raster.getElemByte(9, 2, 2) & 0xff), 130);
+		
+		assertEquals((int)(raster.getElemByte(7, 8, 0) & 0xff), 222);
+		assertEquals((int)(raster.getElemByte(7, 8, 1) & 0xff), 222);
+		assertEquals((int)(raster.getElemByte(7, 8, 2) & 0xff), 220);
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 */
+	/*private void print(){
+		IBuffer raster = ds.getRasterBuf();
+		for(int line = 0; line < raster.getHeight(); line++){
+			for(int col = 0; col < raster.getWidth(); col++)
+				System.out.print("(" + (int)(raster.getElemByte(line, col, 0) & 0xff) + " " + (int)(raster.getElemByte(line, col, 1) & 0xff) + " " + (int)(raster.getElemByte(line, col, 2) & 0xff) + ")");
+			System.out.println();
+		}
+	}*/
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentBufferGdal.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntGdal.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntGdal.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntGdal.java	(revision 15423)
@@ -0,0 +1,176 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+
+/**
+ * Este test prueba el acceso a datos a traves de un DataSource sin resampleo
+ * para un raster leido con Gdal con coordenadas pixel. 
+ * 
+ * Lee el raster completo y comprueba que los datos leidos sean correctos 
+ * comparando los valores de las cuatro esquinas y algunos valores dentro de la imagen.
+ * Despu�s hace selecciona un �rea dentro de la imagen de 2x2 y compara que los valores
+ * leidos sean correctos.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestDSIntGdal extends BaseTestCase {
+	private String path = baseDir + "miniRaster25x24.tif";	
+	private RasterDataStore       f              = null;	
+	private RasterQuery            query          = null;
+	protected Buffer               raster         = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TestDataSetIntGdal running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		int[] drawableBands = {0, 1, 2};
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAreaOfInterest(0, 0, 25, 24);
+			raster = f.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+			return;
+		}
+		dataTest1();
+		//print();
+		
+		try {
+			query.setAreaOfInterest(10, 10, 2, 2);
+			raster = f.query(query);
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+			return;
+		}
+		dataTest2();
+		//print();
+	}
+	
+	private void dataTest2(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 80);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 96);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 60);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 1, 0) & 0xff), 80);
+		assertEquals((int)(raster.getElemByte(0, 1, 1) & 0xff), 96);
+		assertEquals((int)(raster.getElemByte(0, 1, 2) & 0xff), 60);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(1, 0, 0) & 0xff), 82);
+		assertEquals((int)(raster.getElemByte(1, 0, 1) & 0xff), 97);
+		assertEquals((int)(raster.getElemByte(1, 0, 2) & 0xff), 68);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(1, 1, 0) & 0xff), 82);
+		assertEquals((int)(raster.getElemByte(1, 1, 1) & 0xff), 97);
+		assertEquals((int)(raster.getElemByte(1, 1, 2) & 0xff), 68);
+	}
+	
+	private void dataTest1(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 14);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 14);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 0);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 24, 0) & 0xff), 68);
+		assertEquals((int)(raster.getElemByte(0, 24, 1) & 0xff), 90);
+		assertEquals((int)(raster.getElemByte(0, 24, 2) & 0xff), 52);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(23, 0, 0) & 0xff), 129);
+		assertEquals((int)(raster.getElemByte(23, 0, 1) & 0xff), 122);
+		assertEquals((int)(raster.getElemByte(23, 0, 2) & 0xff), 106);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(23, 24, 0) & 0xff), 145);
+		assertEquals((int)(raster.getElemByte(23, 24, 1) & 0xff), 140);
+		assertEquals((int)(raster.getElemByte(23, 24, 2) & 0xff), 134);
+		
+		assertEquals((int)(raster.getElemByte(6, 6, 0) & 0xff), 21);
+		assertEquals((int)(raster.getElemByte(6, 6, 1) & 0xff), 37);
+		assertEquals((int)(raster.getElemByte(6, 6, 2) & 0xff), 10);
+		
+		assertEquals((int)(raster.getElemByte(6, 23, 0) & 0xff), 91);
+		assertEquals((int)(raster.getElemByte(6, 23, 1) & 0xff), 105);
+		assertEquals((int)(raster.getElemByte(6, 23, 2) & 0xff), 92);
+		
+		assertEquals((int)(raster.getElemByte(23, 6, 0) & 0xff), 153);
+		assertEquals((int)(raster.getElemByte(23, 6, 1) & 0xff), 133);
+		assertEquals((int)(raster.getElemByte(23, 6, 2) & 0xff), 122);
+		
+		assertEquals((int)(raster.getElemByte(9, 14, 0) & 0xff), 63);
+		assertEquals((int)(raster.getElemByte(9, 14, 1) & 0xff), 69);
+		assertEquals((int)(raster.getElemByte(9, 14, 2) & 0xff), 55);
+		
+		assertEquals((int)(raster.getElemByte(6, 13, 0) & 0xff), 70);
+		assertEquals((int)(raster.getElemByte(6, 13, 1) & 0xff), 78);
+		assertEquals((int)(raster.getElemByte(6, 13, 2) & 0xff), 55);
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 */
+	/*private void print(){
+		IBuffer raster = ds.getRasterBuf();
+		for(int line = 0; line < raster.getHeight(); line++){
+			for(int col = 0; col < raster.getWidth(); col++)
+				System.out.print("(" + (int)(raster.getElemByte(line, col, 0) & 0xff) + " " + (int)(raster.getElemByte(line, col, 1) & 0xff) + " " + (int)(raster.getElemByte(line, col, 2) & 0xff) + ")");
+			System.out.println();
+		}
+	}*/
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntGdal.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestGdalByteHistogram.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestGdalByteHistogram.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestGdalByteHistogram.java	(revision 15423)
@@ -0,0 +1,133 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+/**
+ * Test a un histograma de una imagen de 3 bandas de un byte por dato leido con gdal. 
+ * El test comprueba valores a lo largo de todo el histograma
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestGdalByteHistogram extends BaseTestCase {
+	private String path = baseDir + "histograma.bmp";	
+	private RasterDataStore       f              = null;	
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TestGdalByteHistogram running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void testStack() {
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			return;
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+//		ds = new BufferFactory(f);
+		BufferHistogram histogram = null;
+		try {
+			histogram = ((RasterDataStore)f).getHistogramComputer().getBufferHistogram();
+			histogram = BufferHistogramImpl.convertHistogramToRGB(histogram);
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (HistogramException e) {
+			e.printStackTrace();
+		}
+		//print(histogram);
+		resultTest(histogram);
+	}
+	
+	private void resultTest(BufferHistogram histogram) {
+		for (int i = 0; i <= 255; i++) {
+			switch (i) {
+				case 0:
+					assertEquals((int) histogram.getHistogramValue(0, i), 1);
+					break;
+				case 1:
+					assertEquals((int) histogram.getHistogramValue(0, i), 2);
+					break;
+				case 2:
+					assertEquals((int) histogram.getHistogramValue(0, i), 3);
+					break;
+				case 126:
+					assertEquals((int) histogram.getHistogramValue(0, i), 4);
+					break;
+				case 127:
+					assertEquals((int) histogram.getHistogramValue(0, i), 5);
+					break;
+				case 128:
+					assertEquals((int) histogram.getHistogramValue(0, i), 6);
+					break;
+				case 129:
+					assertEquals((int) histogram.getHistogramValue(0, i), 7);
+					break;
+				case 253:
+					assertEquals((int) histogram.getHistogramValue(0, i), 8);
+					break;
+				case 254:
+					assertEquals((int) histogram.getHistogramValue(0, i), 9);
+					break;
+				case 255:
+					assertEquals((int) histogram.getHistogramValue(0, i), 10);
+					break;
+				default:
+					assertEquals((int) histogram.getHistogramValue(0, i), 0);
+					break;
+			}
+		}
+	}
+
+	public void print(BufferHistogram histogram) {
+		for (int i = 0; i < histogram.getNumBands(); i++) {
+			int cont = 0;
+			for (int j = 0; j < histogram.getBandLenght(i); j++) {
+				double var = histogram.getHistogramValue(i, j);
+				if (var != 0) {
+					System.out.println(j + ": " + var);
+					cont += var;
+				}
+			}
+			System.out.println("");
+			System.out.println(cont + " ");
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestGdalByteHistogram.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferEcw.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferEcw.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferEcw.java	(revision 15423)
@@ -0,0 +1,22 @@
+/* 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.buffer;

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferEcw.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferMrSID.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferMrSID.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferMrSID.java	(revision 15423)
@@ -0,0 +1,22 @@
+/* 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.buffer;

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSIntBufferMrSID.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentGdal.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentGdal.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentGdal.java	(revision 15423)
@@ -0,0 +1,175 @@
+/* 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.buffer;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+
+/**
+ * Este test prueba el acceso a datos a traves de un DataSource sin resampleo
+ * para un raster leido con Gdal con coordenadas pixel. 
+ * 
+ * Lee el raster completo y comprueba que los datos leidos sean correctos 
+ * comparando los valores de las cuatro esquinas y algunos valores dentro de la imagen.
+ * Despu�s hace selecciona un �rea dentro de la imagen de 2x2 y compara que los valores
+ * leidos sean correctos.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestDSDoubleAdjustToExtentGdal extends BaseTestCase {
+	private String path = baseDir + "miniRaster25x24.tif";	
+	private RasterDataStore       f              = null;	
+	private RasterQuery            query          = null;
+	protected Buffer               raster         = null;
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+    @Override
+    protected void doSetUp() throws Exception {
+		System.err.println("TDSDoubleAdjustToExtentGdal running...");
+		//System.out.println("TestDataSource (Real Coord) Adjust To Extent [Gdal] running...");
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		int[] drawableBands = {0, 1, 2};
+		try {
+			f = manager.open(path);
+		} catch (NotSupportedExtensionException e) {
+			return;
+		} catch (RasterDriverException e) {
+			return;
+		}
+		query = manager.createQuery();
+		query.setDrawableBands(drawableBands);
+		try {
+			query.setAreaOfInterest(645817.0, 4923851.0, 40, 40);
+			raster = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		dataTest1();
+		//print();
+		
+		try {
+			query.setAreaOfInterest(645829.8, 4923840.4, 2, 2);
+			raster = f.query(query);
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		}
+		dataTest2();
+		//print();
+	}
+	
+	private void dataTest2(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 64);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 81);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 39);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 1, 0) & 0xff), 64);
+		assertEquals((int)(raster.getElemByte(0, 1, 1) & 0xff), 81);
+		assertEquals((int)(raster.getElemByte(0, 1, 2) & 0xff), 39);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(1, 0, 0) & 0xff), 64);
+		assertEquals((int)(raster.getElemByte(1, 0, 1) & 0xff), 81);
+		assertEquals((int)(raster.getElemByte(1, 0, 2) & 0xff), 39);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(1, 1, 0) & 0xff), 64);
+		assertEquals((int)(raster.getElemByte(1, 1, 1) & 0xff), 81);
+		assertEquals((int)(raster.getElemByte(1, 1, 2) & 0xff), 39);
+	}
+	
+	private void dataTest1(){
+		//Upper Left
+		assertEquals((int)(raster.getElemByte(0, 0, 0) & 0xff), 14);
+		assertEquals((int)(raster.getElemByte(0, 0, 1) & 0xff), 14);
+		assertEquals((int)(raster.getElemByte(0, 0, 2) & 0xff), 0);
+		//Upper Right
+		assertEquals((int)(raster.getElemByte(0, 24, 0) & 0xff), 68);
+		assertEquals((int)(raster.getElemByte(0, 24, 1) & 0xff), 90);
+		assertEquals((int)(raster.getElemByte(0, 24, 2) & 0xff), 52);
+		//Lower Left
+		assertEquals((int)(raster.getElemByte(23, 0, 0) & 0xff), 129);
+		assertEquals((int)(raster.getElemByte(23, 0, 1) & 0xff), 122);
+		assertEquals((int)(raster.getElemByte(23, 0, 2) & 0xff), 106);
+		//Lower Right
+		assertEquals((int)(raster.getElemByte(23, 24, 0) & 0xff), 145);
+		assertEquals((int)(raster.getElemByte(23, 24, 1) & 0xff), 140);
+		assertEquals((int)(raster.getElemByte(23, 24, 2) & 0xff), 134);
+		
+		assertEquals((int)(raster.getElemByte(6, 6, 0) & 0xff), 21);
+		assertEquals((int)(raster.getElemByte(6, 6, 1) & 0xff), 37);
+		assertEquals((int)(raster.getElemByte(6, 6, 2) & 0xff), 10);
+		
+		assertEquals((int)(raster.getElemByte(6, 23, 0) & 0xff), 91);
+		assertEquals((int)(raster.getElemByte(6, 23, 1) & 0xff), 105);
+		assertEquals((int)(raster.getElemByte(6, 23, 2) & 0xff), 92);
+		
+		assertEquals((int)(raster.getElemByte(23, 6, 0) & 0xff), 153);
+		assertEquals((int)(raster.getElemByte(23, 6, 1) & 0xff), 133);
+		assertEquals((int)(raster.getElemByte(23, 6, 2) & 0xff), 122);
+		
+		assertEquals((int)(raster.getElemByte(9, 14, 0) & 0xff), 63);
+		assertEquals((int)(raster.getElemByte(9, 14, 1) & 0xff), 69);
+		assertEquals((int)(raster.getElemByte(9, 14, 2) & 0xff), 55);
+		
+		assertEquals((int)(raster.getElemByte(6, 13, 0) & 0xff), 70);
+		assertEquals((int)(raster.getElemByte(6, 13, 1) & 0xff), 78);
+		assertEquals((int)(raster.getElemByte(6, 13, 2) & 0xff), 55);
+	}
+	
+	/**
+	 * Imprime todos los pixels de la fuente de datos en RGB
+	 */
+	/*private void print(){
+		IBuffer raster = ds.getRasterBuf();
+		for(int line = 0; line < raster.getHeight(); line++){
+			for(int col = 0; col < raster.getWidth(); col++)
+				System.out.print("(" + (int)(raster.getElemByte(line, col, 0) & 0xff) + " " + (int)(raster.getElemByte(line, col, 1) & 0xff) + " " + (int)(raster.getElemByte(line, col, 2) & 0xff) + ")");
+			System.out.println();
+		}
+	}*/
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/buffer/TestDSDoubleAdjustToExtentGdal.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/TestTemplate.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/TestTemplate.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/TestTemplate.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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;
+
+import junit.framework.TestCase;
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestTemplate extends TestCase {
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestHistogramSerializer running...");
+		
+	}
+	
+	public void testStack(){
+		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/TestTemplate.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/store/TestGetTileUsingStores.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/store/TestGetTileUsingStores.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/store/TestGetTileUsingStores.java	(revision 15423)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.store;
+
+import java.io.File;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.raster.cache.tile.provider.TileServer;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.tilecache.io.TileDataParametersImpl;
+import org.gvsig.raster.tilecache.io.TileProvider;
+import org.gvsig.tools.locator.LocatorException;
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestGetTileUsingStores extends BaseTestCase {
+	private String        path    = baseDir + "03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg";
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestGetTileUsingStores running...");
+		
+	}
+	
+	public void testStack() {
+		TileDataParametersImpl params = new TileDataParametersImpl();
+		params.setFile(new File(path));
+		RasterDataStore store = null;
+		try {
+			store = RasterLocator.getManager().open(params);
+		} catch (LocatorException e) {
+			e.printStackTrace();
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		}
+		TileProvider prov = (TileProvider)store.getProvider();
+		TileServer server = prov.getInternalProvider().getTileServer();
+		double ps = server.getStruct().getPixelSizeByLevel(15);
+		double tileSize = server.getStruct().getTileSizeByLevel(15)[0];
+		double xMax = 645740.00390625 + (tileSize * ps);
+		double yMin = 4924990.522216797 - (tileSize * ps);
+		Extent extent = new ExtentImpl(645740.00390625, 4924990.522216797, xMax, yMin);
+		RasterQuery query = RasterLocator.getManager().createQuery();
+		query.setTileParameters(15, 16912, 12357, extent, server.getStruct());
+		
+		try {
+			Buffer b = store.query(query);
+			System.out.println("" + b);
+		} catch (ProcessInterruptedException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (InvalidSetViewException e) {
+			e.printStackTrace();
+		}
+		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/store/TestGetTileUsingStores.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestGetParams.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestGetParams.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestGetParams.java	(revision 15423)
@@ -0,0 +1,30 @@
+package org.gvsig.fmap.dal.coverage.util;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.raster.ermapper.io.ErmapperDataParameters;
+import org.gvsig.raster.gdal.io.GdalDataParameters;
+import org.gvsig.raster.lizardtech.io.LizardTechDataParameters;
+import org.gvsig.raster.util.DefaultProviderServices;
+
+public class TestGetParams extends BaseTestCase {
+	
+	protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack() {
+		ProviderServices ps = (DefaultProviderServices)manager.getProviderServices();
+		RasterDataParameters params = ps.createParameters("file.jp2");
+		assertTrue(params instanceof ErmapperDataParameters);
+		params = ps.createParameters("file.tif");
+		assertTrue(params instanceof GdalDataParameters);
+		params = ps.createParameters("file.sid");
+		assertTrue(params instanceof LizardTechDataParameters);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestGetParams.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestAdjustExtentToRotateRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestAdjustExtentToRotateRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestAdjustExtentToRotateRaster.java	(revision 15423)
@@ -0,0 +1,87 @@
+/* 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.util;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+/**
+ * Comprueba la llamada de RasterUtilities calculateAdjustedView con un raster
+ * rotado. Le pasar� un extent y este tiene que ser devuelto ajustado a la
+ * transformaci�n indicada. Como comprobaci�n se convertir� el resultado a
+ * valores pixel y se mirar� que esten entre el rango 0-width, 0-height
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TestAdjustExtentToRotateRaster extends BaseTestCase {
+	private int w = 870, h = 870;
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+
+	protected void doSetUp() throws Exception {
+		System.err.println("TestAdjustExtentToRotateRaster running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+
+	public void testStack() {
+		AffineTransform at = new AffineTransform(2.4, 0.2, 0.2, -2.4, 644850.0, 4925250.0);
+		Extent ext = new ExtentImpl(644823.3, 4925240.5, 644930.5, 4925123.6);
+		Extent e = RasterLocator.getManager().getRasterUtils().calculateAdjustedView(ext, at, w, h);
+//		System.out.println("-UL=" + e.minX() + " " + e.maxY());
+//		System.out.println("-LR=" + e.maxX() + " " + e.minY());
+		
+		Point2D ul = new Point2D.Double(e.minX(), e.maxY());
+		Point2D lr = new Point2D.Double(e.maxX(), e.minY());
+
+		try {
+			at.inverseTransform(ul, ul);
+			at.inverseTransform(lr, lr);
+		} catch (NoninvertibleTransformException exc) {
+			exc.printStackTrace();
+		}
+		
+//		System.out.println("*UL=" + ul.getX() + " " + ul.getY());
+//		System.out.println("*LR=" + lr.getX() + " " + lr.getY());
+
+		if (ul.getX() < 0 || ul.getY() < 0 || lr.getX() < 0 || lr.getY() < 0)
+			assertEquals(0, 1);
+
+		if (ul.getX() >= w || ul.getY() >= h || lr.getX() >= w || lr.getY() >= h)
+			assertEquals(0, 1);
+		
+//		System.out.println("-UL=" + e.minX() + " " + e.maxY());
+//		System.out.println("-LR=" + e.maxX() + " " + e.minY());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestAdjustExtentToRotateRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TransparencyRangeTest.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TransparencyRangeTest.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TransparencyRangeTest.java	(revision 15423)
@@ -0,0 +1,110 @@
+/* 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.util;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.raster.impl.datastruct.TransparencyRangeImpl;
+import org.gvsig.raster.impl.provider.DefaultRasterProvider;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TransparencyRangeTest extends BaseTestCase {
+		
+	private TransparencyRange tr = new TransparencyRangeImpl();
+	private TransparencyRange tr1 = new TransparencyRangeImpl();
+	private TransparencyRange tr2 = new TransparencyRangeImpl();
+	private TransparencyRange tr3 = new TransparencyRangeImpl();
+	
+    public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TransparencyRangeTest running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		
+		//Simplificaciones entre dos intervalos
+		
+		tr.setRed(new int[]{3 , 5});
+		tr.setGreen(new int[]{4 , 7});
+		tr.setBlue(new int[]{1 , 5});
+		tr.setAnd(true);
+		tr.loadStrEntryFromValues();
+		
+		tr1.setRed(new int[]{4 , 7});
+		tr1.setGreen(new int[]{3 , 5});
+		tr1.setBlue(new int[]{2 , 4});
+		tr1.setAnd(true);
+		tr1.loadStrEntryFromValues();
+		
+		tr2.setRed(new int[]{5 , 10});
+		tr2.setGreen(new int[]{10 , 15});
+		tr2.setBlue(new int[]{5 , 14});
+		tr2.setAnd(true);
+		tr2.loadStrEntryFromValues();
+		
+		tr3.setRed(new int[]{6 , 12});
+		tr3.setGreen(new int[]{14 , 20});
+		tr3.setBlue(new int[]{16 , 24});
+		tr3.setAnd(true);
+		tr3.loadStrEntryFromValues();
+	}
+	
+	public void testStack(){
+		int[] r = tr.union(tr1.getRed(), DefaultRasterProvider.RED_BAND);
+		int[] g = tr.union(tr1.getGreen(), DefaultRasterProvider.GREEN_BAND);
+		int[] b = tr.union(tr1.getBlue(), DefaultRasterProvider.BLUE_BAND);
+		
+		assertEquals(r[0], 3);
+		assertEquals(r[1], 7);
+		assertEquals(g[0], 3);
+		assertEquals(g[1], 7);
+		assertEquals(b[0], 1);
+		assertEquals(b[1], 5);
+		
+		//Simplificaciones de una lista de intervalos
+		ArrayList<TransparencyRange> l = new ArrayList<TransparencyRange>();
+		l.add(tr);
+		l.add(tr1);
+		l.add(tr2);
+		l.add(tr3);
+		
+		/*Transparency t = new Transparency();
+		t.setTransparencyRangeList(l);
+		t.simplify();
+		
+		for (int i = 0; i < l.size(); i++)
+			System.out.println("Entrada: " + ((TransparencyRange)l.get(i)).getStrEntry());*/
+	}
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TransparencyRangeTest.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIntersectExtent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIntersectExtent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIntersectExtent.java	(revision 15423)
@@ -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.fmap.dal.coverage.util;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+
+/**
+ * Comprueba la llamada de RasterUtilities intersects con un raster rotado. Esta llamada comprueba
+ * si dos extents intersectan.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestIntersectExtent extends BaseTestCase {
+
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestIntersectsExtent running...");
+	}
+	
+	public void testStack(){
+		AffineTransform at = new AffineTransform(2.0707369692354263, -1.2132800188916328, -1.2132800188916328, -2.0707369692354263, 645519.8062266004, 4925635.747389836);
+		Point2D ul = new Point2D.Double(645519.8062266004, 4925635.747389836);
+		Point2D ll = new Point2D.Double(644464.2526101647, 4923834.206226601);
+		Point2D ur = new Point2D.Double(647321.3473898353, 4924580.193773401);
+		Point2D lr = new Point2D.Double(646265.7937733995, 4922778.652610166);
+
+		Point2D ulA = new Point2D.Double(645021.0, 4925601.0);
+		Point2D lrA = new Point2D.Double(645973.0, 4924920.0);
+		
+		Point2D ulB = new Point2D.Double(646008.0, 4923286.0);
+		Point2D lrB = new Point2D.Double(646614.0, 4922830.0);
+		
+		Point2D ulC = new Point2D.Double(646475.0, 4925468.0);
+		Point2D lrC = new Point2D.Double(646822.0, 4925156.0);
+		
+		Extent e1 = new ExtentImpl(ul, lr, ur, ll);
+		Extent e2 = new ExtentImpl(ulA, lrA);
+		Extent e3 = new ExtentImpl(ulB, lrB);
+		Extent e4 = new ExtentImpl(ulC, lrC);
+		
+		try {
+			RasterUtils util = RasterLocator.getManager().getRasterUtils();
+			assertEquals(util.intersects(e1, e2, at), true);
+			assertEquals(util.intersects(e1, e3, at), true);
+			assertEquals(util.intersects(e1, e4, at), false);
+		} catch (NoninvertibleTransformException e) {
+			e.printStackTrace();
+		}
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIntersectExtent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIsInsideRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIsInsideRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIsInsideRaster.java	(revision 15423)
@@ -0,0 +1,69 @@
+/* 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.util;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+
+/**
+ * Comprueba la llamada de RasterUtilities isInside con un raster rotado. Esta llamada cmprueba
+ * si un punto se encuentra dentro de un Extent o fuera. Para esto convierte ambos a coordenadas
+ * pixel y comprueba si el punto est� entre 0 y maxX y 0 y maxY. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TestIsInsideRaster extends BaseTestCase {
+	
+	public void start() throws Exception {
+		this.setUp();
+		this.testStack();
+	}
+	
+	protected void doSetUp() throws Exception {
+		System.err.println("TestIsInsideRaster running...");
+		
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+	}
+	
+	public void testStack(){
+		AffineTransform at = new AffineTransform(2.0707369692354263, -1.2132800188916328, -1.2132800188916328, -2.0707369692354263, 645519.8062266004, 4925635.747389836);
+		Point2D ul = new Point2D.Double(645519.8062266004, 4925635.747389836);
+		Point2D ll = new Point2D.Double(644464.2526101647, 4923834.206226601);
+		Point2D ur = new Point2D.Double(647321.3473898353, 4924580.193773401);
+		Point2D lr = new Point2D.Double(646265.7937733995, 4922778.652610166);
+		Extent e = new ExtentImpl(ul, lr, ur, ll);
+		
+		assertEquals(RasterLocator.getManager().getRasterUtils().isInside(new Point2D.Double(645915.55, 4924461.97), e, at), true);
+		assertEquals(RasterLocator.getManager().getRasterUtils().isInside(new Point2D.Double(646161.22, 4925326.38), e, at), false);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/util/TestIsInsideRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/datastruct/TestColorTable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/datastruct/TestColorTable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/datastruct/TestColorTable.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import java.awt.Color;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.BaseTestCase;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+/**
+ * Test para comprobar el funcionamiento de las tablas de color.
+ * @version 12/05/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class TestColorTable extends BaseTestCase {
+	private String path = baseDir + "gifTransparente.gif";
+
+    protected void doSetUp() throws Exception {
+		try {
+			super.doSetUp();
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+		System.err.println("TestColorTable running...");
+	}
+
+	public void testStack() {
+		dataTest1();
+		dataTest2();
+	}
+
+	/**
+	 * Compara un array de bytes con sus respectivos valores de color
+	 * @param item
+	 * @param red
+	 * @param green
+	 * @param blue
+	 * @param alpha
+	 */
+	private void compareColor(byte[] item, int red, int green, int blue, int alpha) {
+		assertEquals((item[0] & 0xff), red);
+		assertEquals((item[1] & 0xff), green);
+		assertEquals((item[2] & 0xff), blue);
+		assertEquals((item[3] & 0xff), alpha);
+	}
+
+	/**
+	 * Comprueba la tabla de color de una imagen existente
+	 */
+	private void dataTest1() {
+		open(path);
+		ColorTable table = dataStore.getColorTable();
+		compareColor(table.getColorTableByBand()[0],  255, 255, 255,   0);
+		compareColor(table.getColorTableByBand()[1],    0,   0,   0, 255);
+		compareColor(table.getColorTableByBand()[2],    0, 102, 255, 255);
+		compareColor(table.getColorTableByBand()[3],    0, 153, 255, 255);
+		compareColor(table.getColorTableByBand()[4],    0,   0, 255, 255);
+		compareColor(table.getColorTableByBand()[5],    0,  51, 255, 255);
+		compareColor(table.getColorTableByBand()[6],   55,  55, 255, 255);
+		compareColor(table.getColorTableByBand()[7],    0, 204, 255, 255);
+		compareColor(table.getColorTableByBand()[8],  191, 191, 255, 255);
+		compareColor(table.getColorTableByBand()[9],  191, 242, 255, 255);
+		compareColor(table.getColorTableByBand()[10], 223, 223, 223, 255);
+		compareColor(table.getColorTableByBand()[11], 127, 127, 127, 255);
+		compareColor(table.getColorTableByBand()[12],  63,  63,  63, 255);
+		compareColor(table.getColorTableByBand()[13], 159, 159, 159, 255);
+		compareColor(table.getColorTableByBand()[14],  31,  31,  31, 255);
+		compareColor(table.getColorTableByBand()[15],  95,  95,  95, 255);
+		compareColor(table.getColorTableByBand()[16], 191, 191, 191, 255);
+	}
+
+	/**
+	 * Comprueba una tabla de color creada a mano
+	 */
+	@SuppressWarnings("unchecked")
+	private void dataTest2() {
+		ColorTable table = new DataStoreColorTable("dataTest2");
+		ArrayList list = new ArrayList();
+		ColorItem item = new ColorItemImpl();
+		item.setValue(0.0f);
+		item.setColor(Color.black);
+		list.add(item);
+		item = new ColorItemImpl();
+		item.setValue(10.0f);
+		item.setColor(Color.white);
+		list.add(item);
+		item = new ColorItemImpl();
+		item.setValue(20.0f);
+		item.setColor(Color.red);
+		list.add(item);
+
+		table.createPaletteFromColorItems(list, false);
+		table.setInterpolated(false);
+
+		compareColor(table.getRGBAByBand(0.0f),    0,   0,   0, 255);
+		compareColor(table.getRGBAByBand(10.0f), 255, 255, 255, 255);
+		compareColor(table.getRGBAByBand(20.0f), 255,   0,   0, 255);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/java/org/gvsig/fmap/dal/coverage/datastruct/TestColorTable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/readtest.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/readtest.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/readtest.rmf	(revision 15423)
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Histogram>
+	<BandCount>3</BandCount>
+	<DataType>0</DataType>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>2 5 2 0 0 0 2 4 0 0 4 0 1 2 4 0 0 1 4 0 0 4 2 0 4 2 2 0 0 4 2 0 4 0 2 0 6 0 4 0 0 2 0 1 4 2 0 2 0 0 8 2 4 0 0 3 0 0 0 0 0 0 0 0 0 0 4 0 0 0 4 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 6 0 0 8 0 0 0 0 0 0 0 0 2 6 0 4 0 0 0 0 1 0 0 0 2 0 2 0 2 0 0 0 0 0 16 4 0 0 4 0 0 0 0 4 0 4 0 0 2 0 2 2 0 2 0 2 2 6 2 0 0 0 0 0 4 2 0 4 1 0 0 4 4 0 0 0 4 0 0 0 0 0 4 4 0 4 0 6 13 2 7 2 16 4 4 7 6 4 4 16 12 0 7 8 14 14 0 2 6 6 4 6 4 6 12 10 13 4 2 2 6 4 7 0 8 8 2 6 8 4 4 17 0 0 0 0 4 2 0 0 4 4 0 6 8 4 2 2 4 5 5 4 2 6 4 0 2 1 4 4 0 0</Values>
+	</Band>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>2 8 8 2 2 8 1 4 4 4 0 0 3 0 0 4 0 2 4 4 2 0 0 2 0 4 0 0 0 0 4 4 2 4 0 1 0 0 0 0 0 0 0 0 6 3 0 0 2 0 4 0 4 4 2 0 0 0 0 4 0 0 2 0 0 0 0 0 0 0 0 0 4 0 0 0 2 4 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 2 0 0 0 0 0 4 0 4 0 0 0 0 0 2 4 2 0 0 0 4 0 0 0 0 2 0 1 0 0 0 0 2 2 2 0 0 1 1 0 2 8 0 0 0 2 0 0 2 0 0 4 8 0 4 0 0 0 0 0 2 0 0 2 0 0 0 0 0 2 0 6 2 2 0 0 0 5 0 0 0 8 0 0 0 4 4 0 0 0 4 0 0 8 0 8 0 4 0 14 4 0 3 2 10 6 7 4 4 18 2 4 10 12 0 6 12 4 8 12 4 4 12 4 2 6 0 4 15 4 6 10 10 0 2 8 6 2 10 2 1 5 6 8 4 2 8 0 1 8 0 4 0 0 2 6 3 7 12 1 8 8</Values>
+	</Band>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>4 0 8 0 0 4 1 2 2 0 0 0 0 4 0 0 4 0 0 0 6 0 0 0 1 0 0 2 0 0 4 4 1 2 0 0 4 4 2 4 0 0 0 0 0 0 0 0 0 4 0 0 0 0 2 0 4 0 0 0 0 0 2 0 0 0 0 0 0 0 0 4 0 4 0 4 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 2 0 0 0 4 2 4 0 0 0 0 0 0 4 4 0 0 0 0 1 0 0 0 0 0 0 0 2 2 0 0 0 2 0 25 4 1 0 0 0 0 2 0 0 2 4 2 4 0 0 0 0 0 0 0 2 2 6 4 0 1 0 4 4 4 8 0 0 0 5 12 6 14 4 0 0 22 0 4 0 1 4 6 4 10 10 8 2 2 9 10 10 8 2 7 2 10 2 4 4 2 8 14 8 8 2 0 4 4 9 8 8 0 4 5 4 2 6 2 4 2 1 10 2 4 6 8 0 0 0 4 6 1 0 0 6 6 2 0 2 5 10 2 3 0 16 0 0 0 0 0 0 3 4 8 1 2 0 2 0 0 4</Values>
+	</Band>
+</Histogram>
+<ColorTable name="" interpolated="0" version="1.1">
+	<Color value="0.0" name="" rgb="255,255,255" interpolated="50.0"/>
+	<Color value="1.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="2.0" name="" rgb="0,102,255" interpolated="50.0"/>
+	<Color value="3.0" name="" rgb="0,153,255" interpolated="50.0"/>
+	<Color value="4.0" name="" rgb="0,0,255" interpolated="50.0"/>
+	<Color value="5.0" name="" rgb="0,51,255" interpolated="50.0"/>
+	<Color value="6.0" name="" rgb="55,55,255" interpolated="50.0"/>
+	<Color value="7.0" name="" rgb="0,204,255" interpolated="50.0"/>
+	<Color value="8.0" name="" rgb="191,191,255" interpolated="50.0"/>
+	<Color value="9.0" name="" rgb="191,242,255" interpolated="50.0"/>
+	<Color value="10.0" name="" rgb="223,223,223" interpolated="50.0"/>
+	<Color value="11.0" name="" rgb="127,127,127" interpolated="50.0"/>
+	<Color value="12.0" name="" rgb="63,63,63" interpolated="50.0"/>
+	<Color value="13.0" name="" rgb="159,159,159" interpolated="50.0"/>
+	<Color value="14.0" name="" rgb="31,31,31" interpolated="50.0"/>
+	<Color value="15.0" name="" rgb="95,95,95" interpolated="50.0"/>
+	<Color value="16.0" name="" rgb="191,191,191" interpolated="50.0"/>
+	<Color value="17.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="18.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="19.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="20.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="21.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="22.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="23.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="24.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="25.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="26.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="27.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="28.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="29.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="30.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="31.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Alpha value="0.0" alpha="0" interpolated="50.0"/>
+	<Alpha value="1.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="2.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="3.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="4.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="5.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="6.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="7.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="8.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="9.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="10.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="11.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="12.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="13.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="14.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="15.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="16.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="17.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="18.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="19.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="20.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="21.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="22.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="23.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="24.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="25.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="26.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="27.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="28.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="29.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="30.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="31.0" alpha="255" interpolated="50.0"/>
+</ColorTable>
+<Statistics>
+	<BandCount>3</BandCount>
+	<Band>
+		<Max>125.0</Max>
+		<Min>-128.0</Min>
+		<SecondMax>124.0</SecondMax>
+		<SecondMin>-127.0</SecondMin>
+		<MaxRGB>250.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>248.0</SecondMaxRGB>
+		<SecondMinRGB>1.0</SecondMinRGB>
+		<Mean>95.86833333333334</Mean>
+		<Variance>3050.1676638888875</Variance>
+	</Band>
+	<Band>
+		<Max>127.0</Max>
+		<Min>-128.0</Min>
+		<SecondMax>126.0</SecondMax>
+		<SecondMin>-127.0</SecondMin>
+		<MaxRGB>255.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>254.0</SecondMaxRGB>
+		<SecondMinRGB>3.0</SecondMinRGB>
+		<Mean>105.20166666666667</Mean>
+		<Variance>2689.3743305555545</Variance>
+	</Band>
+	<Band>
+		<Max>127.0</Max>
+		<Min>-128.0</Min>
+		<SecondMax>124.0</SecondMax>
+		<SecondMin>-126.0</SecondMin>
+		<MaxRGB>254.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>250.0</SecondMaxRGB>
+		<SecondMinRGB>1.0</SecondMinRGB>
+		<Mean>85.10333333333334</Mean>
+		<Variance>3218.745988888888</Variance>
+	</Band>
+	<TailTrim>
+		<Key>3.0</Key>
+		<Value>10.0</Value>
+	</TailTrim>
+	<TailTrim>
+		<Key>4.0</Key>
+		<Value>16.0</Value>
+	</TailTrim>
+</Statistics>
+<FLyrGeoRaster>
+	<Extent>
+			<X>644848.8</X>
+			<Y>4925251.2</Y>
+			<RotationX>0.0</RotationX>
+			<RotationY>0.0</RotationY>
+			<PixelSizeX>2.4</PixelSizeX>
+			<PixelSizeY>-2.4</PixelSizeY>
+			<Width>2088.0</Width>
+			<Height>2088.0</Height>
+	</Extent>
+	<Dimension>
+			<ImagePxWidth>870.0</ImagePxWidth>
+			<ImagePxHeight>870.0</ImagePxHeight>
+	</Dimension>
+</FLyrGeoRaster>
+<GeoPoints>
+	<GeoPoint n="0">
+		<PixelX>10.0</PixelX>
+		<PixelY>10.0</PixelY>
+		<MapX>34223.3</MapX>
+		<MapY>2344.2</MapY>
+		<Active>true</Active>
+	</GeoPoint>
+	<GeoPoint n="1">
+		<PixelX>10.0</PixelX>
+		<PixelY>10.0</PixelY>
+		<MapX>34223.3</MapX>
+		<MapY>2344.2</MapY>
+		<Active>true</Active>
+	</GeoPoint>
+</GeoPoints>
+<NoData>
+	<Data value="5450.0" type="2"/>
+</NoData>
+<ColorInterpretation>
+	<BandCount>3</BandCount>
+	<Band>Red</Band>
+	<Band>Green</Band>
+	<Band>Blue</Band>
+</ColorInterpretation>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/letters.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/letters.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster25x24.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster25x24.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/q101866.sid
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/q101866.sid
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniraster30x30.jp2
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniraster30x30.jp2
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster25x24.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster25x24.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster25x24.rmf	(revision 15423)
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Histogram>
+	<BandCount>3</BandCount>
+	<DataType>0</DataType>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>2 5 2 0 0 0 2 4 0 0 4 0 1 2 4 0 0 1 4 0 0 4 2 0 4 2 2 0 0 4 2 0 4 0 2 0 6 0 4 0 0 2 0 1 4 2 0 2 0 0 8 2 4 0 0 3 0 0 0 0 0 0 0 0 0 0 4 0 0 0 4 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 6 0 0 8 0 0 0 0 0 0 0 0 2 6 0 4 0 0 0 0 1 0 0 0 2 0 2 0 2 0 0 0 0 0 16 4 0 0 4 0 0 0 0 4 0 4 0 0 2 0 2 2 0 2 0 2 2 6 2 0 0 0 0 0 4 2 0 4 1 0 0 4 4 0 0 0 4 0 0 0 0 0 4 4 0 4 0 6 13 2 7 2 16 4 4 7 6 4 4 16 12 0 7 8 14 14 0 2 6 6 4 6 4 6 12 10 13 4 2 2 6 4 7 0 8 8 2 6 8 4 4 17 0 0 0 0 4 2 0 0 4 4 0 6 8 4 2 2 4 5 5 4 2 6 4 0 2 1 4 4 0 0</Values>
+	</Band>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>2 8 8 2 2 8 1 4 4 4 0 0 3 0 0 4 0 2 4 4 2 0 0 2 0 4 0 0 0 0 4 4 2 4 0 1 0 0 0 0 0 0 0 0 6 3 0 0 2 0 4 0 4 4 2 0 0 0 0 4 0 0 2 0 0 0 0 0 0 0 0 0 4 0 0 0 2 4 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 2 0 0 0 0 0 4 0 4 0 0 0 0 0 2 4 2 0 0 0 4 0 0 0 0 2 0 1 0 0 0 0 2 2 2 0 0 1 1 0 2 8 0 0 0 2 0 0 2 0 0 4 8 0 4 0 0 0 0 0 2 0 0 2 0 0 0 0 0 2 0 6 2 2 0 0 0 5 0 0 0 8 0 0 0 4 4 0 0 0 4 0 0 8 0 8 0 4 0 14 4 0 3 2 10 6 7 4 4 18 2 4 10 12 0 6 12 4 8 12 4 4 12 4 2 6 0 4 15 4 6 10 10 0 2 8 6 2 10 2 1 5 6 8 4 2 8 0 1 8 0 4 0 0 2 6 3 7 12 1 8 8</Values>
+	</Band>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>4 0 8 0 0 4 1 2 2 0 0 0 0 4 0 0 4 0 0 0 6 0 0 0 1 0 0 2 0 0 4 4 1 2 0 0 4 4 2 4 0 0 0 0 0 0 0 0 0 4 0 0 0 0 2 0 4 0 0 0 0 0 2 0 0 0 0 0 0 0 0 4 0 4 0 4 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 2 0 0 0 4 2 4 0 0 0 0 0 0 4 4 0 0 0 0 1 0 0 0 0 0 0 0 2 2 0 0 0 2 0 25 4 1 0 0 0 0 2 0 0 2 4 2 4 0 0 0 0 0 0 0 2 2 6 4 0 1 0 4 4 4 8 0 0 0 5 12 6 14 4 0 0 22 0 4 0 1 4 6 4 10 10 8 2 2 9 10 10 8 2 7 2 10 2 4 4 2 8 14 8 8 2 0 4 4 9 8 8 0 4 5 4 2 6 2 4 2 1 10 2 4 6 8 0 0 0 4 6 1 0 0 6 6 2 0 2 5 10 2 3 0 16 0 0 0 0 0 0 3 4 8 1 2 0 2 0 0 4</Values>
+	</Band>
+</Histogram>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/neighbour50x50.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/neighbour50x50.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/wcs16bits.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/wcs16bits.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/band1-30x28byte.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/band1-30x28byte.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/band2-30x28byte.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/band2-30x28byte.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/band3-30x28byte.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/band3-30x28byte.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/wheel.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/wheel.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster28x25F32.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster28x25F32.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster28x25F32.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster28x25F32.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/miniRaster28x25F32.rmf	(revision 15423)
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Statistics>
+	<BandCount>1</BandCount>
+	<Band>
+		<Max>1273.8699951171875</Max>
+		<Min>1141.550048828125</Min>
+		<SecondMax>1273.8499755859375</SecondMax>
+		<SecondMin>1145.510009765625</SecondMin>
+		<MaxRGB>0.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>0.0</SecondMaxRGB>
+		<SecondMinRGB>255.0</SecondMinRGB>
+		<Mean>1218.573829171317</Mean>
+		<Variance>774.3655060315505</Variance>
+	</Band>
+</Statistics>
+<NoData>
+	<Data value="-99999.0" type="2"/>
+</NoData>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/testGdalWriter.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/testGdalWriter.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.rmf	(revision 15423)
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<FLyrGeoRaster>
+	<Projection>EPSG:23030</Projection>
+	<Extent>
+			<X>645519.8062266004</X>
+			<Y>4925635.747389836</Y>
+			<RotationX>-1.2132800188916328</RotationX>
+			<RotationY>-1.2132800188916328</RotationY>
+			<PixelSizeX>2.0707369692354263</PixelSizeX>
+			<PixelSizeY>-2.0707369692354263</PixelSizeY>
+			<Width>2857.0947796705877</Width>
+			<Height>2857.0947796702385</Height>
+	</Extent>
+	<Dimension>
+			<ImagePxWidth>870.0</ImagePxWidth>
+			<ImagePxHeight>870.0</ImagePxHeight>
+	</Dimension>
+</FLyrGeoRaster>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/testGdalWriter.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/testGdalWriter.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/testGdalWriter.rmf	(revision 15423)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<FLyrGeoRaster>
+	<Extent>
+			<X>644848.8</X>
+			<Y>4925251.2</Y>
+			<RotationX>0.0</RotationX>
+			<RotationY>0.0</RotationY>
+			<PixelSizeX>2.4</PixelSizeX>
+			<PixelSizeY>-2.4</PixelSizeY>
+			<Width>0.0</Width>
+			<Height>0.0</Height>
+	</Extent>
+	<Dimension>
+			<ImagePxWidth>870.0</ImagePxWidth>
+			<ImagePxHeight>870.0</ImagePxHeight>
+	</Dimension>
+</FLyrGeoRaster>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/gifTransparente.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/gifTransparente.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/CastilloEcwETRS89.ecw
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/CastilloEcwETRS89.ecw
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/bilinear50x50.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/bilinear50x50.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie1.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie1.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/inverseDistance50x50.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/inverseDistance50x50.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie2.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie2.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/wcs16bits.wld
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/wcs16bits.wld	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/wcs16bits.wld	(revision 15423)
@@ -0,0 +1,6 @@
+3.8618319375554164
+0.0
+0.0
+3.861681556251123
+748722.1285067874
+4268622.4
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/histograma.bmp
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/histograma.bmp
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie1.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie1.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie1.rmf	(revision 15423)
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Serials>
+	<Serial>
+		<Name>Katrina</Name>
+		<Description>Evolución del katrina</Description>
+		<TimeType>1</TimeType>
+		<DataType>1</DataType>
+		<Dates>
+			<Date>25/08/2005-12:05:00</Date>
+			<Date>27/08/2005-02:36:00</Date>
+		</Dates>
+	</Serial>
+	<Serial>
+		<Name>Katrina2</Name>
+		<Description>Evolución del katrina en otra serie</Description>
+		<TimeType>1</TimeType>
+		<DataType>0</DataType>
+		<Dates>
+			<Date>152322.0</Date>
+			<Date>152400.0</Date>
+		</Dates>
+	</Serial>
+</Serials>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie3.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie3.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie2.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie2.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie2.rmf	(revision 15423)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Serials>
+	<Serial>
+		<Name>Katrina</Name>
+		<Description>Evolución del katrina</Description>
+		<TimeType>0</TimeType>
+		<DataType>1</DataType>
+		<Dates>
+			<Date>28/08/2005-12:05:00</Date>
+		</Dates>
+	</Serial>
+	<Serial>
+		<Name>Katrina2</Name>
+		<Description>Evolución del katrina en otra serie</Description>
+		<TimeType>0</TimeType>
+		<DataType>0</DataType>
+		<Dates>
+			<Date>152438.0</Date>
+		</Dates>
+	</Serial>
+</Serials>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie3.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie3.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/serie3.rmf	(revision 15423)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Serials>
+	<Serial>
+		<Name>Katrina</Name>
+		<Description>Evolución del katrina</Description>
+		<TimeType>0</TimeType>
+		<DataType>1</DataType>
+		<Dates>
+			<Date>29/08/2005-12:00:00</Date>
+		</Dates>
+	</Serial>
+	<Serial>
+		<Name>Katrina2</Name>
+		<Description>Evolución del katrina en otra serie</Description>
+		<TimeType>0</TimeType>
+		<DataType>0</DataType>
+		<Dates>
+			<Date>152550.0</Date>
+		</Dates>
+	</Serial>
+</Serials>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/writetest.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/writetest.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/writetest.rmf	(revision 15423)
@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Histogram>
+	<BandCount>3</BandCount>
+	<DataType>0</DataType>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>2 5 2 0 0 0 2 4 0 0 4 0 1 2 4 0 0 1 4 0 0 4 2 0 4 2 2 0 0 4 2 0 4 0 2 0 6 0 4 0 0 2 0 1 4 2 0 2 0 0 8 2 4 0 0 3 0 0 0 0 0 0 0 0 0 0 4 0 0 0 4 0 2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 6 0 0 8 0 0 0 0 0 0 0 0 2 6 0 4 0 0 0 0 1 0 0 0 2 0 2 0 2 0 0 0 0 0 16 4 0 0 4 0 0 0 0 4 0 4 0 0 2 0 2 2 0 2 0 2 2 6 2 0 0 0 0 0 4 2 0 4 1 0 0 4 4 0 0 0 4 0 0 0 0 0 4 4 0 4 0 6 13 2 7 2 16 4 4 7 6 4 4 16 12 0 7 8 14 14 0 2 6 6 4 6 4 6 12 10 13 4 2 2 6 4 7 0 8 8 2 6 8 4 4 17 0 0 0 0 4 2 0 0 4 4 0 6 8 4 2 2 4 5 5 4 2 6 4 0 2 1 4 4 0 0</Values>
+	</Band>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>2 8 8 2 2 8 1 4 4 4 0 0 3 0 0 4 0 2 4 4 2 0 0 2 0 4 0 0 0 0 4 4 2 4 0 1 0 0 0 0 0 0 0 0 6 3 0 0 2 0 4 0 4 4 2 0 0 0 0 4 0 0 2 0 0 0 0 0 0 0 0 0 4 0 0 0 2 4 0 0 0 0 0 0 0 0 0 5 0 0 0 0 0 0 2 0 0 0 0 0 4 0 4 0 0 0 0 0 2 4 2 0 0 0 4 0 0 0 0 2 0 1 0 0 0 0 2 2 2 0 0 1 1 0 2 8 0 0 0 2 0 0 2 0 0 4 8 0 4 0 0 0 0 0 2 0 0 2 0 0 0 0 0 2 0 6 2 2 0 0 0 5 0 0 0 8 0 0 0 4 4 0 0 0 4 0 0 8 0 8 0 4 0 14 4 0 3 2 10 6 7 4 4 18 2 4 10 12 0 6 12 4 8 12 4 4 12 4 2 6 0 4 15 4 6 10 10 0 2 8 6 2 10 2 1 5 6 8 4 2 8 0 1 8 0 4 0 0 2 6 3 7 12 1 8 8</Values>
+	</Band>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>4 0 8 0 0 4 1 2 2 0 0 0 0 4 0 0 4 0 0 0 6 0 0 0 1 0 0 2 0 0 4 4 1 2 0 0 4 4 2 4 0 0 0 0 0 0 0 0 0 4 0 0 0 0 2 0 4 0 0 0 0 0 2 0 0 0 0 0 0 0 0 4 0 4 0 4 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 2 0 2 0 0 0 4 2 4 0 0 0 0 0 0 4 4 0 0 0 0 1 0 0 0 0 0 0 0 2 2 0 0 0 2 0 25 4 1 0 0 0 0 2 0 0 2 4 2 4 0 0 0 0 0 0 0 2 2 6 4 0 1 0 4 4 4 8 0 0 0 5 12 6 14 4 0 0 22 0 4 0 1 4 6 4 10 10 8 2 2 9 10 10 8 2 7 2 10 2 4 4 2 8 14 8 8 2 0 4 4 9 8 8 0 4 5 4 2 6 2 4 2 1 10 2 4 6 8 0 0 0 4 6 1 0 0 6 6 2 0 2 5 10 2 3 0 16 0 0 0 0 0 0 3 4 8 1 2 0 2 0 0 4</Values>
+	</Band>
+</Histogram>
+<ColorTable name="" interpolated="0" version="1.1">
+	<Color value="0.0" name="" rgb="255,255,255" interpolated="50.0"/>
+	<Color value="1.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="2.0" name="" rgb="0,102,255" interpolated="50.0"/>
+	<Color value="3.0" name="" rgb="0,153,255" interpolated="50.0"/>
+	<Color value="4.0" name="" rgb="0,0,255" interpolated="50.0"/>
+	<Color value="5.0" name="" rgb="0,51,255" interpolated="50.0"/>
+	<Color value="6.0" name="" rgb="55,55,255" interpolated="50.0"/>
+	<Color value="7.0" name="" rgb="0,204,255" interpolated="50.0"/>
+	<Color value="8.0" name="" rgb="191,191,255" interpolated="50.0"/>
+	<Color value="9.0" name="" rgb="191,242,255" interpolated="50.0"/>
+	<Color value="10.0" name="" rgb="223,223,223" interpolated="50.0"/>
+	<Color value="11.0" name="" rgb="127,127,127" interpolated="50.0"/>
+	<Color value="12.0" name="" rgb="63,63,63" interpolated="50.0"/>
+	<Color value="13.0" name="" rgb="159,159,159" interpolated="50.0"/>
+	<Color value="14.0" name="" rgb="31,31,31" interpolated="50.0"/>
+	<Color value="15.0" name="" rgb="95,95,95" interpolated="50.0"/>
+	<Color value="16.0" name="" rgb="191,191,191" interpolated="50.0"/>
+	<Color value="17.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="18.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="19.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="20.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="21.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="22.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="23.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="24.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="25.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="26.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="27.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="28.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="29.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="30.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Color value="31.0" name="" rgb="0,0,0" interpolated="50.0"/>
+	<Alpha value="0.0" alpha="0" interpolated="50.0"/>
+	<Alpha value="1.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="2.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="3.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="4.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="5.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="6.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="7.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="8.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="9.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="10.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="11.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="12.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="13.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="14.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="15.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="16.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="17.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="18.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="19.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="20.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="21.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="22.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="23.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="24.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="25.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="26.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="27.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="28.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="29.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="30.0" alpha="255" interpolated="50.0"/>
+	<Alpha value="31.0" alpha="255" interpolated="50.0"/>
+</ColorTable>
+<Statistics>
+	<BandCount>3</BandCount>
+	<Band>
+		<Max>125.0</Max>
+		<Min>-128.0</Min>
+		<SecondMax>124.0</SecondMax>
+		<SecondMin>-127.0</SecondMin>
+		<MaxRGB>250.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>248.0</SecondMaxRGB>
+		<SecondMinRGB>1.0</SecondMinRGB>
+		<Mean>95.86833333333334</Mean>
+		<Variance>3050.1676638888875</Variance>
+	</Band>
+	<Band>
+		<Max>127.0</Max>
+		<Min>-128.0</Min>
+		<SecondMax>126.0</SecondMax>
+		<SecondMin>-127.0</SecondMin>
+		<MaxRGB>255.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>254.0</SecondMaxRGB>
+		<SecondMinRGB>3.0</SecondMinRGB>
+		<Mean>105.20166666666667</Mean>
+		<Variance>2689.3743305555545</Variance>
+	</Band>
+	<Band>
+		<Max>127.0</Max>
+		<Min>-128.0</Min>
+		<SecondMax>124.0</SecondMax>
+		<SecondMin>-126.0</SecondMin>
+		<MaxRGB>254.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>250.0</SecondMaxRGB>
+		<SecondMinRGB>1.0</SecondMinRGB>
+		<Mean>85.10333333333334</Mean>
+		<Variance>3218.745988888888</Variance>
+	</Band>
+	<TailTrim>
+		<Key>3.0</Key>
+		<Value>10.0</Value>
+	</TailTrim>
+	<TailTrim>
+		<Key>4.0</Key>
+		<Value>16.0</Value>
+	</TailTrim>
+</Statistics>
+<FLyrGeoRaster>
+	<Extent>
+			<X>644848.8</X>
+			<Y>4925251.2</Y>
+			<RotationX>0.0</RotationX>
+			<RotationY>0.0</RotationY>
+			<PixelSizeX>2.4</PixelSizeX>
+			<PixelSizeY>-2.4</PixelSizeY>
+			<Width>2088.0</Width>
+			<Height>2088.0</Height>
+	</Extent>
+	<Dimension>
+			<ImagePxWidth>870.0</ImagePxWidth>
+			<ImagePxHeight>870.0</ImagePxHeight>
+	</Dimension>
+</FLyrGeoRaster>
+<GeoPoints>
+	<GeoPoint n="0">
+		<PixelX>10.0</PixelX>
+		<PixelY>10.0</PixelY>
+		<MapX>34223.3</MapX>
+		<MapY>2344.2</MapY>
+		<Active>true</Active>
+	</GeoPoint>
+	<GeoPoint n="1">
+		<PixelX>10.0</PixelX>
+		<PixelY>10.0</PixelY>
+		<MapX>34223.3</MapX>
+		<MapY>2344.2</MapY>
+		<Active>true</Active>
+	</GeoPoint>
+</GeoPoints>
+<NoData>
+	<Data value="5450.0" type="2"/>
+</NoData>
+<ColorInterpretation>
+	<BandCount>3</BandCount>
+	<Band>Red</Band>
+	<Band>Green</Band>
+	<Band>Blue</Band>
+</ColorInterpretation>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/03AUG23153350-M2AS-000000122423_01_P001-BROWSE.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/bspline50x50.tif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/bspline50x50.tif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/histograma.rmf
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/histograma.rmf	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/histograma.rmf	(revision 15423)
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="ISO-8859-15"?>
+<RasterMetaFile>
+<Statistics>
+	<BandCount>1</BandCount>
+	<Band>
+		<Max>127.0</Max>
+		<Min>-128.0</Min>
+		<SecondMax>126.0</SecondMax>
+		<SecondMin>-127.0</SecondMin>
+		<MaxRGB>255.0</MaxRGB>
+		<MinRGB>0.0</MinRGB>
+		<SecondMaxRGB>254.0</SecondMaxRGB>
+		<SecondMinRGB>1.0</SecondMinRGB>
+		<Mean>175.96363636363637</Mean>
+		<Variance>7253.525950413219</Variance>
+	</Band>
+</Statistics>
+<Histogram>
+	<BandCount>1</BandCount>
+	<DataType>0</DataType>
+	<Band>
+		<Min>-128.0</Min>
+		<Max>127.0</Max>
+		<Values>6 7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 8 9 10 1 2 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 4 5</Values>
+	</Band>
+</Histogram>
+</RasterMetaFile>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/03AUG23153350-M2AS-000000122423_01_P001-BROWSE.wld
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/03AUG23153350-M2AS-000000122423_01_P001-BROWSE.wld	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/03AUG23153350-M2AS-000000122423_01_P001-BROWSE.wld	(revision 15423)
@@ -0,0 +1,6 @@
+2.4
+0
+0
+-2.4
+644850.0
+4925250.0
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.wld
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.wld	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/src/test/resources/rot.wld	(revision 15423)
@@ -0,0 +1,6 @@
+2.4
+0
+0
+-2.4
+644850.0
+4925250.0
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.main/pom.xml	(revision 15423)
@@ -0,0 +1,106 @@
+<?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.main</artifactId>
+    <packaging>jar</packaging>
+    <name>org.gvsig.raster.main</name>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.raster</artifactId>
+        <version>2.2.1-SNAPSHOT</version>
+    </parent>
+    <properties>
+        <build-dir>${basedir}/../../build</build-dir>
+    </properties>
+    <dependencyManagement>
+     	<!-- ONLY MAIN DEPENDENCIES -->
+    	<dependencies>
+	        <dependency>
+            	<groupId>org.gvsig</groupId>
+            	<artifactId>org.gvsig.raster.gdal.io</artifactId>
+            	<version>2.0.0-SNAPSHOT</version>
+        	</dependency>
+        	<dependency>
+            	<groupId>org.gvsig</groupId>
+            	<artifactId>org.gvsig.raster.ermapper.io</artifactId>
+            	<version>2.0.0-SNAPSHOT</version>
+        	</dependency>
+        	<dependency>
+            	<groupId>org.gvsig</groupId>
+            	<artifactId>org.gvsig.raster.lizardtech.io</artifactId>
+            	<version>2.0.0-SNAPSHOT</version>
+	        </dependency>
+	        <dependency>
+				<groupId>org.gvsig</groupId>
+				<artifactId>org.gvsig.raster.tilecache.io</artifactId>
+				<version>2.0.0-SNAPSHOT</version>
+			</dependency>
+		</dependencies>
+	</dependencyManagement>
+    <dependencies>
+        <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.gdal.io</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.lib.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+         <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.ermapper.io</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.lizardtech.io</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.gdal.io</artifactId>
+            <scope>test</scope>
+        </dependency>
+        <dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.cache.lib.impl</artifactId>
+            <scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.timesupport.lib.impl</artifactId>
+            <scope>test</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.tilecache.io</artifactId>
+            <scope>test</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.core.maven.dependencies</artifactId>
+            <type>pom</type>
+            <scope>test</scope>
+        </dependency>
+    </dependencies>
+    <build>
+        <plugins>
+            <!-- TODO: MAKE TESTS WORK AND REMOVE THIS OPTION -->
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+</project>

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 15423)
@@ -0,0 +1 @@
+org.gvsig.raster.algorithm.RasterBaseAlgorithmLibrary
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/org/gvsig/raster/algorithm/i18n/text.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/org/gvsig/raster/algorithm/i18n/text.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/org/gvsig/raster/algorithm/i18n/text.properties	(revision 15423)
@@ -0,0 +1,17 @@
+The_process_cant_be_cancelled=No se puede cancelar el proceso
+Failed_pausing_the_process=No se puede pausar el proceso
+msg_cancel_incrementable=�Est� seguro de que desea cancelar este proceso?
+title_cancel_incrementable=Confirmaci�n
+Failed_resuming_the_process=Fall\u00f3 reanudando el proceso.
+The_process_cant_be_paused=No se puede pausar el proceso
+espere=Espere
+tiempo_transcurrido=Tiempo transcurrido
+error_processing=Error en el procesado
+cargar_toc=\u00bfDesea cargar la capa en el TOC?
+confirmacion=Confirmaci�n
+stats=Estad�sticas
+compress=Compresi�n
+file=Fichero
+path=Ruta
+size=Tama�o
+time=Tiempo
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/org/gvsig/raster/algorithm/i18n/text_en.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/org/gvsig/raster/algorithm/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/resources/org/gvsig/raster/algorithm/i18n/text_en.properties	(revision 15423)
@@ -0,0 +1,17 @@
+The_process_cant_be_cancelled=Operation cannot be cancelled.
+Failed_pausing_the_process=Failed to pause processing.
+msg_cancel_incrementable=Cancel the computation?
+title_cancel_incrementable=Confirmation
+Failed_resuming_the_process=Failed to resume processing.
+The_process_cant_be_paused=Operation cannot be paused.
+espere=Wait
+tiempo_transcurrido=Elapsed time
+error_processing=Error in the process
+cargar_toc=Would you like to load layer?
+confirmacion=Confirmation
+stats=Statistics
+compress=Compression
+file=File
+path=Path
+size=Size
+time=Time
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmManager.java	(revision 15423)
@@ -0,0 +1,68 @@
+/* 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.algorithm;
+
+import org.gvsig.raster.algorithm.process.DataProcess;
+import org.gvsig.raster.algorithm.process.ProcessException;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+/**
+ * Default {@link RasterBaseAlgorithmManager} implementation.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @version $Id$
+ */
+public class RasterBaseAlgorithmManager {
+	private static RasterBaseAlgorithmManager internalInstance  = new RasterBaseAlgorithmManager();
+
+	/**
+	 * Gets an instance of this object for internal use.
+	 * @return RasterBaseAlgorithmManager
+	 */
+	public static RasterBaseAlgorithmManager getInstance() {
+		return internalInstance;
+	}
+
+	/**
+	 * Returns a new instance of a process.
+	 * @param processLabel
+	 *        Label to identify the process
+	 * @return DataProcess
+	 * @throws ProcessException
+	 */
+	public DataProcess createRasterTask(String processLabel) throws ProcessException {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(RasterBaseAlgorithmLibrary.REGISTER_PROCESS_LABEL);
+		try {
+			DataProcess process = (DataProcess)point.create(processLabel);
+			process.setName(processLabel);
+			return process;
+		} catch (InstantiationException e) {
+			throw new ProcessException("", e);
+		} catch (IllegalAccessException e) {
+			throw new ProcessException("", e);
+		}
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Operation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Operation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Operation.java	(revision 15423)
@@ -0,0 +1,32 @@
+/* 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.algorithm.util;
+
+/**
+ * Interface for operations
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface Operation {
+	public boolean compare(double a, double b);
+	
+	public void invoke();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Operation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/AbstractOperation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/AbstractOperation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/AbstractOperation.java	(revision 15423)
@@ -0,0 +1,36 @@
+/* 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.algorithm.util;
+
+/**
+ * Interface for operations
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class AbstractOperation implements Operation {
+	public boolean compare(double a, double b) {
+		return false;
+	}
+	
+	public void invoke() {
+		//do nothing
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/AbstractOperation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Interpolation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Interpolation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Interpolation.java	(revision 15423)
@@ -0,0 +1,261 @@
+/* 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.algorithm.util;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+
+/**
+ * Calculates a pixel value using a interpolation method
+ * @author Nacho Brodin nachobrodin@gmail.com
+ * @author Victor Olaya
+ */
+public class Interpolation {
+	private Buffer        buffer    = null;
+	private double        nodata    = 0;
+	
+	public Interpolation(Buffer buf) {
+		this.buffer = buf;
+		NoData nodata = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(
+				1, Buffer.TYPE_DOUBLE);
+		this.nodata = nodata.getValue().doubleValue();
+	}
+	
+	private double[] getKernel(int x, int y, int band) {
+		if(buffer.getDataType() == Buffer.TYPE_BYTE) {
+			return getKernelByte(x, y, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_DOUBLE) {
+			return getKernelByte(x, y, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_FLOAT) {
+			return getKernelByte(x, y, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_SHORT) {
+			return getKernelByte(x, y, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_INT) {
+			return getKernelByte(x, y, band);
+		}
+		return null;
+	}
+
+	public double getNearestNeighbour(double x, double y, int band) {
+		int dy = (int)Math.round(y);
+		int dx = (int)Math.round(x);
+		dy = dy < buffer.getHeight() ? dy : buffer.getHeight() - 1;
+		dx = dx < buffer.getWidth() ? dx : buffer.getWidth() - 1;
+		if(buffer.getDataType() == Buffer.TYPE_BYTE) {
+			return (double)buffer.getElemByte(dy, dx, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_DOUBLE) {
+			return (double)buffer.getElemDouble(dy, dx, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_FLOAT) {
+			return (double)buffer.getElemFloat(dy, dx, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_SHORT) {
+			return (double)buffer.getElemShort(dy, dx, band);
+		}
+		if(buffer.getDataType() == Buffer.TYPE_INT) {
+			return (double)buffer.getElemInt(dy, dx, band);
+		}
+		return nodata;
+	}
+
+	/**
+	 * Calcula los valores N y Z para el m�todo bilinear y obtiene el valor del pixel como
+	 * Z / N
+	 * @param dx distancia en X desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param dy distancia en Y desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param kernel valor del pixel y alrededor 
+	 * @return valor del pixel
+	 */
+	public double getBilinearValue(double x, double y, int band) {
+		double[] kernel = getKernel((int)x, (int)y, band);
+		double dx = x - ((int) x);
+		double dy = y - ((int) y);
+		
+		double z = 0.0, n = 0.0, d;
+		d = (1.0 - dx) * (1.0 - dy);
+		z += d * kernel[0];
+		n += d;
+
+		d = dx * (1.0 - dy);
+		z += d * kernel[1]; 
+		n += d;
+
+		d = (1.0 - dx) * dy;
+		z += d * kernel[2]; 
+		n += d;
+
+		d = dx * dy;
+		z += d * kernel[3]; 
+		n += d;
+
+		double b = 0;
+		if(n > 0.0)
+			b = (z / n);
+		return b;
+	}
+	
+	/**
+	 * Calcula los valores N y Z para el m�todo de distancia inversa y calcula el valor del
+	 * pixel como Z / N.
+	 * @param dx distancia en X desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param dy distancia en Y desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param kernel valor del pixel y alrededor 
+	 * @return valor del pixel
+	 */
+	public double getInverseDistance(double x, double y, int band) {
+		double[] kernel = getKernel((int)x, (int)y, band);
+		double dx = x - ((int) x);
+		double dy = y - ((int) y);
+		
+		double z = 0.0, n = 0.0, d;
+		d = 1.0 / Math.sqrt(dx * dx + dy * dy);
+		z += d * kernel[0];
+		n += d;
+
+		d = 1.0 / Math.sqrt((1.0 - dx) * ( 1.0 - dx) + dy * dy);
+		z += d * kernel[1]; 
+		n += d;
+
+		d = 1.0 / Math.sqrt(dx*dx + (1.0-dy)*(1.0-dy));
+		z += d * kernel[2]; 
+		n += d;
+
+		d = 1.0 / Math.sqrt((1.0 - dx) *( 1.0 - dx) + (1.0 - dy) * (1.0 - dy));
+		z += d * kernel[3]; 
+		n += d;
+
+		double b = 0;
+		if(n > 0.0)
+			b = (z / n);
+		return b;
+	}
+	
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	private double[] getKernelByte(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = (buffer.getElemByte(y, x, band) & 0xff);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = (buffer.getElemByte(y, nextX, band) & 0xff);
+		d[2] = (buffer.getElemByte(nextY, x, band) & 0xff);
+		d[3] = (buffer.getElemByte(nextY, nextX, band) & 0xff);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	@SuppressWarnings("unused")
+	private double[] getKernelShort(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = (buffer.getElemShort(y, x, band) & 0xffff);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = (buffer.getElemShort(y, nextX, band) & 0xffff);
+		d[2] = (buffer.getElemShort(nextY, x, band) & 0xffff);
+		d[3] = (buffer.getElemShort(nextY, nextX, band) & 0xffff);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	@SuppressWarnings("unused")
+	private double[] getKernelInt(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = (buffer.getElemInt(y, x, band) & 0xffffffff);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = (buffer.getElemInt(y, nextX, band) & 0xffffffff);
+		d[2] = (buffer.getElemInt(nextY, x, band) & 0xffffffff);
+		d[3] = (buffer.getElemInt(nextY, nextX, band) & 0xffffffff);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	@SuppressWarnings("unused")
+	private double[] getKernelFloat(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = buffer.getElemFloat(y, x, band);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = buffer.getElemFloat(y, nextX, band);
+		d[2] = buffer.getElemFloat(nextY, x, band);
+		d[3] = buffer.getElemFloat(nextY, nextX, band);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	@SuppressWarnings("unused")
+	private double[] getKernelDouble(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = buffer.getElemDouble(y, x, band);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = buffer.getElemDouble(y, nextX, band);
+		d[2] = buffer.getElemDouble(nextY, x, band);
+		d[3] = buffer.getElemDouble(nextY, nextX, band);
+		return d;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/util/Interpolation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/DataProcess.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/DataProcess.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/DataProcess.java	(revision 15423)
@@ -0,0 +1,357 @@
+/* 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.algorithm.process;
+
+import java.util.HashMap;
+import java.util.Hashtable;
+
+import javax.swing.SwingUtilities;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.process.CancelEvent;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+import org.gvsig.raster.algorithm.gui.IIncrementable;
+import org.gvsig.raster.algorithm.gui.IncrementableEvent;
+import org.gvsig.raster.algorithm.gui.IncrementableListener;
+import org.gvsig.raster.algorithm.gui.IncrementableTask;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+import org.gvsig.tools.dispose.Disposable;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Clase base de todos los procesos raster. En ella se genstionan todas las
+ * funciones comunes como incremento de la tarea, gesti�n de eventos a la tarea, 
+ * par�metros de la tarea, etc ...
+ * 
+ * 18/12/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class DataProcess extends ProcessParamsManagement implements IIncrementable, IncrementableListener, Runnable, Disposable {
+	protected IncrementableTask incrementableTask = null;
+	protected volatile Thread   blinker           = null;
+	protected TaskEventManager  taskEventManager  = null;
+	protected IProcessActions   externalActions   = null;
+	protected Hashtable<String, Object>
+	                            taskParams        = new Hashtable<String, Object>();
+	
+
+	private String              log               = "";
+	private String              lastLine          = "";
+	private long                time              = 0;
+	private boolean             progressActive    = true;
+	private IProcessActions     queueActions      = null;
+	protected Logger            logger            = LoggerFactory.getLogger(DataProcess.class.toString());
+	private int                 percent           = 0;
+	private String              processName       = null;
+	
+	//***************************************************
+	//Task control
+	//***************************************************
+	
+	/**
+	 * Builds the window <code>IncrementableTask</code> to show
+	 * the increment of the task.
+	 */
+	public IncrementableTask getIncrementableTask() {
+		if (incrementableTask == null) {
+			incrementableTask = new IncrementableTask(this);
+			incrementableTask.addIncrementableListener(this);
+		}
+		return incrementableTask;
+	}
+	
+	/**
+	 * Sets the button to cancel the task
+	 */
+	public void setCancelable(boolean enabled) {
+		getIncrementableTask().getButtonsPanel().setEnabled(IButtonsPanel.BUTTON_CANCEL, enabled);
+	}
+	
+	/**
+	 * Show the increment of this task <code>IncrementableTask</code>
+	 */
+	public void showIncrementableWindow() {
+		if (progressActive) {
+			getIncrementableTask().showWindow();
+			getIncrementableTask().start();
+		}
+	}
+
+	/**
+	 * Starts the process. It will call the run method
+	 */
+	public void start() {
+		showIncrementableWindow();
+		if(blinker == null)
+			blinker = new Thread(this);
+		blinker.start();
+	}
+		
+	/**
+	 * A specific task will load parameters using this initialization.
+	 */
+	public abstract void init();
+	
+	/**
+	 * This call will be implemented by a specific process. It will do the actions to carry out
+	 * the task
+	 * @throws InterruptedException
+	 */
+	public abstract void process() throws ProcessInterruptedException, ProcessException;
+	
+	/**
+	 * Gets the result of the process. All processes will have a parameter PROCESS that it is
+	 * the own process. It is useful to get the process name or other data.
+	 * 
+	 * This result of the process is sent to the method "end" in <code>IProcessActions</code> when the task
+	 * is thrown in a thread or is recovered by the user when the task is thrown sequentially.
+	 * 
+	 * @return Result of the task
+	 */
+	public HashMap<String, Object> getResult() {
+		outputParameters.put("PROCESS", this);
+		outputParameters.put(TIME, getTime());
+		outputParameters.put(PROCESS_NAME, getName());
+		return outputParameters;
+	}
+	
+	/**
+	 * Adds a output from the process in runtime
+	 * @param key
+	 * @param value
+	 */
+	protected void addOutputValue(String key, Object value) {
+		outputParameters.put(key, value);
+	}
+	
+	/**
+	 * Sequential execution of this task
+	 * @throws ProcessException 
+	 */
+	public void execute() throws ProcessInterruptedException, ProcessException {
+		taskEventManager = RasterLocator.getManager().createRasterTask(this);
+		loadGlobalParameters();
+		init();
+		process();
+		
+		//Sets in the output the result of the process
+		SwingUtilities.invokeLater(new Runnable() {
+			public void run() {
+				if (externalActions != null) {
+					externalActions.end(getResult());
+				}
+			}
+		});
+	}
+	
+	/**
+	 * This method will be executed by the Thread. It will have the global actions for 
+	 * any task and it will call to the <code>execute</code> function.
+	 */
+	public void run() {
+		long t1 = new java.util.Date().getTime();
+
+		try {
+			execute();
+		} catch (ProcessInterruptedException e) {
+			if (externalActions != null)
+				externalActions.interrupted();
+			Thread.currentThread().interrupt();
+		} catch (ProcessException e) {
+			if (progressActive) {
+				if (incrementableTask != null) {
+					getIncrementableTask().processFinalize();
+					incrementableTask = null;
+				}
+			}
+			logger.warn(RasterLocator.getManager().getRasterUtils().getTrace(e));
+			if(e.getMessage() != null && e.getMessage().compareTo("") != 0)
+				messageBoxError(e.getMessage(), null);
+			else
+				messageBoxError("error_processing", null);
+			queueActions = null;
+
+		} catch (Exception e) {
+			if (progressActive) {
+				if (incrementableTask != null) {
+					getIncrementableTask().processFinalize();
+					incrementableTask = null;
+				}
+			}
+			logger.warn(RasterLocator.getManager().getRasterUtils().getTrace(e));
+			if(e.getMessage() != null && e.getMessage().compareTo("") != 0)
+				messageBoxError(e.getMessage(), null);
+			else
+				messageBoxError("error_processing", null);
+			queueActions = null;
+		} finally {
+			try {
+				//Evita un NullPointerException sun.awt.X11.XWindowPeer.restoreTransientFor(XWindowPeer.java:1500) 
+				Thread.sleep(500);
+			} catch(Exception e) {}
+			
+			taskEventManager.removeTask();
+			if (progressActive) {
+				if (incrementableTask != null)
+					getIncrementableTask().processFinalize();
+			}
+			if (queueActions != null)
+				queueActions.end(this);
+			time = new java.util.Date().getTime() - t1;
+			blinker = null;
+		}
+	}
+	
+	/**
+	 * When the process is launched in a thread, this method enables or disables
+	 * the GUI to show the progress.
+	 */
+	public void setProgressActive(boolean active) {
+		this.progressActive = active;
+	}
+	
+	/**
+	 * Gets the time that a task lasts
+	 */
+	public long getTime() {
+		return time;
+	}
+	
+	/**
+	 * Gets the object to execute external actions. 
+	 * A user should be register this object to receive the events
+	 */
+	public IProcessActions getActions() {
+		return externalActions;
+	}
+
+	/**
+	 * Sets the object to execute external actions. 
+	 * A user should be register this object to receive the events
+	 */
+	public void setActions(IProcessActions actions) {
+		this.externalActions = actions;
+	}
+	
+	/**
+	 * Gets the object to execute actions in the queue of processes
+	 */
+	public IProcessActions getUniqueProcessActions() {
+		return queueActions;
+	}
+
+	/**
+	 * Asigna el objeto para ejecutar acciones externar.
+	 * @param IProcessActions
+	 */
+	public void setUniqueProcessActions(IProcessActions actions) {
+		this.queueActions = actions;
+	}
+	
+	/**
+	 * Inserts a new line in the increment window
+	 */
+	protected void insertLineLog(String line) {
+		lastLine = line;
+		log = log + line + "\n";
+	}
+	
+	/**
+	 * Gets the last line in the increment window
+	 */
+	public String getLabel() {
+		return lastLine;
+	}
+	
+	/**
+	 * Gets the log of the increment window
+	 */
+	public String getLog() {
+		return log;
+	}
+	
+	/**
+	 * Un evento de cancelado es enviado a la tarea cuando actionCanceled es activado. Para
+	 * ello se crear� un objeto CancelEvent y se asignar� a la tarea en ejecuci�n. Esta lo
+	 * procesar� cuando pueda e interrumpir� el proceso.
+	 */
+	public void actionCanceled(IncrementableEvent e) {
+		taskEventManager.setEvent(new CancelEvent(this));
+	}
+	
+	/**
+	 * Updates the percentaje of progress and manages the cancelation
+	 * @param parcial
+	 * @param total
+	 * @throws ProcessInterruptedException
+	 */
+	public void updatePercent(int parcial, int total) throws ProcessInterruptedException {
+		if (taskEventManager != null && taskEventManager.getEvent() != null)
+			taskEventManager.manageEvent(taskEventManager.getEvent());
+		if(externalActions != null)
+			externalActions.updateProgress(parcial, total);
+		percent = (int)((parcial * 100) / total);
+	}
+
+	public int getPercent() {
+		return percent;
+	}
+
+	public void actionResumed(IncrementableEvent e) {	
+	}
+	
+	public void actionSuspended(IncrementableEvent e) {
+	}
+	
+	public boolean isCancelable() {
+		return true;
+	}
+
+	public boolean isPausable() {
+		return false;
+	}
+	
+	public String getName() {
+		return processName;
+	}
+	
+	public void setName(String name) {
+		this.processName = name;
+	}
+	
+	public void dispose() {
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	@Override
+	protected void finalize() throws Throwable {
+		incrementableTask           = null;
+		blinker                     = null;
+		externalActions             = null;
+		super.finalize();
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/DataProcess.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/IProcessActions.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/IProcessActions.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/IProcessActions.java	(revision 15423)
@@ -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.algorithm.process;
+
+/**
+ * Acciones que puede ejecutar un proceso sobre un objeto externo. Un proceso
+ * debe ser independiente de objetos que sean dependientes de su funcionalidad. Es
+ * decir, cualquier extensi�n debe poder usar un proceso y este ejecutar metodos
+ * de la funcionalidad. Esto se hace ha trav�s de este interfaz.
+ * 
+ * @version 26/09/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface IProcessActions {
+	
+	/**
+	 * El proceso comunica que ha sido interrumpido
+	 *
+	 */
+	public void interrupted();
+
+	/**
+	 * Acciones de finalizaci�n del proceso
+	 */
+	public void end(Object param);
+	
+	/**
+	 * A process can report the progress of the task
+	 * @param current
+	 * @param total
+	 */
+	public void updateProgress(int current, int total);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/IProcessActions.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessException.java	(revision 15423)
@@ -0,0 +1,39 @@
+/* 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.algorithm.process;
+/**
+ * This exception is thrown when a problem inside a raster process
+ * is detected. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ProcessException extends Exception {
+	private static final long serialVersionUID = 666908550965442025L;
+
+	public ProcessException(String msg, Throwable e) {
+		super(msg, e);
+	}
+	
+	public ProcessException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessParamsManagement.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessParamsManagement.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessParamsManagement.java	(revision 15423)
@@ -0,0 +1,407 @@
+/* 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.algorithm.process;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.raster.algorithm.gui.IIncrementable;
+import org.gvsig.raster.algorithm.gui.IncrementableListener;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.Disposable;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+/**
+ * Base class for all geoprocesses. This class contains all utilities to register
+ * and get parameters in a geoprocess instance
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class ProcessParamsManagement extends ProcessUtils implements IIncrementable, IncrementableListener, Runnable, Disposable {
+	//***********************
+	//Global input parameters
+	//***********************
+	
+	/**
+	 * Input parameter: If is defined then the ROIs will be used
+	 */
+	public static String                ROI_EPSG                           = "ROI_EPSG";
+	/**
+	 * Input parameter: Force to this bounding box. If is defined, then ROI_EPSG is not taken into account
+	 */
+	public static String                WINDOW                             = "WINDOW";
+	/**
+	 * Input parameter: Force to this width in pixels in the output buffer
+	 */
+	public static String                OUTPUT_WIDTH                       = "OUTPUT_WIDTH";
+	/**
+	 * Input parameter: Force to this height in pixels in the output buffer
+	 */
+	public static String                OUTPUT_HEIGHT                      = "OUTPUT_HEIGHT";
+	/**
+	 * Input parameter: The output of this algorithm is for previews. It usually implies that the buffer will be
+	 * send as output parameter, the buffer will be RGB and the input buffer will be to read and write
+	 */
+	public static String                PREVIEW                            = "PREVIEW";
+	
+	//************************
+	//Global output parameters
+	//***********************
+	
+	/**
+	 * Output parameter: The getResult sets the correct value in the output.
+	 */
+	public static String                TIME                               = "TIME";
+	/**
+	 * Output parameter: The getResult sets the correct value in the output.
+	 */
+	public static String                PROCESS                            = "PROCESS";
+	/**
+	 * Output parameter: The getResult sets the correct value in the output.
+	 */
+	public static String                PROCESS_NAME                       = "PROCESS_NAME";
+
+	public static final String          REGISTER_INPUT_PARAMETERS_LABEL    = "RasterProcessInputParam";
+	public static final String          REGISTER_OUTPUT_PARAMETERS_LABEL   = "RasterProcessOutputParam";
+	
+	private Extent                      outputWindow                       = null;
+	private int                         outputWidth                        = 0;
+	private int                         outputHeight                       = 0;
+	private String                      roiEPSG                            = null;
+	private boolean                     preview                            = false;
+	private boolean                     globalParametersLoaded             = false;
+
+	protected Hashtable<String, Object> inputParameters                    = new Hashtable<String, Object>();
+	protected HashMap<String, Object>   outputParameters                   = new HashMap<String, Object>();
+
+	/**
+	 *  Registers input parameters of a raster process
+	 */
+	public static void registerInputParameter(String parameterLabel, Class<?> parameterClass, String processLabel) {
+		registerParameter(processLabel, parameterLabel, parameterClass, REGISTER_INPUT_PARAMETERS_LABEL);
+	}
+	
+	/**
+	 *  Registers output parameters of a raster process
+	 */
+	public static void registerOutputParameter(String parameterLabel, Class<?> parameterClass, String processLabel) {
+		registerParameter(processLabel, parameterLabel, parameterClass, REGISTER_OUTPUT_PARAMETERS_LABEL);
+	}
+	
+	/**
+	 * Registers a parameter for a raster process
+	 */
+	private static void registerParameter(String processLabel, String parameterLabel, Class<?> parameterClass, String type) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(type + "_" + processLabel);
+		point.append(parameterLabel, "", parameterClass);
+		registerGlobalInputParameters(parameterLabel, parameterClass, processLabel);
+		registerGlobalOutputParameters(parameterLabel, parameterClass, processLabel);
+	}
+	
+	public static void registerGlobalInputParameters(String parameterLabel, Class<?> parameterClass, String processLabel) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(REGISTER_INPUT_PARAMETERS_LABEL + "_" + processLabel);
+		if(!point.has(ROI_EPSG))
+			point.append(ROI_EPSG, "", String.class);
+		if(!point.has(WINDOW))
+			point.append(WINDOW, "", Extent.class);
+		if(!point.has(OUTPUT_HEIGHT))
+			point.append(OUTPUT_HEIGHT, "", Integer.class);
+		if(!point.has(OUTPUT_WIDTH))
+			point.append(OUTPUT_WIDTH, "", Integer.class);
+		if(!point.has(PREVIEW))
+			point.append(PREVIEW, "", Boolean.class);
+	}
+	
+	public static void registerGlobalOutputParameters(String parameterLabel, Class<?> parameterClass, String processLabel) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(REGISTER_OUTPUT_PARAMETERS_LABEL + "_" + processLabel);
+		if(!point.has(TIME))
+			point.append(TIME, "", Long.class);
+		if(!point.has(PROCESS))
+			point.append(PROCESS, "", DataProcess.class);
+		if(!point.has(PROCESS_NAME))
+			point.append(PROCESS_NAME, "", String.class);
+	}
+	
+	/**
+	 * Gets the key list of the input parameters
+	 * @param processLabel
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public List<String> getRasterTaskInputParameters(String processLabel) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(REGISTER_INPUT_PARAMETERS_LABEL + "_" + processLabel);
+		return point.getNames();
+	}
+	
+	/**
+	 * Gets the key list of the output parameters
+	 * @param processLabel
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public List<String> getRasterTaskOutputParameters(String processLabel) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(REGISTER_OUTPUT_PARAMETERS_LABEL + "_" + processLabel);
+		return point.getNames();
+	}
+	
+	/**
+	 * Gets the class of a parameter in a process.
+	 * @param processLabel
+	 * @param parameterName
+	 * @return
+	 */
+	public Class<?> getParameterTypeByProcess(String processLabel, String parameterName) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get(REGISTER_INPUT_PARAMETERS_LABEL + "_" + processLabel);
+		return point.get(parameterName).getExtension();
+	}
+	
+	/**
+	 * Gets a list with the class of all parameters. 
+	 * @param processLabel
+	 * @param parameterName
+	 * @return
+	 */
+	public List<Class<?>> getParameterClassList(String processLabel, String parameterName) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get(REGISTER_INPUT_PARAMETERS_LABEL + "_" + processLabel);
+		List<Class<?>> classList = new ArrayList<Class<?>>();
+		Iterator<?> it = point.iterator();
+		while(it.hasNext()) {
+			Object obj = it.next();
+			classList.add((Class<?>)obj);
+		}
+		return classList;
+	}
+	
+	@Override
+	protected void finalize() throws Throwable {
+		if(inputParameters != null) {
+			inputParameters.clear();
+			inputParameters = null;
+		}
+		super.finalize();
+	}
+	
+	/**
+	 * Add a parameter to this task at runtime. The 
+	 * parameter should have been registered before add
+	 * @param name key
+	 * @param param object to this task
+	 */
+	public void addParam(String key, Object param) {
+		if (param != null)
+			inputParameters.put(key, param);
+		else
+			inputParameters.remove(key);
+	}
+
+	/**
+	 * Remove a parameter to this task at runtime.
+	 * @param name key
+	 */
+	public void removeParam(String key) {
+		inputParameters.remove(key);
+	}
+
+	/**
+	 * Gets a parameter from its key
+	 * @param name key
+	 * @return parameter
+	 */
+	public Object getParam(String key) {
+		loadGlobalParameters();
+		return inputParameters.get(key);
+	}
+	
+	/**
+	 * Gets a <code>String</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public String getStringParam(String key) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(key);
+		return (value != null && value instanceof String) ? (String)value : null;
+	}
+	
+	/**
+	 * Gets a <code>Byte</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public byte getByteParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof Byte) ? ((Byte)value).byteValue() : 0;
+	}
+	
+	/**
+	 * Gets a <code>Float</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public float getFloatParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof Float) ? ((Float)value).floatValue() : 0F;
+	}
+	
+	/**
+	 * Gets a <code>double</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public double getDoubleParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof Double) ? ((Double)value).doubleValue() : 0D;
+	}
+	
+	/**
+	 * Gets a <code>int</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public int getIntParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof Integer) ? ((Integer)value).intValue() : 0;
+	}
+	
+	/**
+	 * Gets a <code>Boolean</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public boolean getBooleanParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof Boolean) ? ((Boolean)value).booleanValue() : false;
+	}
+	
+	/**
+	 * Gets a <code>int[]</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public int[] getIntArrayParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof int[]) ? ((int[])value) : null;
+	}
+	
+	/**
+	 * Gets a <code>double[]</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public double[] getDoubleArrayParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof double[]) ? ((double[])value) : null;
+	}
+	
+	/**
+	 * Gets a <code>Extent</code> parameter from its key
+	 * @param key
+	 * @return parameter
+	 */
+	public Extent getExtentParam(String name) {
+		loadGlobalParameters();
+		Object value = inputParameters.get(name);
+		return (value != null && value instanceof Extent) ? ((Extent)value) : null;
+	}
+	
+	/**
+	 * Gets the default EPSG for the regions of interest. If this parameter is null
+	 * @return
+	 */
+	protected String getROIEPSG() {
+		return roiEPSG;
+	}
+	
+	/**
+	 * Gets the bounding box defined by the user to the process
+	 * @return
+	 */
+	protected Extent getOutputWindow() {
+		return outputWindow;
+	}
+	
+	/**
+	 * Gets the width in pixels of the output
+	 * @return
+	 */
+	protected int getOutputWidth() {
+		return outputWidth;
+	}
+	
+	/**
+	 * Gets the height in pixels of the output
+	 * @return
+	 */
+	protected int getOutputHeight() {
+		return outputHeight;
+	}
+	
+	/**
+	 * Returns true if the output will be rescaled
+	 * @return
+	 */
+	protected boolean isOutputRescaled() {
+		return (outputWidth != 0 || outputHeight != 0);
+	}
+	
+	/**
+	 * Returns true if the output of this algorithm is for previews. It usually implies that the buffer will be
+	 * send as output parameter, the buffer will be RGB and the input buffer will be to read and write.
+	 * @return
+	 */
+	protected boolean isForPreviews() {
+		return preview;
+	}
+	
+	/**
+	 * Loads global parameters defined in this class
+	 */
+	protected void loadGlobalParameters() {
+		if(globalParametersLoaded)
+			return;
+		globalParametersLoaded = true;
+		roiEPSG = getStringParam(ROI_EPSG);
+		outputWindow = getParam(WINDOW) != null ? (Extent)getParam(WINDOW) : null;
+		outputWidth = getIntParam(OUTPUT_WIDTH);
+		outputHeight = getIntParam(OUTPUT_HEIGHT);
+		preview = getBooleanParam(PREVIEW);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessParamsManagement.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessUtils.java	(revision 15423)
@@ -0,0 +1,581 @@
+/* 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.algorithm.process;
+
+import java.awt.Component;
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.BufferParam;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.BufferCreationException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.store.parameter.NewRasterStoreParameters;
+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.ValidateDataParametersException;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.roi.ROI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Clase base de todos los procesos raster. En ella se genstionan todas las
+ * funciones comunes como incremento de la tarea, gesti�n de eventos a la tarea, 
+ * par�metros de la tarea, etc ...
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class ProcessUtils {
+	private Logger          log          = LoggerFactory.getLogger(ProcessUtils.class);
+	protected NoData        doubleNODATA = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(1, Buffer.TYPE_DOUBLE);
+	
+	/**
+	 * Registra un mensaje de error en el log de gvSIG
+	 * @param msg Mensaje a guardar en el log
+	 * @param parent Objeto que hizo disparar el mensaje
+	 * @param exception Excepcion que ha sido recogida
+	 */
+	public void debug(String msg, Object parent, Exception exception) {
+		if(parent != null)
+		    LoggerFactory
+            .getLogger(parent.getClass()).debug(Messages.getText(msg), exception);
+	}
+	
+	/**
+	 * Shows a error dialog with a text and a accept button 
+	 * @param msg Message to show in the dialog
+	 * @param parentWindow Parent window
+	 */
+	public void messageBoxError(String msg, Object parentWindow){
+		String string = Messages.getText("accept");
+		Object[] options = {string};
+		JOptionPane.showOptionDialog((Component)parentWindow,
+					"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>",
+					Messages.getText("confirmacion"),
+					JOptionPane.OK_OPTION,
+					JOptionPane.ERROR_MESSAGE,
+					null,
+					options,
+					string);
+	}
+	
+	/**
+	 * Muestra un dialogo de error con un texto y un bot�n de aceptar. El error es
+	 * registrado en el log de gvSIG con la excepcion que se le pase por parametro
+	 * @param msg Mensaje a mostrar en el dialogo.
+	 * @param parentWindow Ventana desde la que se lanza el dialogo
+	 * @param exception Excepcion que ha sido recogida
+	 */
+	public void messageBoxError(String msg, Object parentWindow, Exception exception) {
+		debug(msg, parentWindow, exception);
+		messageBoxError(msg, parentWindow);
+	}
+	
+	/**
+	 * Muestra un dialogo de error con un texto y un bot�n de aceptar. Se le pasa como �ltimo par�metros
+	 * una lista de excepciones que ser�n guardadas en el log
+	 * @param msg Mensaje a mostrar en el dialogo.
+	 * @param parentWindow Ventana desde la que se lanza el dialogo
+	 * @param exception Excepcion que ha sido recogida
+	 */
+	public void messageBoxError(String msg, Object parentWindow, ArrayList<Exception> exception) {
+		for (int i = 0; i < exception.size(); i++) 
+			debug(msg, parentWindow, exception.get(i));
+		messageBoxError(msg, parentWindow);
+	}
+	
+	/**
+	 * Exports a raster buffer to disk
+	 * @param sFilename
+	 * @param buf
+	 * @param cellsize
+	 * @param minX
+	 * @param minY
+	 * @return
+	 * @throws ProviderNotRegisteredException 
+	 * @throws InitializeException 
+	 */
+	public void exportRaster(final String sFilename, 
+			Buffer buf, 
+			ColorInterpretation ci,
+			Extent windowExtent,
+			NoData nodata,
+			IProjection proj) {
+		nodata.setFileName(sFilename);
+		nodata.save();
+		
+		buf.setDataExtent(windowExtent.toRectangle2D());
+		
+		DataManager manager = DALLocator.getDataManager();
+		String provider = "Gdal Store";
+		try {
+			DataServerExplorerParameters eparams = manager.createServerExplorerParameters("FilesystemExplorer");
+			DataServerExplorer serverExplorer = manager.openServerExplorer(eparams.getExplorerName(), eparams);
+
+			NewRasterStoreParameters sparams = (NewRasterStoreParameters)serverExplorer.getAddParameters(provider);
+			sparams.setBuffer(buf);
+			sparams.setColorInterpretation(ci.getValues());
+			sparams.setProjection(proj);
+			sparams.setDestination(sFilename);
+			
+			serverExplorer.add("Gdal Store", sparams, true);
+		} catch (InitializeException e) {
+			log.debug("Error saving the file of the process", e);
+		} catch (ProviderNotRegisteredException e) {
+			log.debug("Error saving the file of the process", e);
+		} catch (ValidateDataParametersException e) {
+			log.debug("Error saving the file of the process", e);
+		} catch (DataException e) {
+			log.debug("Error saving the file of the process", e);
+		}
+	}
+	
+	/**
+	 * Exports a raster buffer to disk
+	 * @param sFilename
+	 * @param buf
+	 * @param cellsize
+	 * @param minX
+	 * @param minY
+	 * @return
+	 * @throws ProviderNotRegisteredException 
+	 * @throws InitializeException 
+	 */
+    public boolean exportRaster(final String sFilename, Buffer buf, double cellsize, double minX,
+        double minY, NoData nodata) {
+        return exportRaster(sFilename, buf, cellsize, minX, minY);
+    }
+	
+    /**
+     * Exports buffer to disk
+     * 
+     * @param sFilename
+     *            Name of file to write data buffer
+     * @param buf
+     *            data buffer
+     * @param cellsize
+     *            Cell size of new raster
+     * @param minX
+     * @param minY
+     * @param nodata
+     *            No data value of new raster
+     * @param proj
+     *            Projection of new raster
+     * @return
+     */
+    public boolean exportRaster(final String sFilename, Buffer buf, double cellsize, double minX,
+        double minY, NoData nodata, IProjection proj) {
+        boolean result = exportRaster(sFilename, buf, cellsize, minX, minY, proj);
+        nodata.setFileName(sFilename);
+        nodata.save();
+        return result;
+    }
+	
+    /**
+     * Export buffer to disk
+     * 
+     * @param sFilename
+     *            Name of raster file
+     * @param buf
+     *            Buffer data with new data
+     * @param alphaBuffer
+     *            Buffer with alpha data
+     * @param cellsize
+     *            Cell size of new raster
+     * @param ulx
+     *            X coordinate of upper left corner
+     * @param uly
+     *            Y coordinate of upper left corner
+     * @param proj
+     *            Projection of new raster
+     * @return
+     */
+    @SuppressWarnings("deprecation")
+    public boolean exportRaster(final String sFilename, Buffer buf, Buffer alphaBuffer,
+        double cellsize, double ulx, double uly, IProjection proj) {
+		try {
+			RasterManager manager = RasterLocator.getManager();
+			final DataServerWriter writerBufferServer = manager.createDataServerWriter();
+			writerBufferServer.setBuffer(buf, -1);
+			int nBands = buf.getBandCount();
+			ColorInterpretation colorInterpretation = null;
+			if(alphaBuffer != null) {
+				colorInterpretation = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+						new String[] { 
+								ColorInterpretation.RED_BAND, 
+								ColorInterpretation.GREEN_BAND, 
+								ColorInterpretation.BLUE_BAND,
+								ColorInterpretation.ALPHA_BAND});
+			} else {
+				if(nBands == 1)
+					colorInterpretation = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+							new String[] { ColorInterpretation.GRAY_BAND });
+			}
+			final Params params = manager.createWriterParams(sFilename);
+			final AffineTransform affineTransform =
+				new AffineTransform(cellsize, 0, 0,
+						-cellsize, ulx, uly);
+
+			final RasterWriter writer = manager.createWriter(
+						writerBufferServer, 
+						sFilename,
+						nBands, 
+						affineTransform, 
+						buf.getWidth(),
+						buf.getHeight(), 
+						buf.getDataType(), 
+						params, 
+						proj);
+			if(colorInterpretation != null)
+				writer.setColorBandsInterpretation(colorInterpretation.getValues());
+			writer.dataWrite();
+			writer.writeClose();
+		} catch (final Exception e) {
+			e.printStackTrace();
+			return false;
+		}
+		return true;
+	}
+	
+    /**
+     * Export buffer to disk
+     * 
+     * @param sFilename
+     *            Name of raster file
+     * @param buf
+     *            Buffer data with new data
+     * @param alphaBuffer
+     *            Buffer with alpha data
+     * @param cellsize
+     *            Cell size of new raster
+     * @param ulx
+     *            X coordinate of upper left corner
+     * @param uly
+     *            Y coordinate of upper left corner
+     * @return
+     */
+    public boolean exportRaster(final String sFilename, Buffer buf, Buffer alphaBuffer,
+        double cellsize, double ulx, double uly) {
+        return exportRaster(sFilename, buf, alphaBuffer, cellsize, ulx, uly, null);
+    }
+	
+    /**
+     * Exports raster buffer to disk
+     * 
+     * @param sFilename
+     *            Name of raster file
+     * @param buf
+     *            Buffer data with new data
+     * @param cellsize
+     *            Cell size of new raster
+     * @param ulx
+     *            X coordinate of upper left corner
+     * @param uly
+     *            Y coordinate of upper left corner
+     * @return
+     */
+    public boolean exportRaster(final String sFilename, Buffer buf, double cellsize, double ulx,
+        double uly) {
+        return exportRaster(sFilename, buf, null, cellsize, ulx, uly);
+    }
+	
+    /**
+     * Exports raster buffer to disk
+     * 
+     * @param sFilename
+     *            Name of raster file
+     * @param buf
+     *            Buffer data with new data
+     * @param cellsize
+     *            Cell size of new raster
+     * @param ulx
+     *            X coordinate of upper left corner
+     * @param uly
+     *            Y coordinate of upper left corner
+     * @param proj
+     *            Projection of new raster
+     * @return
+     */
+    public boolean exportRaster(final String sFilename, Buffer buf, double cellsize, double ulx,
+        double uly, IProjection proj) {
+        return exportRaster(sFilename, buf, null, cellsize, ulx, uly, proj);
+    }
+	
+	/**
+	 * Gets a list of rectangles which represents the pixel coordinates of each DataStore.
+	 * This rectangle is the area that intersects with the other DataStores in the 	list.
+	 * @param dataStoreList
+	 * @return
+	 */
+	protected Rectangle2D[] getIntersectionInPxCoords(RasterDataStore[] dataStoreList) {
+		Extent extentIntersect = null;
+		int nRectangles = 0;
+		for (int i = 0; i < dataStoreList.length; i++) {
+			if(dataStoreList[i] != null) {
+				if(extentIntersect == null)
+					extentIntersect = dataStoreList[i].getExtent();
+				else
+					extentIntersect = extentIntersect.intersection(dataStoreList[i].getExtent());
+				nRectangles ++;
+			}
+		}
+		Rectangle2D[] result = new Rectangle2D[nRectangles];
+		
+		Point2D p1 = new Point2D.Double(extentIntersect.getULX(), extentIntersect.getULY());
+		Point2D p2 = new Point2D.Double(extentIntersect.getLRX(), extentIntersect.getLRY());
+		
+		int cont = 0;
+		for (int i = 0; i < dataStoreList.length; i++) {
+			if(dataStoreList[i] != null) {
+				Point2D init = dataStoreList[i].worldToRaster(p1);
+				Point2D end = dataStoreList[i].worldToRaster(p2);
+				result[cont] = new Rectangle2D.Double(
+						init.getX(), 
+						init.getY(), 
+						Math.abs(end.getX() - init.getX()), 
+						Math.abs(end.getY() - init.getY()));
+				cont++;
+			}
+		}
+		return result;
+	}
+	
+	/**
+	 * Checks if the point in pixel coordinates is inside the region of 
+	 * interest or not. The point will be
+	 * @param x 
+	 * @param y
+	 * @param rois
+	 * @param extentResult
+	 *       Bounding box of the area to which belongs the point defined in pixel coordinates (x, y)
+	 * @return
+	 */
+	public boolean isInsideOfROI(int x, int y, List<ROI> rois, Extent extentResult) {
+		if(rois == null || rois.size() == 0)
+			return true;
+		
+		ROI roi = rois.get(0);
+		int[] shift = getROIAnalysisShift(extentResult, roi.getStore().getExtent(), roi.getStore().getCellSize());
+		
+		for (int i = 0; i < rois.size(); i++) {
+			if(rois.get(i).isInsideOfPolygon(x + shift[0], y + shift[1]))
+				return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Gets the shift in pixels between the source bounding box and the result bounding box.
+	 * This is useful to get if a pixel is inside a region of interest because the ROI has 
+	 * associate the source. 
+	 * @param extentResult
+	 * @param sourceExtent
+	 * @return
+	 */
+	private int[] getROIAnalysisShift(Extent extentResult, Extent sourceExtent, double cellsize) {
+		double xDistance = Math.abs(extentResult.getULX() - sourceExtent.getULX());
+		double yDistance = Math.abs(extentResult.getULY() - sourceExtent.getULY());
+		return new int[]{(int)(xDistance / cellsize), (int)(yDistance / cellsize)};
+	}
+	
+	/**
+	 * Gets the bounding box taking into account whether there are ROIs or not
+	 * @return
+	 */
+	public Extent getExtentResult(Extent window, List<ROI> rois, RasterDataStore store) {
+		if(window != null)
+			return window.intersection(store.getExtent());
+		if(rois == null)
+			return store.getExtent();
+		else {
+			Extent maxExtent = null;
+			for (int i = 0; i < rois.size(); i++) {
+				if(i == 0)
+					maxExtent = rois.get(i).getROIExtent();
+				else
+					maxExtent = maxExtent.encloseBoundinBoxes(rois.get(i).getROIExtent());
+			}
+			return maxExtent.intersection(store.getExtent());
+		}
+	}
+	
+	/**
+	 * Returns true if the algorithm is applied to the entire layer
+	 * @param extent
+	 * @param rois
+	 * @param store
+	 * @return
+	 */
+	public boolean isAnalizedEntireLayer(Extent window, List<ROI> rois, RasterDataStore store) {
+		if(window == null) {
+			if(rois == null || rois.size() == 0)
+				return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Gets the bounding box of the source in pixel coordinates
+	 * @param resultExtent
+	 * @return
+	 */
+	public Rectangle2D getSourcePxBox(Extent resultExtent, RasterDataStore store) {
+		if(resultExtent == null || resultExtent.equals(store.getExtent()))
+			return new Rectangle2D.Double(0, 0, store.getWidth(), store.getHeight());
+		Point2D p1 = store.worldToRaster(new Point2D.Double(resultExtent.getULX(), resultExtent.getULY()));
+		Point2D p2 = store.worldToRaster(new Point2D.Double(resultExtent.getLRX(), resultExtent.getLRY()));
+		return new Rectangle2D.Double(p1.getX(), p1.getY(), Math.abs(p2.getX() - p1.getX()), Math.abs(p2.getY() - p1.getY()));
+	}
+	
+	/**
+	 * Builds the output buffer
+	 * @param sourcePxBBox
+	 * @param bandCount
+	 * @return
+	 */
+	public Buffer createOutputBuffer(int w, int h, int bandCount) {
+		return createOutputBuffer(w, h, bandCount, Buffer.TYPE_DOUBLE);
+	}
+	
+	public Buffer createOutputBuffer(int w, int h, int bandCount, int datatype) {
+		RasterManager rManager = RasterLocator.getManager();
+		BufferParam bParams = rManager.getBufferFactory().createBufferParams(
+				w, 
+				h, 
+				bandCount, 
+				datatype, 
+				true);
+		Buffer resultBuffer = null;
+		try {
+			resultBuffer = rManager.getBufferFactory().createBuffer(bParams);
+		} catch (BufferCreationException e) {
+			new ProcessException("Error creating the output buffer", e);
+		}
+		return resultBuffer;
+	}
+	
+	/**
+	 * Gets a data buffer from a <code>RasterDataStore</code> 
+     */
+    public Buffer createSourceBuffer(RasterDataStore store, Rectangle2D sourcePxBBox, boolean[] bands) throws ProcessException {
+        RasterManager rManager = RasterLocator.getManager();
+        RasterQuery query = rManager.createQuery();
+        query.setReadOnly(true);
+        
+        int nBands = getNumberOfSelectedBands(bands);
+        int count = 0;
+        int[] drawableBands = new int[nBands];
+        for (int i = 0; i < bands.length; i++) {
+			if(bands[i]) {
+				drawableBands[count] = i;
+				count ++;
+			}
+		}
+        
+        query.setDrawableBands(drawableBands);
+        query.setAreaOfInterest(
+        		new Rectangle(
+        		(int)sourcePxBBox.getX(), 
+        		(int)sourcePxBBox.getY(), 
+        		(int)sourcePxBBox.getWidth(), 
+        		(int)sourcePxBBox.getHeight()));
+
+        try {
+        	Buffer buffer = null;
+        	try {
+        		buffer = store.query(query);
+        	} catch (QueryException e) {
+        		new ProcessException("Error creating the input buffer", e);
+        	}  
+        	return buffer;
+        } catch (ProcessInterruptedException e) {
+        }
+        return null;
+    } 
+    
+	/**
+	 * Gets the number of the selected bands from a list of boolean values.
+	 * Each element in this list represents a band and true or false if the band
+	 * will be used in the task.
+	 * @param bandsPCs
+	 * @return
+	 */
+	private int getNumberOfSelectedBands(boolean[] b) {
+		int bandCount = 0;
+        for (int i = 0; i < b.length; i++) {
+			if(b[i])
+				bandCount++;
+		}
+        return bandCount;
+	}
+	
+	/**
+	 * Gets a value of the buffer in double format
+	 * @param b
+	 * @param row
+	 * @param col
+	 * @param band
+	 * @return
+	 */
+	protected double getData(Buffer b, int row, int col, int band) {
+		if(b.getDataType() == Buffer.TYPE_BYTE) {
+			return (double)b.getElemByte(row, col, band);
+		}
+		if(b.getDataType() == Buffer.TYPE_DOUBLE) {
+			return b.getElemDouble(row, col, band);
+		}
+		if(b.getDataType() == Buffer.TYPE_FLOAT) {
+			return (double)b.getElemFloat(row, col, band);
+		}
+		if(b.getDataType() == Buffer.TYPE_INT) {
+			return (double)b.getElemInt(row, col, band);
+		}
+		if(b.getDataType() == Buffer.TYPE_SHORT) {
+			return (double)b.getElemShort(row, col, band);
+		}
+		
+		return doubleNODATA.getValue().doubleValue();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/process/ProcessUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/BasicAPISwingPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/BasicAPISwingPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/BasicAPISwingPanel.java	(revision 15423)
@@ -0,0 +1,67 @@
+/* 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.algorithm;
+
+import java.util.EventListener;
+
+import javax.swing.JComponent;
+
+/**
+ * Interface for panels which build an algorithm using the parameters selected
+ * by the user
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface BasicAPISwingPanel {
+	
+	/**
+	 * Gets the main component 
+	 * @return
+	 */
+	public JComponent getComponent();
+	
+	/**
+	 * Gets the process loaded with the data selected in the interface
+	 * @return
+	 */
+	public Object getResult() throws Exception;
+	
+	/**
+	 * Initialization actions.
+	 */
+	public void initialize();
+	
+	/**
+	 * Gets the component ID using the object of this component. This is useful
+	 * to know what button has been pressed in a panel. The IDs should be defined
+	 * in the component API.
+	 * @param obj
+	 * @return
+	 */
+	public int getComponentIDByObject(Object obj);
+	
+	/**
+	 * Adds a listener to the components of a panel. The EventListener could be
+	 * any listener.
+	 * @param listener
+	 */
+	public void addListener(EventListener listener);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/BasicAPISwingPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/LogControl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/LogControl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/LogControl.java	(revision 15423)
@@ -0,0 +1,95 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+/* 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.
+ * 
+ */
+
+/**
+ * <code>LogControl</code>. Objeto para un control b�sico de un log. Para a�adir
+ * y reemplazar la �ltima l�nea a�adida.
+ *
+ * @version 27/03/2007
+ * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
+ */
+public class LogControl {
+	String text = "";
+
+	/**
+	 * A�ade una l�nea al log.
+	 * @param line
+	 */
+	public void addLine(String line) {
+		if (text.length() > 0)
+			text += "\n";
+		text += line;
+	}
+
+	/**
+	 * Reemplaza la �ltima l�nea a�adida al log.
+	 * @param line
+	 */
+	public void replaceLastLine(String line) {
+		int index = text.lastIndexOf("\n");
+		if (index < 0)
+			index = 0;
+		text = text.substring(0, index);
+		addLine(line);
+	}
+
+	/**
+	 * Establece el texto completo del log.
+	 * @param value
+	 */
+	public void setText(String value) {
+		text = value;
+	}
+
+	/**
+	 * Devuelve el contenido del log.
+	 * @return String
+	 */
+	public String getText() {
+		return text;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/LogControl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/ProgressPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/ProgressPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/ProgressPanel.java	(revision 15423)
@@ -0,0 +1,406 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+import java.awt.Dialog;
+import java.awt.Dimension;
+import java.awt.Frame;
+import java.awt.GraphicsConfiguration;
+import java.awt.HeadlessException;
+import java.awt.Toolkit;
+
+import javax.swing.JDialog;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JProgressBar;
+import javax.swing.JScrollPane;
+import javax.swing.JTextPane;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.RasterSwingLocator;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelEvent;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelListener;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+
+
+/**
+ * <code>ProgressPanel</code>. Muestra una ventana de di�logo para representar
+ * una barra de progreso con su ventana de registro.
+ *
+ * @version 15/07/2008
+ *
+ * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ProgressPanel extends JDialog {
+	private static final long serialVersionUID = 4321011219898234352L;
+
+	private JPanel              jPanel              = null;
+	private JLabel              jLabel              = null;
+	private JLabel              jLabel1             = null;
+	private JPanel              jPanel1             = null;
+	private JPanel              njp                 = null;
+	private IButtonsPanel       defaultButtonsPanel = null;
+	private JProgressBar        jProgressBar        = null;
+	private JScrollPane         jScrollPane         = null;
+	private JTextPane           jTextPane           = null;
+	private LogControl          text                = new LogControl();
+	private long                startTime           = System.currentTimeMillis();
+	private boolean             showPause           = true;
+
+	/**
+	 * Constructor
+	 */
+	public ProgressPanel() {
+		super();
+		initialize();
+	}
+
+	public ProgressPanel(boolean showPause) {
+		super();
+		this.showPause = showPause;
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Dialog, boolean)
+	 */
+	public ProgressPanel(Dialog owner, boolean modal) throws HeadlessException {
+		super(owner, modal);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Dialog, String, boolean, GraphicsConfiguration)
+	 */
+	public ProgressPanel(Dialog owner, String title, boolean modal,	GraphicsConfiguration gc) throws HeadlessException {
+		super(owner, title, modal, gc);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Dialog, String, boolean)
+	 */
+	public ProgressPanel(Dialog owner, String title, boolean modal)
+			throws HeadlessException {
+		super(owner, title, modal);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Dialog, String)
+	 */
+	public ProgressPanel(Dialog owner, String title) throws HeadlessException {
+		super(owner, title);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Dialog)
+	 */
+	public ProgressPanel(Dialog owner) throws HeadlessException {
+		super(owner);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Frame, boolean)
+	 */
+	public ProgressPanel(Frame owner, boolean modal) throws HeadlessException {
+		super(owner, modal);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Frame, String, boolean, GraphicsConfiguration)
+	 */
+	public ProgressPanel(Frame owner, String title, boolean modal, GraphicsConfiguration gc) {
+		super(owner, title, modal, gc);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Frame, String, boolean)
+	 */
+	public ProgressPanel(Frame owner, String title, boolean modal)
+			throws HeadlessException {
+		super(owner, title, modal);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Frame, String)
+	 */
+	public ProgressPanel(Frame owner, String title) throws HeadlessException {
+		super(owner, title);
+		initialize();
+	}
+
+	/**
+	 * @see JDialog#JDialog(Frame)
+	 */
+	public ProgressPanel(Frame owner) throws HeadlessException {
+		super(owner);
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 */
+	private void initialize() {
+		njp = new JPanel();
+		njp.setLayout(new java.awt.BorderLayout(5, 5));
+		njp.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 15, 5, 15));
+		this.setContentPane(njp);
+		this.setResizable(false);
+		njp.add(getJPanel(), java.awt.BorderLayout.NORTH);
+		njp.add(getJPanel1(), java.awt.BorderLayout.CENTER);
+		njp.add(getButtonsPanel().getComponent(), java.awt.BorderLayout.SOUTH);
+		showLog(false);
+		setPercent(0);
+		Dimension d = Toolkit.getDefaultToolkit().getScreenSize();
+		this.setLocation(
+				(int) (d.getWidth() - this.getWidth()) >> 1,
+				(int) (d.getHeight() - this.getHeight()) >> 1);
+		this.setVisible(true);
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel() {
+		if (jPanel == null) {
+			jLabel1 = new JLabel();
+			jLabel = new JLabel();
+			jLabel.setText(Messages.getText("espere") + "...");
+			jPanel = new JPanel();
+			jPanel.setLayout(new java.awt.BorderLayout(5, 5));
+			jPanel.add(jLabel, java.awt.BorderLayout.WEST);
+			jPanel.add(jLabel1, java.awt.BorderLayout.EAST);
+		}
+		return jPanel;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getJPanel1() {
+		if (jPanel1 == null) {
+			jPanel1 = new JPanel();
+			jPanel1.setLayout(new java.awt.BorderLayout(5, 5));
+			jPanel1.add(getJProgressBar(), java.awt.BorderLayout.NORTH);
+			jPanel1.add(getJScrollPane(), java.awt.BorderLayout.CENTER);
+		}
+		return jPanel1;
+	}
+
+	public void addButtonPressedListener(ButtonsPanelListener listener) {
+		getDefaultButtonsPanel().addButtonPressedListener(listener);
+	}
+
+	public void removeButtonPressedListener(ButtonsPanelListener listener) {
+		getDefaultButtonsPanel().removeButtonPressedListener(listener);
+	}
+
+	public void showLog(boolean visible) {
+		getButtonsPanel().getButton(IButtonsPanel.BUTTON_SEEDETAILS).setVisible(!visible);
+		getButtonsPanel().getButton(IButtonsPanel.BUTTON_HIDEDETAILS).setVisible(visible);
+		jScrollPane.setVisible(visible);
+
+		this.setIgnoreRepaint(true);
+
+		if (visible)
+			this.setSize(this.getWidth(), 300);
+		else
+			this.pack();
+
+		this.setIgnoreRepaint(false);
+		if (this.isVisible())
+			this.setVisible(true);
+	}
+
+	public void showPause(boolean visible) {
+		if (showPause) {
+			getButtonsPanel().getButton(IButtonsPanel.BUTTON_RESTART).setVisible(!visible);
+			getButtonsPanel().getButton(IButtonsPanel.BUTTON_PAUSE).setVisible(visible);
+		} else {
+			getButtonsPanel().getButton(IButtonsPanel.BUTTON_RESTART).setVisible(false);
+			getButtonsPanel().getButton(IButtonsPanel.BUTTON_PAUSE).setVisible(false);
+		}
+	}
+
+	/**
+	 * @return Buttons panel
+	 * @see DefaultButtonsPanel#getButtonsPanel()
+	 */
+	public IButtonsPanel getButtonsPanel() {
+		return getDefaultButtonsPanel();
+	}
+
+	/**
+	 * This method initializes DefaultButtonsPanel
+	 *
+	 * @return DefaultButtonsPanel
+	 */
+	public IButtonsPanel getDefaultButtonsPanel() {
+		if (defaultButtonsPanel == null) {
+			defaultButtonsPanel = RasterSwingLocator.getSwingManager().createButtonsPanel(IButtonsPanel.BUTTONS_NONE, getJPanel1());
+			getButtonsPanel().addSeeDetails();
+			getButtonsPanel().addHideDetails();
+			getButtonsPanel().addPause();
+			getButtonsPanel().addRestart();
+			showPause(true);
+			getButtonsPanel().addCancel();
+			//getButtonsPanel().setLayout(new java.awt.FlowLayout(FlowLayout.CENTER));
+			getButtonsPanel().addButtonPressedListener(new ButtonsPanelListener() {
+				public void actionButtonPressed(ButtonsPanelEvent e) {
+					switch (e.getButton()) {
+						case IButtonsPanel.BUTTON_SEEDETAILS:
+							showLog(true);
+							break;
+						case IButtonsPanel.BUTTON_HIDEDETAILS:
+							showLog(false);
+							break;
+						case IButtonsPanel.BUTTON_PAUSE:
+							showPause(false);
+							break;
+						case IButtonsPanel.BUTTON_RESTART:
+							showPause(true);
+							break;
+					}
+				}
+			});
+		}
+		return defaultButtonsPanel;
+	}
+
+	/**
+	 * This method initializes jProgressBar
+	 *
+	 * @return javax.swing.JProgressBar
+	 */
+	private JProgressBar getJProgressBar() {
+		if (jProgressBar == null) {
+			jProgressBar = new JProgressBar();
+			jProgressBar.setValue(50);
+			jProgressBar.setPreferredSize(new Dimension(450, 18));
+		}
+		return jProgressBar;
+	}
+
+	/**
+	 * This method initializes jScrollPane
+	 *
+	 * @return javax.swing.JScrollPane
+	 */
+	private JScrollPane getJScrollPane() {
+		if (jScrollPane == null) {
+			jScrollPane = new JScrollPane();
+			jScrollPane.setViewportView(getJTextPane());
+			jScrollPane.setVisible(false);
+		}
+		return jScrollPane;
+	}
+
+	/**
+	 * This method initializes jTextPane
+	 *
+	 * @return javax.swing.JTextPane
+	 */
+	private JTextPane getJTextPane() {
+		if (jTextPane == null) {
+			jTextPane = new JTextPane();
+			jTextPane.setEditable(false);
+		}
+		return jTextPane;
+	}
+
+	private void updateLog() {
+		jTextPane.setText(text.getText());
+		jTextPane.setCaretPosition(jTextPane.getText().length());
+	}
+
+	public void addLineLog(String line) {
+		text.addLine(line);
+		updateLog();
+	}
+
+	public void replaceLastLineLog(String line) {
+		text.replaceLastLine(line);
+		updateLog();
+	}
+
+	public void setLog(String value) {
+		long time = (System.currentTimeMillis() - startTime) / 1000;
+		text.setText(value + "\n" + Messages.getText("tiempo_transcurrido") + ": " + time + "s");
+		updateLog();
+	}
+
+	public int getPercent() {
+		return jProgressBar.getValue();
+	}
+
+	public void setPercent(int value) {
+		if ((value == 0) && (!jProgressBar.isIndeterminate())) {
+			jProgressBar.setIndeterminate(true);
+			jLabel1.setVisible(false);
+		}
+		if ((value != 0) && (jProgressBar.isIndeterminate())) {
+			jProgressBar.setIndeterminate(false);
+			jLabel1.setVisible(true);
+		}
+		jProgressBar.setValue(value);
+		jLabel1.setText(value + "%");
+	}
+
+	public void setLabel(String value) {
+		jLabel.setText(value);
+	}
+
+	/**
+	 * <p>Sets whether this panel will show a normal progress bar
+	 * or an indeterminate one.</p>
+	 *
+	 * @see JProgressBar#setIndeterminate(boolean)
+	 * @param indeterminate
+	 */
+	public void setIndeterminate(boolean indeterminate) {
+		getJProgressBar().setIndeterminate(indeterminate);
+	}
+
+	/**
+	 * <p>Gets whether this panel will show a normal progress bar
+	 * or an indeterminate one.</p>
+	 *
+	 * @see JProgressBar#setIndeterminate(boolean)
+	 * @param indeterminate
+	 * @return whether this panel will show a normal progress bar or an indeterminate one
+	 */
+	public boolean getIndeterminate() {
+		return getJProgressBar().isIndeterminate();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/ProgressPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancel.java	(revision 15423)
@@ -0,0 +1,52 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+public class Cancel implements Cancellable {
+	private boolean cancel = false;
+
+	/**
+	 * Crea un nuevo CancelDraw.
+	 */
+	public Cancel() {
+	}
+
+	/**
+	 * Insertar si se debe cancelar el dibujado.
+	 * 
+	 * @param b
+	 *            true si se debe cancelar el dibujado.
+	 */
+	public void setCanceled(boolean b) {
+		cancel = b;
+	}
+
+	/**
+	 * @see com.iver.utiles.swing.threads.Cancellable#isCanceled()
+	 */
+	public boolean isCanceled() {
+		return cancel;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancellable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancellable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancellable.java	(revision 15423)
@@ -0,0 +1,55 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+
+/**
+ * <p><code>Cancellable</code> interface is designed for adding support to notify that a task must be cancelled.</p>
+ * 
+ * <p>This is useful if a process is hung up, blocking, or simply if user wants cancel it, for instance, a
+ *  drawing process of a heavy layer.</p>
+ * 
+ * <p>The classes which implement this interface are force to share the canceling information, in order to be
+ *  notified about the current status of it. This implies a synchronous canceling process, that could be implemented by
+ *  another object.</p>
+ */
+public interface Cancellable {
+	/**
+	 * <p>Determines if the related task must be canceled.</p>
+	 * 
+	 * @return <code>true</code> if task must been canceled; otherwise <code>false</code>
+	 * 
+	 * @see #setCanceled(boolean)
+	 */
+	boolean isCanceled();
+
+	/**
+	 * <p>Sets if the related task must be canceled.</p>
+	 * 
+	 * @param canceled <code>true</code> if the task must be canceled; otherwise <code>false</code>
+	 * 
+	 * @see #isCanceled()
+	 */
+	void setCanceled(boolean canceled);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/Cancellable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableEvent.java	(revision 15423)
@@ -0,0 +1,81 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+/* 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.
+ * 
+ */
+
+import java.util.EventObject;
+/**
+ * Se utiliza para poder definir que acci�n esta ocurriendo en un momento dado
+ * en la ventana IncrementableTask
+ *
+ * @version 23/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class IncrementableEvent extends EventObject {
+	private static final long serialVersionUID = 75795297813891036L;
+
+	/**
+	 * Definir si la acci�n que esta ocurriendo es la de resumir.
+	 */
+	public static final int RESUMED = 1;
+
+	/**
+	 * Definir si la acci�n que esta ocurriendo es la de suspender
+	 */
+	public static final int SUSPENDED = 2;
+
+	/**
+	 * Definir si la acci�n que esta ocurriendo es la de cancelar.
+	 */
+	public static final int CANCELED = 3;
+
+	/**
+	 * Constructor de IncrementableEvent
+	 * @param source
+	 */
+	public IncrementableEvent(Object source) {
+		super(source);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableEvent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableTask.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableTask.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableTask.java	(revision 15423)
@@ -0,0 +1,364 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+/* 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.
+ *
+ */
+
+import java.awt.event.WindowAdapter;
+import java.awt.event.WindowEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.swing.JDialog;
+import javax.swing.JOptionPane;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelEvent;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelListener;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * <code>IncrementableTask</code>. Es un dialogo que contiene un ProgressPanel.
+ * Se ejecuta bajo un Thread y va consultando a un objeto de tipo IIncrementable
+ * para modificar sus valores.
+ *
+ * @version 20/08/2008
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class IncrementableTask implements Runnable, ButtonsPanelListener {
+
+    private static final Logger LOG = LoggerFactory
+        .getLogger(IncrementableTask.class);
+
+	IIncrementable                            iIncrementable         = null;
+	private volatile ProgressPanel            progressPanel          = null;
+	private volatile Thread                   blinker                = null;
+	private boolean                           threadSuspended        = false;
+	private boolean                           ended                  = false;
+	private boolean                           askOnCancel            = true;
+	private ArrayList<IncrementableListener>  actionCommandListeners = new ArrayList<IncrementableListener>();
+	private boolean                           bDoCallListeners       = true;
+
+	/**
+	 * Constructor del IncrementableTask.
+	 * @param incrementable
+	 * @param dialog
+	 */
+	public IncrementableTask(IIncrementable incrementable, ProgressPanel dialog) {
+		iIncrementable = incrementable;
+		progressPanel = dialog;
+		configureProgressPanel();
+	}
+
+	/**
+	 * Constructor del IncrementableTask.
+	 * @param incrementable
+	 */
+	public IncrementableTask(IIncrementable incrementable) {
+		iIncrementable = incrementable;
+		configureProgressPanel();
+	}
+
+	/**
+	 * Inicio del thread para que la ventana vaya consultando por si sola al
+	 * iIncrementable
+	 */
+	public void start() {
+		blinker = new Thread(this);
+		blinker.start();
+	}
+
+	/**
+	 * Detiene el proceso de consulta de la ventana.
+	 */
+	public void stop() {
+		ended = true;
+	}
+
+	/**
+	 * Este thread va leyendo el porcentaje hasta que se completa el histograma.
+	 */
+	public synchronized void run() {
+//		while (!ended && (iIncrementable.getPercent() <= 100)) {
+		while (! ended) {
+			try {
+				getProgressPanel().setLabel(iIncrementable.getLabel());
+				getProgressPanel().setPercent(iIncrementable.getPercent());
+				getProgressPanel().setTitle(iIncrementable.getTitle());
+				getProgressPanel().setLog(iIncrementable.getLog());
+				Thread.sleep(100);
+				synchronized (this) {
+					while (threadSuspended && !ended)
+						wait(500);
+				}
+			} catch (InterruptedException e) {
+			}
+		}
+
+		// Forces to refresh the log with the last changes
+		getProgressPanel().setLog(iIncrementable.getLog());
+	}
+
+	/**
+	 * Termina el proceso de lectura de porcentajes y logs de la ventana y
+	 * cierra esta.
+	 */
+	public void processFinalize() {
+		stop();
+		while (isAlive());
+		hide();
+	}
+
+	/**
+	 * Ocultar la ventana y parar el proceso
+	 */
+	private void hide() {
+		hideWindow();
+		progressPanel = null;
+		blinker = null;
+	}
+
+	/**
+	 * Ocultar la ventana
+	 */
+	public void hideWindow() {
+//		getProgressPanel().dispose();
+		getProgressPanel().setVisible(false);
+	}
+
+	/**
+	 * Devuelve un booleano indicando si esta activa la ventana.
+	 * @return boolean
+	 */
+	public boolean isAlive() {
+		if (blinker == null)
+			return false;
+		return blinker.isAlive();
+	}
+
+	/**
+	 * Muestra la ventana de incremento con el porcentaje de la construcci�n del
+	 * histograma.
+	 */
+	public void showWindow() {
+		getProgressPanel().setTitle(iIncrementable.getTitle());
+		getProgressPanel().showLog(false);
+		getProgressPanel().setVisible(true);
+	}
+
+	/**
+	 * Devuelve el componente ProgressPanel de la ventana incrementable.
+	 * @return ProgressPanel
+	 */
+	public ProgressPanel getProgressPanel() {
+		if (progressPanel == null) {
+			progressPanel = new ProgressPanel(false);
+		}
+		return progressPanel;
+	}
+
+	protected void configureProgressPanel() {
+		getProgressPanel().setAlwaysOnTop(true);
+		getProgressPanel().addButtonPressedListener(this);
+
+		// Must ask if user wants to cancel the process, avoid closing the dialog
+		getProgressPanel().setDefaultCloseOperation( JDialog.DO_NOTHING_ON_CLOSE );
+		getProgressPanel().addWindowListener(new WindowAdapter() {
+			public void windowClosing(WindowEvent e) {
+				// Simulates an event like the produced pressing the cancel button of the associated progress panel
+				actionButtonPressed(new ButtonsPanelEvent(getProgressPanel(), IButtonsPanel.BUTTON_CANCEL));
+			}
+		});
+	}
+
+	private void callActionCommandListeners(int actions) {
+		if (!bDoCallListeners)
+			return;
+		Iterator<IncrementableListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			IncrementableListener listener = (IncrementableListener) acIterator.next();
+			switch (actions) {
+				case IncrementableEvent.RESUMED:
+					listener.actionResumed(new IncrementableEvent(this));
+					break;
+				case IncrementableEvent.SUSPENDED:
+					listener.actionSuspended(new IncrementableEvent(this));
+					break;
+				case IncrementableEvent.CANCELED:
+					listener.actionCanceled(new IncrementableEvent(this));
+					break;
+			}
+		}
+	}
+
+	/**
+	 * A�adir el manejador de eventos para atender las peticiones de start,
+	 * stop...
+	 *
+	 * @param listener
+	 */
+	public void addIncrementableListener(IncrementableListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un manejador de eventos.
+	 * @param listener
+	 */
+	public void removeIncrementableListener(IncrementableListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Definir si queremos que confirme al usuario si realmente desea cancelar el
+	 * proceso
+	 *
+	 * @param value
+	 */
+	public void setAskCancel(boolean value) {
+		askOnCancel = value;
+	}
+
+	/**
+	 * Metodo para gestionar todos los eventos del objeto.
+	 */
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		switch (e.getButton()) {
+			case IButtonsPanel.BUTTON_CANCEL:
+				boolean cancelled = true;
+				if (askOnCancel) {
+					if (! iIncrementable.isCancelable()) {
+						JOptionPane.showMessageDialog(null, Messages.getText("The_process_cant_be_cancelled"), Messages.getText("Information"), JOptionPane.INFORMATION_MESSAGE);
+						return;
+					}
+
+					/* Pauses the process */
+					if (iIncrementable.isPausable()) {
+						try {
+							callActionCommandListeners(IncrementableEvent.SUSPENDED);
+						}
+						catch (Exception iex) {
+                        LOG.error("", iex);
+							JOptionPane.showMessageDialog(null, Messages.getText("Failed_pausing_the_process"), Messages.getText("Error"), JOptionPane.ERROR_MESSAGE);
+						}
+					}
+
+					/* Asks user to cancel or not the process */
+					cancelled = false;
+					String string1 = Messages.getText("Yes");
+					String string2 = Messages.getText("No");
+					Object[] options = { string1, string2 };
+					int answer = JOptionPane.showOptionDialog(getProgressPanel(), Messages
+							.getText("msg_cancel_incrementable"), Messages
+							.getText("title_cancel_incrementable"),
+							JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
+							options, string1);
+					if (answer == JOptionPane.YES_OPTION) {
+						cancelled = true;
+
+						/* Continues the process */
+						try {
+							if (iIncrementable.isPausable())
+								callActionCommandListeners(IncrementableEvent.RESUMED);
+						} catch (Exception e2) {
+                        LOG.error("", e2);
+							Messages.getText("Failed_resuming_the_process");
+						}
+					}
+					else {
+						/* Continues the process */
+						try {
+							if (iIncrementable.isPausable())
+								callActionCommandListeners(IncrementableEvent.RESUMED);
+						} catch (Exception e2) {
+                        LOG.error("", e2);
+							Messages.getText("Failed_resuming_the_process");
+						}
+					}
+				}
+				if (cancelled) {
+//					ended = true;
+					// Will wait the process to finish and notify this to stop
+					callActionCommandListeners(IncrementableEvent.CANCELED);
+				}
+				break;
+			case IButtonsPanel.BUTTON_PAUSE:
+				threadSuspended = true;
+
+				/* Pauses the associated process */
+				try {
+					if (! iIncrementable.isPausable()) {
+						JOptionPane.showMessageDialog(null, Messages.getText("The_process_cant_be_paused"), Messages.getText("Information"), JOptionPane.INFORMATION_MESSAGE);
+					}
+					else {
+						callActionCommandListeners(IncrementableEvent.SUSPENDED);
+					}
+				}
+				catch (Exception iex) {
+                LOG.error("", iex);
+					JOptionPane.showMessageDialog(null, Messages.getText("Failed_pausing_the_process"), Messages.getText("Error"), JOptionPane.ERROR_MESSAGE);
+				}
+
+				break;
+			case IButtonsPanel.BUTTON_RESTART:
+				threadSuspended = false;
+
+				/* Resumes the associated process */
+				callActionCommandListeners(IncrementableEvent.RESUMED);
+				break;
+		}
+	}
+
+	/**
+	 * @return Buttons panel
+	 * @see ProgressPanel#getButtonsPanel()
+	 */
+	public IButtonsPanel getButtonsPanel() {
+		return getProgressPanel().getButtonsPanel();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableTask.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableListener.java	(revision 15423)
@@ -0,0 +1,75 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+/* 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.
+ * 
+ */
+
+import java.util.EventListener;
+
+/**
+ * Interfaz para la ventana IncrementableTask, aqui se define los
+ * comportamientos de los botones de la ventana.
+ *
+ * @version 23/04/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface IncrementableListener extends EventListener {
+	/**
+	 * Invocado cuando se aprieta el boton Resumir de la ventana
+	 * @param e
+	 */
+	public void actionResumed(IncrementableEvent e);
+
+	/**
+	 * Invocado cuando se aprieta el boton Suspender de la ventana
+	 * @param e
+	 */
+	public void actionSuspended(IncrementableEvent e);
+
+	/**
+	 * Invocado cuando se aprieta el boton Cancelar de la ventana
+	 * @param e
+	 */
+	public void actionCanceled(IncrementableEvent e);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IncrementableListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IIncrementable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IIncrementable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IIncrementable.java	(revision 15423)
@@ -0,0 +1,94 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm.gui;
+
+
+/* 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.
+ * 
+ */
+
+/**
+ * 
+ *
+ * @version 20/08/2008
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface IIncrementable {
+	/**
+	 * Devuelve el titulo de la ventana IncrementableTask
+	 * @return String
+	 */
+	public String getTitle();
+
+	/**
+	 * Devuelve el contenido del log de la ventana IncrementableTask
+	 * @return String
+	 */
+	public String getLog();
+
+	/**
+	 * Devuelve la etiqueta de la ventana IncrementableTask
+	 * @return String
+	 */
+	public String getLabel();
+	
+	/**
+	 * Devuelve el porcentaje de 0 a 100 de la ventana IncrementableTask
+	 * @return int
+	 */
+	public int getPercent();
+
+	/**
+	 * <p>Determines if this process can be canceled.</p>
+	 * 
+	 * @return <code>true</code> if this process can be canceled, otherwise <code>false</code>
+	 */
+	public boolean isCancelable();
+
+	/**
+	 * <p>Determines if this process can be paused.</p>
+	 * 
+	 * @return <code>true</code> if this process can be paused, otherwise <code>false</code>
+	 */
+	public boolean isPausable();
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/gui/IIncrementable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmLibrary.java	(revision 15423)
@@ -0,0 +1,138 @@
+/*
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.algorithm;
+
+import java.util.List;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Initialization of RasterBaseAlgorithmLibrary library.
+ * 
+ * @author <a href="mailto:nachobrodin@gmail.com">Nacho Brodin</a>
+ */
+public class RasterBaseAlgorithmLibrary extends AbstractLibrary {
+	public static final String         REGISTER_PROCESS_LABEL             = "DataProcess";
+	public static final String         REGISTER_INPUT_PARAMETERS_LABEL    = "DataProcessInputParameters";
+	public static final String         REGISTER_OUTPUT_PARAMETERS_LABEL   = "DataProcessOutputParameters";
+
+	/**
+	 * Registers a raster process
+	 */
+	public static void register(String processLabel, Class<?> process) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(REGISTER_PROCESS_LABEL);
+		point.append(processLabel, "", process);
+	}
+	
+	/**
+	 * Gets the process name 
+	 * @param process
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public static String getProcessName(Class<?> process) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(REGISTER_PROCESS_LABEL);
+		List<String> it = point.getNames();
+		for (int i = 0; i < it.size(); i++) {
+			Class<?> value = point.get(it.get(i)).getExtension();
+			if(value == process)
+				return it.get(i);
+		} 
+		return null;
+	}
+	
+	/**
+	 *  Registers input parameters of a raster process
+	 *  @deprecated Uses ProcessParamsManagement register
+	 */
+	public static String registerInputParameter(String parameterLabel, Class<?> parameterClass) {
+		return registerParameter(parameterLabel, parameterClass, REGISTER_INPUT_PARAMETERS_LABEL);
+	}
+	
+	/**
+	 *  Registers output parameters of a raster process
+	 *  @deprecated Uses ProcessParamsManagement register
+	 */
+	public static String registerOutputParameter(String parameterLabel, Class<?> parameterClass) {
+		return registerParameter(parameterLabel, parameterClass, REGISTER_OUTPUT_PARAMETERS_LABEL);
+	}
+	
+	/**
+	 * Registers a raster process
+	 * @deprecated Uses ProcessParamsManagement register
+	 */
+	private static String registerParameter(String parameterLabel, Class<?> parameterClass, String type) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add(type);
+		int i = 0;
+		
+		//Si no hay un par�metro registrado con ese nombre se registra
+		if(point.get(parameterLabel) == null) {
+			point.append(parameterLabel, "", parameterClass);
+			return parameterLabel;
+		} else {
+			//Si hay un par�metro registrado con ese nombre pero los tipos son iguales no se hace nada
+			if(point.get(parameterLabel).getExtension() == parameterClass)
+				return parameterLabel;
+			
+			//Buscamos un nombre no registrado para el par�metro a�adiendo sufijos
+			String newName = parameterLabel + "_" + i;
+			while (point.get(newName) != null && point.get(newName).getExtension() != parameterClass) {
+				i++;
+				newName = parameterLabel + "_" + i;
+			}
+			point.append(parameterLabel + "_" + i, "", parameterClass);
+		}
+		return parameterLabel + "_" + i;
+	}
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Nothing to do
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        Messages.addResourceFamily(
+            "org.gvsig.raster.algorithm.i18n.text", 
+            RasterBaseAlgorithmLibrary.class.getClassLoader(), 
+            RasterBaseAlgorithmLibrary.class.getClass().getName());
+        //registerGeoProcess(new RasterReprojectAlgorithmLibrary());
+    }
+
+    /**
+     * Returns the instance of the manager
+     * @return
+     */
+    public static RasterBaseAlgorithmManager getManager() {
+    	return RasterBaseAlgorithmManager.getInstance();
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/src/main/java/org/gvsig/raster/algorithm/RasterBaseAlgorithmLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm/pom.xml	(revision 15423)
@@ -0,0 +1,119 @@
+<?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.algorithm</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster</artifactId>
+		<version>2.2.171</version>
+	</parent>
+	<dependencies>
+		<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.raster.swing.api</artifactId>
+            <scope>compile</scope>
+		</dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.swing.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+     	 <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.metadata.lib.basic.impl</artifactId>
+          <scope>runtime</scope>
+      	</dependency>
+      	<dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.metadata.swing.basic.impl</artifactId>
+          <scope>runtime</scope>
+      	</dependency>
+        <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.tools.lib</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.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>
+        <build-dir>${basedir}/../../build</build-dir>
+    </properties>
+</project>

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


Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.algorithm
___________________________________________________________________
Added: svn:ignore
   + target

.settings

.project

.classpath


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIWriter.java	(revision 15423)
@@ -0,0 +1,12 @@
+package org.gvsig.raster.roi;
+
+import java.util.List;
+
+/**
+ * API to read regions of interest
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * 
+ */
+public interface ROIWriter {
+	public void write (List<ROI> rois);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROI.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROI.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROI.java	(revision 15423)
@@ -0,0 +1,226 @@
+/* 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.roi;
+
+import java.awt.Color;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+
+
+/**
+ * Region of interest 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface ROI {
+	
+	public RasterDataStore getStore();
+	
+	/**
+	 * Checks if the rectangle defined in the parameters is inside if the ROI or outside
+	 */
+	public boolean isInside(double x, double y, double w, double h);
+	
+	/**
+	 * Checks if a point in pixel coordinates is inside of this region of interest
+	 * @return true whether the point is inside
+	 */
+	public boolean isInsideOfPolygon(int x, int y);
+	
+	/**
+	 * Gets the bounding box of this ROI
+	 * @return
+	 */
+	public Extent getROIExtent();
+	
+	public Color getColor();
+
+	public void setColor(Color color);
+	
+	public String getName();
+
+	public void setName(String name);
+	
+	public long getID();
+	
+	public void setID(long id);
+	
+	
+//	public ROI add(ROI roi);
+//	
+//	public ROI intersect(ROI roi);
+//	
+//	public ROI subtract(ROI roi);
+//	
+//	public ROI exclusiveOr(ROI roi);
+//	
+//	public double getAspect(int x, int y)
+//			throws GridException;
+//
+//	public double getCellSize();
+//	
+//	/**
+//	 * Obtiene el valor de una celda de tipo byte. Si el punto no pertenece al
+//	 * ROI devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
+//	 * acceder a un tipo de dato erroneo.
+//	 * @param x Posici?n X en coordenadas pixel del ROI
+//	 * @param y Posici?n Y en coordenadas pixel del ROI
+//	 * @throws RasterBufferInvalidAccessException
+//	 * @return Valor byte
+//	 */
+//	public byte getCellValueAsByte(int x, int y)
+//			throws GridException;
+//
+//	/**
+//	 * Obtiene el valor de una celda de tipo double. Si el punto no pertenece al
+//	 * ROI devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
+//	 * acceder a un tipo de dato erroneo.
+//	 * @param x Posici?n X en coordenadas pixel del ROI
+//	 * @param y Posici?n Y en coordenadas pixel del ROI
+//	 * @throws RasterBufferInvalidAccessException
+//	 * @return Valor double
+//	 */
+//	public double getCellValueAsDouble(int x, int y)
+//			throws GridException;
+//
+//	/**
+//	 * Obtiene el valor de una celda de tipo Float. Si el punto no pertenece al
+//	 * ROI devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
+//	 * acceder a un tipo de dato erroneo.
+//	 * @param x Posici?n X en coordenadas pixel del ROI
+//	 * @param y Posici?n Y en coordenadas pixel del ROI
+//	 * @throws RasterBufferInvalidAccessException
+//	 * @return Valor Float
+//	 */
+//	public float getCellValueAsFloat(int x, int y)
+//			throws GridException;
+//
+//	/**
+//	 * Obtiene el valor de una celda de tipo int. Si el punto no pertenece al
+//	 * ROI devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
+//	 * acceder a un tipo de dato erroneo.
+//	 * @param x Posici?n X en coordenadas pixel del ROI
+//	 * @param y Posici?n Y en coordenadas pixel del ROI
+//	 * @throws RasterBufferInvalidAccessException
+//	 * @return Valor int
+//	 */
+//	public int getCellValueAsInt(int x, int y)
+//			throws GridException;
+//
+//	/**
+//	 * Obtiene el valor de una celda de tipo short. Si el punto no pertenece al
+//	 * ROI devuelve un valor NoData. La excepci?n ser? lanzada si intentamos 
+//	 * acceder a un tipo de dato erroneo.
+//	 * @param x Posici?n X en coordenadas pixel del ROI
+//	 * @param y Posici?n Y en coordenadas pixel del ROI
+//	 * @throws RasterBufferInvalidAccessException
+//	 * @return Valor short
+//	 */
+//	public short getCellValueAsShort(int x, int y)
+//			throws GridException;
+//
+//	public int getDirToNextDownslopeCell(int x, int y) throws GridException;
+//
+//	public int getDirToNextDownslopeCell(int x, int y,boolean bForceDirToNoDataCell)
+//													throws GridException;
+//
+//	public double getDistToNeighborInDir(int iDir);
+//
+//	public GridExtent getGridExtent();
+//
+//	public int getLayerNX();
+//
+//	public int getLayerNY();
+//	
+//	/**
+//	 * 
+//	 * @return n�mero de celdas del ROI.
+//	 */
+//	public long getValues() throws GridException;
+//	
+//	public double getMaxValue() throws GridException;
+//	
+//	public double getMeanValue() throws GridException;
+//
+//	public double getMinValue() throws GridException;
+//
+//	/**
+//	* Devuelve la matriz de varianza-covarianza, si no se encuentra calculada se calcula
+//	* @retrun Matriz de varianza-covarianza
+//	*/
+//	public double[][] getVarCovMatrix() throws GridException;
+//	
+//	public int getNX();
+//
+//	public int getNY();
+//
+//	public double getNoDataValue();
+//
+//	public double getSlope(int x, int y) throws GridException;
+//
+//	public GridCell[] getSortedArrayOfCells() throws GridException;
+//
+//	public double getVariance() throws GridException;
+//
+//	
+//	public boolean isNoDataValue(double dValue);
+//
+//	public void setInterpolationMethod(int iMethod);
+//
+//	public Grid getGrid();
+//
+//	
+//	public long getID();
+//	
+//	public void setID(long id);
+//
+//	
+//	/**
+//	 *Establece el Subconjunto de bandas que abarca el ROI. 
+//	 *
+//	 */
+//	public void setBandsSubset(int bandsSubset[]);
+//	
+//	/**
+//	 * Restaura el subconjunto accesible por el ROI a todas las bandas del Grid.
+//	 */
+//	public void clearBandsSubset();
+//	
+//	/**
+//	 * Asigna la banda sobre la que se realizan las operaciones. Por defecto es la banda 0
+//	 * con lo que para el uso de MDTs no habr� que modificar este valor.
+//	 * @param band Banda sobre la que se realizan las operaciones.
+//	 */
+//	public void setBandToOperate(int band);
+//
+//	/**
+//	 * 
+//	 * @return N�mero de bandas que abarca el ROI.
+//	 */
+//	public int getBandCount();
+//
+//	/**
+//	 * 
+//	 * @return Subconjunto de bandas que abarca el ROI.
+//	 */
+//	public int[] getBandsSubset();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIReader.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIReader.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIReader.java	(revision 15423)
@@ -0,0 +1,14 @@
+package org.gvsig.raster.roi;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+
+/**
+ * API to read regions of interest
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * 
+ */
+public interface ROIReader {
+	public List<ROI> read(List<ROI> existingROIs) throws ROIException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/ROIReader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/AbstractROI.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/AbstractROI.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/AbstractROI.java	(revision 15423)
@@ -0,0 +1,410 @@
+/* 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.roi;
+
+import java.awt.Color;
+import java.util.List;
+
+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.GridExtent;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.tools.ToolsLocator;
+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;
+
+/**
+ * Clase que representa las Regiones de Interes. 
+ * 
+ * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es).
+ *
+ */
+public abstract class AbstractROI implements ROI {
+	public static final String      PERSISTENT_NAME        = "AbstractROI_Persistent";
+    public static final String      PERSISTENT_DESCRIPTION = "AbstractROI Persistent";
+    
+	private long                    id                     = 0;
+	private String 					name		           = "";
+	private Color					color		           = null;
+	private RasterDataStore         store 		           = null;
+	protected Statistics			statistic 	           = null;
+	/**
+	 * M�nimo extent que contiene al ROI.
+	 */
+	protected Extent 			    roiExtent              = null;
+	private int                     pxWidth                = -1;
+	private int                     pxHeight               = -1;
+	
+	/**
+	 * Coord. x del grid donde est� laz esquina sup. iz. del roi (coords. pixel).
+	 */
+	protected int 					xOffset		           = 0;
+	/**
+	 * Coord. y del grid donde est� la esquina sup. iz. del roi (coords. pixel).
+	 */
+	protected int					yOffset		           = 0;
+	/**
+	 * Subconjunto de bandas que abarca el ROI.
+	 */
+	private int 					bandsSubset[]          = null;
+	private RasterManager           manager                = null;
+	private int                     operationBand          = 0;
+	
+	public AbstractROI(RasterDataStore store) {
+		this.manager = RasterLocator.getManager();
+		this.store = store;
+		roiExtent = this.manager.getDataStructFactory().createExtent();
+		statistic = this.manager.createROIStatistics(this);
+	}
+	
+	public RasterDataStore getStore() {
+		return store;
+	}
+	
+	/**
+	 * Obtiene el extent m�ximo de todas las ROIs pasadas por par�metro.
+	 * @param rois Lista de ROIs para calcular la extensi�n m�xima que ocupan
+	 * @return Entent m�ximo
+	 */
+	public static Extent getROIsMaximunExtent(List<ROI> rois) {
+		double minx = 0, miny = 0, maxx = 0, maxy = 0;
+		for (int i = 0; i < rois.size(); i++) {
+			Extent ext = ((AbstractROI) rois.get(i)).getROIExtent();
+			if(i == 0) {
+				minx = ext.minX();
+				miny = ext.minY();
+				maxx = ext.maxX();
+				maxy = ext.maxY();
+			} else {
+				if(ext.minX() < minx)
+					minx = ext.minX();
+				if(ext.minY() < miny)
+					miny = ext.minY();
+				if(ext.maxX() > maxx)
+					maxx = ext.maxX();
+				if(ext.maxY() > maxy)
+					maxy = ext.maxY();
+			}
+		}
+		return RasterLocator.getManager().getDataStructFactory().createExtent(minx, miny, maxx, maxy);
+	}
+
+	public ROI add(ROI roi){
+		return null;
+	}
+	
+	public ROI intersect(ROI roi){
+		return null;
+	}
+	
+	public ROI subtract(ROI roi){
+		return null;
+	}
+	
+	public ROI exclusiveOr(ROI roi){
+		return null;
+	}
+
+	public double getCellSize() {
+		return store.getCellSize();
+	}
+	
+	public Extent getROIExtent() {
+		return roiExtent;
+	}
+	
+	public Extent getStoreExtent() {
+		return store.getExtent();
+	}
+
+	public int getLayerWidth() {
+		return (int)store.getWidth();
+	}
+
+	public int getLayerHeight() {
+		return (int)store.getHeight();
+	}
+	
+	/**
+	 * 
+	 * @return n�mero de celdas del ROI.
+	 */
+	public long getValues() throws GridException {
+		if (!statistic.isCalculated())
+			try {
+				statistic.calculate(1);
+			} catch (FileNotOpenException e) {
+				throw new GridException("", e);
+			} catch (RasterDriverException e) {
+				throw new GridException("", e);
+			} catch (ProcessInterruptedException e) {
+				throw new GridException("", e);
+			}
+		return statistic.getNumberOfCells()[operationBand];
+	}
+
+	public double getMaxValue() throws GridException {
+		if (!statistic.isCalculated())
+			try {
+				statistic.calculate(1);
+			} catch (FileNotOpenException e) {
+				throw new GridException("", e);
+			} catch (RasterDriverException e) {
+				throw new GridException("", e);
+			} catch (ProcessInterruptedException e) {
+				throw new GridException("", e);
+			}
+		return statistic.getMax()[operationBand];
+	}
+
+	public double getMeanValue() throws GridException {
+		if (!statistic.isCalculated())
+			try {
+				statistic.calculate(1);
+			} catch (FileNotOpenException e) {
+				throw new GridException("", e);
+			} catch (RasterDriverException e) {
+				throw new GridException("", e);
+			} catch (ProcessInterruptedException e) {
+				throw new GridException("", e);
+			}
+		return statistic.getMean()[operationBand];
+	}
+
+	public double getMinValue() throws GridException {
+		if (!statistic.isCalculated())
+			try {
+				statistic.calculate(1);
+			} catch (FileNotOpenException e) {
+				throw new GridException("", e);
+			} catch (RasterDriverException e) {
+				throw new GridException("", e);
+			} catch (ProcessInterruptedException e) {
+				throw new GridException("", e);
+			}
+		return statistic.getMin()[operationBand];
+	}
+
+	/**
+	* Devuelve la matriz de varianza-covarianza, si no se encuentra calculada se calcula
+	* @retrun Matriz de varianza-covarianza
+	*/
+	public double[][] getVarCovMatrix() throws GridException {
+		if(!statistic.isAdvancedStatisticsCalculated())
+			statistic.calculateAdvanced();
+		return statistic.getVarianceCovarianceMatrix();
+	}
+	
+	public int getROIPxWidth() {
+		if(pxWidth < 0)
+			pxWidth = (int) Math.abs(Math.floor((roiExtent.maxX() - roiExtent.minX()) / store.getCellSize()));
+		return pxWidth;
+	}
+
+	public int getROIPxHeight() {
+		if(pxHeight < 0)
+			pxHeight = (int) Math.abs(Math.floor((roiExtent.minY() - roiExtent.maxY()) / store.getCellSize()));
+		return pxHeight;
+	}
+
+	public double getNoDataValue() {
+		//		 TODO Ver si usar un nodatavalue especifico del roi.
+		return store.getNoDataValue().getValue().doubleValue();
+	}
+
+	public double getVariance() throws GridException {
+		if (!statistic.isCalculated())
+			try {
+				statistic.calculate(1);
+			} catch (FileNotOpenException e) {
+				throw new GridException("", e);
+			} catch (RasterDriverException e) {
+				throw new GridException("", e);
+			} catch (ProcessInterruptedException e) {
+				throw new GridException("", e);
+			};
+		return statistic.getVariance()[operationBand];
+	}
+
+	/**
+	 * Checks if a point in pixel coordinates which is inside the grid, belongs to
+	 * a geometry
+	 * @param x X coordinate
+	 * @param y Y coordinate 
+	 * @return true is inside of a geometry 
+	 */
+	public abstract boolean isInsideOfPolygon(int x, int y);
+	
+	/**
+	 * Checks if a rectangle in pixel coordinates intersects with some geometry of this ROI 
+	 * @param x X upper left coordinate
+	 * @param y Y upper left coordinate
+	 * @param w Width of the area in pixels
+	 * @param h Height of the area in pixels
+	 * @return true is inside of a geometry 
+	 */
+	public abstract boolean isInside(double x, double y, double w, double h);	
+
+	public Color getColor() {
+		return color;
+	}
+
+	public void setColor(Color color) {
+		this.color = color;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	public long getID() {
+		return id;
+	}
+	
+	public void setID(long id) {
+		this.id = id;
+	}
+	
+	public String toString() {
+		return getName();
+	}
+	
+	/**
+	 *Establece el Subconjunto de bandas que abarca el ROI. 
+	 *
+	 */
+	public void setBandsSubset(int bandsSubset[]){
+		this.bandsSubset=bandsSubset;
+		statistic.setCalculated(false);
+	}
+	
+	/**
+	 * Restaura el subconjunto accesible por el ROI a todas las bandas del Grid.
+	 */
+	public void clearBandsSubset(){
+		if (bandsSubset!=null){
+			bandsSubset = null;
+			statistic.setCalculated(false);
+		}
+	}
+	
+	/**
+	 * @return N�mero de bandas que abarca el ROI.
+	 */
+	public int getBandCount() {
+		return store.getBandCount();
+	}
+
+	/**
+	 * 
+	 * @return Subconjunto de bandas que abarca el ROI.
+	 */
+	public int[] getBandsSubset() {
+		return bandsSubset;
+	}
+
+	protected Statistics getStatistic() {
+		return statistic;
+	}
+	
+
+	/**
+	 * @deprecated The regions of interest should not be persisted
+	 */
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		this.id = state.getLong("id");
+		this.name = state.getString("name");
+		this.color = (Color)state.get("color");
+		//this.grid = (Grid)state.get("grid");
+		this.statistic = (Statistics)state.get("statistic");
+		this.roiExtent = (GridExtent)state.get("roiExtent");
+		this.xOffset = state.getInt("xOffset");
+		this.yOffset = state.getInt("yOffset");
+		
+		List<Integer> aux = state.getList("bandsSubset");
+		this.bandsSubset = new int[aux.size()];
+		for (int i = 0; i < aux.size(); i++) {
+			this.bandsSubset[i] = aux.get(i).intValue();
+		}
+		this.manager = (RasterManager)state.get("manager");
+		this.operationBand = state.getInt("operationBand");
+	}
+
+	/**
+	 * @deprecated The regions of interest should not be persisted
+	 */
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("id", id);		
+		state.set("name", name);
+		state.set("color", color);	
+		//state.set("grid", grid);	
+		state.set("statistic", statistic);	
+		state.set("roiExtent", roiExtent);	
+		state.set("xOffset", xOffset);	
+		state.set("yOffset", yOffset);
+		state.set("bandsSubset", bandsSubset);
+		state.set("manager", manager);
+		state.set("operationBand", operationBand);
+	}	
+	
+	/**
+	 * @deprecated The regions of interest should not be persisted
+	 */
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					AbstractROI.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			definition.addDynFieldLong("id").setMandatory(true);
+			definition.addDynFieldString("name").setMandatory(true);
+			definition.addDynFieldObject("color").setClassOfValue(Color.class).setMandatory(false);
+			//definition.addDynFieldObject("grid").setClassOfValue(Grid.class).setMandatory(false);
+			definition.addDynFieldObject("statistic").setClassOfValue(Statistics.class).setMandatory(false);
+			definition.addDynFieldObject("roiExtent").setClassOfValue(GridExtent.class).setMandatory(false);
+			definition.addDynFieldInt("xOffset").setMandatory(false);
+			definition.addDynFieldInt("yOffset").setMandatory(false);
+			definition.addDynFieldList("bandsSubset").setClassOfItems(Integer.class).setMandatory(false);
+			definition.addDynFieldObject("manager").setClassOfValue(GridExtent.class).setMandatory(true);
+			definition.addDynFieldInt("operationBand").setMandatory(true);
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/AbstractROI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/VectorialROI.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/VectorialROI.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/VectorialROI.java	(revision 15423)
@@ -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.roi;
+
+import java.util.List;
+
+import org.gvsig.fmap.geom.Geometry;
+
+/**
+ * ROI of vectorial elements
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface VectorialROI extends ROI {
+
+	/**
+	 * Adds a geometry
+	 */
+	public void addGeometry(Geometry geometry);
+	
+	/**
+	 * Deletes a geometry with the <code>index</code> selected
+	 */
+	public void deleteGeometry(int index);
+
+
+	/**
+	 * Gets the list of geometries of this ROI
+	 */
+	public List<Geometry> getGeometries();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/raster/roi/VectorialROI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/Buffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/Buffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/Buffer.java	(revision 15423)
@@ -0,0 +1,521 @@
+/* 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;
+
+import java.awt.geom.Rectangle2D;
+import java.awt.image.DataBuffer;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.DataSet;
+import org.gvsig.fmap.dal.coverage.datastruct.Band;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.WarpException;
+import org.gvsig.fmap.dal.coverage.process.IncrementableTask;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.Histogramable;
+
+/**
+ * Interfaz que contiene las operaciones que debe soportar un buffer de datos.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface Buffer extends DataSet, Histogramable {
+    public final static int TYPE_UNDEFINED                 = DataBuffer.TYPE_UNDEFINED;
+    public final static int TYPE_BYTE                      = DataBuffer.TYPE_BYTE;
+    public final static int TYPE_SHORT                     = DataBuffer.TYPE_SHORT;
+    public final static int TYPE_USHORT                    = DataBuffer.TYPE_USHORT;
+    public final static int TYPE_INT                       = DataBuffer.TYPE_INT;
+    public final static int TYPE_FLOAT                     = DataBuffer.TYPE_FLOAT;
+    public final static int TYPE_DOUBLE                    = DataBuffer.TYPE_DOUBLE;
+    public final static int TYPE_IMAGE                     = -1;
+    
+	public final static int INTERPOLATION_Undefined        = 0;
+	public final static int INTERPOLATION_NearestNeighbour = 1;
+	public final static int INTERPOLATION_Bilinear         = 2;
+	public final static int INTERPOLATION_InverseDistance  = 3;
+	public final static int INTERPOLATION_BicubicSpline    = 4;
+	public final static int INTERPOLATION_BSpline          = 5;
+	
+	public final static int INCREMENTABLE_INTERPOLATION    = 0;
+	public final static int INCREMENTABLE_HISTOGRAM        = 1;
+    
+	/*public static int TYPE_UNDEFINED = 32;
+	public static int TYPE_Byte = 0;		//Buffer byte (8)
+	public static int TYPE_UInt16 = 1;		//Buffer short (16)
+	public static int TYPE_Int16 = 2;		//Buffer short (16)
+	public static int TYPE_UInt32 = 6;		//Buffer int (32)
+	public static int TYPE_Int32 = 3;		//Buffer int (32)
+	public static int TYPE_Float32 = 4;		//Buffer float (32)
+	public static int TYPE_Float64 = 5;		//Buffer double (64)
+	public static int TYPE_CInt16 = 7;		//Buffer short (16)
+	public static int TYPE_CInt32 = 8;		//Buffer int (32)
+	public static int TYPE_CFloat32 = 9;	//Buffer float (32)
+	public static int TYPE_CFloat64 = 10;*/	//Buffer double (64)
+    
+	/**
+	 * Gets the RasterDataStore reference
+	 * @return
+	 */
+	public RasterDataStore getStore();
+
+	/**
+	 * Sets the RasterDataStore reference
+	 * @param store
+	 */
+	public void setStore(RasterDataStore store);
+	
+    /**
+     * Ancho del raster
+     * @return Entero con el ancho del raster
+     */
+    public int getWidth();
+
+    /**
+     * Alto del raster
+     * @return Entero con el alto del raster
+     */
+    public int getHeight();
+    
+    /**
+     * Gets the height of a block of data.
+     * @return
+     */
+    public int getBlockHeight();
+
+    /**
+     * N�mero de bandas
+     * @return Entero con el n�mero de bandas
+     */
+    public int getBandCount();
+    
+    /**
+     * Obtiene el tipo de dato. Los tipos de dato posibles est�n definidos en IRaster.
+     * @return tipo de datos
+     */
+	public int getDataType();
+	
+	/**
+	 * Asigna el tipo de dato. Los tipos de dato posibles est�n definidos en IRaster.
+	 * @param dataType Tipo de dato del buffer
+	 */
+	public void setDataType(int dataType);
+	
+    /**
+     * Gets the NoData value of this buffer
+     * @return 
+     */
+     public NoData getNoDataValue();
+    
+    /**
+     * Obtiene true si el pixel pasado por par�metro cae dentro de los l�mites
+     * del rater y false si cae fuera. 
+     * @param x Posici�n X del pixel a averiguar
+     * @param y Posici�n Y del pixel a averiguar
+     * @return true si est� dentro y false si cae fuera.
+     */
+    public boolean isInside(int x, int y);
+
+    /**
+     * Calcula el m�nimo y el m�ximo del histograma previamente.
+     * @return double[] con el m�nimo y m�ximo y el segundo minimo y maximo.
+     * @throws ProcessInterruptedException 
+     */
+    public double[] getLimits() throws ProcessInterruptedException;
+
+    /**
+     * Sets the NoData value 
+     * @param nd
+     */
+    public void setNoDataValue(NoData nd);
+    
+    /**
+     * Reserva de memoria para el rasterbuf solo en la banda solicitada
+     * @param dataType Tipo de dato
+     * @param width Ancho
+     * @param height Alto
+     * @param band N�mero de banda
+     * @param orig
+     */
+    public void mallocOneBand(int dataType, int width, int height, int band);
+    
+    /**
+     * Informa de si el buffer tiene la capacidad de intercambio de bandas o
+     * no la tiene.
+     * @return Devuelve true si tiene la capacidad de intercambio de bandas y 
+     * false si no la tiene.
+     */
+    public boolean isBandSwitchable();
+    
+    /**
+     * Returns true if the current buffer can't be writed
+     * @return
+     */
+    public boolean isReadOnlyBuffer();
+    
+    /**
+     * Returns true if it is a cached buffer
+     * @return
+     */
+    public boolean isCached();
+    
+	/**
+	 * Gets a bouding box of this buffer
+	 * @return
+	 */
+	public Rectangle2D getDataExtent();
+	
+	/**
+	 * Sets a bounding box of this buffer
+	 * @param r
+	 */
+	public void setDataExtent(Rectangle2D r);
+	
+	/**
+	 * Assigns the band list but only for a read only buffer 
+	 * @param bandList
+	 */
+	public void addDrawableBands(int[] db);
+	
+    //***********************************************
+    //Obtiene una linea de datos de todas las bandas
+    
+	/**
+	 * Obtiene una l�nea de datos con todas las bandas para buffers con tipo
+	 * de dato byte.
+	 * @param line N�mero de l�nea del buffer a recuperar
+	 * @return Array bidimensional conteniendo la l�nea de datos donde la primera
+	 * dimensi�n representa las bandas y la segunda la posici�n en la l�nea
+	 */    
+    public byte[][] getLineByte(int line);
+
+    /**
+	 * Obtiene una l�nea de datos con todas las bandas para buffers con tipo
+	 * de dato short.
+	 * @param line N�mero de l�nea del buffer a recuperar
+	 * @return Array bidimensional conteniendo la l�nea de datos donde la primera
+	 * dimensi�n representa las bandas y la segunda la posici�n en la l�nea
+	 */  
+    public short[][] getLineShort(int line);
+
+    /**
+	 * Obtiene una l�nea de datos con todas las bandas para buffers con tipo
+	 * de dato int.
+	 * @param line N�mero de l�nea del buffer a recuperar
+	 * @return Array bidimensional conteniendo la l�nea de datos donde la primera
+	 * dimensi�n representa las bandas y la segunda la posici�n en la l�nea
+	 */  
+    public int[][] getLineInt(int line);
+        
+    /**
+	 * Obtiene una l�nea de datos con todas las bandas para buffers con tipo
+	 * de dato float.
+	 * @param line N�mero de l�nea del buffer a recuperar
+	 * @return Array bidimensional conteniendo la l�nea de datos donde la primera
+	 * dimensi�n representa las bandas y la segunda la posici�n en la l�nea
+	 */  
+    public float[][] getLineFloat(int line);
+    
+    /**
+	 * Obtiene una l�nea de datos con todas las bandas para buffers con tipo
+	 * de dato double.
+	 * @param line N�mero de l�nea del buffer a recuperar
+	 * @return Array bidimensional conteniendo la l�nea de datos donde la primera
+	 * dimensi�n representa las bandas y la segunda la posici�n en la l�nea
+	 */  
+    public double[][] getLineDouble(int line);
+    
+    //***********************************************
+    //Obtiene una linea de datos de una banda
+    
+    /**
+     * Obtiene una l�nea de datos de la banda solicitada para buffers con tipo
+	 * de dato byte.
+     * @param line N�mero de l�nea del buffer a recuperar
+     * @param band N�mero de banda a recuperar
+     * @return Array unidimensional que representa la l�nea de datos.
+     */
+    public byte[] getLineFromBandByte(int line, int band);
+
+    /**
+     * Obtiene una l�nea de datos de la banda solicitada para buffers con tipo
+	 * de dato short.
+     * @param line N�mero de l�nea del buffer a recuperar
+     * @param band N�mero de banda a recuperar
+     * @return Array unidimensional que representa la l�nea de datos.
+     */
+    public short[] getLineFromBandShort(int line, int band);
+
+    /**
+     * Obtiene una l�nea de datos de la banda solicitada para buffers con tipo
+	 * de dato int.
+     * @param line N�mero de l�nea del buffer a recuperar
+     * @param band N�mero de banda a recuperar
+     * @return Array unidimensional que representa la l�nea de datos.
+     */
+    public int[] getLineFromBandInt(int line, int band);
+        
+    /**
+     * Obtiene una l�nea de datos de la banda solicitada para buffers con tipo
+	 * de dato float.
+     * @param line N�mero de l�nea del buffer a recuperar
+     * @param band N�mero de banda a recuperar
+     * @return Array unidimensional que representa la l�nea de datos.
+     */
+    public float[] getLineFromBandFloat(int line, int band);
+    
+    /**
+     * Obtiene una l�nea de datos de la banda solicitada para buffers con tipo
+	 * de dato double.
+     * @param line N�mero de l�nea del buffer a recuperar
+     * @param band N�mero de banda a recuperar
+     * @return Array unidimensional que representa la l�nea de datos.
+     */
+    public double[] getLineFromBandDouble(int line, int band);
+    
+    //***********************************************    
+    //Obtiene un elemento de la matriz
+    
+    public byte getElemByte(int line, int col, int band);
+    
+    public short getElemShort(int line, int col, int band);
+    
+    public int getElemInt(int line, int col, int band);
+    
+    public float getElemFloat(int line, int col, int band);
+    
+    public double getElemDouble(int line, int col, int band);
+    
+    //***********************************************
+    //Copia un elemento de todas la bandas en el buffer pasado por par�metro
+    
+    public void getElemByte(int line, int col, byte[] data);
+    
+    public void getElemShort(int line, int col, short[] data);
+    
+    public void getElemInt(int line, int col, int[] data);
+    
+    public void getElemFloat(int line, int col, float[] data);
+    
+    public void getElemDouble(int line, int col, double[] data);
+    
+    //***********************************************
+    
+    /**
+     * Sustituye una banda completa copiando los datos de la que se pasa por par�metro
+     * @param nBand N�mero de banda a sustituir
+     * @param banda a copiar
+     */
+    public void copyBand(int nBand, Band band);
+    
+    /**
+     * Sustituye una banda completa que se asigna por referencia
+     * @param nBand N�mero de banda a sustituir
+     * @param banda a asignar por referencia
+     */
+    public void assignBand(int nBand, Band band);
+    
+    /**
+     * Obtiene una banda completa del raster
+     * @param nBand N�mero de banda 
+     */
+    public Band getBand(int nBand);
+    
+    /**
+     * Obtiene una banda completa del raster
+     * @param nBand N�mero de banda 
+     */
+    public Buffer getBandBuffer(int nBand);
+        
+    //***********************************************
+    //Asigna una linea de datos a una banda
+    
+    public void setLineInBandByte(byte[] data, int line, int band);
+
+    public void setLineInBandShort(short[] data, int line, int band);
+
+    public void setLineInBandInt(int[] data, int line, int band);
+        
+    public void setLineInBandFloat(float[] data, int line, int band);
+    
+    public void setLineInBandDouble(double[] data, int line, int band);
+    
+    //***********************************************
+    //Asigna una linea de datos a todas las bandas
+    
+    public void setLineByte(byte[][] data, int line);
+
+    public void setLineShort(short[][] data, int line);
+
+    public void setLineInt(int[][] data, int line);
+        
+    public void setLineFloat(float[][] data, int line);
+    
+    public void setLineDouble(double[][] data, int line);
+    
+    //**********************************************    
+    //Asigna un elemento de la matriz
+    
+    public void setElem(int line, int col, int band, byte data);
+    
+    public void setElem(int line, int col, int band, short data);
+    
+    public void setElem(int line, int col, int band, int data);
+    
+    public void setElem(int line, int col, int band, float data);
+    
+    public void setElem(int line, int col, int band, double data);
+    
+    //***********************************************
+    //Asigna un elemento a todas la bandas en el buffer pasado por par�metro
+    
+    public void setElemByte(int line, int col, byte[] data);
+    
+    public void setElemShort(int line, int col, short[] data);
+    
+    public void setElemInt(int line, int col, int[] data);
+
+    public void setElemFloat(int line, int col, float[] data);
+    
+    public void setElemDouble(int line, int col, double[] data);
+    
+    //***********************************************
+    //Inicializa una banda a un valor pasado por par�metro
+    
+    public void assign(int band, byte value);
+    
+    public void assign(int band, short value);
+    
+    public void assign(int band, int value);
+
+    public void assign(int band, float value);
+    
+    public void assign(int band, double value);
+    
+    //***********************************************
+   
+    /**
+     * Crea un buffer banda inicializado con el valor pasado por par�metro. Las dimensiones
+     * corresponden a las del buffer existente.
+     * @param defaultValue Valor con el que se inicializa la banda creada
+     */
+    public Band createBand(byte defaultValue);
+    
+    /**
+     * Replica la banda de una posici�n sobre otra. Si la banda de destino no existe
+     * se crea nueva. Si la posici�n de la banda de destino est� intercalada entre bandas 
+     * que ya existen las otras se desplazan hacia abajo, NO se machacan los datos de ninguna.
+     * Los datos se replican por referencia por lo que al modificar la banda original las
+     * del resto quedar�n afectadas.   
+     * @param orig. Posici�n de la banda de origen. 
+     * @param dest. Posici�n de la banda destino
+     */   
+    public void replicateBand(int orig, int dest);
+    
+    /**
+     * Clona el buffer actual y devuelve el clone
+     * @return Buffer clonado
+     */
+    public Buffer cloneBuffer();
+    
+    /**
+     * Intercambia dos bandas.
+     * @param band1 Banda 1 a intercambiar 
+     * @param band2 Banda 2 a intercambiar
+     */
+    public void interchangeBands(int band1, int band2);
+    
+    /**
+     * Intercambia la posici�n de las bandas. La nueva posici�n viene dada por el vector
+     * pasado por par�metro. Cada posici�n del vector es una banda del buffer y el contenido de 
+     * esa posici�n es la banda que se dibujar� sobre ese buffer.
+	 * <P> 
+     * Por ejemplo un array con los valores:
+     * [2, 0, 1] significa que la banda que ocupa ahora la posici�n 2 pasar� a ocupar la 0, la que 
+     * tiene la posici�n 0 pasa a ocupar la 1 y la que tiene la posici�n 1 pasa a ocupar la 2.
+     * </P>
+     * @param bands  Array con la nueva distribuci�n de bandas
+     */
+    public void switchBands(int[] bands);
+    
+    /**
+     * Asigna el valor de no valido.
+     * @param value
+     */
+    public void setNotValidValue(double value);
+    
+    /**
+     * Obtiene el valor de no valido.
+     * @return value
+     */
+    public double getNotValidValue();
+    
+    /**
+     * Asigna una banda al valor especificado como no valido. Esta banda es com�n para todas las bandas
+     * del buffer, es decir se asigna por referencia. No tiene el mismo resultado que asignar una banda
+     * a un valor fijo.
+     * @param iBand N�mero de banda
+     */
+    public void assignBandToNotValid(int iBand);
+    
+	/**
+	 * Ajusta el �rea del grid a un ancho y un alto dado en pixeles. Este ajuste se har� 
+	 * en relaci�n a un m�todo de interpolaci�n definido en el par�metro.
+	 * @param w Ancho de la nueva imagen.
+	 * @param h Alto de la nueva imagen.
+	 * @param interpolation M�todo de interpolaci�n que se usar� en el ajuste.
+	 */
+	public Buffer getAdjustedWindow(int w, int h, int interpolationMethod) throws ProcessInterruptedException;
+	
+	/**
+	 * This call returns an incrementable task that is needed to load the buffer. Usually 
+	 * this is a BufferInterpolation class.
+	 * @return
+	 */
+	public IncrementableTask getIncrementableTask(int type);
+	
+	public double[][] getAllBandsLimits() throws ProcessInterruptedException;
+	
+    /**
+     * Project buffer using the coordinate transformation. Coordinate
+     * transformation has to define the tranformation between target buffer to
+     * source buffer. Result buffer will have extent, width and height received
+     * as parameters. If coordinate transform is null, transformation will not
+     * be applied and result buffer will have the same data but the extent and
+     * size of buffer will be modified.
+     * 
+     * @param coordTrans
+     *            Coordinate transformation to warp buffer
+     * @param extent
+     *            Extent of projected buffer
+     * @param width
+     *            Width of projected buffer
+     * @param height
+     *            Height of projected buffer
+     * @return buffer Buffer projected with extent, width and height received as
+     *         parameter.
+     * @throws WarpException
+     *             If there are any problem wrapping buffer.
+     */
+	public Buffer project(ICoordTrans coordTrans, Extent extent, int width, int height) throws WarpException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/Buffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/BufferParam.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/BufferParam.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/BufferParam.java	(revision 15423)
@@ -0,0 +1,131 @@
+package org.gvsig.fmap.dal.coverage.dataset;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+
+
+/**
+ * Parameters to create buffers to store raster data
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface BufferParam {
+	public static int        UNDEFINED      = -1;
+	public static int        CACHED         = 0;
+	public static int        READ_ONLY      = 1;
+	public static int        MEMORY         = 2;
+	
+	/**
+	 * Returns the width in pixels
+	 * @return Width in pixels of this raster
+	 */
+	public int getWidth();
+
+	/**
+	 * Sets the width in pixels
+	 * @param  width
+	 *         Width in pixels of this raster
+	 */
+	public void setWidth(int width);
+
+	/**
+	 * Returns the height in pixels
+	 * @return Height in pixels of this raster
+	 */
+	public int getHeight();
+
+	/**
+	 * Sets the height in pixels
+	 * @param  height
+	 *         Height in pixels of this raster 
+	 */
+	public void setHeight(int height);
+
+	/**
+	 * Returns the X upper left coordinate
+	 * @return X upper left coordinate in pixels
+	 */
+	public int getX();
+
+	/**
+	 * Sets the X upper left coordinate
+	 * @params  x
+	 *          X upper left coordinate in pixels
+	 */
+	public void setX(int x);
+
+	/**
+	 * Returns the Y upper left coordinate
+	 * @return Y upper left coordinate in pixels
+	 */
+	public int getY();
+
+	/**
+	 * Sets the Y upper left coordinate
+	 * @params  y
+	 *          Y upper left coordinate in pixels
+	 */
+	public void setY(int y);
+
+	/**
+	 * Gets the data type
+	 * @return
+	 */
+	public int getDataType();
+
+	/**
+	 * Sets the data type
+	 * @param dataType
+	 */
+	public void setDataType(int dataType);
+
+	/**
+	 * Gets number of bands
+	 * @return
+	 */
+	public int getBandCount();
+
+	/**
+	 * Sets number of bands
+	 * @param bandCount
+	 */
+	public void setBandCount(int bandCount);
+	
+	/**
+	 * Sets the type of access defined as constant in Buffer interface
+	 */
+	public void setAccessType(int accessType);
+	
+	/**
+	 * Gets the type of access defined as constant in Buffer interface
+	 */
+	public int getAccessType();
+	
+	/**
+	 * Sets the band list
+	 * @param file
+	 */
+	public void setBandList(BandList bands);
+
+	/**
+	 * Gets the band list
+	 * @return
+	 */
+	public BandList getBandList();
+	
+	public void setDataStore(RasterDataStore roDataSource);
+
+	public RasterDataStore getDataStore();
+
+	public void setMalloc(boolean malloc);
+
+	public boolean isMalloc();
+	
+	public void setRoWindow(int[] roWindow);
+
+	public int[] getRoWindow();
+	
+	public void setRoWindowExtent(Extent roWindow);
+
+	public Extent getRoWindowExtent();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/BufferParam.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/AbstractBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/AbstractBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/AbstractBuffer.java	(revision 15423)
@@ -0,0 +1,148 @@
+package org.gvsig.fmap.dal.coverage.dataset;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.BufferCreationException;
+import org.gvsig.fmap.dal.coverage.exception.WarpException;
+
+/**
+ * Abstract class that implements common functionality to any buffer implementation.
+ * 
+ * @author <a href="mailto:lmarques@disid.com">Lluis Marques</a>
+ *
+ */
+public abstract class AbstractBuffer implements Buffer {
+
+    @Override
+    public Buffer project(ICoordTrans coordTrans, Extent extent, int width, int height)
+        throws WarpException {
+
+        if (this.getDataExtent() == null) {
+            throw new IllegalArgumentException(
+                "Soruce buffer has to have data extent to be projected");
+        }
+
+        if (width <= 0 || height <= 0) {
+            throw new IllegalArgumentException(
+                "Width or heigth of result buffer can not be 0 or negative");
+        }
+
+        Rectangle2D dataExtentRect = this.getDataExtent();
+        Extent sourceExtent =
+            RasterLocator.getManager().getDataStructFactory().createExtent(dataExtentRect);
+        AffineTransform atSourceBuffer =
+            new AffineTransform(sourceExtent.width() / this.getWidth(), 0, 0,
+                -sourceExtent.height() / this.getHeight(), sourceExtent.getMin().getX(),
+                sourceExtent.getMax().getY());
+
+        BufferParam bufParam =
+            RasterLocator.getManager().getBufferFactory()
+                .createBufferParams(width, height, this.getBandCount(), this.getDataType(), true);
+        Buffer bufReprojected = null;
+        try {
+            bufReprojected = RasterLocator.getManager().getBufferFactory().createBuffer(bufParam);
+        } catch (BufferCreationException e) {
+            String msg =
+                String.format(
+                    "Can not create buffer. [parameters width %1s height: %2s bands number %3s"
+                        + " data type %4s malloc %5s]", this.getWidth(), this.getHeight(),
+                    this.getBandCount(), this.getDataType(), true);
+            throw new WarpException(msg, e);
+        }
+
+        AffineTransform atReprojectedBuffer =
+            new AffineTransform(extent.width() / width, 0, 0, -extent.height() / height, extent
+                .getMin().getX(), extent.getMax().getY());
+
+        try {
+
+            NoData noData = this.getNoDataValue();
+            if (noData == null) {
+                noData =
+                    RasterLocator.getManager().getDataStructFactory()
+                        .createDefaultNoData(this.getBandCount(), this.getDataType());
+            }
+
+            for (int row = 0; row < bufReprojected.getHeight(); row++) {
+                for (int col = 0; col < bufReprojected.getWidth(); col++) {
+                    Point2D worldPoint = new Point2D.Double();
+                    atReprojectedBuffer.transform(new Point2D.Double(col, row), worldPoint);
+                    Point2D reprojectedWorldPoint = worldPoint;
+
+                    // If there is a coordinate transform defined, transforms
+                    // world point
+                    if (coordTrans != null) {
+                        reprojectedWorldPoint = coordTrans.convert(worldPoint, null);
+                    }
+
+                    Point2D sourceBufferPoint = new Point2D.Double();
+                    atSourceBuffer.inverseTransform(reprojectedWorldPoint, sourceBufferPoint);
+                    writePixel(bufReprojected.getDataType(), this, bufReprojected,
+                        bufReprojected.getBandCount(), sourceBufferPoint, col, row, noData);
+                }
+            }
+        } catch (NoninvertibleTransformException e) {
+            throw new WarpException(String.format("Can not invert transformation %1s",
+                atSourceBuffer), e);
+        }
+        return bufReprojected;
+    }
+
+    private void writePixel(int type, Buffer sourceBuffer, Buffer buf, int bandCount, Point2D p,
+        int col, int row, NoData nd) {
+        if (p.getX() >= 0 && p.getX() < sourceBuffer.getWidth() && p.getY() >= 0
+            && p.getY() < sourceBuffer.getHeight()) {
+            for (int iBand = 0; iBand < bandCount; iBand++) {
+                switch (type) {
+                case Buffer.TYPE_BYTE:
+                    buf.setElem(row, col, iBand,
+                        sourceBuffer.getElemByte((int) p.getY(), (int) p.getX(), iBand));
+                    break;
+                case Buffer.TYPE_SHORT:
+                    buf.setElem(row, col, iBand,
+                        sourceBuffer.getElemShort((int) p.getY(), (int) p.getX(), iBand));
+                    break;
+                case Buffer.TYPE_INT:
+                    buf.setElem(row, col, iBand,
+                        sourceBuffer.getElemInt((int) p.getY(), (int) p.getX(), iBand));
+                    break;
+                case Buffer.TYPE_FLOAT:
+                    buf.setElem(row, col, iBand,
+                        sourceBuffer.getElemFloat((int) p.getY(), (int) p.getX(), iBand));
+                    break;
+                case Buffer.TYPE_DOUBLE:
+                    buf.setElem(row, col, iBand,
+                        sourceBuffer.getElemDouble((int) p.getY(), (int) p.getX(), iBand));
+                    break;
+                }
+            }
+        } else {
+            for (int iBand = 0; iBand < bandCount; iBand++) {
+                switch (type) {
+                case Buffer.TYPE_BYTE:
+                    buf.setElem(row, col, iBand, nd.getValue().byteValue());
+                    break;
+                case Buffer.TYPE_SHORT:
+                    buf.setElem(row, col, iBand, nd.getValue().shortValue());
+                    break;
+                case Buffer.TYPE_INT:
+                    buf.setElem(row, col, iBand, nd.getValue().intValue());
+                    break;
+                case Buffer.TYPE_FLOAT:
+                    buf.setElem(row, col, iBand, nd.getValue().floatValue());
+                    break;
+                case Buffer.TYPE_DOUBLE:
+                    buf.setElem(row, col, iBand, nd.getValue().doubleValue());
+                    break;
+                }
+            }
+        }
+    }
+}
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.dataset package documentation</title>
+</head>
+<body>
+
+	<p>@deprecated</p>
+
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/dataset/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/filter/FilterLoader.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/filter/FilterLoader.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/filter/FilterLoader.java	(revision 15423)
@@ -0,0 +1,44 @@
+package org.gvsig.fmap.dal.coverage.filter;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * <P>
+ * Applies the stack of filters to a buffer. With the same <code>FilterLoader</code>
+ * you can process different buffers. Each buffer can use a different environment
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface FilterLoader {
+	public void addTransparency(Transparency transparency);
+	public void addSrcDataType(int datatype);
+	public void addSrcBandCount(int bandcount);
+	public void addSrcStatistics(Statistics statistics);
+	public void addSrcROI(List<ROI> roi);
+	public void addSrcHistogram(HistogramComputer histogram);
+	public Buffer applyFilters(Buffer buffer);
+	
+	/**
+	 * Gets the transparency object and the color interpretation of the result. 
+	 * Mostly, filters returns ARGB images but sometimes the filter can modify 
+	 * the transparency configuration and the color interpretation.
+	 * For instance, when a color table is applied or a alpha band is added 
+	 * by the filter.
+	 * @return
+	 */
+	public Transparency getTransparency();
+	
+	/**
+	 * Gets the buffer result after the function applyFilters is executed.
+	 * If the buffer has not been modified, it will return the input buffer.
+	 * @return
+	 */
+	public Buffer getBufferResult();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/filter/FilterLoader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/package.html	(revision 15423)
@@ -0,0 +1,19 @@
+<?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.fmap.dal.coverage.grid package documentation</title>
+</head>
+<body>
+
+	<p>A grid is a class which represents a set of cells.</p>
+	
+	<p>
+	Through this object the user can apply kernel operations to a set of cells contained 
+	in a <it>Buffer</it>. Other basic operations to data access can be used but it is 
+	advisable to use the <it>Buffer</it> class for those operations.
+	</p>
+
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RegistrableFilterListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RegistrableFilterListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RegistrableFilterListener.java	(revision 15423)
@@ -0,0 +1,59 @@
+/* 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.grid;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+
+/**
+ * Each panel of a filter should implement this interface. It provides methods for
+ * add and remove listeners and get the parameters.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface RegistrableFilterListener {
+	/**
+	 * Borrar el disparador de eventos de los botones.
+	 * @param listener
+	 */
+	public void removeStateChangedListener(FilterUIListener listener);
+	
+	/**
+	 * 
+	 * Ejecuci�n del m�todo actionValuesCompleted en todos los filtros registrados
+	 */
+	public void callStateChanged();
+	
+	/**
+	 * A�adir el listener para los paneles definidos por el usuario
+	 * @param listener
+	 */
+	public void addFilterUIListener(FilterUIListener listener);
+	
+	/**
+	 * Obtiene los par�metros cargados por el panel
+	 * @return
+	 */
+	public Params getParams();
+	
+	public void setParams(Params params);
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RegistrableFilterListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyListener.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.grid.render;
+
+import java.util.EventListener;
+
+/**
+ * Listener con los eventos que puede disparar una propiedad cuando esta cambia. 
+ * 
+ * 07/01/2008
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface VisualPropertyListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando cambia el valor de la propiedad.
+	 * @param e
+	 */
+	public void visualPropertyValueChanged(VisualPropertyEvent e);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.grid.render package documentation</title>
+</head>
+<body>
+
+	<p>Package for render raster data on a canvas.</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/Render.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/Render.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/Render.java	(revision 15423)
@@ -0,0 +1,307 @@
+/* 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.grid.render;
+
+import java.awt.Graphics2D;
+import java.awt.geom.Dimension2D;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+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.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.exception.ReadException;
+import org.gvsig.tools.dispose.Disposable;
+import org.gvsig.tools.task.TaskStatus;
+
+
+
+/**
+ * Renders a Grid object 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Render extends Runnable, Disposable {
+	
+	/**
+	 * Obtiene las lista de filtros aplicados en la renderizaci�n
+	 * @return RasterFilterList
+	 */
+	public RasterFilterList getFilterList();
+	
+	/**
+	 * Asigna la lista de filtros que se usar� en el renderizado
+	 * @param RasterFilterList
+	 */
+	public void setFilterList(RasterFilterList filterList);
+	
+	/**
+	 * Asigna el �ltimo estado de transparencia de la renderizaci�n.
+	 * @param lastTransparency
+	 */
+	public void setLastTransparency(Transparency lastTransparency);
+	
+	/**
+	 * Obtiene el �ltimo objeto transparencia aplicado en la renderizaci�n
+	 * @return Transparency
+	 */
+	public Transparency getRenderingTransparency();
+	
+	/**
+	 * Gets the last alpha band number
+	 * @return
+	 */
+	public int getLastAlphaBandNumber();
+	
+	/**
+	 * Informa de si el raster tiene tabla de color asociada o no.
+	 * @return true si tiene tabla de color y false si no la tiene.
+	 */
+	public boolean existColorTable();
+	
+	/**
+	 * Gets a data store
+	 * @return
+	 */
+	public RasterDataStore getDataStore();
+	
+	/**
+	 * Sets a data store
+	 * @param dataStore
+	 */
+	public void setDataStore(RasterDataStore dataStore);
+	
+	/**
+	 * Gets the color table 
+	 * @return 
+	 */
+	public ColorTable getColorTable();
+	
+	/**
+	 * Asigna un listener a la lista que ser� informado cuando cambie una
+	 * propiedad visual en la renderizaci�n.
+	 * @param listener VisualPropertyListener
+	 */
+	public void addVisualPropertyListener(VisualPropertyListener listener);
+	
+	/**
+	 * Devuelve si la asignacion de las bandas a renderizar representa una capa
+	 * en escala de grises
+	 * @return
+	 */
+	public boolean isRenderingAsGray();
+	
+	/**
+	 * Sets the color interpretation to renderize this layer
+	 * @param ci
+	 */
+	public void setRenderColorInterpretation(ColorInterpretation ci);
+	
+	/**
+	 * Gets the color interpretation to renderize this layer
+	 * @return
+	 */
+	public ColorInterpretation getRenderColorInterpretation();
+
+	/**
+	 * Asigna el n�mero de bandas y el orden de renderizado. Cada posici�n del vector es una banda
+	 * del buffer y el contenido de esa posici�n es la banda de la imagen que se dibujar�
+	 * sobre ese buffer. A la hora de renderizar hay que tener en cuenta que solo se renderizan las
+	 * tres primeras bandas del buffer por lo que solo se tienen en cuenta los tres primeros
+	 * elementos. Por ejemplo, el array {1, 0, 3} dibujar� sobre el Graphics las bandas 1,0 y 3 de un
+	 * raster que tiene al menos 4 bandas. La notaci�n con -1 en alguna posici�n del vector solo tiene sentido
+	 * en la visualizaci�n pero no se puede as�gnar una banda del buffer a null.
+	 * Algunos ejemplos:
+	 * <P>
+	 * {-1, 0, -1} Dibuja la banda 0 del raster en la G de la visualizaci�n.
+	 * Si replicateBand es true R = G = B sino R = B = 0
+	 * {1, 0, 3} La R = banda 1 del raster, G = 0 y B = 3
+	 * {0} La R = banda 0 del raster. Si replicateBand es true R = G = B sino G = B = 0
+	 * </P>
+	 *
+	 *
+	 * @param renderBands: bandas y su posici�n
+	 */
+	//public void setRenderBands(int[] renderBands);
+	
+	/**
+	 * Obtiene el n�mero de bandas y el orden de renderizado. Cada posici�n del
+	 * vector es una banda del buffer y el contenido de esa posici�n es la banda
+	 * de la imagen que se dibujar� sobre ese buffer. A la hora de renderizar hay
+	 * que tener en cuenta que solo se renderizan las tres primeras bandas del
+	 * buffer por lo que solo se tienen en cuenta los tres primeros elementos. Por
+	 * ejemplo, el array {1, 0, 3} dibujar� sobre el Graphics las bandas 1,0 y 3
+	 * de un raster de al menos 4 bandas. La notaci�n con -1 en alguna posici�n
+	 * del vector solo tiene sentido en la visualizaci�n pero no se puede as�gnar
+	 * una banda del buffer a null. Algunos ejemplos:
+	 * <P>
+	 * <UL>
+	 * <LI> {-1, 0, -1} Dibuja la banda 0 del raster en la G de la visualizaci�n. Si
+	 * replicateBand es true R = G = B sino R = B = 0 </LI>
+	 * <LI> {1, 0, 3} La R = banda 1 del raster, G = 0 y B = 3 </LI>
+	 * <LI> {0} La R = banda 0 del raster. Si replicateBand es true R = G = B
+	 * sino G = B = 0</LI>
+	 * </UL>
+	 * </P>
+	 *
+	 * @return bandas y su posici�n
+	 */
+	//public int[] getRenderBands();
+	
+	/**
+	 * Dibuja el raster sobre el Graphics. Para ello debemos de pasar el viewPort que corresponde a la
+	 * vista. Este viewPort es ajustado a los tama�os m�ximos y m�nimos de la imagen por la funci�n
+	 * calculateNewView. Esta funci�n tambi�n asignar� la vista a los drivers. Posteriormente se calcula
+	 * el alto y ancho de la imagen a dibujar (wImg, hImg), as� como el punto donde se va a pintar dentro
+	 * del graphics (pt). Finalmente se llama a updateImage del driver para que pinte y una vez dibujado
+	 * se pasa a trav�s de la funci�n renderizeRaster que es la encargada de aplicar la pila de filtros
+	 * sobre el Image que ha devuelto el driver.
+	 *
+	 * Para calcular en que coordenada pixel (pt) se empezar� a pintar el BufferedImage con el raster le�do
+	 * se aplica sobre la esquina superior izquierda de esta la matriz de transformaci�n del ViewPortData
+	 * pasado vp.mat.transform(pt, pt). Si el raster no est� rotado este punto es el resultante de la
+	 * funci�n calculateNewView que devuelve la petici�n ajustada al extent de la imagen (sin rotar). Si
+	 * el raster est� rotado necesitaremos para la transformaci�n el resultado de la funci�n coordULRotateRaster.
+	 * Lo que hace esta �ltima es colocar la petici�n que ha sido puesta en coordenadas de la imagen sin rotar
+	 * (para pedir al driver de forma correcta) otra vez en coordenadas de la imagen rotada (para calcular su
+	 * posici�n de dibujado).
+	 *
+	 * Para dibujar sobre el Graphics2D el raster rotado aplicaremos la matriz de transformaci�n con los
+	 * par�metros de Shear sobre este Graphics de forma inversa. Como hemos movido el fondo tendremos que
+	 * recalcular ahora el punto donde se comienza a dibujar aplicandole la transformaci�n sobre este
+	 * at.inverseTransform(pt, pt);. Finalmente volcamos el BufferedImage sobre el Graphics volviendo a dejar
+	 * el Graphics en su posici�n original al acabar.
+	 *
+	 * @param g Graphics sobre el que se pinta
+	 * @param vp ViewPort de la extensi�n a dibujar
+	 * @param taskStatus 
+	 * @throws ProcessInterruptedException 
+	 * @throws QueryException 
+	 */
+	public Buffer draw(Graphics2D g, ViewPortData vp, TaskStatus taskStatus)
+		throws QueryException, ProcessInterruptedException;
+	
+    /**
+     * Dibuja la extensi�n del viewport sobre el graphics aplicando la
+     * transformaci�n que recibe como par�metro.
+     * 
+     * @param g
+     *            Graphics sobre el que se pinta
+     * @param vp
+     *            ViewPort de la extensi�n a dibujar
+     * @param coordTrans
+     *            Transformaci�n a aplicar sobre el buffer antes de ser
+     *            dibujado. La transformaci�n ser� valida si tiene como
+     *            proyecci�n fuente la proyecci�n de la extensi�n del ViewPort y
+     *            como proyecci�n destino la proyecci�n de la fuente de datos.
+     * @param taskStatus
+     *            Objeto compartido para indicar el estado de la tarea
+     * @return Si el graphics es null, el buffer proyectado justo antes de ser
+     *         dibujado, en cualquier otro caso un buffer in�til sin datos.
+     * @throws QueryException
+     * @throws ProcessInterruptedException
+     */
+    public Buffer draw(Graphics2D g, ViewPortData vp, ICoordTrans coordTrans, TaskStatus taskStatus)
+        throws QueryException, ProcessInterruptedException;
+	
+	/**
+	 * Este m�todo dibuja sobre el Graphics a partir de un Viewport sin ajustar. Los tiles que van llegando
+	 * no est�n en el tama�o ajustado sino que llegan en su tama�o origina, tipicamente 256x256 p�xeles. Estos
+	 * son reescalados al ir a dibujarlos sobre el Graphics.
+	 * 
+	 * @param g
+	 * @param vp
+	 * @throws RasterDriverException
+	 * @throws InvalidSetViewException
+	 * @throws ProcessInterruptedException
+	 */
+	public void drawTiledService(Graphics2D g, ViewPortData vp, Dimension2D viewDimension, TaskStatus status)
+		throws QueryException, ProcessInterruptedException;
+	
+    /**
+     * Dibuja la extensi�n del viewport de forma teselada sobre el graphics
+     * aplicando la
+     * transformaci�n que recibe como par�metro.
+     * 
+     * @param g
+     *            Graphics sobre el que se pinta
+     * @param vp
+     *            ViewPort de la extensi�n a dibujar
+     * @param viewDimension
+     *            Dimensi�n de la vista
+     * @param coordTrans
+     *            Transformaci�n a aplicar sobre el buffer antes de ser
+     *            dibujado. La transformaci�n ser� valida si tiene como
+     *            proyecci�n fuente la proyecci�n de la extensi�n del ViewPort y
+     *            como proyecci�n destino la proyecci�n de la fuente de datos.
+     * @param status
+     *            Objeto compartido para indicar el estado de la tarea
+     * @throws QueryException
+     * @throws ProcessInterruptedException
+     */
+    public void drawTiledService(Graphics2D g, ViewPortData vp, Dimension2D viewDimension,
+        ICoordTrans coordTrans, TaskStatus status) throws QueryException,
+        ProcessInterruptedException;
+	
+	/**
+	 * <p>
+	 * This method throws the draw call in a Thread. This is useful to draw tiles.
+	 * </p>
+	 * <p>
+	 * Strategy:
+	 * <ul>
+	 * <li>If the image is out of the view the thread won't be thrown</li>
+	 * <li>Throw the thread to draw</li>
+	 * <li>The main thread waits until the secondary thread ends</li>
+	 * <li>When the buffer of a new tile has been received then nextBuffer is called from the store</li>
+	 * <li>When the last tile has been received then endReading is called from the store. This method unlocks the main
+	 * thread and will finish the process</li>
+	 * <li></li>
+	 * </ul> 
+	 * </p>
+	 * 
+	 * @see draw
+	 */
+	public void drawThread(Graphics2D g, ViewPortData vp);
+	
+	/**
+	 * Draws the image with the parameters used in the last drawn. 
+	 * @return
+	 */
+	public Buffer getLastRenderBuffer()
+		throws QueryException, ProcessInterruptedException;
+	
+	/**
+	 * Sets the view structures to draw
+	 * @param g
+	 * @param vp
+	 */
+	public void setGraphicInfo(Graphics2D g, ViewPortData vp);
+	
+	public void setReading(boolean reading);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/Render.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/ImageDrawer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/ImageDrawer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/ImageDrawer.java	(revision 15423)
@@ -0,0 +1,115 @@
+/* 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.grid.render;
+
+import java.awt.Image;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+
+/**
+ * Writes data from a buffer on a Image object. At this level neither bounding box nor
+ * rotations nor world coordinates are managed.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface ImageDrawer {
+	
+	/**
+	 * Sets the buffer to render
+	 */
+	public void setBuffer(Buffer b);
+
+	/**
+	 * Assigns the buffer transparency
+	 * @param t
+	 */
+	public void setLastTransparency(Transparency t);
+	
+	/**
+	 * Sets the shift in pixels from the upper left corner. It is useful when we need supersampling to render
+	 * the image. If the step is null then the supersampling is deactivated else the size of the output
+	 * buffer will be width X height pixels. This size should be set with setOutPutSize method.
+	 * 
+	 * Exists supersampling when the zoom to draw is greater than 1:1. To draw a pixel will be necessary
+	 * more than one pixel in the output buffer. 
+	 * 
+	 * @param step Desplazamiento
+	 */
+	public void setSupersamplingOn(double[] step);
+	
+	/**
+	 * Sets the size of the output buffer. This is useful to reescale the output buffer
+	 * @param width Ancho
+	 * @param h Alto
+	 */
+	public void setOutputSize(int width, int height);
+	
+	/**
+	 * Releases the link to the buffer.
+	 */
+	public void dispose();
+	
+	/**
+	 * Adds a list of filters
+	 * @param stats
+	 * @param filters
+	 * @throws FilterTypeException
+	 */
+	public void addFilters(Statistics stats, List<RasterFilter> filters) throws FilterTypeException;
+	
+	/**
+	 * Adds a enhanced filter to the buffer
+	 * @param stats
+	 * @return
+	 */
+	public Buffer addEnhanced(Statistics stats);
+	
+	/**
+	 * Adds a enhanced filter to the buffer
+	 * @param stats
+	 * @return
+	 */
+	public Buffer addEnhanced(Statistics stats, boolean tailTrim, double tailTrimValue);
+	
+	/**
+	 * Dibuja el buffer sobre un objeto Image de java.awt y devuelve el resultado.
+	 *
+	 * @param replicateBand Flag de comportamiento del renderizado. Al renderizar el buffer
+	 * este obtiene la primera banda del buffer y la asigna al R, la segunda al G y la tercera
+	 * al B. Este flag no es tomado en cuenta en caso de que existan 3 bandas en el buffer.
+	 * Si no hay tres bandas, por ejemplo una y el flag es true esta ser� replicada
+	 * en R, G y B, en caso de ser false la banda ser� dibujada en su posici�n (R, G o B)
+	 * y en las otras bandas se rellenar� con 0.
+	 *
+	 * @param transparentBand. Si es true la banda 4 es alpha y si es false no lo es.
+	 *
+	 * @return java.awt.Image con el buffer dibujado.
+	 * @throws ProcessInterruptedException
+	 */
+	public Image drawBufferOverImageObject() throws ProcessInterruptedException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/ImageDrawer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyEvent.java	(revision 15423)
@@ -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.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.grid.render;
+
+import java.util.EventObject;
+
+/**
+ * Evento de una propiedad cuando esta cambia
+ * 
+ * 07/01/2008
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class VisualPropertyEvent extends EventObject {
+	private static final long serialVersionUID = -1649548367781607532L;
+	private String name = null;
+	private Object value = null;
+
+	/**
+	 * Constructor. Se asignan los valores de nombre y valor de la 
+	 * propiedad que ha disparado el evento.
+	 * @param source Objeto fuente
+	 * @param name Nombre de la propiedad
+	 * @param value Valor de la propiedad
+	 */
+	public VisualPropertyEvent(Object source) {
+		super(source);
+	}
+
+	/**
+	 * Obtiene el nombre de la propiedad que dispar� el evento
+	 * @return cadena con el nombre de la propiedad que dispar� el evento
+	 */
+	public String getName() {
+		return name;
+	}
+	
+	/**
+	 * Obtiene el valor de la propiedad antes de que se modificara.
+	 * @return Object con el valor de la propiedad que dispar� el evento
+	 */
+	public Object getValue() {
+		return value;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/render/VisualPropertyEvent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterList.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterList.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterList.java	(revision 15423)
@@ -0,0 +1,349 @@
+/* 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.grid;
+
+import java.util.List;
+import java.util.TreeMap;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.tools.dispose.Disposable;
+import org.gvsig.tools.persistence.Persistent;
+
+/**
+ * Operaciones definidas sobre la lista de filtros
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterFilterList extends Persistent, Disposable {
+	/**
+	 * Asigna un listener a la lista que ser� informado cuando cambie un
+	 * filtro o posici�n en la lista. 
+	 * @param listener FilterListListener
+	 */
+	public void addFilterListListener(FilterListChangeListener listener);
+	
+	/**
+	 * A�ade un par�metro a la lista de filtros. Estos par�metros luego pueden ser
+	 * utilizados por los managers que se registren
+	 * @param key Nombre del par�metro que coincide con el nombre de la clase.
+	 * @param value Objeto
+	 */
+	public void addEnvParam(String key, Object value);
+
+	/**
+	 * Obtiene un par�metro de la lista de filtros.
+	 * @param key Identificador del par�metro. Coincide con el nombre de la clase del par�metro.
+	 */
+	public Object getEnvParam(String key);
+
+	/**
+	 * Controla que los tipos de entrada y salida de los filtros sean los
+	 * correctos
+	 * @throws FilterTypeException
+	 */
+	public void controlTypes() throws FilterTypeException;
+
+	/**
+	 * A�ade un filtro al final de la lista
+	 * @param filter        filtro a�adido
+	 * @throws FilterTypeException
+	 */
+	public void add(RasterFilter filter) throws FilterTypeException;
+
+	/**
+	 * Sustituye un filtro de una posici�n de la pila por otro
+	 * @param filter
+	 * @param i
+	 * @throws FilterTypeException
+	 */
+	public void replace(RasterFilter filter, String name) throws FilterTypeException;
+
+	/**
+	 * A�ade un filtro en la lista en la posici�n indicada.
+	 * @param filter        filtro a�adido
+	 * @param pos	posici�n
+	 * @throws FilterTypeException
+	 */
+	public void add(RasterFilter filter, int pos) throws FilterTypeException;
+
+	/**
+	 * Removes all filters
+	 */
+	public void removeAll();
+	
+	/**
+	 * Elimina un filtro a partir de su nombre
+	 * @param name Nombre del filtro a eliminar
+	 * @throws FilterTypeException
+	 */
+	public void remove(String name) throws FilterTypeException;
+
+	/**
+	 * Elimina un filtro por clase.
+	 *
+	 * @param baseFilterClass
+	 * @throws FilterTypeException
+	 */
+	public void remove(Class<?> baseFilterClass) throws FilterTypeException;
+	
+	/**
+	 * Devuelve el tipo de dato de retorno al aplicar la pila de filtros
+	 * @return
+	 */
+	public int getOutDataType();
+
+	/**
+	 * Devuelve el raster resultado de la aplicacion de la pila de filtros
+	 * @return
+	 */
+	public Buffer getResult();
+
+	/**
+	 * Obtiene la cantidad de filtros en la lista
+	 * @return N�mero de filtros apilados
+	 */
+	public int lenght();
+
+	/**
+	 * Obtiene el filtro apilado de la posici�n i o null si el indice es incorrecto
+	 * @param i        Posici�n a acceder en la pila
+	 * @return        Filtro
+	 */
+	public RasterFilter get(int i);
+	
+	/**
+	 * Obtiene el filtro apilado de nombre name o null si no existe
+	 * @param i       Nombre del filtro buscado
+	 * @return        Filtro
+	 */
+	public RasterFilter get(String name);
+
+	/**
+	 * Obtiene el filtro apilado que corresponde con el nombre
+	 * @param name	Nombre de filtro
+	 * @return      Filtro en caso de que exista un filtro apilado de ese tipo
+	 * o null si no hay ninguno.
+	 */
+	public RasterFilter getByName(String name);
+
+	/**
+	 * Obtiene el primer filtro de la lista que es instancia de la clase pasada por
+	 * par�metro
+	 * @param baseFilterClass Filtro base
+	 * @return RasterFilter
+	 */
+	public RasterFilter getFilterByBaseClass(Class<?> baseFilterClass);
+
+	/**
+	 * Obtiene el tipo del filtro de la pila de la posici�n i
+	 * @param i Posici�n a acceder en la pila
+	 * @return tipo de filtro
+	 */
+	public String getName(int i);
+
+	/**
+	 * Elimina todos los filtros de la pila
+	 */
+	public void clear();
+
+	/**
+	 * Sustituye un filtro de una posici�n de la pila por otro
+	 * @param filter
+	 * @param i
+	 */
+	public void replace(RasterFilter filter, int i);
+
+	/**
+	 * Move un filtro determinado a la posici�n especificada.
+	 * @param filter Filtro a mover
+	 * @param position Posici�n a asignar
+	 * @return Devuelve true si el filtro existia y lo ha movido y false si no lo ha hecho.
+	 */
+	public boolean move(Class<?> filter, int position);
+
+	/**
+	 * Asigna el raster de entrada inicial
+	 * @param raster
+	 */
+	public void setInitRasterBuf(Buffer raster);
+
+	/**
+	 * Devuelve el tipo de datos inicial de la lista
+	 * @return Tipo de dato del raster inicial
+	 */
+	public int getInitDataType();
+	
+	/**
+	 * Asigna el tipo de dato inicial
+	 * @param dt
+	 */
+	public void setInitDataType(int dt);
+
+	/**
+	 * M�todo que devuelve true si el tipo de filtro pasado por par�metro est� en la
+	 * pila y false si no lo est�.
+	 * @param type        Tipo de par�metro a comprobar
+	 * @return true si est� en la pila y false si no lo est�
+	 */
+	public boolean isActive(String name);
+
+	/**
+	 * M�todo que devuelve true si el tipo de filtro pasado por par�metro est� en
+	 * la pila y false si no lo est�.
+	 *
+	 * @param filter Tipo de filtro a comprobar
+	 * @return true si est� en la pila y false si no lo est�
+	 */
+	public boolean isActive(RasterFilter filter);
+
+	/**
+	 * Devuelve la posici�n en la lista de una clase de filtro concreta
+	 *
+	 * @param c Clase a buscar en la lista
+	 * @return posici�n en la lista
+	 */
+	public int getPosition(Class<?> c);
+
+	/**
+	 * Aplica los filtros sobre un RasterBuf
+	 * @return IBuffer de salida
+	 * @throws ProcessInterruptedException
+	 * @throws FilterAddException 
+	 */
+	public Buffer execute() throws ProcessInterruptedException, FilterAddException;
+
+	public void resetPercent();
+
+	public int getPercent();
+
+	/**
+	 * Guarda el estado de la lista de filtros en una pila, que se podr�
+	 * ir recuperando con popStatus()
+	 */
+	public void pushStatus();
+
+	/**
+	 * Obtiene el estado actual de los filtros, el ArrayList devuelto es una
+	 * clonaci�n del original, asi no compartiran datos.
+	 * @return
+	 */
+	public List<RasterFilter> getStatusCloned();
+
+	/**
+	 * Define el estado actual de los filtros
+	 * @param newArray
+	 */
+	public void setStatus(List<RasterFilter> newArray);
+
+	/**
+	 * Recupera un estado guardado con antelaci�n mediante el m�todo pushStatus()
+	 */
+	public void popStatus();
+
+	/**
+	 * Obtiene el TreeMap con los par�metros
+	 * @return TreeMap
+	 */
+	public TreeMap<String, Object> getEnv();
+
+	/**
+	 * Asigna el TreeMap con los par�metros del entorno
+	 * @param env
+	 */
+	public void setEnv(TreeMap<String, Object> env);
+	
+	/**
+	 * Builds a new filter parameter object
+	 * @return Params
+	 */
+	public Params createEmptyFilterParams();
+	
+	/**
+	 * Builds an instance of a filter from its class name.
+	 * @param strPackage package and class name
+	 * @return Filtro instanciado
+	 * @throws FilterTypeException
+	 */
+	public RasterFilter createEmptyFilter(String nameFilter) throws FilterTypeException;
+	
+	/**
+	 * Crea una pila de filtros a partir de un Array de Strings. Cada elemento del array debe
+	 * tener la forma elemento=valor.
+	 * @param filters
+	 * @throws FilterTypeException
+	 */
+	//public void createFilterListFromStrings(List<String> f) throws FilterTypeException;
+	
+	/**
+	 * Gets a specific manager using its ID
+	 * @return
+	 */
+	public RasterFilterListManager getManagerByID(String id) throws FilterManagerException;
+	
+	/**
+	 * Gets a specific manager using its ID
+	 * @return
+	 */
+	public RasterFilterListManager getManagerByFilterClass(Class<?> c) throws FilterManagerException;
+	
+	/**
+	 * Gets the manager using its class
+	 * @param clase
+	 * @return
+	 */
+	public RasterFilterListManager getManagerByClass(Class<?> clase);
+	
+	/**
+	 * Gets the registered list of filters
+	 * @return
+	 */
+	public List<Class<?>> getRegisteredFilterList();
+	
+	/**
+	 * Gets the registered list of filters
+	 * @return
+	 */
+	public List<Class<?>> getRegisteredFilterListByDataType(int dataType);
+	
+	/**
+	 * Gets a filter class searching in the register managers by its identifier
+	 * @param id
+	 * @return
+	 */
+	public Class<?> getFilterClassByID(String id);
+
+	/**
+	 * Gets the transparency object and the color interpretation of the result. 
+	 * Mostly, filters returns ARGB images but sometimes the filter can alterate 
+	 * the transparency configuration and the color interpretation.
+	 * For instance, when a color table is applied or a alpha band is added 
+	 * by the filter.
+	 * @return
+	 */
+	public Transparency getTransparency();
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/AbstractRasterFilterManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/AbstractRasterFilterManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/AbstractRasterFilterManager.java	(revision 15423)
@@ -0,0 +1,48 @@
+package org.gvsig.fmap.dal.coverage.grid;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class AbstractRasterFilterManager implements RasterFilterListManager {
+	private RasterFilterList	filterList = null;
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public AbstractRasterFilterManager(RasterFilterList filterList) {
+		this.filterList = filterList;
+	}
+
+	/**
+	 * Registers managers for filters with panel configuration
+	 */
+	public static void register(String idManager, Class<?> filterClass, Class<?> panelClass) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add("RasterFilter");
+		point.append(idManager, "", filterClass);
+		point = extensionPoints.add("PanelRasterFilter");
+		point.append(idManager, "", panelClass);
+	}
+	
+	/**
+	 * Registers managers
+	 */
+	public static void register(String idManager, Class<?> filterClass) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add("RasterFilter");
+		point.append(idManager, "", filterClass);
+	}
+	
+	public RasterFilterList getFilterList() {
+		return filterList;
+	}
+	
+	public void setFilterList(RasterFilterList filterList) {
+		this.filterList = filterList;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/AbstractRasterFilterManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/Grid.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/Grid.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/Grid.java	(revision 15423)
@@ -0,0 +1,311 @@
+/* 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.grid;
+
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridCell;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.store.props.BasicStats;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.tools.dispose.Disposable;
+
+
+/**
+ * Interfaz que deben implementar los grid en los que se puede consultar sus datos.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Grid extends Disposable {	
+	
+	/**
+	 *Aplica la lista de filtros sobre el buffer
+	 * @throws FilterAddException 
+	 * @throws InterruptedException
+	 */
+	public void applyFilters() throws ProcessInterruptedException, FilterAddException;
+	
+	/**
+	 * Carga el buffer de datos desde el reader para poder escribir sobre los datos de
+	 * la ventana original. Esto es �til cuando el GridWriter se crea asociado a un raster
+	 * pero el buffer est� vacio, por ejemplo en el caso de crear un GridInterpolated. Un
+	 * GridInterpolated no carga ning�n buffer en memoria sino que accede a los datos en disco
+	 * a medida que se le van solicitando. Por ello, no es posible modificarlos sino cargamos
+	 * un buffer con los datos previamente.
+	 */
+	public void loadWriterData() throws GridException;
+	
+	/**
+	 * Obtiene el buffer de datos del grid
+	 * @return RasterBuf
+	 */
+	public Buffer getRasterBuf();
+	
+	/**
+	 * Asigna la banda sobre la que se realizan las operaciones. Por defecto es la banda 0
+	 * con lo que para el uso de MDTs no habr� que modificar este valor.
+	 * @param band Banda sobre la que se realizan las operaciones.
+	 */
+	public void setBandToOperate(int band);
+	
+	/**
+	 * Obtiene el n�mero de bandas del grid o 0 si no tiene buffer de
+	 * datos asociado.
+	 * @return N�mero de bandas
+	 */
+	public int getBandCount();
+	
+	/**
+	 * Obtiene el objeto que calcula las estad�sticas del Grid
+	 * @return IBasicStats
+	 */
+	public BasicStats getStatistics();
+	
+	/**
+	 * Obtiene el valor de una celda de tipo byte. Si el punto excede los l�mites
+	 * del grid devuelve un valor NoData. La excepci�n ser� lanzada si intentamos 
+	 * acceder a un tipo de dato erroneo.
+	 * @param x Posici�n X a recuperar
+	 * @param y Posici�n Y a recuperar
+	 * @throws RasterBufferInvalidAccessException
+	 * @return Valor byte
+	 */
+	public byte getCellValueAsByte(int x, int y)throws GridException;
+	
+	/**
+	 * Obtiene el valor de una celda de tipo short. Si el punto excede los l�mites
+	 * del grid devuelve un valor NoData. La excepci�n ser� lanzada si intentamos 
+	 * acceder a un tipo de dato erroneo.
+	 * @param x Posici�n X a recuperar
+	 * @param y Posici�n Y a recuperar
+	 * @throws RasterBufferInvalidAccessException
+	 * @return Valor short
+	 */
+	public short getCellValueAsShort(int x, int y)throws GridException;
+	
+	/**
+	 * Obtiene el valor de una celda de tipo int. Si el punto excede los l�mites
+	 * del grid devuelve un valor NoData. La excepci�n ser� lanzada si intentamos 
+	 * acceder a un tipo de dato erroneo.
+	 * @param x Posici�n X a recuperar
+	 * @param y Posici�n Y a recuperar
+	 * @throws RasterBufferInvalidAccessException
+	 * @return Valor int
+	 */
+	public int getCellValueAsInt(int x, int y)throws GridException;
+
+	/**
+	 * Obtiene el valor de una celda de tipo float. Si el punto excede los l�mites
+	 * del grid devuelve un valor NoData. La excepci�n ser� lanzada si intentamos 
+	 * acceder a un tipo de dato erroneo.
+	 * @param x Posici�n X a recuperar
+	 * @param y Posici�n Y a recuperar
+	 * @throws RasterBufferInvalidAccessException
+	 * @return Valor float
+	 */
+	public float getCellValueAsFloat(int x, int y)throws GridException;
+	
+	/**
+	 * Obtiene el valor de una celda de tipo double. Si el punto excede los l�mites
+	 * del grid devuelve un valor NoData. La excepci�n ser� lanzada si intentamos 
+	 * acceder a un tipo de dato erroneo.
+	 * @param x Posici�n X a recuperar
+	 * @param y Posici�n Y a recuperar
+	 * @throws RasterBufferInvalidAccessException
+	 * @return Valor double
+	 */
+	public double getCellValueAsDouble(int x, int y)throws GridException;
+	
+	/**
+	 * Asigna el m�todo de interpolaci�n. Si el lector no es interpolado se instanciar� 
+	 * como interpolado sin necesidad de llamar a switchToInterpolationMethod. Los m�todos
+	 * de interpolaci�n soportados est�n definidos en la clase GridInterpolated como variables
+	 * est�ticas.
+	 * 
+	 * @param iMethod
+	 */
+	public void setInterpolationMethod(int iMethod);
+	
+	/**
+	 * Consulta al grid si el valor pasado por par�metro coincide con el valor NoData del 
+	 * buffer. 
+	 * @param dValue valor para comparar con el NoData del buffer
+	 * @return true si el valor pasado es NoData y false si no lo es
+	 */
+	public boolean isNoDataValue(double dValue);
+	
+	/**
+	 * Obtiene la extensi�n de la ventana del raster accedida por el grid 
+	 * @return Objeto GridExtent con la extensi�n.
+	 */
+	public GridExtent getGridExtent();
+	
+	/**
+	 * Consulta si un punto est� dentro del grid o fuera de el
+	 * @param x Coordenada X del punto a consultar
+	 * @param y Coordenada Y del punto a consultar 
+	 * @return true si el punto est� dentro del grid y false si est� fuera de �l
+	 */
+	public boolean isInGrid(int x, int y);
+		
+	/**
+	 * Obtiene el ancho en p�xeles del grid 
+	 * @return entero que representa el ancho en p�xeles
+	 */
+	public int getNX();
+	
+	/**
+	 * Obtiene el alto en p�xeles del grid 
+	 * @return entero que representa el alto en p�xeles
+	 */
+	public int getNY();
+	
+	/**
+	 * Obtiene el ancho en p�xeles del dataset completo
+	 * @return entero que representa el ancho en p�xeles del dataset completo
+	 */
+	public int getLayerNX();
+	
+	/**
+	 * Obtiene el alto en p�xeles del dataset completo
+	 * @return entero que representa el alto en p�xeles del dataset completo
+	 */
+	public int getLayerNY();
+	
+	/**
+	 * Tama�o de celda
+	 * @return
+	 */
+	public double getCellSize();
+	
+	/**
+	 * Obtiene el tipo de datos
+	 * @return
+	 */
+	public int getDataType();
+	
+	/**
+	 * Valor nodata asociado al grid
+	 * @return
+	 */
+	public NoData getNoDataValue();
+	
+	/**
+	 * Obtiene la lista de paletas asociadas al grid
+	 * @return Lista de objetos GridPalette
+	 */
+	public ColorTable getPalette();
+	
+	/**
+	 * Obtiene la pendiente de un �rea de 3x3 p�xeles que tiene como 
+	 * centro las coordenadas que se le indican
+	 * @param x Coordenada pixel X
+	 * @param y Coordenada pixel Y
+	 * @return 
+	 * @throws GridException
+	 */
+	public double getSlope(int x, int y)throws GridException;
+			
+	public double getAspect(int x, int y)throws GridException;
+	
+	public double getDistToNeighborInDir(int iDir);
+	
+	public int getDirToNextDownslopeCell(int x, int y)throws GridException;
+	
+	public int getDirToNextDownslopeCell(int x, int y, boolean bForceDirToNoDataCell)throws GridException;
+	
+	public GridCell[] getSortedArrayOfCells()throws GridException;
+	
+	public void assign(byte value)throws GridException;
+	
+	public void assign(short value)throws GridException;
+	
+	public void assign(int value)throws GridException;
+	
+	public void assign(float value)throws GridException;
+	
+	public void assign(double value)throws GridException;
+	
+	public void assign(Grid driver)throws GridException;
+	
+	public void addToCellValue(int x, int y, byte value) throws GridException;
+	
+	public void addToCellValue(int x, int y, short value) throws GridException;
+	
+	public void addToCellValue(int x, int y, int value) throws GridException;
+	
+	public void addToCellValue(int x, int y, float value) throws GridException;
+	
+	public void addToCellValue(int x, int y, double value) throws GridException;
+	
+	public void assignNoData();
+	
+	public void setCellValue(int x, int y, byte value)throws OutOfGridException;
+	
+	public void setCellValue(int x, int y, short value)throws OutOfGridException;
+	
+	public void setCellValue(int x, int y, int value)throws OutOfGridException;
+	
+	public void setCellValue(int x, int y, float value)throws OutOfGridException;
+	
+	public void setCellValue(int x, int y, double value)throws OutOfGridException;
+	
+	public void add(Grid driver) throws GridException;
+	
+	public void multiply(double dValue) throws GridException;
+	
+	/**
+	 * Asigna el valor que indica que una celda no tiene datos para el buffer
+	 * @param dNoDataValue Valor NoData 
+	 */
+	public void setNoDataValue(NoData dNoDataValue);
+	
+	public void setNoData(int x, int y);
+	
+	/**
+	 * Obtiene la lista de filtros.
+	 * @return Lista de filtros.
+	 */
+	public RasterFilterList getFilterList();
+
+	/**
+	 * Asigna la lista de filtros
+	 * @param filterList
+	 */
+	public void setFilterList(RasterFilterList filterList);
+	
+	/**
+	 * Returns a GridCell object 
+	 * @param iX 
+	 *        X position
+	 * @param iY
+	 *        Y position
+	 * @return
+	 * @throws GridException
+	 */
+	public GridCell getGridCell(int iX, int iY) throws GridException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/Grid.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/BaseRasterFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/BaseRasterFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/BaseRasterFilter.java	(revision 15423)
@@ -0,0 +1,453 @@
+/* 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.grid.filter;
+
+import java.util.Hashtable;
+import java.util.TreeMap;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.BufferParam;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.BufferCreationException;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Base class for all filters
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class BaseRasterFilter implements RasterFilter, Cloneable {
+	public static final String PERSISTENT_NAME        = "BaseRasterFilter";
+    public static final String PERSISTENT_DESCRIPTION = "BaseRasterFilter Persistent";
+	protected Buffer           raster                 = null;
+	protected Buffer           rasterResult           = null;
+	protected int              height                 = 0;
+	protected int              width                  = 0;
+	protected Hashtable<String, Object> 
+	                           params                 = new Hashtable<String, Object>();
+	protected TreeMap<String, Object>   
+	                           environment            = new TreeMap<String, Object>();
+	protected Extent           extent                 = null;
+	private int                percent                = 0;
+	private String             fName                  = "";
+	/**
+	 * Variable que control la aplicaci�n o no del filtro. Si est� a false aunque est� en
+	 * la pila el filtro no se ejecutar�.
+	 */
+	protected boolean           exec                  = true;
+	protected RasterUtils       util                  = null;
+	protected TaskEventManager  taskEventManager      = null;
+	protected String            managername           = null;
+	protected Transparency      transparency          = null;
+	
+	private boolean             hasInputTransparency       = false;
+	protected int               nBandsToProcess       = 0;
+	protected ColorInterpretation 
+	                            colorInterpretation   = null;
+	private boolean             argbOutput            = false;
+
+	/**
+	 * Constructor
+	 */
+	public BaseRasterFilter() {
+		if(RasterLocator.getManager() != null)
+			util = RasterLocator.getManager().getRasterUtils();
+	}
+
+	/**
+	 * Aplica el filtro sobre el raster pasado pixel a pixel
+	 * @throws ProcessInterruptedException
+	 * @throws FilterAddException 
+	 */
+	public void execute() throws ProcessInterruptedException, FilterAddException {
+		taskEventManager = RasterLocator.getManager().createRasterTask(this);
+		pre();
+		if (raster != null && raster.getDataType() != this.getInRasterDataType())
+			exec = false;
+		percent = 0;
+		if (exec)
+			for (int row = 0; row < height; row ++) {
+				for (int col = 0; col < width; col ++)
+					try {
+						process(col, row);
+					}catch (ArrayIndexOutOfBoundsException e) {
+					}
+
+				if (taskEventManager.getEvent() != null)
+					taskEventManager.manageEvent(taskEventManager.getEvent());
+
+				percent = (row * 100) / height;
+			}
+		percent = 100;
+		post();
+	}
+
+	/**
+	 * A�ade un par�metro al filtro
+	 *
+	 * @param name Clave del par�metro
+	 * @param param Objeto pasado como par�metro
+	 */
+	public void addParam(String name, Object param) {
+		if (param != null)
+			params.put(name, param);
+		else
+			params.remove(name);
+	}
+
+	/**
+	 * Elimina un par�metro del filtro
+	 * @param name Clave del par�metro a eliminar
+	 */
+	public void removeParam(String name) {
+		params.remove(name);
+	}
+
+	/**
+	 * Obtiene un par�metro a partir de la clave
+	 * @param name Par�metro
+	 * @return Par�metro
+	 */
+	public Object getParam(String name) {
+		return params.get(name);
+	}
+
+	public Hashtable<String, Object> getParams() {
+		return params;
+	}
+
+	public void setParams(Hashtable<String, Object> params) {
+		this.params = params;
+	}
+
+	public void setExtent(Extent extent) {
+		this.extent = extent;
+	}
+	
+	public boolean isToConvertToRGB() {
+		return false;
+	}
+
+	/**
+	 * Obtiene true si el filtro va a ser ejecutado o false si no va a serlo
+	 * @return
+	 */
+	public boolean isExec() {
+		return exec;
+	}
+
+	/**
+	 * Asigna el valor a la variable exec. Esta estar� a true si el filtro se ejecutar� la pr�xima
+	 * vez que se repinte o false si no se ejecuta.
+	 * @param exec
+	 */
+	public void setExec(boolean exec) {
+		this.exec = exec;
+	}
+
+	/**
+	 * Pone a cero el contador del porcentaje del proceso de filtrado
+	 * @return
+	 */
+	public void resetPercent() {
+		percent = 0;
+	}
+
+	/**
+	 * Obtiene el porcentaje recorrido del proceso de filtrado
+	 * @return
+	 */
+	public int getPercent() {
+		return percent;
+	}
+	
+	/*public int[] getRenderBands() {
+		return renderBands;
+	}*/
+
+	/**
+	 * Funci�n que contiene el c�digo a ejecutar despues de aplicar el filtro
+	 */
+	abstract public void post();
+
+	/**
+	 * Ejecuci�n del filtro para un pixel de la imagen
+	 */
+	abstract public void process(int x, int y);
+
+	/**
+	 * Obtiene el tipo de datos del raster de entrada
+	 */
+	abstract public int getInRasterDataType();
+
+	/**
+	 * Obtiene el tipo de datos del raster de salida
+	 */
+	abstract public int getOutRasterDataType();
+
+	/**
+	 * Gets the result of this filter
+	 */
+	public Object getResult(String name) {
+		if (name.equals(RESULT_BUFFER)) {
+			if (exec)
+				return (Object) this.rasterResult;
+			else
+				return (Object) this.raster;
+		}
+
+		if (name.equals(RESULT_TRANSPARENCY)) {
+			if(transparency == null)
+				return null;
+			ColorInterpretation ci = null;
+			if(rasterResult.getDataType() == Buffer.TYPE_BYTE) {
+				if(argbOutput || (rasterResult.getBandCount() == 4 && hasInputTransparency())) {
+					ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+							new String[]{ColorInterpretation.RED_BAND,
+									ColorInterpretation.GREEN_BAND,
+									ColorInterpretation.BLUE_BAND,
+									ColorInterpretation.ALPHA_BAND});
+					transparency.setColorInterpretation(ci);
+					transparency.activeTransparency();
+					return transparency;
+				} else if(rasterResult.getBandCount() == 3) {
+					ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+							new String[]{ColorInterpretation.RED_BAND,
+									ColorInterpretation.GREEN_BAND,
+									ColorInterpretation.BLUE_BAND});
+					transparency.setColorInterpretation(ci);
+					transparency.activeTransparency();
+					return transparency;
+				} else if(rasterResult.getBandCount() == 1) {
+					ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+							new String[]{ColorInterpretation.GRAY_BAND});
+					transparency.setColorInterpretation(ci);
+					transparency.activeTransparency();
+					return transparency;
+				}
+				/*else if(rasterResult.getBandCount() == 3 && renderBands != null && renderBands.length >=3) {
+					ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(renderBands);
+					transparency.setColorInterpretation(ci);
+					transparency.activeTransparency();
+					return transparency;
+				}*/
+			} 
+			String[] values = new String[rasterResult.getBandCount()];
+			for (int i = 0; i < values.length; i++) {
+				values[i] = ColorInterpretation.UNDEF_BAND;
+			}
+			ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(values);
+			transparency.setColorInterpretation(ci);
+			transparency.activeTransparency();
+			return transparency;
+		}
+		return null;
+	}
+	
+	abstract public String getGroup();
+	abstract public Params getUIParams(String nameFilter);
+	abstract public String[] getNames();
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public Object clone() throws CloneNotSupportedException {
+		return super.clone();
+	}
+
+	public String getName() {
+		return fName;
+	}
+
+	public void setName(String name) {
+		fName = name;
+	}
+
+	public TreeMap<String, Object> getEnv() {
+		return environment;
+	}
+
+	public void setEnv(TreeMap<String, Object> env) {
+		this.environment = env;
+	}
+
+	public String getManagerName() {
+		return managername;
+	}
+
+	/**
+	 * Releases buffer resources
+	 */
+	public void dispose() {
+		
+	}
+	
+	protected Buffer getOutputBuffer() {
+		return rasterResult;
+	}
+	
+	protected Buffer getInputBuffer() {
+		return raster;
+	}
+	
+	protected void finalize() throws Throwable {
+		rasterResult = null;
+		raster = null;
+		extent = null;
+		fName = null;
+		super.finalize();
+	}
+
+	/**
+	 * Code to execute before apply a filter
+	 */
+	public void pre() throws FilterAddException {
+		exec = true;
+		raster = (Buffer) params.get("raster");
+		//renderBands = (int[]) params.get("renderBands");
+		transparency = (Transparency)environment.get("Transparency");
+		height = raster.getHeight();
+		width = raster.getWidth();
+		
+		//�til para imagenes de tipo byte que puedan traer transparencia
+		if(	raster != null && 
+			transparency != null && 
+			raster.getDataType() == Buffer.TYPE_BYTE &&
+			transparency.existAlphaBand()) {
+			nBandsToProcess = raster.getBandCount() - 1;
+			hasInputTransparency = true;
+		} else
+			nBandsToProcess = raster.getBandCount();
+	}
+	
+	//*****************************************
+	//Support methods
+	//*****************************************
+	
+	protected void createARGBBufferResult() throws FilterAddException {
+		BufferParam param = RasterLocator.getManager().getBufferFactory().createBufferParams(width, height, 4, Buffer.TYPE_BYTE, true);
+		try {
+			rasterResult = RasterLocator.getManager().getBufferFactory().createBuffer(param);
+			if(raster != null)
+				rasterResult.setDataExtent(raster.getDataExtent());
+			argbOutput = true;
+		} catch (LocatorException e) {
+			throw new FilterAddException("Error creating buffer", e);
+		} catch (BufferCreationException e) {
+			throw new FilterAddException("Error creating buffer", e);
+		}
+	}
+	
+	protected void createBufferResult(int dataType, int bandCount) throws FilterAddException {
+		BufferParam param = RasterLocator.getManager().getBufferFactory().createBufferParams(width, height, bandCount, dataType, true);
+		try {
+			rasterResult = RasterLocator.getManager().getBufferFactory().createBuffer(param);
+			if(raster != null)
+				rasterResult.setDataExtent(raster.getDataExtent());
+		} catch (LocatorException e) {
+			throw new FilterAddException("Error creating buffer", e);
+		} catch (BufferCreationException e) {
+			throw new FilterAddException("Error creating buffer", e);
+		}
+	}
+	
+	/**
+	 * Checks the renderBands array for RGB inputs. If it is not good, 
+	 * it will be calculated. This function will have into account the 
+	 * transparency object to render the alpha band
+	 */
+	/*protected void checkRGBRenderBands() {
+		for (int i = 0; i < renderBands.length; i++) {
+			if(renderBands[i] >= raster.getBandCount())
+				renderBands[i] = -1;
+		}
+		
+		//Necesita 3 bandas para renderizar, ya que la entrada debe ser un valor RGB
+		int countBandsToDraw = 0;
+		for (int i = 0; i < renderBands.length; i++) {
+			if(renderBands[i] >= 0 && renderBands[i] < 3)
+				countBandsToDraw ++;
+		}
+		//Si no tiene al menos 3 bandas de entrada calculamos el renderBands
+		if(renderBands == null || countBandsToDraw < 3) {
+			switch (raster.getBandCount()) {
+			case 1:renderBands = new int[]{0, 0, 0}; break;
+			case 2:renderBands = new int[]{0, 1, 1}; break;
+			case 3:renderBands = new int[]{0, 1, 2}; break;
+			default:
+				if(transparency.existAlphaBand())
+					renderBands = new int[]{0, 1, 2, 3}; 
+				else
+					renderBands = new int[]{0, 1, 2};
+			}
+		}
+	}*/
+	
+	/**
+	 * Copies the alpha band from the input raster to the output.
+	 * In most filters, this band is not processed and it will copy
+	 * it directly in the output
+	 */
+	protected void writeAlphaBand(int line, int col) {
+		if(hasInputTransparency)  {
+			rasterResult.setElem(line, col, rasterResult.getBandCount() - 1, 
+					raster.getElemByte(line, col, raster.getBandCount() - 1));
+		}
+	}
+	
+	protected boolean hasInputTransparency() {
+		return hasInputTransparency;
+	}
+	
+	protected int numberOfBandsToProcess() {
+		return nBandsToProcess;
+	}
+	
+	protected ColorInterpretation getColorInterpretation() {
+		if(transparency != null)
+			return transparency.getColorInterpretation();
+		
+		if(raster.getBandCount() >= 4)
+			return RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+					new String[]{ColorInterpretation.RED_BAND,
+						ColorInterpretation.GREEN_BAND,
+						ColorInterpretation.BLUE_BAND,
+						ColorInterpretation.ALPHA_BAND});
+		else if(raster.getBandCount() == 3)
+			return RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+					new String[]{ColorInterpretation.RED_BAND,
+							ColorInterpretation.GREEN_BAND,
+							ColorInterpretation.BLUE_BAND});
+		else return RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+				new String[]{ColorInterpretation.GRAY_BAND});
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/BaseRasterFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/LinearStretchParams.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/LinearStretchParams.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/LinearStretchParams.java	(revision 15423)
@@ -0,0 +1,112 @@
+/* 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.grid.filter;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Stretch;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+
+/**
+ * Parameters for LinearStretch filter
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface LinearStretchParams {
+	/**
+	 * Consulta si tiene alg�n valor el recorte de colas
+	 * @return true si tiene valor el recorte de colas y false si no lo tiene
+	 */
+	public boolean hasTailTrim();
+	
+	/**
+	 * Obtiene la lista de valores de recorte. Este formato es que el que necesita el
+	 * filtro TailTrim para calcular el valor del porcentaje recorte.
+	 * @return double
+	 */
+	public double[] getTailTrimList();
+	
+	/**
+	 * Carga los valores de recorte calculados por el filtro TailTrim que ya deber�a haber
+	 * sido aplicado. Estos valores estar�n salvados en DatasetListStatistics.
+	 * @param stats
+	 */
+	public void loadTailTrimValues(Statistics stats);
+	
+	/**
+	 * Aplica el recorte de colas sobre los extremos de los m�ximos y m�nimos de entrada.
+	 * La aplicaci�n de esta funci�n considera que ya se han calculado los valores con 
+	 * loadTailTrimValues.
+	 */
+	public void applyTrimToStretchs();
+	
+	/**
+	 * Calcula la escala y el desplazamiento teniendo en cuenta que
+	 * ya tenga todos los valores de entrada asignados.
+	 */
+	public void calcLinearScaleAndOffset();
+	
+	/**
+	 * Asigna el m�ximo y el m�nimo
+	 * @param stats
+	 * @param type
+	 * @param band
+	 */
+	public void setMaxMin(Statistics stats, int[] renderBands);
+	
+	/**
+	 * Aplica el eliminado de extremos. Para ello utiliza el segundo m�ximo y m�nimo de entrada.
+	 */
+	public void applyRemoveEndsToStretchs(Statistics stats, int[] renderBands);
+	
+	/**
+	 * Gets the list of ranges in the red band
+	 * @return
+	 */
+	public Stretch getRed();
+
+	/**
+	 * Sets the list of ranges in the red band
+	 */
+	public void setRed(Stretch red);
+
+	/**
+	 * Gets the list of ranges in the green band
+	 */
+	public Stretch getGreen();
+
+	/**
+	 * Sets the list of ranges in the red band
+	 */
+	public void setGreen(Stretch green);
+	
+	/**
+	 * Gets the list of ranges in the blue band
+	 */
+	public Stretch getBlue();
+
+	/**
+	 * Sets the list of ranges in the blue band
+	 */
+	public void setBlue(Stretch blue);
+
+	public boolean isRgb();
+
+	public void setRgb(boolean rgb);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/LinearStretchParams.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.grid.filter package documentation</title>
+</head>
+<body>
+
+	<p>Main classes for applying filters.</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/filter/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilter.java	(revision 15423)
@@ -0,0 +1,179 @@
+/* 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.grid;
+
+import java.util.Hashtable;
+import java.util.TreeMap;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+
+/**
+ * Este interfaz es implementado por el ancestro de cualquier filtro o el propio filtro.
+ * Contiene las operaciones necesarias para su ejecuci�n a trav�s de la pila de filtros.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterFilter {
+		public static String    RESULT_BUFFER          = "raster";
+		public static String    RESULT_TRANSPARENCY    = "transparency";
+		
+		/**
+		 * Acciones a realizar antes de la ejecuci�n del filtro
+		 */
+		public void pre() throws FilterAddException;
+
+		/**
+		 * Ejecuci�n de la funci�n process de todo el filtro.
+		 * @throws ProcessInterruptedException
+		 *
+		 */
+		public void execute() throws ProcessInterruptedException, FilterAddException;
+
+		/**
+		 * Procesa la posici�n x,y del raster
+		 * @param x posici�n X
+		 * @param y posici�n Y
+		 */
+		public void process(int x, int y);
+
+		/**
+		 * Acciones a realizar despu�s de la ejecuci�n del filtro
+		 */
+		public void post();
+		
+		/**
+		 * Returns true if this filter is to conver the input buffer to RGB. This kind
+		 * of filters will be in the top of the stack because all others need as input
+		 * a RGB data buffer
+		 * @return
+		 */
+		public boolean isToConvertToRGB();
+
+		/**
+		 * Par�metros pasados al filtro en forma de nombre de par�metro y objeto que
+		 * representa al par�metro. Este puede ser cualquier tipo de variable u objeto.
+		 *
+		 * Par�metros obligatorios:
+		 *         inRaster (IRaster)
+		 * par�metros obligatorios (si se da el caso)
+		 *         previousFilter (IRasterFilter)
+		 *
+		 * @param name
+		 * @param value
+		 */
+		public void addParam(String name, Object value);
+
+		/**
+		 * Devuelve los resultados despues de la ejecuci�n del filtro.
+		 * @param name
+		 * @return
+		 */
+		public Object getResult(String name);
+
+		/**
+		 * Obtiene el tipo de datos de entrada al filtro
+		 * @return Tipo de dato
+		 */
+		public int getInRasterDataType();
+
+		/**
+		 * Obtiene el tipo de datos de salida del filtro
+		 * @return Tipo de dato
+		 */
+		public int getOutRasterDataType();
+
+		/**
+		 * Obtiene el grupo del filtro
+		 * @return
+		 */
+		public String getGroup();
+		
+		/**
+		 * Devuelve el nombre interno del filtro
+		 * @return the fName
+		 */
+		public String getName();
+		
+		/**
+		 * @param name the fName to set
+		 */
+		public void setName(String name);
+		
+		/**
+		 * Obtiene el TreeMap con los par�metros del entorno
+		 * @return TreeMap
+		 */
+		public TreeMap<String, Object> getEnv();
+
+		/**
+		 * Asigna el TreeMap con los par�metros del entorno
+		 * @param env
+		 */
+		public void setEnv(TreeMap<String, Object> env);
+		
+		/**
+		 * Obtiene un par�metro a partir de la clave
+		 * @param name Par�metro
+		 * @return Par�metro
+		 */
+		public Object getParam(String name);
+		
+		/**
+		 * Gets the param list
+		 * @return
+		 */
+		public Hashtable<String, Object> getParams();
+		
+		/**
+		 * Gets the param list
+		 * @param params
+		 */
+		public void setParams(Hashtable<String, Object> params);
+		
+		/**
+		 * Devolver� un booleano indicando si es visible o no en el panel de filtros.
+		 * @return
+		 */
+		public boolean isVisible();
+		
+		/**
+		 * Obtener que datos puede tratar una interfaz con sus valores
+		 * @param nameFilter. Cada tipo de filtro puede tener parametros distintos
+		 * @return
+		 */
+		public Params getUIParams(String nameFilter);
+		
+		/**
+		 * Gets the list of specific filter names. Each kind of filter can have a list
+		 * of specific types. This function returns the names of this filters
+		 * @return
+		 */
+		public String[] getNames();
+		
+		/**
+		 * Gets the manager name
+		 * @return
+		 */
+		public String getManagerName();
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeEvent.java	(revision 15423)
@@ -0,0 +1,51 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.grid;
+
+import java.util.EventObject;
+
+/**
+ * Evento de la pila de filtros cambia
+ * 
+ * 07/01/2008
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class FilterListChangeEvent extends EventObject {
+	private static final long serialVersionUID = -1649548367781607532L;
+	private Object value = null;
+
+	/**
+	 * Constructor. Se asigna la pila de filtros que dispara el evento.
+	 * @param source Objeto fuente
+	 */
+	public FilterListChangeEvent(Object source) {
+		super(source);
+	}
+
+	/**
+	 * Obtiene el valor de la propiedad antes de que se modificara.
+	 * @return Object con el valor de la propiedad que dispar� el evento
+	 */
+	public Object getValue() {
+		return value;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeEvent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterUIListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterUIListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterUIListener.java	(revision 15423)
@@ -0,0 +1,40 @@
+/* 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.grid;
+
+import java.util.EventListener;
+import java.util.EventObject;
+
+/**
+ * Listener para acciones lanzadas por los interfaces personalizados 
+ * para filtros hechos por los usuarios.
+ * 28/09/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface FilterUIListener extends EventListener {
+	/**
+	 * Este evento es lanzado al terminar de rellenar todos los campos
+	 * del interfaz. Informa de que ya pueden ser recuperados.
+	 * @param e
+	 */
+	public void actionValuesCompleted(EventObject e);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterUIListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeListener.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.grid;
+
+import java.util.EventListener;
+
+/**
+ * Listener que una lista de filtros dispara cuando es cambiada. 
+ * 
+ * 07/01/2008
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface FilterListChangeListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando cambia la lista de filtros
+	 * @param e
+	 */
+	public void filterListChanged(FilterListChangeEvent e);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/FilterListChangeListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterListManager.java	(revision 15423)
@@ -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.fmap.dal.coverage.grid;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+
+
+/**
+ * Interfaz que deben implementar los Gestores de pila de filtros
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface RasterFilterListManager {
+
+	/**
+	 * Gets the ID of this manager with which it was registered
+	 * @return
+	 */
+	public String getManagerID();
+	
+	/**
+	 * Convierte cada filtro o elemento de un filtro de la pila en un String de la forma
+	 * elemento=valor. Esta versi�n la implementan las extensiones que registren filtros
+	 * de forma externa para que pueda ser ejecutado por el RasterFilterListManager.
+	 * @param filterList Lista de cadenas de la forma variable=valor a la que se a�adiran las
+	 * cadenas que generen el gestor de filtros actual.
+	 * @param rf Filtro analizado. Cada gestor de filtros comprobar� si el filtro pasado
+	 * es gestionado por el y si lo hace introduce las cadenas correspondientes.
+	 * @return ArrayList donde cada elemento es una cadena
+	 */
+	//public List<String> getStringsFromFilterList(List<String> filterList, RasterFilter rf);
+
+	/**
+	 * Crea una pila de filtros a partir de un Array de Strings. Cada elemento del array debe
+	 * tener la forma elemento=valor. Esta versi�n la implementan las extensiones que registren filtros
+	 * de forma externa para que pueda ser ejecutado por el RasterFilterListManager.
+	 * @param filters	Lista de filtros
+	 * @param fil Cadena que representa el identificador del elemento
+	 * @param filteri N�mero de filtro de la lista analizado
+	 * @return filteri modificado
+	 */
+	//public int createFilterListFromStrings(List<String> filters, String fil, int filteri) throws FilterTypeException;
+
+	/**
+	 * Devuelve la lista de filtros que puede manejar un RasterFilterListManager
+	 * @return
+	 */
+	public List<Class<?>> getRasterFilterList();
+
+	/**
+	 * A�ade un filtro
+	 * @param classFilter Clase del filtro a a�adir
+	 * @param params Par�metros de carga
+	 */
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException;
+
+	/**
+	 * Obtiene la lista de filtros
+	 * @return RasterFilterList
+	 */
+	public RasterFilterList getFilterList();
+	
+	/**
+	 * Sets the filter list
+	 * @return RasterFilterList
+	 */
+	public void setFilterList(RasterFilterList filterList);
+
+	/**
+	 * Adds a filter in a specific manager
+	 * @param params Par�metros de carga
+	 */
+	public void addFilter(Params params) throws FilterTypeException;
+
+	/**
+	 * Builds a filter of this type
+	 * @param params
+	 * @return
+	 * @throws FilterTypeException 
+	 */
+	public RasterFilter createFilter(Params params) throws FilterTypeException;
+
+	/**
+	 * Returns true if this manager contains a filter with the selected ID
+	 * @param id
+	 * @return
+	 */
+	public Class<?> getFilterClassByID(String id);
+	
+	/**
+	 * Returns true if the data type selected is supported and false if not
+	 * @param dataType
+	 * @return
+	 */
+	public boolean isDataTypeSupported(int dataType);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/grid/RasterFilterListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterQuery.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterQuery.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterQuery.java	(revision 15423)
@@ -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.fmap.dal.coverage.store;
+
+import java.awt.Rectangle;
+
+import org.gvsig.fmap.dal.DataQuery;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.cache.tile.provider.TileListener;
+import org.gvsig.timesupport.Time;
+import org.gvsig.tools.task.TaskStatus;
+
+/**
+ * Parameters to load data from a raster data source.
+ * <P>Use cases:</P>
+ * <UL>
+ * <LI>Select a window of pixels</LI>
+ * <LI>Select a window of pixels with resampling</LI>
+ * <LI>Select a bounding box</LI>
+ * <LI>Select a bounding box with resampling</LI>
+ * <LI>Enable or disable supersampling in all request above described</LI>
+ * <LI>Adjust the request to the source limits or builds a buffer with a frame filled with nodata values (In all request above described)</LI>
+ * <LI>All data in a buffer of the same size that the source</LI>
+ * <LI>Select a bounding box and tiled the request</LI>
+ * <LI>Get one tile</LI>
+ * <LI></LI>
+ * </UL>
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterQuery extends DataQuery {
+	
+	public void setAreaOfInterest();
+	
+	public void setAreaOfInterest(Rectangle pixelWindow);
+	
+	public void setAreaOfInterest(Rectangle pixelWindow, int bufWidth, int bufHeight);
+	
+	public void setAreaOfInterest(Extent boundingBox);
+	
+	public void setAreaOfInterest(Extent boundingBox, int bufWidth, int bufHeight);
+	
+	public void setAreaOfInterest(Extent requestBoundingBox, int bufWidth, int bufHeight, TileListener listener);
+	
+	public void setTileParameters(int level, int tileCol, int tileRow);
+	
+	/**
+	 * Parameters to make a tile request.
+	 * @param level
+	 *        Resolution level 
+	 * @param tileCol 
+	 *        Tile column in the matrix of its level
+	 * @param tileRow
+	 *        Tile row in the matrix of its level
+	 * @param extent
+	 *        Bounding box of the requested tile
+	 * @param cacheStruct
+	 *        Cache structure force by the client
+	 *        @deprecated 
+	 */
+	public void setTileParameters(int level, int tileCol, int tileRow, Extent extent, CacheStruct cacheStruct);
+	
+	/**
+	 * Sets the number of the alpha band. This parameter is take into 
+	 * account only when the request is made using TileListener. In this case
+	 * the parameter transparencyBuffer in nextBuffer method will have the right
+	 * data.
+	 * @param bandNumber
+	 */
+	public void setAlphaBand(int bandNumber);
+	
+	/**
+	 * The user can told if the buffer will be stored or not in the RasterDatasource.
+	 * @param store
+	 */
+	public void storeLastBuffer(boolean store);
+	
+	/**
+	 * Asigna el flag que ajusta el extent de la petici�n al del raster. Si est� a
+	 * true en caso de que el extent de la petici�n sea mayor lo ajustar� a los limites
+	 * de este. Si est� a false no lo ajustar� rellenando los valores con NoData
+	 * @param adjustToExtent true para ajustar y false si no queremos que lo haga. Por defecto
+	 * estar� a true.
+	 */
+	public void setAdjustToExtent(boolean adjustToExtent);
+	
+	/**
+	 * Obtiene el flag que ajusta el extent de la petici�n al del raster. Si est� a
+	 * true en caso de que el extent de la petici�n sea mayor lo ajustar� a los limites
+	 * de este. Si est� a false no lo ajustar� rellenando los valores con NoData. Por defecto
+	 * estar� a true.
+	 * @return true si ajusta y false si no lo hace
+	 */
+	public boolean isAdjustToExtent();
+	
+	/**
+	 * Set the list of bands to write in a buffer when the call query be executed. 
+	 * Each position in the array represents a buffer band and the number inside 
+	 * of this position is the image band read which be write in the buffer 
+	 * @param drawableBands	Array with the list of bands to write
+	 */
+	public void setDrawableBands(int[] drawableBands);
+	
+	/**
+	 * Gets a buffer of data with the same number of bands and the same order that
+	 * the original raster
+	 */
+	public void setAllDrawableBands();
+	
+	/**
+	 * Gets the list of bands to write in a buffer when the call query be executed. 
+	 * Each position in the array represents a buffer band and the number inside 
+	 * of this position is the image band read which be write in the buffer 
+	 * @return Array with the list of bands
+	 */
+	public int[] getDrawableBands();
+	
+	/**
+	 * Asigna el flag que dice si la carga del siguiente buffer es de solo lectura o lectura/escritura.
+	 * La asignaci�n del flag de solo lectura a true debe hacerse para cada consulta.
+	 * @param readOnly true si la siguiente carga de buffer se hace de solo lectura y false si es de lectura/escritura
+	 */
+	public void setReadOnly(boolean readOnly);
+	
+	/**
+	 * Asigna el flag que dice si la carga del siguiente buffer es en memoria
+	 * @param memory true si la siguiente carga de buffer se hace en memoria y false se deja decidir al dataset 
+	 * el tipo de buffer
+	 */
+	public void setMemoryBuffer(boolean readOnly);
+	
+	/**
+	 * Asigna el valor noData con el que se rellenan las celdas cuando se hace una petici�n
+	 * en la que no se quiere que se ajuste al �rea del raster. Por defecto noData tendr� el valor
+	 * que aparece en IBuffer.
+	 * @param noData
+	 */
+	public void setNoDataToFill(NoData noData);
+	
+	/**
+	 * Consulta el flag de supersampleo en la carga del buffer.
+	 * <P>
+	 * Si este flag es false
+	 * y pasamos un buffer de tama�o mayor que el n�mero de pixels del �rea requerida en la
+	 * llamada setAreaOfInterest entonces se ajustar� este buffer al n�mero de pixeles contenidos
+	 * en el �rea.
+	 * </P>
+	 * <P>
+	 * Por ejemplo, si solicitamos un �rea de 5x4 pixels de un raster y pedimos que nos los grabe
+	 * en un buffer de 500x400, si esta variable es false el buffer lo generar� de 5x4. Si esta
+	 * variable es true el buffer lo generar� de 500x400.
+	 * </P>
+	 *
+	 * @return true si el supersampleo en la carga del buffer est� activado y false si no lo est�.
+	 */
+	public boolean isSupersamplingOptionActive();
+	
+	/**
+	 * Returns true if the buffer is not writable
+	 * @return
+	 */
+	public boolean isReadOnly();
+	
+	/**
+	 * Gets the time information of the viewport requested
+	 * @return
+	 */
+	public Time getTime();
+
+	/**
+	 * Sets the time information of the viewport requested
+	 * @return
+	 */
+	public void setTime(Time time);
+
+	/**
+	 * Activa o desactiva el supersampling en la carga del buffer.
+	 * <P>
+	 * Si este flag es false
+	 * y pasamos un buffer de tama�o mayor que el n�mero de pixels del �rea requerida en la
+	 * llamada setAreaOfInterest entonces se ajustar� este buffer al n�mero de pixeles contenidos
+	 * en el �rea.
+	 * </P>
+	 * <P>
+	 * Por ejemplo, si solicitamos un �rea de 5x4 pixels de un raster y pedimos que nos los grabe
+	 * en un buffer de 500x400, si esta variable es false el buffer lo generar� de 5x4. Si esta
+	 * variable es true el buffer lo generar� de 500x400.
+	 * </P>
+	 *
+	 * @param supersamplingLoadingBuffer true o false para activar o desactivar el supersampling en la
+	 * carga del buffer.
+	 */
+	public void setSupersamplingOption(boolean supersamplingLoadingBuffer);
+	
+	/**
+	 * Sets the task status
+	 * @param taskStatus
+	 */
+	public void setTaskStatus(TaskStatus taskStatus);
+	
+	/**
+	 * Giving a world coordinates, a buffer size and a original raster size. If the 
+	 * buffer is bigger than the window requested in the source raster (supersampling), 
+	 * then it means that each pixel of the raster will be written several times in 
+	 * the destination buffer.
+	 * 
+	 * This function calculates the shift in pixels en X and Y coordinate that 
+	 * correspond with the first pixel, due to this pixel won't be drawn entirely.
+	 * 
+	 * Dado unas coordenadas reales, un tama�o de buffer y un tama�o de raster.
+	 * Si el buffer es de mayor tama�o que el raster (supersampleo) quiere decir que
+	 * por cada pixel de buffer se repiten varios del raster. Esta funci�n calcula el
+	 * n�mero de pixels de desplazamiento en X e Y que corresponden al primer pixel del
+	 * buffer en la esquina superior izquierda. Esto es necesario porque la coordenada
+	 * solicitada es real y puede no caer sobre un pixel completo. Este calculo es
+	 * util cuando un cliente quiere supersamplear sobre un buffer y que no se lo haga
+	 * el driver autom�ticamente.
+	 */
+	public double[] getStep();
+
+	/**
+	 * Force that the built of the buffer be ARGB. Be careful with the renderBands. It 
+	 * will have four bands as maximum.
+	 */
+	public void forceARGBRequest();
+	
+	/**
+	 * Force that the built of the buffer be RGB. Be careful with the renderBands. It 
+	 * will have three bands as maximum.
+	 */
+	public void forceRGBRequest();
+	
+	public boolean isforcingRGBRequest();
+	
+	public boolean isforcingARGBRequest();
+
+	/**
+	 * Buffer loaded by the provider. This buffer is created by the <code>RasterQuery</code>  
+	 * but in some cases can be useful to pass the buffer already created by parameter. 
+	 * In any case,  is advisable not to do it.
+	 * @return
+	 */
+	public void setBufferForProviders(Buffer buffer) throws QueryException;
+
+	/**
+	 * Clones this RasterQuery
+	 * @return
+	 */
+	public RasterQuery clone();
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterQuery.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataStore.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataStore.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataStore.java	(revision 15423)
@@ -0,0 +1,598 @@
+/* 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.store;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.net.URI;
+import java.util.List;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPointList;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.CloneException;
+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.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.process.vector.Vectorization;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Histogramable;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.fmap.dal.exception.CloseException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider;
+import org.gvsig.raster.roi.ROI;
+
+/**
+ * Interfaz que deben implementar los almacenes de datos raster.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterDataStore extends DataStore, TRasterStore,
+	PyramidRasterStore, RasterStoreProperties, Histogramable {
+	public static final int              RED_BAND            = 0x01;
+	public static final int              GREEN_BAND          = 0x02;
+	public static final int              BLUE_BAND           = 0x04;
+	public static final int              ALPHA_BAND          = 0x08;
+
+	/**
+	* Tipos de raster dependiendo de su fuente
+	*/
+	public static final int              FILE                = 0;
+	public static final int              POSTGIS             = 1;
+	public static final int              REMOTE              = 2;
+	public static final int              MOSAIC              = 3;
+
+	/**
+	 * Actions to reload the information of a layer such as, read rmf or
+	 * tfw files
+	 */
+	public void reload();
+
+	/**
+	 * Gets a default band list for this provider
+	 * @return
+	 */
+	public BandList getDefaultBandList();
+
+	/**
+	 * Gets a list of data parameters. If it doesn't have
+	 * internal providers this method will return only one DataParameter
+	 * @return
+	 */
+	public RasterDataParameters[] getDataParametersByProvider();
+
+	/**
+	 * Gets a list of sizes. If the provider doesn't have files it will return null.
+	 * If the provider has one file it will return an array of one element with the
+	 * size of this file. If the provider contains others with one file each one.
+	 * @return
+	 */
+	public long[] getFileSizeByProvider();
+
+	/**
+	 * Gets a list of file names or URI. Each element of this array is the name of a
+	 * provider
+	 * @return
+	 */
+	public URI[] getURIByProvider();
+
+	/**
+	 * Gets the number of bands by provider.
+	 * @return
+	 */
+	public int[] getBandCountByProvider();
+
+	/**
+	 * Gets a list of Metadata
+	 * @return
+	 */
+	public Metadata[] getMetadataByProvider();
+
+	/**
+	 * Gets the number of overviews by provider
+	 * @param number of band
+	 * @return
+	 */
+	public int[] getOverviewCountByProvider(int band) throws BandAccessException;
+
+	/**
+	 * Gets the size of a overview in one band. The result is a list of strings (WidthXHeight)
+	 *
+	 * @param band
+	 * @return
+	 */
+	public String[] getOverviewSizeByProvider(int band, int overview) throws BandAccessException;
+
+	/**
+	 * Gets a list of affine transforms
+	 * @return
+	 */
+	public AffineTransform[] getAffineTransformByProvider();
+
+	/**
+	 * Gets the height by provider
+	 * @return
+	 */
+	public double[] getHeightByProvider();
+
+	/**
+	 * Gets the width by provider
+	 * @return
+	 */
+	public double[] getWidthByProvider();
+
+	/**
+	 * Gets the URI of the source. If the provider has only one band
+	 * the result will be the URI. If it is multifile will have to choose
+	 * among several sources.
+	 * @param band
+	 * @return
+	 */
+	public URI getURIByBand(int band);
+
+	/**
+	 * Returns the number of internal providers that it has
+	 * @return
+	 */
+	public int getProviderCount();
+
+	/**
+	 * Adds a new file. The behavior of this function depends on
+	 * the kind of provider and its implementation.
+	 * @param file
+	 * @throws InvalidSourceException
+	 */
+	public void addFile(File file) throws InvalidSourceException;
+
+	/**
+	 * Removes a file. The behavior of this function depends on
+	 * the kind of provider and its implementation.
+	 * @param file
+	 */
+	public void removeFile(File file);
+
+	/**
+	 * Define el valor NoData asociado al raster.
+	 * @return
+	 */
+	public void setNoDataValue(NoData value);
+
+	/**
+	 * Obtiene el extent asignado
+	 * @return	Extent
+	 */
+	public Extent getView();
+
+	/**
+	 * Creates a new dataset which has the same source reference
+	 * @return RasterDataStore
+	 */
+	public RasterDataStore newDataStore();
+
+	/**
+	 * Creates a new dataset which has the same source reference but insure
+	 * that the provider will be not tiled. Most of processes has to be applied
+	 * over not tiled providers
+	 * @return RasterDataStore
+	 */
+	public RasterDataStore newNotTiledDataStore();
+
+	/**
+	 * Obtiene el Tama�o de cada fichero de que consta el raster en bytes.
+	 * @return long que representa el tama�o
+	 */
+	public long getFileSize();
+
+	/**
+	 * 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);
+
+	/**
+	 * 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);
+
+	/**
+	 * Metodo que obtiene si un punto cae dentro de los l�mites de la extensi�n de la fuente de
+	 * datos raster o fuera de ellos.
+	 * @param p Punto a calcular
+	 * @return true si est� dentro de los l�mites y false si est� fuera
+	 */
+	public boolean isInside(Point2D p);
+
+	/**
+	 * Returns true if the data source is tiled
+	 * @return
+	 */
+	public boolean isTiled();
+
+	/**
+	 * Returns true if the provider has several files and all of them has the same extension
+	 * @return
+	 */
+	public boolean isMultiFile();
+
+	/**
+	 * Returns true if the source of data is a mosaic of images
+	 * @return
+	 */
+	public boolean isMosaic();
+
+	/**
+	 * Obtiene la matriz de transformaci�n del propio raster. Esta matriz es la
+	 * encargada de convertir las coordenadas de la petici�n en coordenadas a las
+	 * que se pide a la libreria. En gdal, por ejemplo, se piden las coordenadas a
+	 * la libreria en coordenadas pixel por lo que esta matriz tendr� la
+	 * georreferenciaci�n asociada en el worldfile o cabecera. Otras librerias
+	 * como ermapper la petici�n a la libreria se hace en coordenadas geograficas
+	 * que son las mismas en las que pide el usuario de gvSIG por lo que esta
+	 * matriz en este caso se inicializa con la identidad.
+	 * @return
+	 */
+	public AffineTransform getOwnAffineTransform();
+
+	/**
+	 * Obtiene la transformaci�n afin aplicada en las peticiones con coordenadas
+	 * reales. Esta corresponde al producto matricial entre la transformaci�n de
+	 * la propia georreferenciaci�n del raster (ownTransformation) y la
+	 * transformaci�n que se le aplique de forma externa. Si esta �ltima no existe
+	 * ser� la matriz identidad.
+	 * @return Matriz de la transformaci�n af�n.
+	 */
+	public AffineTransform getAffineTransform();
+
+	/**
+	 * Asigna una transformaci�n al raster para que se tenga en cuenta en la
+	 * asignaci�n del setView. Esta asignaci�n recalcula el extent, el
+	 * requestExtent y asigna el AffineTransform que se usar� para la
+	 * transformaci�n. Esta transformaci�n ser� considerada como si la imagen
+	 * tuviera asociado un rmf.
+	 * @param t Transformaci�n af�n a aplicar
+	 */
+	public void setAffineTransform(AffineTransform transf);
+
+	/**
+	 * Gets an object which vectorize a raster
+	 * @return
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 *         When the object Vectorization is built the raster data buffer is loaded.
+	 *         This operation can be interrupted
+	 */
+	public Vectorization createVectorizeObject() throws QueryException, ProcessInterruptedException;
+
+	/**
+	 * Builds an render object using this RasterDataStore
+	 * @return Render
+	 */
+	public Render getRender();
+
+	/**
+	 * Assigns a render object
+	 * @param render
+	 */
+	public void setRender(Render render);
+
+	/**
+	 * Saves georeferencing information in the rmf file
+	 * @throws RmfSerializerException
+	 */
+	public void saveGeoreferencingToRmf() throws RmfSerializerException;
+
+	/**
+	 * Saves a color table
+	 * @param table
+	 * @throws RmfSerializerException
+	 */
+	public void saveColorTableToRmf(ColorTable table) throws RmfSerializerException;
+
+	/**
+	 * Saves the geo point list to a RMF file
+	 * @param pointList
+	 * @throws RmfSerializerException
+	 */
+	public void saveGeoPointListToRmf(GeoPointList pointList) throws RmfSerializerException;
+
+	/**
+	 * Saves a list of files in the RMF file
+	 * @param fileList
+	 * @throws RmfSerializerException
+	 */
+	public void saveROIFileListToRmf(List<File> fileList) throws RmfSerializerException;
+
+	/**
+	 * Gets the list of ROI files in the RMF
+	 * @return
+	 * @throws RmfSerializerException
+	 */
+	public List<File> getROIFileListFromRmf();
+
+	/**
+	 * Tipo de fichero soportado.
+	 * Devuelve true si el tipo de fichero (extension) est� soportado, si no
+	 * devuelve false.
+	 *
+	 * @param fName Fichero raster
+	 * @return  true si est� soportado, si no false.
+		*/
+	public boolean isFileSupported(String fName);
+
+	/**
+	 * Returns true if this DataStore is open and false if not
+	 * @return
+	 */
+	public boolean isOpen();
+
+	/**
+	 * Obtiene el flag que dice si el raster est� o no georreferenciado
+	 * @return true si est� georreferenciado y false si no lo est�.
+	 */
+	public boolean isGeoreferenced();
+
+	/**
+	 * Returns true if this data store is reproyectable or false if not
+	 * @return
+	 */
+	public boolean isReproyectable();
+
+	/**
+	 * Consulta de si un raster tiene rotaci�n o no.
+	 * @return true si tiene rotaci�n y false si no la tiene.
+	 */
+	public boolean isRotated();
+
+	/**
+	 * Obtiene el n�mero de overviews de una banda
+	 * @return N�mero de overviews del raster.
+	 */
+	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException;
+
+	/**
+	 * Informa de si el dataset soporta overviews o no.
+	 * @return true si soporta overviews y false si no las soporta.
+	 */
+	public boolean overviewsSupport();
+
+	/**
+	 * Obtiene el ancho de una overview de una banda
+	 * @return
+	 */
+	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException;
+
+	/**
+	 * Obtiene el alto de una overview de una banda
+	 * @return
+	 */
+	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException;
+
+	/**
+	 * Returns the band list
+	 * @return
+	 */
+	public BandList getBands();
+
+	/**
+	 * Clones this object
+	 * @return RasterDataStore
+	 * @throws CloneException
+	 */
+	public RasterDataStore cloneDataStore() throws CloneException;
+
+	/**
+	 * Gets a provider
+	 * @return
+	 */
+	public CoverageStoreProvider getProvider();
+
+	/**
+	 * Sets a provider
+	 * @return
+	 */
+	public void setProvider(CoverageStoreProvider prov);
+
+	/**
+	 * Deletes the cache of this layer composed by the files in the provider list
+	 */
+	public void deleteLayerFromCache();
+
+	/**
+	 * Sets the parameters
+	 * @param p
+	 */
+	public void setParameters(DataStoreParameters p);
+
+	/**
+	 * Returns the source type (FILE, POSTGIS, REMOTE,...)
+	 * @return
+	 */
+	public int getSourceType();
+
+	/**
+	 * This method will return the DataParameters if it has a simple provider behind. If it has
+	 * a TileProvider this method will return the DataParameters used by the TileProvider.
+	 * @return
+	 */
+	public RasterDataParameters getInternalParameters();
+
+	/**
+     * Sets the explorer
+     * @param explorer
+     */
+    public void setExplorer(RasterDataServerExplorer explorer);
+
+	/**
+	 * Closes this data store
+	 * @throws CloseException
+	 */
+	public void close() throws CloseException;
+
+
+	//******************************************
+	//***********Query methods******************
+
+	/**
+	 * Returns the last buffer loaded if the flag storeLastBuffer in the query is true
+	 * @return
+	 */
+	public Buffer getLastBuffer();
+
+	/**
+	 * Gets a pixel
+	 * @param x
+	 * @param y
+	 * @param band
+	 * @return
+	 * @throws InvalidSetViewException
+	 * @throws FileNotOpenException
+	 * @throws RasterDriverException
+	 */
+	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException;
+
+	/**
+	 * Makes a request to load a buffer of data. This call returns an array of results. The first
+	 * element in the array is the buffer and the other elements are the transparency buffer,
+	 * the legend and so on. This funtion is mainly used by the getTile call. This array contains
+	 * all visualization properties.
+	 * @param query
+	 * @return Object[]
+	 */
+	public Object[] queryArray(RasterQuery query) throws ProcessInterruptedException, QueryException;
+
+	/**
+	 * Makes a request to load a buffer of data. This call returns only a buffer. This call is used
+	 * by most functions because the properties are read from the datastore.
+	 * @param query
+	 * @return Buffer
+	 */
+	public Buffer query(RasterQuery query) throws ProcessInterruptedException, QueryException;
+
+	/**
+	 * Sets a tile server to create a second level of cache. This second level will be
+	 * created if the cache structure is different to the current.
+	 * @param tileServer
+	 */
+	public void setTileServer(Class<?> tileServer) throws InitializeException;
+
+	/**
+	 * Some sevices has neither limits nor pixel size. For instance, WebMapService
+	 * is a service of this type if the size is not fixed. Other services, like
+	 * WMTS are enclosed too but in this case it will have resolution by level.
+	 * This method returns true if the data source is enclosed.
+	 * @return
+	 */
+	public boolean isRasterEnclosed();
+
+	/**
+	 * This function returns true if the image to be loaded needs a enhanced filter or
+	 * doesn't. It depends on the format, number of bands, type of data and so on.
+	 * @return The default value is false but each driver can change this value.
+	 */
+	public boolean needEnhanced();
+	
+	/**
+	 * Gets the information in a real point
+	 * @param x
+	 *        X Pixel position
+	 * @param y
+	 *        Y pixel position
+	 * @return
+	 */
+	public String getInfoByPoint(double x, double y, ICancellable cancellable) throws InfoByPointException;
+
+	/**
+	 * Gets the information in a pixel point. Some services need additional
+	 * information as the window where the request is done
+	 * @param x
+	 *        X Pixel position
+	 * @param y
+	 *        Y pixel position
+	 * @param bbox
+	 *        Bounding box of the window
+	 * @param w
+	 *        Width in pixels of the window
+	 * @param h
+	 *        Height in pixels of the window
+	 * @param cancellable
+	 * @return
+	 * @throws RemoteServiceException
+	 */
+	public String getInfoByPoint(double x, double y, Extent extent, int w, int h, ICancellable cancellable) throws InfoByPointException;
+
+	/**
+	 * Gets the list of geo points associated to this provider
+	 * @return
+	 */
+	public GeoPointList getGeoPointList();
+
+	/**
+	 * Sets the list of geo points associated to this provider
+	 */
+	public void setGeoPointList(GeoPointList geoPointList);
+
+	/**
+	 * Gets the list of regions of interest
+	 * @param defaultProjection
+	 * @return
+	 * @throws ROIException
+	 */
+	public List<ROI> getRois(IProjection defaultProjection) throws ROIException;
+
+	/**
+	 * Gets the list of regions of interest
+	 * @param defaultProjection
+	 * @return
+	 * @throws ROIException
+	 */
+	public List<ROI> getRois(String epsg) throws ROIException;
+
+	/**
+	 * Sets the list of regions of interest
+	 * @param rois
+	 */
+	public void setRois(List<ROI> rois);
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataStore.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/ExternalCancellable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/ExternalCancellable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/ExternalCancellable.java	(revision 15423)
@@ -0,0 +1,29 @@
+/* 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.store;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface ExternalCancellable {
+	public void processFinalize();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/ExternalCancellable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterStoreProperties.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterStoreProperties.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterStoreProperties.java	(revision 15423)
@@ -0,0 +1,206 @@
+/* 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.store;
+
+import java.awt.Image;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+
+
+
+/**
+ * Properties of a raster data store
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterStoreProperties {
+	//******************************************
+	//***********Single Properties*************
+	/**
+	 * Obtiene el tipo de dato por banda
+	 * @return tipo de dato por banda
+	 */
+	public int[] getDataType();
+
+	/**
+	 * Gets the nodata value for this raster
+	 * @return
+	 */
+	public NoData getNoDataValue();
+	
+	/**
+	 * Obtiene el n�mero de bandas del raster
+	 * @return N�mero de bandas
+	 */
+	public int getBandCount();
+
+	/**
+	 * Obtiene la altura del raster en p�xeles.
+	 * @return altura
+	 */
+	public double getHeight();
+
+	/**
+	 * Obtiene la anchura del raster en p�xeles.
+	 * @return anchura
+	 */
+	public double getWidth();
+	
+	/**
+	 * Obtiene el tama�o de celda del raster
+	 * @return Valor del tama�o de celda
+	 */
+	public double getCellSize();
+	
+	/**
+	 * Obtiene el tama�o de pixel en X
+	 * @return tama�o de pixel en X
+	 */
+	public double getPixelSizeX();
+
+	/**
+	 * Obtiene el tama�o de pixel en Y
+	 * @return tama�o de pixel en Y
+	 */
+	public double getPixelSizeY();
+	
+	/**
+	 * Obtiene el extent del raster.
+	 * @return Extent
+	 */
+	public Extent getExtent();
+	
+	/**
+	 * Este es el extent sobre el que se ajusta una petici�n para que esta no
+	 * exceda el extent m�ximo del raster. Para un raster sin rotar ser� igual al
+	 * extent pero para un raster rotado ser� igual al extent del raster como si
+	 * no tuviera rotaci�n. Esto ha de ser as� ya que la rotaci�n solo se hace
+	 * sobre la vista y las peticiones han de hacerse en coordenadas de la imagen
+	 * sin shearing aplicado.
+	 * @return Extent
+	 */
+	public Extent getExtentWithoutRot();
+	
+	/**
+	 * Obtiene el nombre del dataStore
+	 * @return String 
+	 *         nombre del fichero
+	 */
+	public String getName();
+	
+	/**
+	 * Obtiene la proyecci�n asociada al raster. Como todos los dataset del 
+	 * multiDataset deben tener la misma proyecci�n obtenemos esta del primer
+	 * dataset.
+	 * @return Proyecci�n en formato cadena
+	 * @throws RasterDriverException
+	 */
+	public String getWktProjection() throws RasterDriverException;
+	
+	/**
+	 * Gets the dataset projection
+	 * @return IProjection
+	 */
+	public IProjection getProjection();
+	
+	/**
+	 * Sets the dataset projection
+	 * @param proj
+	 */
+	public void setProjection(IProjection proj, boolean persist) throws RmfSerializerException;
+	
+	
+	//******************************************
+	//***********Dataset Properties*************
+	/**
+	 * Obtiene el objeto que contiene que contiene la interpretaci�n de 
+	 * color por banda para el dataset seleccionado
+	 * @param dataset Dataset del que se necesesita la informaci�n de color dentro del RasterMultiDataset
+	 * @return DatasetColorInterpretation
+	 */
+	public ColorInterpretation getColorInterpretation();
+	
+	public void setColorInterpretation(ColorInterpretation ci);
+	
+	/**
+	 * Gets the object with the metadata
+	 * @return
+	 */
+	public Metadata getMetadata();
+	
+	
+	/**
+	 * Gets the color table.
+	 * @return color table loaded or null if it doesn't have
+	 */
+	public ColorTable getColorTable();
+	
+	/**
+	 * Gets the legend as a image. The store could not have implemented this method .
+	 * This is useful above all for WMS but whatever raster layer 
+	 * could return a legend as image.
+	 * @return
+	 */
+	public Image getImageLegend();
+	
+	/**
+	 * Obtiene el estado de transparencia a partir de los estados de transparencia de todos
+	 * los ficheros que lo componen. Si varios de los ficheros que lo componen tienen banda de 
+	 * transparencia estas tendr�n que ser mezcladas sobre una banda de transparencia �nica.
+	 * @return Objeto FileTransparency con el estado de transparencia
+	 */
+	public Transparency getTransparency();
+	
+	/**
+	 * Gets the statistics object
+	 * @return MultiFileStatistics
+	 */
+	public Statistics getStatistics();
+	
+	/**
+	 * Sets the statistics object. When the statistics are assigned the rmf is saved
+	 * with the new statistics.
+	 * @param stats
+	 * @throws RmfSerializerException 
+	 */
+	public void setStatistics(Statistics stats) throws RmfSerializerException;
+	
+	/**
+	 * Obtiene el histograma asociado al dataset. 
+	 *
+	 * @return Histograma asociado al dataset.
+	 * @throws InterruptedException 
+	 */
+	public HistogramComputer getHistogramComputer() throws HistogramException, InterruptedException;
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterStoreProperties.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/DataServerWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/DataServerWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/DataServerWriter.java	(revision 15423)
@@ -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.fmap.dal.coverage.store;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.process.BaseIncrementableTask;
+import org.gvsig.tools.dispose.Disposable;
+
+
+/**
+ * Este interfaz debe ser implementado por las clases que vayan a
+ * servir datos a los drivers de escritura.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface DataServerWriter extends Disposable, BaseIncrementableTask {
+	/**
+	 * Para el tipo de datos ARGB (32 bits en un solo entero) obtiene un array que representa 
+	 * los datos le�dos. Este array se obtendr� de la fuente de datos
+	 * asociada al renderizador y sera de ancho sizeX y alto sizeY. Es el propio renderizador
+	 * el encargado de llevar la posici�n de la �ltima l�nea le�da para la siguiente petici�n
+	 * ofrecer datos a partir de donde se quedo.
+	 * @param sizeX Ancho del bloque de datos
+	 * @param sizeY Alto del bloque de datos
+	 * @return Array con los datos leidos
+	 * @throws OutOfMemoryError 
+	 * @throws ProcessInterruptedException 
+	 */
+	public int[] readARGBData(int sizeX, int sizeY, int nBand) throws ProcessInterruptedException, OutOfMemoryError;
+	
+	/**
+	 * Para el tipo de datos byte obtiene un array bidimensional donde la primera dimensi�n
+	 * son las bandas y la segunda los datos. Este array se obtendra de la fuente de datos
+	 * asociada al renderizador y sera de ancho sizeX y alto sizeY. Es el propio renderizador
+	 * el encargado de llevar la posici�n de la �ltima l�nea le�da para la siguiente petici�n
+	 * ofrecer datos a partir de donde se quedo.
+	 * @param sizeX Ancho del bloque de datos
+	 * @param sizeY Alto del bloque de datos
+	 * @return Array bidimensionar de numero de bandas por datos leidos
+	 */
+    public byte[][] readByteData(int sizeX, int sizeY);
+	/**
+	 * Para el tipo de datos short obtiene un array bidimensional donde la primera dimensi�n
+	 * son las bandas y la segunda los datos. Este array se obtendra de la fuente de datos
+	 * asociada al renderizador y sera de ancho sizeX y alto sizeY. Es el propio renderizador
+	 * el encargado de llevar la posici�n de la �ltima l�nea le�da para la siguiente petici�n
+	 * ofrecer datos a partir de donde se quedo.
+	 * @param sizeX Ancho del bloque de datos
+	 * @param sizeY Alto del bloque de datos
+	 * @return Array bidimensionar de numero de bandas por datos leidos
+	 */
+    public short[][] readShortData(int sizeX, int sizeY);
+	/**
+	 * Para el tipo de datos int obtiene un array bidimensional donde la primera dimensi�n
+	 * son las bandas y la segunda los datos. Este array se obtendra de la fuente de datos
+	 * asociada al renderizador y sera de ancho sizeX y alto sizeY. Es el propio renderizador
+	 * el encargado de llevar la posici�n de la �ltima l�nea le�da para la siguiente petici�n
+	 * ofrecer datos a partir de donde se quedo.
+	 * @param sizeX Ancho del bloque de datos
+	 * @param sizeY Alto del bloque de datos
+	 * @return Array bidimensionar de numero de bandas por datos leidos
+	 */
+    public int[][] readIntData(int sizeX, int sizeY);
+	/**
+	 * Para el tipo de datos float obtiene un array bidimensional donde la primera dimensi�n
+	 * son las bandas y la segunda los datos. Este array se obtendra de la fuente de datos
+	 * asociada al renderizador y sera de ancho sizeX y alto sizeY. Es el propio renderizador
+	 * el encargado de llevar la posici�n de la �ltima l�nea le�da para la siguiente petici�n
+	 * ofrecer datos a partir de donde se quedo.
+	 * @param sizeX Ancho del bloque de datos
+	 * @param sizeY Alto del bloque de datos
+	 * @return Array bidimensionar de numero de bandas por datos leidos
+	 */
+    public float[][] readFloatData(int sizeX, int sizeY);
+	/**
+	 * Para el tipo de datos double obtiene un array bidimensional donde la primera dimensi�n
+	 * son las bandas y la segunda los datos. Este array se obtendra de la fuente de datos
+	 * asociada al renderizador y sera de ancho sizeX y alto sizeY. Es el propio renderizador
+	 * el encargado de llevar la posici�n de la �ltima l�nea le�da para la siguiente petici�n
+	 * ofrecer datos a partir de donde se quedo.
+	 * @param sizeX Ancho del bloque de datos
+	 * @param sizeY Alto del bloque de datos
+	 * @return Array bidimensionar de numero de bandas por datos leidos
+	 */
+    public double[][] readDoubleData(int sizeX, int sizeY);
+    
+	/**
+	 * Asigna el buffer de datos e inicializa variables de
+	 * @param buffer
+	 * @param nband Si es menor que cero sirve datos de todas las bandas. Si es
+	 * mayor que cero sirve datos de la banda indicada por el valor.
+	 */
+	public void setBuffer(Buffer buffer, int nband);
+	
+	/**
+	 * Gets the data buffer
+	 * @return
+	 */
+	public Buffer getBuffer();
+	
+	/**
+	 * Assigns the band number to serve
+	 * @param nband Number of band or lesser than zero for all bands
+	 */
+	public void setBand(int nband);
+	
+	/**
+	 * Obtiene el porcentaje de incremento de la lectura de datos
+	 * @return
+	 */
+	public int getPercent();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/DataServerWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterWriter.java	(revision 15423)
@@ -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.fmap.dal.coverage.store;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+
+/**
+ * Interfaz con los m�todos para la escritura de raster.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface RasterWriter {
+	/**
+	 * Realiza la funci�n de compresi�n a partir de los datos pasados por el
+	 * cliente.
+	 * @throws IOException
+	 * @throws RmfSerializerException 
+	 */
+	public void dataWrite() throws IOException, ProcessInterruptedException;
+	
+	/**
+	 * Cierra el driver
+	 */
+	public void writeClose() throws IOException;
+
+	/**
+	 * Cancela el grabado de datos
+	 */
+	public void writeCancel();
+	
+	/**
+	 * A�ade la proyecci�n Wkt con la que salvar.
+	 * @param wkt
+	 */
+	public void setWkt(String wkt);
+	
+	/**
+	 * Obtiene los par�metros del driver.
+	 * @return WriterParams
+	 */
+	public Params getParams();
+	
+	/**
+	 * Asigna la interpretaci�n de color para el fichero de salida.
+	 * @param colorInterp Interpretaci�n de color
+	 */
+	public void setColorBandsInterpretation(String[] colorInterp);
+	
+	/**
+	 * Obtiene el nombre del driver.
+	 * @return Nombre del driver
+	 */
+	public String getDriverName();
+	
+	/**
+	 * Porcentaje de escritura completado.
+	 * @return Entero con el porcentaje de escritura.
+	 */
+	public int getPercent();
+	
+	/**
+	 * Assigns the object to be cancelled
+	 *
+	 * @param cancellable
+	 */
+	public void setCancellableRasterDriver(ExternalCancellable cancellable);
+	
+	/**
+	 * Gets the provider name of this {@link RasterWriter}
+	 * @return
+	 */
+	public String getProviderName();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.store package documentation</title>
+</head>
+<body>
+
+	<p>Structures which represents a store of raster data</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterFileStoreParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterFileStoreParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterFileStoreParameters.java	(revision 15423)
@@ -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.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.fmap.dal.coverage.store.parameter;
+
+import java.io.File;
+
+
+/**
+ * All raster files parameter should inherit from this interface. It provides
+ * general methods for open a raster.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterFileStoreParameters extends RasterDataParameters {
+	public File getFile();
+
+	public void setFile(File aFile);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterFileStoreParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/NewRasterStoreParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/NewRasterStoreParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/NewRasterStoreParameters.java	(revision 15423)
@@ -0,0 +1,161 @@
+package org.gvsig.fmap.dal.coverage.store.parameter;
+
+import java.awt.geom.AffineTransform;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.NewDataStoreParameters;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+
+/**
+ * This class represents parameters that we need to create a new
+ * raster source.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface NewRasterStoreParameters extends NewDataStoreParameters {
+	public static String          FIELD_BUFFER                 = "buffer";
+	public static String          FIELD_COLORINTERPRETATION    = "colorInterpretation";
+	public static String          FIELD_SRS                    = RasterDataParameters.FIELD_CRS;
+	public static String          FIELD_PARAMS                 = "driverparams";
+	public static String          FIELD_BAND                   = "band";
+	public static String          FIELD_WKT                    = "wktproj";
+	public static String          FIELD_AFFINETRANSFORM        = "affineTransform";
+	public static String          FIELD_DATA_SERVER            = "dataserver";
+	
+	/**
+	 * Sets the data server
+	 * @param dataServer
+	 */
+	public void setDataServer(DataServerWriter dataServer);
+	
+	/**
+	 * Sets the name of the file to save
+	 * @param fileName
+	 */
+	public void setDestination(String path, String fileName);
+	
+	/**
+	 * Sets the name of the file to save
+	 * @param fileName
+	 */
+	public void setDestination(String fileName);
+	
+	/**
+	 * Sets the buffer with data loaded
+	 * @param buffer
+	 */
+	public void setBuffer(Buffer buffer);
+	
+	/**
+	 * Sets the color interpretation. Constants with color interpretation are
+	 * declared int {@link ColorInterpretation} class.
+	 * @param colorInterpretation
+	 */
+	public void setColorInterpretation(String[] colorInterpretation);
+	
+	/**
+	 * Sets the projection
+	 * @param projection
+	 */
+	public void setProjection(IProjection projection);
+	
+	/**
+	 * Sets the driver parameters. This method is useful when the parameters are loaded 
+	 * using the driver GUI. If this parameters does not exists then it will use generic
+	 * configuration.
+	 * @param params
+	 */
+	public void setDriverParams(Params params);
+	
+	/**
+	 * Sets the projection using Wkt notation
+	 * @param wkt
+	 */
+	public void setWktProjection(String wkt);
+	
+	/**
+	 * Sets the number of band in the buffer that will be saved. If this value is greater
+	 * than zero only one band (n) will be written. If this value is lower than zero 
+	 * then all bands will be written. This is the value by default. 
+	 * @param n
+	 */
+	public void setBand(int n);
+	
+	/**
+	 * This method is maintained to keep compatibility with the old system. It is recommended
+	 * not to use. If the buffer don't have bounding box the affine transform will be the 
+	 * identity and if not the affine transform will be calculated using the geographic information.
+	 * 
+	 * @param at
+	 * @deprecated 
+	 */
+	public void setAffineTransform(AffineTransform at);
+	
+	/**
+	 * This method is maintained to keep compatibility with the old system. It is recommended
+	 * not to use. If the buffer don't have bounding box the affine transform will be the 
+	 * identity and if not the affine transform will be calculated using the geographic information.
+	 * 
+	 * @return AffineTransform
+	 */
+	public AffineTransform getAffineTransform();
+	
+	/**
+	 * Gets the number of band in the buffer that will be saved. If this value is greater
+	 * than zero only one band (n) will be written. If this value is lower than zero 
+	 * then all bands will be written. This is the value by default. 
+	 * @return
+	 */
+	public int getBand();
+	
+	/**
+	 * Gets the projection using Wkt notation
+	 * @return
+	 */
+	public String getWktProjection();
+	
+	/**
+	 * Gets the driver parameters. This method is useful when the parameters are loaded 
+	 * using the driver GUI. If this parameters does not exists then it will use generic
+	 * configuration.
+	 * @return
+	 */
+	public Params getDriverParams();
+	
+	/**
+	 * Gets the name of the file to save
+	 * @return
+	 */
+	public String getFileName();
+	
+	public String getPath();
+	
+	/**
+	 * Gets the buffer with data loaded
+	 * @return
+	 */
+	public Buffer getBuffer();
+	
+	/**
+	 * Gets the color interpretation. Constants with color interpretation are
+	 * declared int {@link ColorInterpretation} class.
+	 * @return
+	 */
+	public String[] getColorInterpretation();
+	
+	/**
+	 * Gets the projection
+	 * @return
+	 */
+	public IProjection getProjection();
+	
+	/**
+	 * Gets the data server
+	 * @return
+	 */
+	public DataServerWriter getDataServer();
+}
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/NewRasterStoreParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TileDataParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TileDataParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TileDataParameters.java	(revision 15423)
@@ -0,0 +1,65 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+package org.gvsig.fmap.dal.coverage.store.parameter;
+
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+
+
+/**
+ * Parameters for a tiled service
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface TileDataParameters extends DataStoreParameters {
+	public static final String     DYNCLASS_NAME    = "TileDataParameters";
+	
+	/**
+	 * Gets the <code>DataParameters</code>
+	 * @return
+	 */
+	public DataParameters getDataParameters();
+	
+	/**
+	 * Sets the <code>DataParameters</code>
+	 * @param params
+	 */
+	public void setDataParameters(DataParameters params);
+	
+	/**
+	 * Sets the flag to delete the cache 
+	 * @param deleteCache
+	 */
+	public void deleteCache(boolean deleteCache);
+	
+	/**
+	 * Returns true if the cache is going to be deleted
+	 * @return
+	 */
+	public boolean isDeletingCache();
+	
+	/**
+	 * Gets the name. If it is a remote provider will return a URI and
+	 * if it is a file provider will return its path
+	 * @return
+	 */
+	public String getName();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TileDataParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RemoteStoreParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RemoteStoreParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RemoteStoreParameters.java	(revision 15423)
@@ -0,0 +1,93 @@
+/* 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.store.parameter;
+
+import org.gvsig.fmap.dal.DataStoreParameters;
+
+/**
+ * Parameters for Remote providers
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RemoteStoreParameters extends DataStoreParameters {
+	
+	/**
+	 * Sets the number of alpha band
+	 * @param alphaBand
+	 */
+	public void setAlphaBand(int alphaBand);
+	
+	/**
+	 * Sets the frame width
+	 * @param frame
+	 */
+	public void setFrame(int frame);
+	
+	/**
+	 * Gets the alpha band
+	 * @return
+	 */
+	public int getAlphaBand();
+	
+	/**
+	 * Gets the frame width
+	 * @return
+	 */
+	public int getFrame();
+	
+	/**
+	 * Returns true if the service has limits and false if doesn't
+	 * @return
+	 */
+	public boolean isSizeFixed();
+	
+	/**
+	 * 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);
+	
+	/**
+	 * Sets the flag to delete cache
+	 * @param deleteCache
+	 */
+	public void deleteCache(boolean deleteCache);
+	
+	/**
+	 * Gets true if the cache is going to be deleted
+	 * @return
+	 */
+	public boolean isDeletingCache();
+	
+	/**
+	 * Clones this RemoteStoreParameters
+	 * @return
+	 */
+	public RemoteStoreParameters clone();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RemoteStoreParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/MultiDimensionalStoreParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/MultiDimensionalStoreParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/MultiDimensionalStoreParameters.java	(revision 15423)
@@ -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.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.fmap.dal.coverage.store.parameter;
+
+
+/**
+ * All providers that support time should have parameters of this type
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface MultiDimensionalStoreParameters extends TimeStoreParameters {
+	
+	/**
+	 * Gets the last selected variable as a String
+	 * @return
+	 */
+	public String getStringVariable();
+	
+	/**
+	 * Gets the last selected field as a String
+	 * @return
+	 */
+	public String getStringLevel();
+	
+	/**
+	 * Sets the variable
+	 * @param variable
+	 */
+	public void setFieldVariable(String variable);
+	
+	/**
+	 * Sets the level selecting its position in the list of levels
+	 * @param timePosInList
+	 */
+	public void setFieldLevel(int levelPosInList);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/MultiDimensionalStoreParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterDataParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterDataParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterDataParameters.java	(revision 15423)
@@ -0,0 +1,159 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.fmap.dal.coverage.store.parameter;
+
+import java.io.File;
+import java.net.URI;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.RasterDataServerExplorer;
+
+/**
+ * All raster parameter should inherit from this interface. It provides
+ * general methods for open a raster.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterDataParameters extends DataStoreParameters {
+	//Load options
+	public static int             REPROJECT_DATA               = 1;
+	public static int             REPROJECT_VIEW               = 2;
+	public static int             DONT_CHANGE_PROJECTION       = 0;
+	public static int             NEW_PROJETION_TO_THE_LAYER   = 6;
+	public static int             NOT_LOAD                     = 4;
+	public static int             ON_THE_FLY                   = 5;
+
+	//General parameters
+	public static final String    FIELD_URI                    = "uri";
+	public static final String    FIELD_CRS                    = "crs";
+	public static final String    FIELD_RMF_FOLDER             = "rmf_folder";
+
+
+	/**
+	 * Flag to know if this provider is visible or it isn't
+	 * @return
+	 */
+	public boolean isVisible();
+
+	/**
+	 * Assigns the flag to know if this provider is visible or it isn't
+	 * @return
+	 */
+	public void setVisible(boolean visible);
+
+	public boolean isValid();
+
+	/**
+	 * When a layer is loaded will have several options when its projection is not the same that the view projection.
+	 * This options are defined as static variables in RasterDataParameters interface
+	 * @param frame
+	 */
+	public void setReprojectionOption(int option);
+
+	/**
+	 * When a layer is loaded will have several options when its projection is not the same that the view projection.
+	 * This options are defined as static variables in RasterDataParameters interface
+	 * @return
+	 */
+	public int getReprojectionOption();
+
+	/**
+	 * Gets the uniform resource identifier of a provider. This can be
+	 * a file name or a URL
+	 * @return
+	 */
+	public URI getURI();
+
+	/**
+	 * Sets the uniform resource identifier of a provider. This can be
+	 * a file name or a URL
+	 * @param uri
+	 */
+	public void setURI(URI uri);
+
+	public String getSRSID();
+
+	public void setSRSID(String srsid);
+
+	public void setSRS(IProjection srs);
+
+	public IProjection getSRS();
+
+	public boolean isOverridingHost();
+
+	public void setOverrideHost(boolean over);
+
+	/**
+	 * Sets the number of alpha band
+	 * @param alphaBand
+	 */
+	public void setAlphaBand(int alphaBand);
+
+	/**
+	 * Sets the frame width
+	 * @param frame
+	 */
+	public void setFrame(int frame);
+
+	/**
+	 * Gets the number of alpha band
+	 * @param alphaBand
+	 */
+	public int getAlphaBand();
+
+	/**
+	 * Gets the frame width
+	 * @param frame
+	 */
+	public int getFrame();
+
+	/**
+	 * Sets the folder to store RMF file. This folder may be different
+	 * than the raster folder
+	 * @param rmfFolder
+	 */
+	public void setRMFFolder(File rmfFolder);
+
+	/**
+	 * Gets the folder to store RMF file
+	 * @return
+	 */
+	public File getRMFFolder();
+
+	/**
+	 * Return true if the store to open is going to be tiled
+	 */
+	public boolean isSourceTiled();
+
+	/**
+	 * Assigns field from a data parameters to other
+	 * @param par
+	 */
+	public void assignFields(RasterDataParameters par, RasterDataServerExplorer explorer);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/RasterDataParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.store.parameters package documentation</title>
+</head>
+<body>
+
+	<p>Parameters to open or create a raster store</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TimeStoreParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TimeStoreParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TimeStoreParameters.java	(revision 15423)
@@ -0,0 +1,71 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+*
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+* MA  02110-1301, USA.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.fmap.dal.coverage.store.parameter;
+
+import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException;
+
+/**
+ * All providers that support time should have parameters of this type
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface TimeStoreParameters extends RasterDataParameters {
+	/**
+	 * Selects the next instant.
+	 */
+	public void selectNextInstant();
+	
+	/**
+	 * Selects the previous instant.
+	 */
+	public void selectPrevInstant();
+	
+	/**
+	 * Goes to the selected position in the image list
+	 * @param position
+	 * @throws OperationNotSupportedException 
+	 */
+	public void goTo(int position);
+	
+	/**
+	 * Gets the last instant position selected in the list of instants.
+	 * @return
+	 */
+	public int getFieldTime();
+	
+	/**
+	 * Sets the time selecting its position in the list of times
+	 * @param timePosInList
+	 */
+	public void setFieldTime(int timePosInList);
+	
+	/**
+	 * Sets the time selecting its position in the list of times
+	 * @param timePosInList
+	 */
+	public String getStringTime();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/parameter/TimeStoreParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/TRasterStore.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/TRasterStore.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/TRasterStore.java	(revision 15423)
@@ -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.fmap.dal.coverage.store;
+
+import org.gvsig.fmap.dal.coverage.exception.OperationNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.exception.TimeException;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+import org.gvsig.timesupport.Time;
+
+/**
+ * This interfaz is implemented by all data stores that support time
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface TRasterStore {
+	/**
+	 * Assigns the time for read information of the right source. The difference with setTime(SerialInfo time) 
+	 * is that this method selects the time from the source that has been selected previously. This is because
+	 * Time variable only has time information and it has not serial information.
+	 * @param time
+	 * @throws TimeException
+	 * @throws OperationNotSupportedException 
+	 */
+	public void setTime(Time time) throws TimeException, OperationNotSupportedException;
+	
+	/**
+	 * Selects the next image
+	 * @throws OperationNotSupportedException 
+	 */
+	public void selectNext() throws OperationNotSupportedException;
+	
+	/**
+	 * Selects the previous image
+	 * @throws OperationNotSupportedException 
+	 */
+	public void selectPrev() throws OperationNotSupportedException;
+	
+	/**
+	 * Goes to the selected position in the image list
+	 * @param position
+	 * @throws OperationNotSupportedException 
+	 */
+	public void goTo(int position) throws OperationNotSupportedException;
+	
+	/**
+	 * Gets the serial information
+	 * @return
+	 * @throws RmfSerializerException 
+	 */
+	public TimeSeries getTimeSerials() throws RmfSerializerException;
+	
+	/**
+	 * Sets the serial information
+	 * @throws RmfSerializerException 
+	 */
+	public void setTimeSerials(TimeSeries serialInfo) throws RmfSerializerException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/TRasterStore.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataServerExplorer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataServerExplorer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataServerExplorer.java	(revision 15423)
@@ -0,0 +1,46 @@
+package org.gvsig.fmap.dal.coverage.store;
+
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.exception.ConnectException;
+
+/**
+ * RasterDataServerExplorer is an abstraction for a raster server. It allows connecting to the server 
+ * and browsing its contents. More specifically, this interface provides a list of the available 
+ * data stores in a server.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterDataServerExplorer extends DataServerExplorer {
+	public int TIME   = 10000;
+	
+	/**
+	 * Returns the internal parameters, that is, the parameters that
+	 * are not tiled.
+	 * @return
+	 */
+	public DataStoreParameters getStoredParameters();
+	
+	/**
+	 * Connect to the server
+	 * @param cancellable
+	 * @throws ConnectException
+	 */
+	public void connect(ICancellable cancellable) throws ConnectException;
+	
+	/**
+	 * Checks if the network and host are reachable
+	 * @param timeout for the host
+	 * @return true if both are reachable and false if they are not
+	 */
+	public boolean isHostReachable(int timeout);
+	
+	/**
+	 * Checks if the network and host are reachable for a fixed time defined in
+	 * a constant of this interface.
+	 * @return true if both are reachable and false if they are not
+	 */
+	public boolean isHostReachable();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/RasterDataServerExplorer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/PyramidRasterStore.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/PyramidRasterStore.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/PyramidRasterStore.java	(revision 15423)
@@ -0,0 +1,68 @@
+/* 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.store;
+
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+
+/**
+ * Methods for raster data stores with resolution levels
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface PyramidRasterStore {
+	
+	/**
+	 * Calculates the extent of a zoom level using other extent as a reference. This function
+	 * is useful when the request is between two levels. It will adjust the request to the nearest
+	 * zoom level. 
+	 * @param level
+	 * @param extent
+	 * @param w
+	 * @param h
+	 * @return
+	 */
+	public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h);
+	
+	/**
+	 * Calculates the extent of a zoom level using a center. 
+	 * @param viewCenter
+	 * @param level
+	 * @param w
+	 * @param h
+	 * @return
+	 */
+	public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h);
+	
+	/**
+	 * Gets the number of zoom levels
+	 * @return
+	 */
+	public int getZoomLevels();
+	
+	/**
+	 * Gets the nearest level
+	 * @param pixelSize
+	 * @return
+	 */
+	public int getNearestLevel(double pixelSize);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/PyramidRasterStore.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Histogramable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Histogramable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Histogramable.java	(revision 15423)
@@ -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.fmap.dal.coverage.store.props;
+
+
+
+/**
+ * This interface should be implemented for every class that is capable to
+ * provide an object to compute its histogram.
+ * 
+ * @version 27/03/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface Histogramable {
+	
+	/**
+	 * Gets the object which computes the histogram
+	 * @return Histograma
+	 */
+	public HistogramComputer getHistogramComputer();
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Histogramable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorInterpretation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorInterpretation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorInterpretation.java	(revision 15423)
@@ -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.fmap.dal.coverage.store.props;
+
+import org.gvsig.tools.persistence.Persistent;
+
+
+
+/**
+ * Interfaz que representa una interpretaci�n de color.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface ColorInterpretation extends Persistent {
+	// Identificadores de color interpretation
+	public static final String RED_BAND            = "Red";
+	public static final String GREEN_BAND          = "Green";
+	public static final String BLUE_BAND           = "Blue";
+	public static final String ALPHA_BAND          = "Alpha";
+	public static final String GRAY_BAND           = "Gray";
+	public static final String PAL_BAND            = "Palette";
+	public static final String UNDEF_BAND          = "Undefined";
+	
+	public static final String RED_GREEN_BAND      = "Red_Green";
+	public static final String RED_BLUE_BAND       = "Red_Blue";
+	public static final String GREEN_BLUE_BAND     = "Green_Blue";
+	
+	//Constants to initialize the color interpretation
+	public static final String RGB                 = "RGB";
+	public static final String BGR                 = "BGR";
+	public static final String ARGB                = "ARGB";
+	public static final String GRAYSCALE           = "GRAYSCALE";
+	public static final String PALETTE             = "PALETTE";
+	
+	/**
+	 * Asigna un valor para la interpretaci�n de color de una banda
+	 * @param band Banda 
+	 * @param value valor
+	 */
+	public void setColorInterpValue(int band, String value);
+	
+	/**
+	 * Obtiene el n�mero de entradas de interpretaci�n de color por
+	 * banda en la lista.
+	 * @return
+	 */
+	public int length();
+	
+	/**
+	 * Returns true if the values Red, Green and Blue are
+	 * assigned to any band of the image or the values Gray or Palette are
+	 * assigned.
+	 * @return
+	 */
+	public boolean hasInterpretation();
+	
+	/**
+	 * Returns true if the color interpretation is BGR, that is, the 
+	 * three first bands of the image are Blue, Green and Red.
+	 * @return
+	 */
+	public boolean isBGR();
+	
+	/**
+	 * Returns true if the color interpretation is RGB, that is, the 
+	 * three first bands of the image are Red, Green and Blue.
+	 * @return
+	 */
+	public boolean isRGB();
+	
+	/**
+	 * Returns true if the color interpretation is ARGB, that is, the 
+	 * four first bands of the image are Red, Green, Blue and Alpha.
+	 * @return
+	 */
+	public boolean isRGBA();
+	
+	/**
+	 * Returns true if the color interpretation is Palette
+	 * @return
+	 */
+	public boolean isPalette();
+	
+	/**
+	 * Returns true if the selected band has red, green or blue interpretation and false otherwise
+	 * @param band
+	 * @return
+	 */
+	public boolean isColorInterpretation(int band);
+	
+	/**
+	 * Returns true if the selected band has gray interpretation and false otherwise
+	 * @param band
+	 * @return
+	 */
+	public boolean isGrayInterpretation(int band);
+	
+	/**
+	 * Returns true if the selected band has alpha interpretation and false otherwise
+	 * @param band
+	 * @return
+	 */
+	public boolean isAlphaInterpretation(int band);
+	
+	/**
+	 * Obtiene el valor de interpretaci�n de color de la entrada i. 
+	 * @param i N�mero de entrada
+	 * @return interpretaci�n de color para la entrada solicitada
+	 */
+	public String get(int i);
+	
+	/**
+	 * Obtiene la posici�n de la banda que contiene el identificador pasado por par�metro 
+	 * o -1 si no tiene dicho identificador.
+	 * @return Posici�n de la banda que contiene el identificador o -1 si no lo tiene.
+	 */
+	public int getBand(String id);
+	
+	/**
+	 * Consulta si la interpretaci�n de color est� por definir en la imagen.
+	 * @return true si no hay interpretaci�n de color definida y false si la hay
+	 */
+	public boolean isUndefined();
+	
+	/**
+	 * Inicializa el vector de cadenas que contendr�n el nombre de la interpretaci�n 
+	 * de color asignada a cada banda. Este valor es el devuelto por la imagen.
+	 * @param values N�mero de valores
+	 */
+	public void initColorInterpretation(int values);
+	
+	/**
+	 * Obtiene los valores de la interpretaci�n de color
+	 * @return String[]
+	 */
+	public String[] getValues();
+	
+	/**
+	 * Returns true if one band has the "Alpha" label
+	 * @return
+	 */
+	public boolean hasAlphaBand();
+	
+	/**
+	 * Returns the number of band with the label "Alpha"
+	 * @return
+	 */
+	public int getAlphaBand();
+	
+	/**
+	 * A�ade un objeto DatasetColorInterpretation al actual. El resultado es la suma 
+	 * de ambos.
+	 * @param ci
+	 */
+	public void addColorInterpretation(ColorInterpretation ci);
+	
+	/**
+	 * Returns an array with bands to render reading values of this color
+	 * interpretation object. Each element in the array represents band in the destination buffer
+	 * . The value in this position represents the source band which will be write 
+	 * in the destination buffer 
+	 * @return
+	 */
+	public int[] buildRenderBands();
+	
+	/**
+	 * Clones this object
+	 * @return
+	 */
+	public ColorInterpretation cloneColorInterpretation();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorInterpretation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorTable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorTable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorTable.java	(revision 15423)
@@ -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.fmap.dal.coverage.store.props;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.tools.persistence.Persistent;
+
+/**
+ * Interfaz que representa una tabla de color.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface ColorTable extends Persistent {
+	
+	/**
+	 * Obtiene el nombre de la paleta
+	 * @return Nombre de la paleta
+	 */
+	public String getName();
+	
+	/**
+	 * Devuelve un ArrayList con cada ColorItem de la tabla de color
+	 * @return
+	 */
+	public List<ColorItem> getColorItems();
+	
+	/**
+	 * Asigna el nombre de la paleta
+	 * @param Nombre de la paleta
+	 */
+	public void setName(String name);
+	
+	/**
+	 * Crea una paleta a traves de una lista de colores y se le puede especificar
+	 * si queremos que la comprima o no.
+	 * @param colorItems
+	 * @param compress
+	 */
+	public void createPaletteFromColorItems(List<ColorItem> colorItems, boolean compress);
+	
+	/**
+	 * Definir si la paleta tendra los valores interpolados o no
+	 * @param interpolated
+	 */
+	public void setInterpolated(boolean interpolated);
+	
+	/**
+	 * Nos indica si la paleta la ha generado con valores interpolados o no.
+	 * @return
+	 */
+	public boolean isInterpolated();
+	
+	/**
+	 * Obtiene la tabla de color por banda
+	 * @return Paleta
+	 */
+	public byte[][] getColorTableByBand();
+	
+	/**
+	 * Obtiene el flag de paleta activa o desactivada.
+	 * @return true la paleta est� activa y false desactiva
+	 */
+	public boolean isPaletteActive();
+
+	/**
+	 * Asigna el flag de paleta activa o desactivada.
+	 * @param paletteActive true activa la paleta false la desactiva
+	 */
+	public void setPaletteActive(boolean paletteActive);
+	
+	/**
+	 * Obtiene el valor RGB para un clave entera pasada por par�metro
+	 * @param value clave de la cual se quiere obtener el valor RGB de la paleta
+	 * @return valor RGB
+	 */
+	public byte[] getRGBAByBand(double value);
+	
+	/**
+	 * Returns true if this table contains at least one entry
+	 * with an alpha value
+	 * @return
+	 */
+	public boolean hasAlpha();
+	
+	/**
+	 * Establece la tabla de color actual en los rangos de limite especificados
+	 * por parametros, distribuyendolo proporcionalmente.
+	 * @param min
+	 * @param max
+	 * @param compress
+	 */
+	public void createColorTableInRange(double min, double max, boolean compress);
+	
+	/**
+	 * Borra valores duplicados de la paleta. Solo aquellos que coincidan en valor
+	 * y color.
+	 */
+	public void removeDuplicatedValues();
+	
+	/**
+	 * Comprime la actual tabla de color
+	 */
+	public void compressPalette();
+	
+	/**
+	 * Informa de si una tabla de color se puede comprimir
+	 * @return
+	 */
+	public boolean isCompressible();
+	
+	/**
+	 * Clones this object
+	 * @return
+	 */
+	public Object clone();
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/ColorTable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/TimeSeries.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/TimeSeries.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/TimeSeries.java	(revision 15423)
@@ -0,0 +1,128 @@
+/* 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.store.props;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+
+import org.gvsig.timesupport.Time;
+
+/**
+ * This interfaz represents a list of serials of raster data
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface TimeSeries {
+	
+	/**
+	 * Selects the serial
+	 * @param name
+	 */
+	public void selectSerial(String name);
+	
+	/**
+	 * Selects the serial
+	 * @param pos
+	 */
+	public void selectSerial(int pos);
+	
+	/**
+	 * Sets the description
+	 * @return
+	 */
+	public void setDescription(String description);
+	
+	/**
+	 * Gets the serial name
+	 * @return
+	 */
+	public String getName();
+	
+	/**
+	 * Sets the serial name
+	 * @return
+	 */
+	public void setName(String name);
+	
+	/**
+	 * Gets the description
+	 * @return
+	 */
+	public String getDescription();
+	
+	/**
+	 * Creates the serial time using a Time object from org.gvsig.timesupport
+	 * @param time
+	 * @throws ParseException 
+	 */
+	public void createNewTime(Time time) throws ParseException;
+	
+	/**
+	 * Creates a new single value for the time 
+	 * @param value
+	 * @throws ParseException
+	 */
+	public void createNewTimeValue(String value) throws ParseException;
+	
+	/**
+	 * Creates a pair of values for the time. This will represent a interval
+	 * @param dateA
+	 * @param dateB
+	 * @throws ParseException
+	 */
+	public void createNewTimeInterval(String dateA, String dateB) throws ParseException;
+	
+	/**
+	 * Creates a new single value for the time. This method forces the use of 
+	 * the numeric type.
+	 * @param value
+	 * @throws ParseException
+	 */
+	public void createNewTimeValue(double value) throws ParseException;
+	
+	/**
+	 * Creates a pair of values for the time. This will represent a interval. This method 
+	 * forces the use of the numeric type.
+	 * @param dateA
+	 * @param dateB
+	 * @throws ParseException
+	 */
+	public void createNewTimeInterval(double a, double b) throws ParseException;
+	
+	/**
+	 * Removes all date intervals
+	 */
+	public void removeIntervals();
+	
+	/**
+	 * Counts the number of serials
+	 * @return
+	 */
+	public int getNumberOfSerials();
+	
+	/**
+	 * Gets the list of times. The array could be a list of Date objects or Double objects
+	 * depending on the time of time. 
+	 * @return
+	 */
+	public ArrayList<?> getTimeList();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/TimeSeries.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Transparency.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Transparency.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Transparency.java	(revision 15423)
@@ -0,0 +1,212 @@
+/* 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.store.props;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+import org.gvsig.tools.dispose.Disposable;
+
+
+/**
+ * <P>Interfaz que representa la transparencia.</P>
+ * 
+ * <P>
+ * El estado de transparencia de un raster puede verse modificado desde los siguientes sitios:
+ * <UL>
+ * <LI>Color con transparencia definido en los metadatos de la imagen. Caracteristica de PNG.</LI>
+ * <LI>Una banda del raster definida como banda de transparencia. PNGs, IMGs o TIFFs 
+ * pueden tener bandas de transparencia</LI>
+ * <LI>Tablas de color con valores de transparencia. GIF y PNG pueden tener tablas 
+ * que definan entradas de color con transparencia</LI>
+ * <LI>Informaci�n de transparencia en la cabecera raster. Tipicamente valores NO_DATA suelen 
+ * ser interpretados como transparentes en la visualizaci�n.</LI>
+ * <LI>Modificaci�n hecha por el usuario. En la visualizaci�n un usuario puede necesitar
+ * asignar valores o rangos de valores como transparentes.</LI>
+ * </UL> 
+ * </P>
+ * <P>
+ * Estas transparencias quedan representadas por cinco tipo b�sicos:
+ * <UL>
+ * <LI><b>Transparencia por rangos. </b>Esta se aplicar� antes que ninguna y siempre sobre los valores
+ * base del raster.</LI>
+ * <LI><b>Banda de transparencia en un raster. </b></LI>
+ * <LI>M�scara de transparencia</LI>
+ * <LI>Opacidad</LI>
+ * <LI>Zona de recorte</LI>
+ * </UL>
+ * </P>
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Transparency extends Disposable {
+	/**
+	 * Asigna un listener a la lista que ser� informado cuando cambie una
+	 * propiedad visual en la renderizaci�n.
+	 * @param listener VisualPropertyListener
+	 */
+	public void addPropertyListener(PropertyListener listener);
+	
+	/**
+	 * Asigna la informaci�n de si existe o no banda de transparencia cuando este
+	 * objeto va asociado a un dataset. Si tiene este tipo de banda en cada
+	 * dibujado se cargar� la informaci�n de m�scara de transparencia en el la
+	 * variable mask.
+	 * @param true si existe banda de transparencia y false si no lo es.
+	 */
+	public void setTransparencyBand(int alphaBandNumber);
+	
+	/**
+	 * Obtiene el grado de opacidad de todo el raster
+	 * @return valor del grado de opacidad.
+	 */
+	public int getOpacity();
+	
+	/**
+	 * Asigna el grado de opacidad de todo el raster
+	 * @param opacity valor del grado de opacidad.
+	 */
+	public void setOpacity(int opacity);
+	
+	/**
+	 * Obtiene la banda de transpareci si existe o -1 si no existe.
+	 * @return n�mero de banda de transparencia o -1 si no existe.
+	 */
+	public int getAlphaBandNumber();
+	
+	/**
+	 * Obtiene los rangos de pixels que son transparentes en el raster.
+	 * @return Rangos de transparencias a aplicar
+	 */
+	public List<TransparencyRange> getTransparencyRange();
+	
+	/**
+	 * Asigna la lista de rangos de transparencia
+	 * @param ranges
+	 */
+	public void setTransparencyRangeList(List<TransparencyRange> ranges);
+	
+	/**
+	 * Obtiene el valor noData 
+	 * @return
+	 */
+	public NoData getNoData();
+	
+	/**
+	 * Obtiene el �rea de datos
+	 * @return M�scara de transparencia
+	 */
+	public Buffer getDataBuffer();
+	
+	/**
+	 * Obtiene la informaci�n de si existe o no banda de transparencia cuando este
+	 * objeto va asociado a un dataset. Si tiene este tipo de banda en cada
+	 * dibujado se cargar� la informaci�n de m�scara de transparencia en el la
+	 * variable mask.
+	 * @return true si existe banda de transparencia y false si no lo es.
+	 */
+	public boolean existAlphaBand();
+	
+	/**
+	 * Asigna el �rea de datos
+	 * @param b
+	 */
+	public void setDataBuffer(Buffer b);
+	
+	/**
+	 * Asigna el valor noData
+	 * @param noData
+	 */
+	public void setNoData(NoData noData);
+	
+	/**
+	 * Inicializa la lista de rangos de transparencia.
+	 */
+	public void clearListOfTransparencyRange();
+	
+	/**
+	 * Asigna un rango de pixels que son transparentes en el raster.
+	 * @param range
+	 */
+	public void setTransparencyRange(TransparencyRange range);
+	
+	/**
+	 * Comprueba si hay criterios para la aplicaci�n de transparencia y la activa si es
+	 * as� sino se desactiva. Los criterios son:
+	 * <P>
+	 * Que haya una mascara de transparencia.
+	 * </P><P>
+	 * Que exista un buffer de datos para la aplicaci�n de nodata
+	 * </P><P>
+	 * Que hayan reglas sobre la aplicaci�n de transparencia.
+	 * </P><P>
+	 * Que la opacidad sea distita de 255 (completamente opaco). 
+	 * </P>
+	 */
+	public void activeTransparency();
+	
+	
+	/**
+	 * Obtiene el flag de transparencia activa o desactivada.
+	 * @return true la transparencia est� activa y false desactiva
+	 */
+	public boolean isTransparencyActive();
+	
+	/**
+	 * Asigna el flag de transparencia activa o desactivada.
+	 * @param transparencyActive true activa la transparencia false la desactiva
+	 */
+	public void setTransparencyActive(boolean transparencyActive);
+	
+	/**
+	 * Aplica las reglas de transparencia a un pixel RGB y devuelve el valor de ese
+	 * mismo pixel con la transparencia aplicada. Primero procesar� los rangos. Si
+	 * el pixel est� en alguno directamente lo pone transparente y lo devuelve, sino
+	 * comprueba si existe banda de transparencia y si es as� la aplica.
+	 * @param rgb
+	 * @param line
+	 * @param col
+	 * @return
+	 */
+	public int processRGB(int r, int g, int b, int line, int col, Buffer buf);
+	
+	/**
+	 * Sets the band color interpretation 
+	 * @param colorInterpretation
+	 */
+	public void setColorInterpretation(ColorInterpretation colorInterpretation);
+	
+	/**
+	 * Gets the color interpretation
+	 * @return
+	 */
+	public ColorInterpretation getColorInterpretation();
+	
+	/**
+	 * Clones this object
+	 * @return
+	 */
+	public Transparency cloneTransparency();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Transparency.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Statistics.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Statistics.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Statistics.java	(revision 15423)
@@ -0,0 +1,248 @@
+/* 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.store.props;
+
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+
+/**
+ * Interfaz a implementar por las clases que ofrecen estadisticas raster.
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Statistics {
+	
+	/**
+	 * Sets the number of values by band
+	 * @param values
+	 */
+	public void setNumberOfValues(long[] values);
+	
+	/**
+	 * Gets the number of values by band
+	 * @return
+	 */
+	public long[] getNumberOfValues();
+	
+	/**
+	 * Devuelve una lista con los m�ximos de todas las bandas
+	 * @return Valor m�ximo
+	 */
+	public double[] getMax();
+	
+	/**
+	 * Obtiene el valor del segundo m�ximo
+	 * @return Valor del segundo m�ximo
+	 */
+	public double[] getSecondMax();
+	
+	/**
+	 * Obtiene el valor del segundo m�nimo
+	 * @return Valor del segundo m�nimo
+	 */
+	public double[] getSecondMin();
+	
+	/**
+	 * Devuelve el m�ximo valor de todos los m�ximos de las bandas
+	 * @return M�ximo
+	 */
+	public double getMaximun();
+	
+	/**
+	 * Devuelve el m�nimo valor de todos los m�nimos de las bandas
+	 * @return M�ximo
+	 */
+	public double getMinimun();
+
+	/**
+	 * Devuelve el m�ximo valor RGB de todos los m�ximos de las bandas
+	 * @return M�ximo
+	 */
+	public double getMaximunByteUnsigned();
+	
+	/**
+	 * Devuelve el m�nimo valor RGB de todos los m�nimos de las bandas
+	 * @return M�ximo
+	 */
+	public double getMinimunByteUnsigned();
+
+	/**
+	 * Obtiene el valor m�dio
+	 * @return Valor medio
+	 */
+	public double[] getMean();
+
+	/**
+	 * Devuelve una lista con los m�nimos de todas las bandas
+	 * @return Valor m�nimo
+	 */
+	public double[] getMin();
+	
+	/**
+	 * Obtiene el m�nimo cuando el raster es de typo byte RGB
+	 * @return
+	 */
+	public double[] getMinByteUnsigned();
+	
+	/**
+	 * Obtiene el m�ximo cuando el raster es de typo byte RGB
+	 * @return
+	 */
+	public double[] getMaxByteUnsigned();
+	
+	/**
+	 * Obtiene el segundo m�ximo cuando el raster es de typo byte RGB
+	 * @return
+	 */
+	public double[] getSecondMaxByteUnsigned();
+
+	/**
+	 * Obtiene el segundo m�nimo cuando el raster es de typo byte RGB
+	 * @return
+	 */
+	public double[] getSecondMinByteUnsigned();
+
+	/**
+	 * Obtiene la varianza
+	 * @return Varianza
+	 */
+	public double[] getVariance();
+	
+	/**
+	 * Gets the number of bands
+	 * @return
+	 */
+	public int getBandCount();
+	
+	/**
+	 * Sets the number of bands
+	 * @param bandCount
+	 */
+	public void setBandCount(int bandCount);
+	
+	/**
+	 * Asigna un valor de recorte de colas para un porcentaje dado. El valor ser� un array 
+	 * bidimensional ([N�mero de bandas][2]) donde para cada banda se almacena el valor en
+	 * esa posici�n del recorte de colas. Este recorte consiste en ordenar los elementos del 
+	 * raster (o una muestra de ellos) y devolver el valor que corresponde al porcentaje comenzando
+	 * desde el principio del array ordenado y desde el final de �l (m�nimo y m�ximo).
+	 * @param percent Porcentaje de recorte
+	 * @param valueByBand array bidimensional de enteros o doubles. Depende del tipo de dato del raster.
+	 */
+	public void setTailTrimValue(double percent, Object valueByBand);
+	
+	/**
+	 * Obtiene un valor de recorte de colas para un porcentaje dado. El valor ser� un array 
+	 * bidimensional ([N�mero de bandas][2]) donde para cada banda se almacena el valor en
+	 * esa posici�n del recorte de colas. Este recorte consiste en ordenar los elementos del 
+	 * raster (o una muestra de ellos) y devolver el valor que corresponde al porcentaje comenzando
+	 * desde el principio del array ordenado y desde el final de �l (m�nimo y m�ximo).
+	 * @param percent Porcentaje de recorte
+	 * @param valueByBand array bidimensional de enteros o doubles. Depende del tipo de dato del raster.
+	 */
+	public Object getTailTrimValue(double percent);
+	
+	/**
+	 * Obtiene un valor de recorte de colas para una posici�n dada. El valor ser� un array 
+	 * bidimensional ([N�mero de bandas][2]) donde para cada banda se almacena el valor en
+	 * esa posici�n del recorte de colas. Este recorte consiste en ordenar los elementos del 
+	 * raster (o una muestra de ellos) y devolver el valor que corresponde al porcentaje comenzando
+	 * desde el principio del array ordenado y desde el final de �l (m�nimo y m�ximo).
+	 * @param percent Porcentaje de recorte
+	 * @param valueByBand array bidimensional de enteros o doubles. Depende del tipo de dato del raster.
+	 */
+	public Object[] getTailTrimValue(int pos);
+	
+	/**
+	 * Devuelve el n�mero de valores de recorte de colas calculados.
+	 * @return N�mero de valores de recorte de colas calculados.
+	 */
+	public int getTailTrimCount();
+	
+	/**
+	 * Obtiene el flag que informa de si las estad�sticas est�n calculadas o no.
+	 * @return true indica que est�n calculadas y false que no lo est�n
+	 */
+	public boolean isCalculated();
+	
+	/**
+	 * Asigna el flag de estad�sticas calculadas.
+	 * @param calc
+	 */
+	public void setCalculated(boolean calc);
+	
+	/**
+	 * Cuando se llama a este m�todo fuerza que la siguiente petici�n de estad�sticas 
+	 * no sea le�da de RMF y sean recalculadas por completo.
+	 * @param forceToRecalc
+	 */
+	public void forceToRecalc();
+	
+	/**
+	 * Obtiene el porcentaje de progreso del proceso de calculo de histograma
+	 * @return porcentaje de progreso
+	 */
+	public int getPercent();
+	
+	/**
+	 * Pone a cero el porcentaje de progreso del proceso de calculo de histograma
+	 */
+	public void resetPercent();
+	
+	/**
+	 * Throws the thread which figure out statistics
+	 * @throws FileNotOpenException
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 */
+	public void calculate(double scale) throws FileNotOpenException, RasterDriverException, ProcessInterruptedException;
+
+	/**
+	 * Calculo de estadisticas avanzadas (Matriz varianza- covarianza).
+	 */
+	public void calculateAdvanced() throws GridException;
+
+	/**
+	 * Returns true if the advanced statistics are calculated and false if not
+	 * @return
+	 */
+	public boolean isAdvancedStatisticsCalculated();
+	
+	/**
+	 * Gets the number of pixels by band
+	 */
+	public long[] getNumberOfCells();
+
+	/**
+	 * Devuelve la matriz de varianza-covarianza, si no se encuentra calculada se calcula
+	 * @retrun Matriz de varianza-covarianza
+	 */
+	public double[][] getVarianceCovarianceMatrix();
+
+	/**
+	 * Clones this object
+	 * @return
+	 */
+	public Statistics cloneStatistics();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Statistics.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/HistogramComputer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/HistogramComputer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/HistogramComputer.java	(revision 15423)
@@ -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.fmap.dal.coverage.store.props;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.process.IncrementableTask;
+
+/**
+ * Interfaz para la gesti�n de histogramas de un raster. Es la encargada del calculo de un histograma
+ * total o parcial de un raster a partir de los datos de disco. Adem�s tambi�n es la encargada de gestionar
+ * salvar este histograma a .rmf. En caso de que solicite un histograma del raster completo este ir�
+ * a buscarlo al fichero rmf asociado antes de calcularlo por si ya existise. Al realizar el calculo
+ * del histograma de la imagen completa este ser� salvado en el fichero .rmf asociado al raster.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface HistogramComputer extends IncrementableTask {
+	
+	/**
+	 * Obtiene el minimo valor de las estadisticas de un histograma.
+	 * @return double
+	 */
+	public double getMinimum();
+
+	/**
+	 * Obtiene el maximo valor de las estadisticas de un histograma.
+	 * @return double
+	 */
+	public double getMaximum();
+	
+	/**
+	 * Obtiene el histograma. Si puede conseguirlo del fichero rmf ir� all� a 
+	 * buscarlo sino lo calcular�.
+	 * @return histograma 
+	 */
+	public BufferHistogram getBufferHistogram() throws HistogramException, ProcessInterruptedException;
+
+	/**
+	 * Pone a cero el porcentaje de progreso del proceso de calculo de histograma
+	 */
+	public void resetPercent();
+	
+	/**
+	 * Force to recalculate the histogram next time that the method getBufferHistogram
+	 * be called 
+	 */
+	public void refreshHistogram();
+	
+	/**
+	 * This value represents the percentage of the image that will be used 
+	 * for this process. The default value is one, that means that the entire 
+	 * image will be processed
+	 */
+	public void setScaleHistogram(double scale);
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/HistogramComputer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.store.props package documentation</title>
+</head>
+<body>
+
+	<p>Classes which represents store properties like transparency, metadata, color interpretation, histogram or others</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/BasicStats.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/BasicStats.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/BasicStats.java	(revision 15423)
@@ -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.fmap.dal.coverage.store.props;
+
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+
+
+/**
+ * Interfaz a implementar por las clases que ofrecen estadisticas raster.
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface BasicStats {
+	/**
+	 * Calcula las estadisticas recorriendo todo el fichero.
+	 */
+	public void calcFullStatistics()throws FileNotOpenException, RasterDriverException, InterruptedException;
+	
+	/**
+	 * Obtiene el valor m�ximo del grid
+	 * @return Valor m�ximo
+	 * @throws BandAccessException 
+	 */
+	public double getMaxValue() throws BandAccessException;
+
+	/**
+	 * Obtiene el valor m�dio del grid
+	 * @return Valor medio
+	 * @throws BandAccessException 
+	 */
+	public double getMeanValue() throws BandAccessException;
+
+	/**
+	 * Obtiene el valor m�ximo del grid
+	 * @return Valor m�nimo
+	 * @throws BandAccessException 
+	 */
+	public double getMinValue() throws BandAccessException;
+
+	/**
+	 * Consulta si las estadisticas han sido calculadas o no.
+	 * @return true si las estadisticas del grid est�n calculadas y false si no lo est�n 
+	 */
+	public boolean isCalculated();
+	
+	/**
+	 * Obtiene la varianza
+	 * @return Varianza
+	 * @throws BandAccessException 
+	 */
+	public double getVarianceValue() throws BandAccessException;
+	
+	/**
+	 * Asigna la banda sobre la que se realizan las operaciones. Por defecto es la banda 0
+	 * con lo que para el uso de MDTs no habr� que modificar este valor.
+	 * @param band Banda sobre la que se realizan las operaciones.
+	 */
+	public void setBandToOperate(int band);
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/BasicStats.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Metadata.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Metadata.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Metadata.java	(revision 15423)
@@ -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.fmap.dal.coverage.store.props;
+
+
+
+
+/**
+ * Interfaz que representa un conjunto de metadatos de un raster.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Metadata {
+
+	/**
+	 * Inicializa los valores no data;
+	 * @param values
+	 */
+	public void initNoDataByBand(int values);
+
+	/**
+	 * Asigna un valor para el valor noData por banda
+	 * @param band Banda
+	 * @param value valor
+	 */
+	public void setNoDataValue(int band, double value);
+
+	/**
+	 * Devuelve el valor NoData para una banda en concreto.
+	 * @param band
+	 * @return
+	 */
+	public double getNoDataValue(int band);
+
+	/**
+	 * Devuelve el valor NoData en forma de array.
+	 * @return
+	 */
+	public double[] getNoDataValue();
+	
+	/**
+	 * Obtiene los metadatos en forma de vector de cadenas
+	 * @return Vector de cadenas en el que cada cadena es atributo=valor
+	 */
+	public String[] getMetadataString();
+
+	/**
+	 * Devuelve si el valor NoData esta activo
+	 * @return
+	 */
+	public boolean isNoDataEnabled();
+
+	/**
+	 * Establece si el valor NoData esta activo
+	 * @param noDataEnabled
+	 */
+	public void setNoDataEnabled(boolean noDataEnabled);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/store/props/Metadata.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidAccessException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidAccessException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidAccessException.java	(revision 15423)
@@ -0,0 +1,37 @@
+/* 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.exception;
+
+/**
+ * Excepci�n lanzada cuando se detecta un acceso a un tipo de datos incorrecto
+ * en un RasterBuffer.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterBufferInvalidAccessException extends Exception{
+
+	private static final long serialVersionUID = -3065331336250589153L;
+
+	public RasterBufferInvalidAccessException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidAccessException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/GridException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/GridException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/GridException.java	(revision 15423)
@@ -0,0 +1,49 @@
+/* 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.exception;
+
+/**
+ * Excepci�n lanzada por un grid cuando tiene un error general de acceso a 
+ * datos o a alguna propiedad con valor/es inconsistente/s.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GridException extends Exception{
+	private static final long serialVersionUID = 7412405741078802490L;
+
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public GridException(String msg){
+		super(msg);
+	}
+	
+	/**
+	 * Constructor. Asigna el texto de la excepci�n y la excepci�n generica.
+	 * @param msg
+	 */
+	public GridException(String msg, Exception e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/GridException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OperationNotSupportedException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OperationNotSupportedException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OperationNotSupportedException.java	(revision 15423)
@@ -0,0 +1,43 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n producida cuando la operaci�n seleccionada no est� soportada
+ * por ese objeto.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class OperationNotSupportedException extends BaseException {
+	private static final long serialVersionUID = 1557651260026647067L;
+	private static final String MESSAGE_KEY = "operation_not_supported_exception";
+
+	public OperationNotSupportedException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public OperationNotSupportedException(String msg, Exception e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OperationNotSupportedException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ROIException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ROIException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ROIException.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.exception;
+/**
+ * This exception is thrown when a ROI fails
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ROIException extends Exception {
+	private static final long serialVersionUID = 666908550965442025L;
+
+	public ROIException(String msg, Throwable e) {
+		super(msg, e);
+	}
+	
+	public ROIException(String msg) {
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ROIException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ConnectException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ConnectException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ConnectException.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.exception;
+/**
+ * This exception is thrown when a connect operation fails
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ConnectException extends Exception {
+	private static final long serialVersionUID = 1;
+
+	public ConnectException(String msg, Throwable e) {
+		super(msg, e);
+	}
+	
+	public ConnectException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ConnectException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/HistogramException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/HistogramException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/HistogramException.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.exception;
+/**
+ * Excepci�n lanzada por errores en el calculo de histogramas.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class HistogramException extends Exception {
+	private static final long serialVersionUID = 666908550965442025L;
+
+	public HistogramException(String msg, Throwable e) {
+		super(msg, e);
+	}
+	
+	public HistogramException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/HistogramException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BufferCreationException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BufferCreationException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BufferCreationException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * This exception is thrown when the application fails creating a buffer
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class BufferCreationException extends BaseException {
+	private static final long serialVersionUID = 337663732071639106L;
+	private static final String MESSAGE_KEY = "buffer_creation__exception";
+
+	public BufferCreationException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public BufferCreationException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BufferCreationException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilePaletteException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilePaletteException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilePaletteException.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * This exception is thrown when the palette file has problems
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FilePaletteException extends BaseException {
+	private static final long     serialVersionUID         = 337663732071639106L;
+	public static String          MESSAGE_FILENOTFOUND     = "Palette file not found";
+	public static String          MESSAGE_FILEFORMATERROR  = "Error in palette file format";
+
+	public FilePaletteException(String msg) {
+		super(msg, null, null, serialVersionUID);
+	}
+	
+	public FilePaletteException(String msg, Throwable e) {
+		super(msg, e, null, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilePaletteException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterAddException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterAddException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterAddException.java	(revision 15423)
@@ -0,0 +1,49 @@
+/* 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.exception;
+
+/**
+ * Excepci�n lanzada por un filtro o proceso. Cuando es lanzada significa que 
+ * el filtro no puede ser a�adido.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FilterAddException extends Exception {
+	private static final long serialVersionUID = 5187136969233163574L;
+
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public FilterAddException(String msg){
+		super(msg);
+	}
+	
+	/**
+	 * Constructor. Asigna el texto de la excepci�n y la excepci�n generica.
+	 * @param msg
+	 */
+	public FilterAddException(String msg, Exception e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterAddException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.exception package documentation</title>
+</head>
+<body>
+
+	<p>Exceptions which are used in this library.</p>
+
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotExistsException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotExistsException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotExistsException.java	(revision 15423)
@@ -0,0 +1,36 @@
+/* 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.exception;
+
+/**
+ * Excepci�n producida cuando se intenta acceder a un fichero que no existe.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FileNotExistsException extends Exception{
+	private static final long serialVersionUID = -3022090543908771484L;
+
+	public FileNotExistsException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotExistsException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidException.java	(revision 15423)
@@ -0,0 +1,35 @@
+/* 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.exception;
+
+/**
+ * Excepci�n lanzada cuando se detecta que un buffer de raster es incorrecto.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterBufferInvalidException extends Exception{
+	private static final long serialVersionUID = -1566113755637911586L;
+
+	public RasterBufferInvalidException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterBufferInvalidException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ParsingException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ParsingException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ParsingException.java	(revision 15423)
@@ -0,0 +1,39 @@
+/* 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.exception;
+
+/**
+ * Excepci�n cuando se produce un error de parseo en la cadena XML de entrada
+ * a un read de un IRmfBlock. Todas los objetos que quieran leer xml de un bloque rmf
+ * podr�n hacerlo con su parser favorito pero tendr�n que lanzar excepciones de este tipo
+ * para que puedan ser gestionadas.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class ParsingException extends Exception{
+	private static final long serialVersionUID = 5365697240193452525L;
+
+	public ParsingException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ParsingException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessInterruptedException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessInterruptedException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessInterruptedException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n lanzada cuando se interrumpe un proceso
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ProcessInterruptedException extends BaseException {
+	private static final long serialVersionUID = 666908550965442025L;
+
+	public ProcessInterruptedException(Throwable e){
+		super(e.getMessage(), e, "", 0);
+	}
+	
+	public ProcessInterruptedException(String msg){
+		super(msg, "", 0);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessInterruptedException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandNotFoundInListException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandNotFoundInListException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandNotFoundInListException.java	(revision 15423)
@@ -0,0 +1,36 @@
+/* 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.exception;
+
+/**
+ * Excepci�n cuando una banda no se encuentra en una lista en la
+ * que se est� buscando y dicha falta constituye una situaci�n de
+ * error.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class BandNotFoundInListException extends Exception{
+	final private static long serialVersionUID = 0;
+	public BandNotFoundInListException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandNotFoundInListException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSourceException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSourceException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSourceException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * This exception is thrown when the data source is not valid
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class InvalidSourceException extends BaseException {
+	private static final long serialVersionUID = 337663732071639106L;
+	private static final String MESSAGE_KEY = "invalid_source__exception";
+
+	public InvalidSourceException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public InvalidSourceException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSourceException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/MosaicNotValidException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/MosaicNotValidException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/MosaicNotValidException.java	(revision 15423)
@@ -0,0 +1,39 @@
+/* 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.exception;
+
+/**
+ * Excepci�n que se lanza cuando se est� intentando generar un mosaico con
+ * datasets no validos. Esto puede ocurrir por distintos motivos como, que no
+ * sean contiguos los extends, que no sea posible formar una matriz de NXM, que no 
+ * tengan igual tama�o de pixel, etc...
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class MosaicNotValidException extends Exception{
+	private static final long serialVersionUID = 7401956202923548194L;
+
+	public MosaicNotValidException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/MosaicNotValidException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterDriverException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterDriverException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterDriverException.java	(revision 15423)
@@ -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.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.exception;
+
+import org.gvsig.fmap.dal.exception.DataException;
+
+/**
+ * Excepci�n lanzada por un driver de raster. Cada driver concreto tiene su propio
+ * tipo de excepciones GdalException, MrsSIDException, JNCSFileException ... 
+ * Estas son lanzadas hacia el nivel superior como una sola si no pueden ser gestionadas 
+ * en el nivel dataset.io.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterDriverException extends DataException {
+	private static final long serialVersionUID = 7412405741078802490L;
+	private static final String MESSAGE_KEY = "raster_driver_exception";
+
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public RasterDriverException(String msg){
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	/**
+	 * Constructor. Asigna el texto de la excepci�n y la excepci�n generica.
+	 * @param msg
+	 */
+	public RasterDriverException(String msg, Exception e){
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterDriverException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RemoteServiceException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RemoteServiceException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RemoteServiceException.java	(revision 15423)
@@ -0,0 +1,100 @@
+/* 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.exception;
+
+/**
+ * This exception is thrown by a remote service
+ *
+ * @author Vicente Caballero Navarro
+ */
+public class RemoteServiceException extends Exception {
+	private static final long serialVersionUID = 1L;
+	
+	public RemoteServiceException() {
+		super();
+	}
+
+	/**
+	 * Crea RemoteServiceException.
+	 *
+	 * @param message
+	 */
+	public RemoteServiceException(String message) {
+        super(message);
+	}
+
+	/**
+	 * Crea RemoteServiceException.
+	 *
+	 * @param message
+	 * @param cause
+	 */
+	public RemoteServiceException(String message, Throwable cause) {
+		super(format(message, 200), cause);
+	}
+
+	/**
+	  * Crea RemoteServiceException.
+	 *
+	 * @param cause
+	 */
+	public RemoteServiceException(Throwable cause) {
+		super(cause);
+	}
+    
+    /**
+     * 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.
+     */
+    private 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;
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RemoteServiceException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImportMapContextException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImportMapContextException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImportMapContextException.java	(revision 15423)
@@ -0,0 +1,57 @@
+/* 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.exception;
+/**
+ * Exception representing an error in the process of importing a Web Map Context
+ * file into gvSIG.<br><br>
+ *
+ * The error can be critical or not defining if the process can be finished with the
+ * intervention of the user of otherwise it is impossible.<br><br>
+ *
+ * You should check the <b>isCritical()</b> method in order to know if you can continue
+ * importing data or not. If the answer of this method is <b>true</b>, aborting the
+ * process is strongly encouraged; or execute further instructions at your own risk.
+ *
+ * @author jaume dominguez faus - jaume.dominguez@iver.es
+ *
+ */
+public class ImportMapContextException extends Exception {
+	private static final long serialVersionUID = 1L;
+	private boolean critical;
+
+	public ImportMapContextException(String message, boolean critical) {
+		super(message);
+		this.critical = critical;
+	}
+
+	/**
+	 * If <b>true</b> then the elements could be created but with inconsistent values that
+	 * the user can fix modifying its properties. <br><br>
+	 *
+	 * If <b>false</b> then it is not possible to create the elements.
+	 * @return
+	 */
+	public boolean isCritical() {
+		return critical;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImportMapContextException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessException.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.exception;
+/**
+ * This exception is thrown when a process fails
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ProcessException extends Exception {
+	private static final long serialVersionUID = 666908550965442025L;
+
+	public ProcessException(String msg, Throwable e) {
+		super(msg, e);
+	}
+	
+	public ProcessException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ProcessException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RmfSerializerException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RmfSerializerException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RmfSerializerException.java	(revision 15423)
@@ -0,0 +1,49 @@
+/* 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.exception;
+/**
+ * Excepci�n lanzada por los serializadores de los ficheros RMF. Este
+ * se produce cuando no se puede escribir en un RMF o ha sucedido alg�n
+ * error en su acceso.
+ * 
+ * @version 22/07/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class RmfSerializerException extends Exception{
+	private static final long serialVersionUID = -7057372890577482969L;
+
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public RmfSerializerException(String msg){
+		super(msg);
+	}
+	
+	/**
+	 * Constructor. Asigna el texto de la excepci�n y la excepci�n generica.
+	 * @param msg
+	 */
+	public RmfSerializerException(String msg, Exception e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RmfSerializerException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotFoundInListException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotFoundInListException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotFoundInListException.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n cuando un fichero no se encuentra en una lista en la
+ * que se est� buscando y dicha falta constituye una situaci�n de
+ * error.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FileNotFoundInListException extends BaseException {
+	private static final long serialVersionUID = 1557651260026647067L;
+	private static final String MESSAGE_KEY = "file_not_found_in_list_exception";
+
+	public FileNotFoundInListException(String msg) {
+		super(msg, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public FileNotFoundInListException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotFoundInListException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterManagerException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterManagerException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterManagerException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+/**
+ * This exception is thrown when a manager can't be instantiated
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FilterManagerException extends Exception {
+	private static final long serialVersionUID = 5187136969233163574L;
+
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public FilterManagerException(String msg){
+		super(msg);
+	}
+	
+	/**
+	 * Constructor. Asigna el texto de la excepci�n y la excepci�n generica.
+	 * @param msg
+	 */
+	public FilterManagerException(String msg, Exception e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterManagerException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/SupersamplingNotSupportedException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/SupersamplingNotSupportedException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/SupersamplingNotSupportedException.java	(revision 15423)
@@ -0,0 +1,67 @@
+/* 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.exception;
+
+/**
+ * Excepci�n que indica que un driver no soporta supersampling, es decir no se pueden
+ * tomar muestras del contenido de un pixel en distintas posiciones.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SupersamplingNotSupportedException extends Exception {
+	private static final long serialVersionUID = -7184403136518215947L;
+
+	/**
+	 * Constructor
+	 */
+	public SupersamplingNotSupportedException() {
+		super();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param message
+	 */
+	public SupersamplingNotSupportedException(String message) {
+		super(message);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param message
+	 * @param cause
+	 */
+	public SupersamplingNotSupportedException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param cause
+	 */
+	public SupersamplingNotSupportedException(Throwable cause) {
+		super(cause);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/SupersamplingNotSupportedException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotOpenException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotOpenException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotOpenException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n cuando se intenta acceder a un fichero que no ha sido abierto
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FileNotOpenException extends BaseException {
+	private static final long serialVersionUID = -6732162228052967671L;
+	private static final String MESSAGE_KEY = "file_not_open_exception";
+
+	public FileNotOpenException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public FileNotOpenException(String msg, Exception e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotOpenException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImplementationNotValidException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImplementationNotValidException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImplementationNotValidException.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n que se lanza cuando se espera una determinada implementaci�n de 
+ * un interfaz y hay otra diferente.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class ImplementationNotValidException extends BaseException {
+	private static final long serialVersionUID = 337663732071639106L;
+	private static final String MESSAGE_KEY = "implementation_not_valid_exception";
+
+	public ImplementationNotValidException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public ImplementationNotValidException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ImplementationNotValidException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandAccessException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandAccessException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandAccessException.java	(revision 15423)
@@ -0,0 +1,43 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n que se lanza cuando se intenta acceder a una banda que no existe o
+ * tiene problemas en acceder a sus datos.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class BandAccessException extends BaseException {
+	private static final long serialVersionUID = 337663732071639106L;
+	private static final String MESSAGE_KEY = "band_access__exception";
+
+	public BandAccessException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public BandAccessException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/BandAccessException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ColorTableException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ColorTableException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ColorTableException.java	(revision 15423)
@@ -0,0 +1,43 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * This exception is thrown when the palette file has problems
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class ColorTableException extends BaseException {
+	private static final long     serialVersionUID         = 337663732071639106L;
+	public static String          MESSAGE_NOTLOADED        = "The color table cannot be loaded";
+
+	public ColorTableException(String msg) {
+		super(msg, null, null, serialVersionUID);
+	}
+	
+	public ColorTableException(String msg, Throwable e) {
+		super(msg, e, null, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/ColorTableException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterTypeException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterTypeException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterTypeException.java	(revision 15423)
@@ -0,0 +1,49 @@
+/* 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.exception;
+
+/**
+ * Excepci�n lanzada por un filtro o proceso. Cuando es lanzada significa que los
+ * tipos de datos entre los filtros de la pila son incompatibles.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FilterTypeException extends Exception {
+	private static final long serialVersionUID = 5187136969233163574L;
+
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public FilterTypeException(String msg){
+		super(msg);
+	}
+	
+	/**
+	 * Constructor. Asigna el texto de la excepci�n y la excepci�n generica.
+	 * @param msg
+	 */
+	public FilterTypeException(String msg, Exception e){
+		super(msg, e);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FilterTypeException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TileReadingException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TileReadingException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TileReadingException.java	(revision 15423)
@@ -0,0 +1,43 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * This exception is thrown when a tile download or reading fails.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TileReadingException extends BaseException {
+	private static final long serialVersionUID = 337663732071639106L;
+	private static final String MESSAGE_KEY = "tile_access__exception";
+
+	public TileReadingException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public TileReadingException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TileReadingException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSetViewException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSetViewException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSetViewException.java	(revision 15423)
@@ -0,0 +1,43 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n se asigna una extensi�n a un fichero que no es correcta. Normalmente
+ * es porque nos hemos salido de la extensi�n.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class InvalidSetViewException extends BaseException {
+	private static final long serialVersionUID = 337663732071639106L;
+	private static final String MESSAGE_KEY = "invalid_set_view_exception";
+
+	public InvalidSetViewException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public InvalidSetViewException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InvalidSetViewException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TimeException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TimeException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TimeException.java	(revision 15423)
@@ -0,0 +1,40 @@
+/* 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.exception;
+
+/**
+ * This exception is thrown when a problem with a date or an hour occurs.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class TimeException extends Exception{
+	private static final long serialVersionUID = 5365697240193452525L;
+
+	public TimeException(String msg){
+		super(msg);
+	}
+	
+	public TimeException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/TimeException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterException.java	(revision 15423)
@@ -0,0 +1,100 @@
+/* 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.exception;
+
+/**
+ * Base exception for raster problems
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterException extends Exception {
+	private static final long serialVersionUID = 1L;
+	
+	public RasterException() {
+		super();
+	}
+
+	/**
+	 * Crea RemoteServiceException.
+	 *
+	 * @param message
+	 */
+	public RasterException(String message) {
+        super(message);
+	}
+
+	/**
+	 * Crea RemoteServiceException.
+	 *
+	 * @param message
+	 * @param cause
+	 */
+	public RasterException(String message, Throwable cause) {
+		super(format(message, 200), cause);
+	}
+
+	/**
+	  * Crea RemoteServiceException.
+	 *
+	 * @param cause
+	 */
+	public RasterException(Throwable cause) {
+		super(cause);
+	}
+    
+    /**
+     * 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.
+     */
+    private 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;
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/CloneException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/CloneException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/CloneException.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.exception;
+/**
+ * This exception is thrown when a clone operation fails
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class CloneException extends Exception {
+	private static final long serialVersionUID = 1;
+
+	public CloneException(String msg, Throwable e) {
+		super(msg, e);
+	}
+	
+	public CloneException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/CloneException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InfoByPointException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InfoByPointException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InfoByPointException.java	(revision 15423)
@@ -0,0 +1,64 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.exception;
+
+/**
+ * This exception is thrown by a information by point service
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class InfoByPointException extends RasterException {
+	private static final long serialVersionUID = 1L;
+	
+	public InfoByPointException() {
+		super();
+	}
+
+	/**
+	 * Crea RemoteServiceException.
+	 *
+	 * @param message
+	 */
+	public InfoByPointException(String message) {
+        super(message);
+	}
+
+	/**
+	 * Crea RemoteServiceException.
+	 *
+	 * @param message
+	 * @param cause
+	 */
+	public InfoByPointException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	  * Crea RemoteServiceException.
+	 *
+	 * @param cause
+	 */
+	public InfoByPointException(Throwable cause) {
+		super(cause);
+	}
+   
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/InfoByPointException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotValidSourceException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotValidSourceException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotValidSourceException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n lanzada cuando la fuente de datos asignada no es valida
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class NotValidSourceException extends BaseException {
+	private static final long serialVersionUID = -3547608971095136520L;
+	private static final String MESSAGE_KEY = "not_valid_source_exception";
+
+	public NotValidSourceException(String msg, Throwable e){
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public NotValidSourceException(String msg){
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotValidSourceException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OutOfGridException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OutOfGridException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OutOfGridException.java	(revision 15423)
@@ -0,0 +1,35 @@
+/* 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.exception;
+
+/**
+ * Excepci�n lanzada cuando se detecta que un buffer de raster es incorrecto.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class OutOfGridException extends Exception{
+	private static final long serialVersionUID = -8164541183139611665L;
+
+	public OutOfGridException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OutOfGridException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotSupportedExtensionException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotSupportedExtensionException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotSupportedExtensionException.java	(revision 15423)
@@ -0,0 +1,43 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n cuando una extensi�n de fichero no est� soportada
+ * por la aplicaci�n.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class NotSupportedExtensionException extends BaseException {
+	private static final long serialVersionUID = -3547608971095136520L;
+	private static final String MESSAGE_KEY = "not_supported_extension_exception";
+
+	public NotSupportedExtensionException(String msg){
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public NotSupportedExtensionException(String msg, Exception e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/NotSupportedExtensionException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterLegendIONotFound.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterLegendIONotFound.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterLegendIONotFound.java	(revision 15423)
@@ -0,0 +1,31 @@
+/* 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.exception;
+/**
+ * Excepcion para tratar cuando no se encuentra un RasterLegend.
+ *
+ * @version 21/11/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class RasterLegendIONotFound extends Exception {
+	private static final long serialVersionUID = 5429047977555617941L;
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/RasterLegendIONotFound.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/QueryException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/QueryException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/QueryException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * This exception is thrown when a error occurs in a raster query
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class QueryException extends BaseException {
+	private static final long serialVersionUID = -6732162228052967671L;
+	private static final String MESSAGE_KEY = "query_error";
+
+	public QueryException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public QueryException(String msg, Exception e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/QueryException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotSupportedException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotSupportedException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotSupportedException.java	(revision 15423)
@@ -0,0 +1,43 @@
+/* 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.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * This exception is thrown when the file is not supported
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class FileNotSupportedException extends BaseException {
+	private static final long     serialVersionUID                 = 337663732071639106L;
+	public static String          MESSAGE_ROTATIONNOTSUPPORTED     = "Rotation not supported";
+
+	public FileNotSupportedException(String msg) {
+		super(msg, null, null, serialVersionUID);
+	}
+	
+	public FileNotSupportedException(String msg, Throwable e) {
+		super(msg, e, null, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/FileNotSupportedException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OverviewException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OverviewException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OverviewException.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.exception;
+/**
+ * This exception is thrown if there has been a problem building overviews.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class OverviewException extends Exception {
+	private static final long serialVersionUID = 1;
+
+	public OverviewException(String msg, Throwable e) {
+		super(msg, e);
+	}
+	
+	public OverviewException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/OverviewException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/WarpException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/WarpException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/WarpException.java	(revision 15423)
@@ -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.fmap.dal.coverage.exception;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Excepci�n lanzada por un proceso de reproyecci�n
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class WarpException extends BaseException {
+	private static final long serialVersionUID = 337663732071639106L;
+	private static final String MESSAGE_KEY = "warp_exception";
+
+	public WarpException(String msg, Throwable e) {
+		super(msg, e, MESSAGE_KEY, serialVersionUID);
+	}
+	
+	public WarpException(String msg) {
+		super(msg, null, MESSAGE_KEY, serialVersionUID);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/exception/WarpException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/package.html	(revision 15423)
@@ -0,0 +1,17 @@
+<?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.fmap.dal.coverage package documentation</title>
+</head>
+<body>
+
+	<p>Raster library API.</p>
+	
+	<p>
+	It allows to get new Raster and get their text.
+	</p>
+
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterException.java	(revision 15423)
@@ -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.fmap.dal.coverage;
+
+import org.gvsig.tools.exception.BaseException;
+
+/**
+ * Generic exception thrown in the Raster API when the exception or error
+ * may be dealt by the program or the user of the program which is a client of
+ * the Raster API.
+ * 
+ * @see {@link RasterService}
+ * @see {@link RasterManager}
+ * @author gvSIG team.
+ * @version $Id$
+ */
+public class RasterException extends BaseException {
+
+    private static final long serialVersionUID = 6756475060924237176L;
+
+    private static final String MESSAGE =
+        "An error has been produced in the Raster library";
+
+    private static final String KEY = "_RasterException";
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <strong>Don't use this constructor in child classes.</strong>
+     */
+    public RasterException() {
+        super(MESSAGE, KEY, serialVersionUID);
+    }
+
+    /**
+     * Constructor to be used in rare cases, usually you must create a new child
+     * exception class for each case.
+     * <p>
+     * <strong>Don't use this constructor in child classes.</strong>
+     * </p>
+     * 
+     * @param cause
+     *            the original cause of the exception
+     */
+    public RasterException(Exception cause) {
+        super(MESSAGE, cause, KEY, serialVersionUID);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected RasterException(String message, String key, long code) {
+        super(message, key, code);
+    }
+
+    /**
+     * @see BaseException#BaseException(String, Throwable, String, long).
+     * @param message
+     *            the default messageFormat to describe the exception
+     * @param cause
+     *            the original cause of the exception
+     * @param key
+     *            the key to use to search a localized messageFormnata
+     * @param code
+     *            the unique code to identify the exception
+     */
+    protected RasterException(String message, Throwable cause,
+        String key, long code) {
+        super(message, cause, key, code);
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterService.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterService.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterService.java	(revision 15423)
@@ -0,0 +1,59 @@
+/* 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;
+
+import java.util.Date;
+
+/**
+ * Represents a Raster element.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public interface RasterService {
+
+    /**
+     * Returns the Raster's message.
+     * 
+     * @return the message associated to a RasterService
+     * @throws RasterMessageException
+     *             if there is an error getting the Raster's message
+     */
+    public String getMessage() throws RasterMessageException;
+
+    /**
+     * Returns the {@link RasterManager}
+     * 
+     * @return {@link RasterManager}
+     * @see {@link RasterManager}
+     */
+    public RasterManager getManager();
+
+    /**
+     * Returns the Raster's creation date.
+     * 
+     * @return the creation date associated to a RasterService
+     */
+    public Date getDate();
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterService.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLocator.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLocator.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLocator.java	(revision 15423)
@@ -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.fmap.dal.coverage;
+
+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 RasterManager}
+ * .
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class RasterLocator extends BaseLocator {
+    public static final String          MANAGER_NAME         = "Raster.manager";
+    public static final String          MANAGER_DESCRIPTION  = "Raster Manager";
+    private static final String         LOCATOR_NAME         = "Raster.locator";
+    private static final RasterLocator  INSTANCE             = new RasterLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static RasterLocator 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 RasterManager getManager() throws LocatorException {
+        return (RasterManager) getInstance().get(MANAGER_NAME);
+    }
+
+    /**
+     * Registers the Class implementing the RasterManager interface.
+     * 
+     * @param clazz
+     *            implementing the RasterManager interface
+     */
+    public static void registerManager(
+        Class<? extends RasterManager> clazz) {
+        getInstance().register(MANAGER_NAME, MANAGER_DESCRIPTION, clazz);
+    }
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLocator.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterMessageException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterMessageException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterMessageException.java	(revision 15423)
@@ -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.fmap.dal.coverage;
+
+/**
+ * Exception thrown when there is an error getting a Raster message.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class RasterMessageException extends RasterException {
+
+    private static final long serialVersionUID = -4051458353306878010L;
+
+    private static final String MESSAGE =
+        "An error has been produced " + "getting the Raster message";
+
+    private static final String KEY = "_RasterMessageException";
+
+    /**
+     * Creates a new {@link RasterMessageException}.
+     * 
+     * @param cause
+     *            the original cause
+     */
+    public RasterMessageException(Throwable cause) {
+        super(MESSAGE, cause, KEY, serialVersionUID);
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterMessageException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLibrary.java	(revision 15423)
@@ -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.fmap.dal.coverage;
+
+import java.io.File;
+
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+
+/**
+ * Library for API initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class RasterLibrary extends AbstractLibrary {
+	/**
+	 * Control de librer�a ya inicializada.
+	 */
+	public static boolean       wakeup                      = false;
+	/**
+	 * Scale for reading data in the statistics process
+	 */
+	public static double        statisticsScale             = 0.5;
+	/**
+	 * En la generaci�n autom�tica de clases esta variable representa el n�mero de
+	 * clases en las que se hace la divisi�n.
+	 */
+	public static int          defaultNumberOfClasses       = 64;
+	/**
+	 * En la genraci�n de las paletas de color, esta variable representa el n�mero
+	 * de colores en las que se hace la divisi�n para generar la paleta nueva.
+	 * Con esto conseguimos velocidad de procesamiento. Cuanto menor sea, peor
+	 * ser� la calidad representada de la imagen.
+	 */
+	public static int          defaultNumberOfColors        = 256;
+	/**
+	 * Tama�o de bloque en los procesos que recorren un raster completo a base de ventanas con recorrido
+	 * descendente. Esta variable indica la altura de dicho bloque. Por lo tanto cada bloque ser� de
+	 * raster.width X blockHeight. Tipicamente recorridos de este tipo se usan para el calculo de estad�sticas,
+	 * histogramas, salvado a raster, etc... Es importante para el buen funcionamiento que este bloque sea
+	 * potencia de dos.
+	 */
+	public static int          blockHeight                  = 512;
+
+	//*************CACHE*******************
+	/**
+	 * Tama�o aproximado de cach� en Megas. Si este valor es alto cabr�n muchas p�ginas en memoria
+	 * a la vez y si es bajo cabr�n pocas. Hay que tener en cuenta que al instanciar se convertira en bytes
+	 * para su mejor tratamiento. Al llamar al constructor esta variable contendr� el tama�o exacto
+	 * de la cache en bytes. El tama�o aqu� especificado es aproximado. Este variar� dependiendo de los
+	 * par�metros del raster a cachear ya que las p�ginas deben tener una altura potencia de 2.
+	 */
+	public static long          cacheSize                  = 25;
+	/**
+	 * Tama�o m�ximo de la p�gina en Megas. Hay que tener en cuenta que al instanciar se convertira en bytes
+	 * para su mejor tratamiento. Al llamar al constructor esta variable contendr� el tama�o exacto
+	 * de la p�gina en bytes
+	 */
+	public static double        pageSize                   = 4;
+	/**
+	 * N�mero de p�ginas que tiene cada conjunto de cach�
+	 */
+	public static int           pagsPerGroup               = 5;
+
+	//*************PATHS*******************
+
+	/**
+	 * Ruta o rutas donde busca jars con clases que incorporen elementos nuevos que extiendan
+	 * otros ya existentes. Estos pueden ser drivers o filtros.
+	 */
+	public static String[]       pathExtensions            = {"." + File.separator};
+	public static String         pathTileCache             = System.getProperty("user.home") + File.separator + "gvSIG" + File.separator + "gvsig_rcache";
+	public static String         pathRMFRemote             = RasterLibrary.pathTileCache + File.separator + ".metadata" + File.separator + "remote";
+	/**
+	 * Valor noData por defecto para la librer�a. En caso de no tener un valor asociado
+	 * al raster se usar� este.
+	 */
+	public static byte           defaultByteNoDataValue    = -128;
+	public static short          defaultShortNoDataValue   = -32768;
+	public static int            defaultIntegerNoDataValue = -99999;
+	public static float          defaultFloatNoDataValue   = -99999F;
+	public static double         defaultDoubleNoDataValue  = -99999D;
+	
+	public RasterLibrary() {
+		//super(RasterLibrary.class, Library.TYPE.API);
+        registerAsAPI(RasterLibrary.class);
+	}
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Validate there is any implementation registered.
+        RasterManager manager = RasterLocator.getManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                RasterLocator.MANAGER_NAME, RasterLocator
+                    .getInstance());
+        }
+    }
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterManager.java	(revision 15423)
@@ -0,0 +1,410 @@
+/* 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;
+
+import java.awt.geom.AffineTransform;
+import java.io.FileNotFoundException;
+import java.util.Set;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.DataStructFactory;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.datastruct.RasterLegend;
+import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RasterLegendIONotFound;
+import org.gvsig.fmap.dal.coverage.filter.FilterLoader;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.render.ImageDrawer;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+import org.gvsig.fmap.dal.coverage.process.overview.OverviewBuilder;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.store.parameter.NewRasterStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.util.CRSUtils;
+import org.gvsig.fmap.dal.coverage.util.ColorConversion;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.Historical;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.raster.roi.AbstractROI;
+import org.gvsig.raster.roi.ROIReader;
+import org.gvsig.raster.roi.ROIWriter;
+import org.gvsig.raster.roi.VectorialROI;
+
+/**
+ * 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 RasterService}s.
+ * 
+ * @see RasterService
+ * @author gvSIG team
+ * @version $Id$
+ */
+public interface RasterManager {
+	public int TYPE_MULTIDATA   = 0;
+	public int TYPE_MOSAICDATA  = 1;
+	
+	/* **************************
+	 *        SERVICES
+	 ************************** */
+	
+	/**
+	 * Gets the factory to build buffers which store pixel data
+	 * @return {@link BufferFactory}
+	 */
+	public BufferFactory getBufferFactory();
+	
+	/**
+	 * Gets the factory for data structures
+	 * @return
+	 */
+	public DataStructFactory getDataStructFactory();
+	
+	/**
+	 * Gets the data source services
+	 * @return
+	 */
+	public ProviderServices getProviderServices();
+	
+	/**
+	 * Gets projection utilities 
+	 * @return
+	 */
+	public CRSUtils getCRSUtils();
+	
+	/**
+	 * Returns true if exists any implementation registered for
+	 * this service
+	 * @return
+	 */
+	public boolean isCRSUtilSupported();
+	
+	/**
+	 * Gets utilities for files management
+	 * @return
+	 */
+	public FileUtils getFileUtils();
+	
+	/**
+	 * Gets utilities for raster management
+	 * @return
+	 */
+	public RasterUtils getRasterUtils();
+	
+	/**
+	 * Gets mathematical utilities
+	 * @return
+	 */
+	public MathUtils getMathUtils();
+    
+    /**
+     * Gets the object to convert color spaces
+     * @return
+     */
+    public ColorConversion getColorConversion();
+    
+	/**
+	 * Builds a new empty RasterQuery object
+	 * @return {@link RasterQuery}
+	 */
+	public RasterQuery createQuery();
+	
+	/**
+	 * Gets an instance of the overview builder registered
+	 * @return OverviewBuilder
+	 */
+	public OverviewBuilder getOverviewBuilder(String id);
+	
+	/**
+	 * REturns true if the overview builder is supported
+	 * @return
+	 */
+	public boolean isOverviewBuilderSupported();
+	
+	/**
+	 * Gets the list of keys in the overview builder
+	 * @return
+	 */
+	public Set<String> getOverviewBuilderKeyList();
+	
+    /**
+     * Builds a new service to recover historical objects 
+     * @return
+     */
+    public Historical createHistoricalService();
+    
+	/**
+	 * Returns a Statistics object for a ROI
+	 * @param roi
+	 * @return
+	 */
+	public Statistics createROIStatistics(AbstractROI roi);
+	
+	/**
+	 * Creates a service to render a buffer on a java Image object
+	 * @return
+	 */
+	public ImageDrawer createImageDrawerService();
+	
+	/* **************************
+	 *        LEGENDS
+	 ************************** */
+	
+	/**
+	 * Lista de formatos soportados por RasterLegendIO
+	 *
+	 * @return
+	 */
+	public String[] getLegendFormats();
+	
+	/**
+	 * Devuelve un RasterLegend para el formato especificado por parametro.
+	 *
+	 * @param formatName
+	 * @return
+	 * @throws RasterLegendIONotFound
+	 */
+	public RasterLegend getRasterLegendIO(String formatName) throws RasterLegendIONotFound;
+	
+	
+	/* **************************
+	 *        TASK
+	 ************************** */
+	
+	/**
+	 * Gets a register task. To get a task it will use the current thread ID
+	 * @return TaskEventManager
+	 */
+	public TaskEventManager getRasterTask();
+	
+	/**
+	 * Registers the object as a task using the current thread ID. It returns
+	 * a TaskEventManager
+	 * @param process
+	 * @return
+	 */
+	public TaskEventManager createRasterTask(Object process);
+	
+	/* **************************
+	 *        FILTER
+	 ************************** */
+	
+	/**
+	 * Builds a new and empty filter list
+	 * @return
+	 */
+	public RasterFilterList createEmptyFilterList(int type);
+	
+	/**
+	 * Builds a new parameter object. These parameters represents the fieds of a filter
+	 * panel.
+	 * @param id
+	 * @param value
+	 * @param type 
+	 * @param list
+	 * @return
+	 */
+	public Params createParams(String id, Object value, int type, String[] list);
+	
+	/**
+	 * Builds loader of filters using a default list of filters. This loader avoids the
+	 * use of a Grid
+	 * @param dataType
+	 * @return
+	 */
+	public FilterLoader createFilterLoader(int dataType);
+	
+	/**
+	 * Builds loader of filters using a specific list of filters. ThOis loader avoids the
+	 * use of a Grid
+	 * @param dataType
+	 * @return
+	 */
+	public FilterLoader createFilterLoader(RasterFilterList filterList);
+	
+	/* **************************
+	 *      ROI
+	 ************************** */
+	
+	/**
+	 * Creates a reader for a ROI file
+	 * @param filename
+	 *        file name where the regions
+	 * @param store
+	 *        data store associated to these regions
+	 * @param projection
+	 *        Regions projection
+	 * @param bbox
+	 *        
+	 * @return
+	 * @throws FileNotExistsException 
+	 * @throws ROIException 
+	 */
+	public ROIReader createROIReader(
+			String filename, 
+			RasterDataStore store, 
+			IProjection projection) throws ROIException, FileNotExistsException;
+	
+	/**
+	 * Creates a reader from a <code>FeatureStore</code>
+	 * @param roiStore
+	 * @param store
+	 * @param projection
+	 * @return
+	 * @throws ROIException
+	 * @throws FileNotExistsException
+	 */
+	public ROIReader createVectorialROIReader(
+			FeatureStore roiStore, 
+			RasterDataStore store, 
+			IProjection projection);
+	
+	/**
+	 * Creates a writer for a ROI file
+	 * @param filename
+	 * @param projection
+	 * @return
+	 */
+	public ROIWriter createROIWriter(
+			String filename, 
+			IProjection projection);
+	
+	/**
+	 * Creates a vectorial region of interest
+	 * @param roi
+	 * @return
+	 */
+	public VectorialROI createVectorialROI(RasterDataStore roi);
+	
+	/* **************************
+	 *      DEPRECATED
+	 ************************** */
+	
+	/**
+	 * Genera instancias del buffer de datos adecuado al tama�o del raster. Si no hay muchos datos
+	 * (menos de cacheMemorySize) crear� un buffer en memoria. Si hay m�s de esta cantidad
+	 * entonces crearemos un buffer cacheado (RasterCache). A partir de la cantidad se�alada
+	 * por multicacheMemorySize haremos un buffer cacheado donde cada p�gina no ocupa todo
+	 * el ancho del raster ya que este ser� muy grande. La gesti�n de una cache donde cada
+	 * pagina ha de partir una l�nea lleva una complejidad a�adida.
+	 *  
+	 * @param dataType Tipo de dato
+	 * @param width Ancho
+	 * @param height Alto
+	 * @param bandNr Banda
+	 * @param flag En caso de buffers de memoria este flag a true significa que se reserva la memoria
+	 * para el buffer de forma normal y si est� a false no se reserva por lo que la reserva deber� ser
+	 * posterior. 
+	 * @return Objeto RasterBuffer
+	 * @throws RasterDriverException 
+	 * @throws NotSupportedExtensionException 
+	 * @throws FileNotFoundException 
+	 * @deprecated Use {@link BufferFactory} to get a {@link BufferParams} and build a {@link Buffer}
+	 * BufferParam params = RasterManager.getBufferFactory().createBufferParams(dataType, width, height, bandNr, malloc);
+	 * Buffer buffer = RasterManager.getBufferFactory().createBuffer(params);
+	 */
+	public Buffer createBuffer(int dataType, int width, int height, int bandNr, boolean malloc);
+	
+	/**
+	 * Genera una instancia del buffer de solo lectura. Este buffer consta de una cache y unos apuntadores
+	 * a las p�ginas en disco. Cuando se accede a los datos se carga en memoria la p�gina pedida.
+	 *  
+	 * @param dataType Tipo de dato
+	 * @param width Ancho
+	 * @param height Alto
+	 * @param bandNr Banda
+	 * @param flag En caso de buffers de memoria este flag a true significa que se reserva la memoria
+	 * para el buffer de forma normal y si est� a false no se reserva por lo que la reserva deber� ser
+	 * posterior. 
+	 * @deprecated Use {@link BufferFactory} to get a {@link BufferParams} and build a {@link Buffer}
+	 * BufferParam params = RasterManager.getBufferFactory().createMemoryBufferParams(dataType, width, height, bandNr, malloc);
+	 * Buffer buffer = RasterManager.getBufferFactory().createBuffer(params);
+	 */
+	public Buffer createMemoryBuffer(int dataType, int width, int height, int bandNr, boolean malloc);
+	
+	/**
+	 * Factoria para obtener escritores de los distintos tipos de raster.
+	 * @param fName Nombre del fichero.
+	 * @return GeoRasterWriter, o null si hay problemas.
+	 * @deprecated Use DAL API {@link NewRasterStoreParameters}
+	 */
+	public RasterWriter createWriter(String fName) throws NotSupportedExtensionException, RasterDriverException;
+
+	/**
+	 * Factoria para obtener escritores de los distintos tipos de raster.
+	 *
+	 * @param fName Nombre del fichero.
+	 * @return GeoRasterWriter, o null si hay problemas.
+	 * @deprecated Use DAL API {@link NewRasterStoreParameters}
+	 */
+	public RasterWriter createWriter(DataServerWriter dataWriter,
+												 String outFileName,
+												 int nBands,
+												 AffineTransform at,
+												 int outSizeX,
+												 int outSizeY,
+												 int dataType,
+												 Params params,
+												 IProjection proj) throws NotSupportedExtensionException, RasterDriverException;
+
+	/**
+	 * Factoria para obtener escritores de los distintos tipos de raster.
+	 *
+	 * @param fName Nombre del fichero.
+	 * @return GeoRasterWriter, o null si hay problemas.
+	 * @deprecated Use DAL API {@link NewRasterStoreParameters}
+	 */
+	public RasterWriter createWriter(DataServerWriter dataWriter,
+												 String outFileName,
+												 int nBands,
+												 AffineTransform at,
+												 int outSizeX,
+												 int outSizeY,
+												 int dataType,
+												 Params params,
+												 IProjection proj,
+												 boolean geo) throws NotSupportedExtensionException, RasterDriverException;
+	
+	/**
+	 * Obtiene los par�metros del driver de escritura a partir del nombre de fichero de salida.
+	 * @return WriterParams
+	 *  @deprecated Use DAL API {@link NewRasterStoreParameters}
+	 */
+	public Params createWriterParams(String fileName);
+	
+	/**
+	 * Builds a new data server to write data in a buffer 
+	 * @return
+	 * @deprecated Use DAL API {@link NewRasterStoreParameters}
+	 */
+	public DataServerWriter createDataServerWriter();
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/RasterManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/CRSUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/CRSUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/CRSUtils.java	(revision 15423)
@@ -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.fmap.dal.coverage.util;
+
+import org.cresques.cts.ICRSFactory;
+import org.cresques.cts.IProjection;
+/**
+ * Esta clase se encarga de hacer la conversion entre Wkt e IProjection.
+ *
+ * El uso se hace mediante dos llamadas estaticas que son: convertIProjectionToWkt y
+ * convertWktToIProjection.
+ *
+ * Antes de usarlos, hay que saber si tenemos acceso a gvSIG e intentar coger el factory desde all�.
+ * Ya que su uso consume tiempo y espacio de memoria y es preferible reaprovechar ese objeto ya
+ * creado. Esto se hace con setCRSFactory.
+ *
+ * En caso de no asignarse el ya existente, el crear� uno interno y lo dejara en una variable estatica.
+ *
+ * @version 11/07/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface CRSUtils {
+
+	/**
+	 * Asigna la instancia interna a CRSFactory. Es bueno asignarlo si ya existe para evitar su creaci�n.
+	 * @param factory
+	 */
+	public void setCRSFactory(ICRSFactory factory);
+
+	/**
+	 * Convierte una cadena de texto Wkt a IProjection
+	 * @param wkt
+	 * @return
+	 */
+	public IProjection convertWktToIProjection(String wkt);
+
+	/**
+	 * Convierte un IProjection a una cadena de texto Wkt
+	 * @param projection
+	 * @return
+	 */
+	public String convertIProjectionToWkt(IProjection projection);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/CRSUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/MathUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/MathUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/MathUtils.java	(revision 15423)
@@ -0,0 +1,145 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+*
+* Copyright (C) 2007 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.fmap.dal.coverage.util;
+
+/**
+ * Utilidades para calculos matem�ticos
+ * 
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface MathUtils {
+	public final double INCHESMTR = 39.73007874D;
+	public final double INCHESCM  = 0.3973007874D;
+	public final double INCHESMM  = 0.03973007874D;
+	public final double MTRSINCH  = 0.0254D;
+	public final double MMSINCH   = 25.4D;
+	public final double CMSINCH   = 2.54D;
+	
+	/**
+	 * Recorta el n�mero de decimales a n del n�mero pasado por par�metro
+	 * @return N�mero recortado
+	 */
+	public double clipDecimals(double num, int n);
+		
+	/**
+	 * Convierte pixels en milimetros dependiendo del los puntos por pulgada
+	 * @param pixels N�mero de pixels
+	 * @param ppp Puntos por pulgada
+	 * @return N�mero de milimetros
+	 */
+	public double convertPixelsToMms(double pixels, int ppp);
+	
+	/**
+	 * Convierte pixels en centimetros dependiendo del los metros por pixel
+	 * @param pixels N�mero de pixels
+	 * @param mtsPixel Metros por pixel
+	 * @return N�mero de centimetros
+	 */
+	public double convertPixelsToCms(double pixels, int ppp);
+	
+	/**
+	 * Convierte pixels en metros dependiendo del los metros por pixel
+	 * @param pixels N�mero de pixels
+	 * @param mtsPixel Metros por pixel
+	 * @return N�mero de metros
+	 */
+	public double convertPixelsToMts(double pixels, int ppp);
+	
+	/**
+	 * Convierte pixels en pulgadas dependiendo del los metros por pixel
+	 * @param pixels N�mero de pixels
+	 * @param mtsPixel Metros por pixel
+	 * @return N�mero de pulgadas
+	 */
+	public double convertPixelsToInches(double pixels, int ppp);
+
+	/**
+	 * Convierte metros en pixels dependiendo de los puntos por pulgada
+	 * @param mts N�mero de metros
+	 * @param ppp Puntos por pulgada
+	 * @return N�mero de pixeles
+	 */
+	public int convertMtsToPixels(double mts, int ppp);
+	
+	/**
+	 * Convierte pulgadas en pixels dependiendo de los puntos por pulgada
+	 * @param mts N�mero de pulgadas
+	 * @param ppp Puntos por pulgada
+	 * @return N�mero de pixeles
+	 */
+	public int convertInchesToPixels(double inches, int ppp);
+	
+	/**
+	 * Convierte centimetros en pixels dependiendo de los puntos por pulgada
+	 * @param mts N�mero de centmetros
+	 * @param ppp Puntos por pulgada
+	 * @return N�mero de pixeles
+	 */
+	public int convertCmsToPixels(double cms, int ppp);
+	
+	/**
+	 * Convierte milimetros en pixels dependiendo de los puntos por pulgada
+	 * @param mts N�mero de milimetros
+	 * @param ppp Puntos por pulgada
+	 * @return N�mero de pixeles
+	 */
+	public int convertMmsToPixels(double mms, int ppp);
+	
+	/**
+	 * Converts an array of bytes to hexadecimal string
+	 * @param data
+	 * @return
+	 */
+	public String convertToHex(byte[] data);
+
+	/**
+	 * Formats a double with an specified number of decimals. 
+	 * @param num
+	 * Value to tail
+	 * @param n
+	 * Number of decimals
+	 * @return
+	 * The formatted double
+	 */
+	public double format(double num, int n);
+
+	/**
+	 * Convierte un array de Double en un array de tipos b�sicos double
+	 * @param list Lista de objetos Double
+	 * @return double[] lista de tipos b�sicos double
+	 */
+	public double[] convertDoubleList(Double[] list);
+
+	/**
+	 * Convierte un array de Integer en un array de tipos b�sicos int
+	 * @param list Lista de objetos Integer
+	 * @return int[] lista de tipos b�sicos int
+	 */
+	public int[] convertIntList(Integer[] list);
+	
+	/**
+	 * Adjust a double value. If the number is greater than 0.95 or lesser than 0.05 will 
+	 * be round. In any case the number will be cut to four decimals.
+	 * @param d
+	 * @return
+	 */
+	public double adjustDouble(double d);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/MathUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyListener.java	(revision 15423)
@@ -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.fmap.dal.coverage.util;
+
+import java.util.EventListener;
+
+/**
+ * Listener con los eventos que puede disparar una propiedad. Este interfaz forma parte
+ * del servicio de actualizaci�n de nombre de capa �nico. Este proporciona un nombre de capa
+ * raster temporal que no haya sido utilizado todav�a. Cuando alguien modifica este nombre de capa
+ * se lanza este evento y todos los que necesitan un nombre de capa se actualizan. Puede utilizarse
+ * para cualquier cambio de un propiedad.
+ * 
+ * 07/01/2008
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface PropertyListener extends EventListener {
+		/**
+		 * Evento que se dispara cuando cambia el valor de la propiedad.
+		 * @param e
+		 */
+		public void actionValueChanged(PropertyEvent e);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ProviderServices.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ProviderServices.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ProviderServices.java	(revision 15423)
@@ -0,0 +1,298 @@
+/* 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.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.process.overview.OverviewBuilder;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider;
+
+/**
+ * Providers information and basic operations
+ *
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface ProviderServices {
+
+    /**
+     * Abre un dataset pasando como par�metros la proyecci�n y un objeto
+     * identificador del dataset. Este
+     * objeto puede ser una ruta a un fichero en disco. En este caso la
+     * extensi�n del fichero servir� para
+     * buscar el driver que lo gestiona. Si proporcionamos un array de cadenas
+     * se tratar�n como la ruta a N ficheros
+     * de disco. Tambi�n puede ser un buffer de datos en memoria o cualquier
+     * otro objeto que pueda aceptar un driver.
+     *
+     * @param param
+     *            Par�metros al driver
+     * @return RasterMultiDatset
+     * @throws NotSupportedExtensionException
+     * @throws RasterDriverException
+     */
+    public RasterDataStore open(DataStoreParameters param) throws NotSupportedExtensionException, RasterDriverException;
+
+    public RasterDataStore open(String file) throws NotSupportedExtensionException, RasterDriverException,
+        InitializeException, ProviderNotRegisteredException;
+
+    public RasterDataStore open(CoverageStoreProvider prov, DataStoreParameters params)
+        throws NotSupportedExtensionException, RasterDriverException;
+
+    /**
+     * Registers raster providers that support tiles. This method is only for
+     * providers.
+     * In a far future it will be in the SPI.
+     *
+     * @param provider
+     */
+    public void registerFileProvidersTiled(Class<?> provider);
+
+    /**
+     * Gets the list of raster providers that support tiles. This method is only
+     * for providers.
+     * In a far future it will be in the SPI.
+     *
+     * @return
+     */
+    public void registerTileProviderFormats(Class<?> c);
+
+    /**
+     * Registers a implementation to create overviews
+     *
+     * @param ovBuilder
+     */
+    public void registerOverviewBuilderImplementation(String id, OverviewBuilder ovBuilder);
+
+    /**
+     * Registers a implementation for the CRS service
+     *
+     * @param crsUtil
+     */
+    public void registerCRSUtilImplementation(CRSUtils crsUtil);
+
+    /**
+     * Register a format and a provider which is capable to manage this format
+     *
+     * @param ext
+     *            Extension
+     * @param c
+     *            Provider class
+     */
+    public void addFormat(String ext, Class<?> c);
+
+    /**
+     * Returns true if the extension is supported and false if doesn't
+     *
+     * @param ext
+     * @return
+     */
+    public boolean isExtensionSupported(String ext, Class<?> c);
+
+    /**
+     * Returns true if the extension is supported and false if doesn't
+     *
+     * @param ext
+     * @return
+     */
+    public boolean isExtensionSupported(String ext);
+
+    /**
+     * Returns the list of supported formats in read only mode
+     *
+     * @return
+     */
+    public String[] getReadOnlyFormatList();
+
+    /**
+     * Obtiene la lista de extensiones registradas
+     *
+     * @return Lista de extensiones registradas o null si no hay ninguna
+     */
+    public String[] getDriversExtensions();
+
+    /**
+     * Obtiene la lista de extensiones de ficheros sobre los que se puede salvar
+     * en un determinado tipo de datos. Como par�metro de la funci�n se
+     * especifica
+     * el tipo de datos sobre el que se desea consultar. Este m�todo consulta
+     * para
+     * cada driver registrado que extensiones soportan un tipo.
+     *
+     * @param dataType
+     *            Tipo de datos
+     * @param bands
+     *            Numero de bandas
+     * @param reprojectable
+     *            Especifica si devuelve solo los formatos reproyectables
+     * @return Lista de extensiones registradas que soportan el tipo de datos
+     *         pasado por par�metro.
+     * @throws RasterDriverException
+     */
+    public ArrayList<String> getExtensionsSupported(int dataType, int bands) throws RasterDriverException;
+
+    /**
+     * Obtiene la lista de tipos de driver
+     *
+     * @return Lista de tipos de driver registradas o null si no hay ninguno
+     */
+    public String[] getWriteDriversType();
+
+    /**
+     * Obtiene el tipo de driver a partir de la extensi�n
+     *
+     * @param ext
+     *            Extensi�n
+     * @return Tipo
+     */
+    public String getWriteDriverType(String ext);
+
+    /**
+     * Devuelve el n�mero de drivers soportados
+     *
+     * @return N�mero de drivers soportados
+     */
+    public int getWriteNDrivers();
+
+    /**
+     * Devuelve el n�mero de tipos de driver registrados
+     *
+     * @return N�mero de tipos de driver soportados
+     */
+    public int getWriteNTypes();
+
+    /**
+     * M�todo que pregunta si la extensi�n pasada por par�metro est� soportada
+     * con
+     * el tipo y n�mero de bandas indicadas.
+     *
+     * @param dataType
+     *            Tipo de dato
+     * @param bands
+     *            N�mero de bandas
+     * @param extensi�n
+     * @return true si est� soportada y false si no lo est�
+     */
+    public boolean isSupportedThisFileToWrite(String ext, int dataType, int bands);
+
+    /**
+     * Guarda en el fichero file (en formato RMF) el objecto value usando el
+     * serializador que trata
+     * las clases class1.
+     *
+     * Si el fichero RMF no existe se crea. Ha de ser un RMF de formato valido.
+     *
+     * @param file
+     * @param class1
+     * @param value
+     * @throws RmfSerializerException
+     */
+    public void saveObjectToRmfFile(String file, Class<?> class1, Object value) throws RmfSerializerException;
+
+    /**
+     * The object passed by parameter is saved in the selected file (in RMF
+     * format)
+     * using the serializer. If the RMF file does not exists it is created
+     *
+     * @param file
+     * @param value
+     * @throws RmfSerializerException
+     */
+    public void saveObjectToRmfFile(String file, Object value) throws RmfSerializerException;
+
+    /**
+     * Builds a <code>RasterStoreParameters</code> using a file name.
+     * It is only valid for files.
+     */
+    public RasterDataParameters createParameters(String id);
+
+    /**
+     * Builds a <code>RasterStoreParameters</code> using a file name.
+     * It is only valid for files but the provider will be not tiled
+     *
+     * @throws ProviderNotRegisteredException
+     * @throws InitializeException
+     */
+    public RasterDataParameters createNotTiledParameters(String id) throws InitializeException,
+        ProviderNotRegisteredException;
+
+    /**
+     * Builds a <code>RasterStoreParameters</code> using a file name. If exists
+     * more than one
+     * provider which support this file this method will return a list of
+     * parameters
+     * It is only valid for files.
+     */
+    public ArrayList<RasterDataParameters> createParametersList(String id);
+
+    /**
+     * Builds a <code>RasterStoreParameters</code> using a file. If exists more
+     * than one
+     * provider which support this file this method will return a list of
+     * parameters
+     * It is only valid for files.
+     */
+    public ArrayList<RasterDataParameters> createParametersList(File file);
+
+    /**
+     * Builds a <code>RasterStoreParameters</code> for tiled files using a file
+     * name.
+     */
+    public RasterDataParameters createParametersForTiledFiled(String id);
+
+    /**
+     * Saves a buffer to disk
+     *
+     * @param bufResult
+     *            Buffer to save
+     * @param pixelSize
+     *            Pixel size
+     * @param extension
+     *            output file format
+     * @param alphaBand
+     *            true if it has alpha band
+     * @param file
+     *            Path to the new file
+     * @param extent
+     *            Bounding box of the buffer
+     * @throws NotSupportedExtensionException
+     * @throws RasterDriverException
+     * @throws ProcessInterruptedException
+     * @throws IOException
+     */
+    public void exportBufferToFile(Buffer bufResult, double pixelSize, String extension, boolean alphaBand, File file,
+        Extent extent, ColorInterpretation colorInterpretation) throws NotSupportedExtensionException,
+        RasterDriverException, ProcessInterruptedException, IOException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ProviderServices.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.util package documentation</title>
+</head>
+<body>
+
+	<p>Utilities</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/FileUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/FileUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/FileUtils.java	(revision 15423)
@@ -0,0 +1,200 @@
+/* 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.util;
+
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.security.NoSuchAlgorithmException;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+
+
+/**
+ * Utilities for files, directories and file names
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface FileUtils {
+	/**
+	 * Copia de ficheros
+	 * @param pathOrig Ruta de origen
+	 * @param pathDst Ruta de destino.
+	 * @throws FileNotFoundException
+	 * @throws IOException
+	 */
+	public void copyFile(String pathOrig, String pathDst) throws FileNotFoundException, IOException;
+
+	/**
+	 * Crea un fichero de georeferenciaci�n (world file) para un dataset
+	 * determinado
+	 * @param fileName Nombre completo del fichero de raster
+	 * @param ext
+	 * @param pxWidth Ancho en p�xeles
+	 * @param pxHeight Alto en p�xeles
+	 * @throws IOException
+	 */
+	public void createWorldFile(String fileName, Extent ext, int pxWidth, int pxHeight) throws IOException;
+
+	/**
+	 * Crea un fichero de georeferenciaci�n (world file) para un dataset
+	 * determinado
+	 * @param fileName Nombre completo del fichero de raster
+	 * @param at AffineTransform
+	 * @param pxWidth Ancho en p�xeles
+	 * @param pxHeight Alto en p�xeles
+	 * @throws IOException
+	 */
+	public void createWorldFile(String fileName, AffineTransform at, int pxWidth, int pxHeight) throws IOException;
+
+	/**
+	 * Formatea en forma de cadena un tama�o dado en bytes. El resultado ser� una
+	 * cadena con GB, MB, KB y B
+	 * @param size tama�o a formatear
+	 * @return cadena con la cantidad formateada
+	 */
+	public String formatFileSize(long size);
+
+	/**
+	 * Obtiene la extensi�n del fichero a partir de su nombre.
+	 * @param file Nombre o ruta del fichero
+	 * @return Cadena con la extensi�n que representa el tipo de fichero. Devuelve
+	 *         null si no tiene extension.
+	 */
+	public String getExtensionFromFileName(String file);
+
+	/**
+	 * Obtiene el nombre de fichero sin la extensi�n.
+	 * @param file Nombre o ruta del fichero
+	 * @return Cadena con la extensi�n que representa el tipo de fichero. Si no
+	 *         tiene extensi�n devuelve el mismo fichero de entrada
+	 */
+	public String getNameWithoutExtension(String file);
+
+	/**
+	 * Obtiene el nombre de fichero sin la extensi�n ni la ruta.
+	 * @param file Ruta del fichero
+	 * @return Cadena que representa el nombre del fichero sin extensi�n ni path de directorios
+	 */
+	public String getFileNameFromCanonical(String file);
+
+	/**
+	 * Obtiene el �ltimo trozo de la cadena a partir de los caracteres que
+	 * coincidan con el patr�n. En caso de que el patr�n no exista en la cadena
+	 * devuelve esta completa
+	 * @param string
+	 * @param pattern
+     * @return the last part of string maching pattern
+	 */
+	public String getLastPart(String string, String pattern);
+
+	/**
+	 * Obtiene la codificaci�n de un fichero XML
+	 * @param file Nombre del fichero XML
+	 * @return Codificaci�n
+	 */
+	public String readFileEncoding(String file);
+
+	/**
+	 * Obtiene el nombre del fichero RMF a partir del nombre del fichero. Si el
+	 * nombre del fichero tiene una extensi�n esta llamada sustituir� la extensi�n
+	 * existente por .rmf. Si el fichero pasado no tiene extensi�n esta llamada
+	 * a�adir� .rm al final.
+	 * @param fileName Nombre del fichero raster de origen
+	 * @return Nombre del fichero rmf asociado al raster.
+	 */
+	public String getRMFNameFromFileName(String fileName);
+
+
+	//******* Servicio de directorios temporales **************
+
+	/**
+	 * Elimina los ficheros del directorio temporal. Realizamos esta acci�n al
+	 * levantar la librer�a.
+	 */
+	public void cleanUpTempFiles();
+
+	/**
+	 * Esta funci�n crea el directorio para temporales y devuelve el manejador
+	 * del directorio
+     * @return temporal file
+	 */
+	public File getTemporalFile();
+
+	/**
+	 * Esta funci�n crea el directorio para temporales y devuelve la ruta de este
+     * @return path of temporal file
+	 */
+	public String getTemporalPath();
+
+	/**
+	 * Gets the name of a raster file
+	 * @param name
+	 * @return the name of a raster file
+	 * @deprecated
+	 */
+	public String getFormatedRasterFileName(String name);
+
+	/**
+	 * Converts a string to MD5
+	 * @param path
+	 * @return the MD5
+	 * @throws NoSuchAlgorithmException
+	 */
+	public String convertPathToMD5(String path) throws NoSuchAlgorithmException;
+
+
+	//******* Servicio de nombres de capas �nicos **************
+
+	/**
+	 * La gesti�n de nombres �nicos en la generaci�n de capas se lleva de forma
+	 * autom�tica. Cuando alguien crea una capa nueva, si esta no tiene nombre especifico,
+	 * obtiene su nombre mediante este m�todo. La siguiente vez que se llame dar� un nombre
+	 * distinto. El nombre de la capa ser� NewLayer_ seguido de un contador de actualizaci�n
+	 * autom�tica cada vez que se usa.
+	 * @return Nombre �nico para la capa.
+	 */
+	public String usesOnlyLayerName();
+
+	/**
+	 * Obtiene el nombre �nico de la siguiente capa sin actualizar el contador. Es
+	 * solo para consulta. La siguiente vez que se llama a getOnlyLayerName o usesOnlyLayerName
+	 * devolver� el mismo nomnbre.
+	 * @return Nombre �nico para la capa.
+	 */
+	public String getOnlyLayerName();
+
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addOnlyLayerNameListener(PropertyListener listener);
+
+	/**
+	 * Elimina un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeOnlyLayerNameListener(PropertyListener listener);
+
+	//******* End: Servicio de nombres de capas �nicos **************
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/FileUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/Historical.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/Historical.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/Historical.java	(revision 15423)
@@ -0,0 +1,84 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2007 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.fmap.dal.coverage.util;
+
+
+/**
+ * Mantiene la gesti�n de historicos. Se trata de una lista de objetos la cual nos informa
+ * del actualmente vigente y nos devuelve el siguiente si existe o el anterior.
+ *  
+ * @version 31/07/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface Historical {
+
+	/**
+	 * Obtiene el siguiente elemento.
+	 * @return Siguiente elemento o null si no existe o la lista est� vacia
+	 */
+	public Object getNext();
+	
+	/**
+	 * A�ade una elemento a la lista
+	 * @param obj
+	 */
+	public void add(Object obj);
+	
+	/**
+	 * Obtiene el elemento anterior.
+	 * @return Anterior elemento o null si no existe o la lista est� vacia
+	 */
+	public Object getBack();
+	
+	/**
+	 * Consulta si existe un elemento anterior al actualmente vigente
+	 * @return true si existe y false si no existe
+	 */
+	public boolean existBack();
+	
+	/**
+	 * Consulta si existe un elemento posterior al actualmente vigente
+	 * @return true si existe y false si no existe
+	 */
+	public boolean existNext();
+	
+	/**
+	 * Limpia el historico
+	 */
+	public void clear();
+	
+	/**
+	 * Obtiene el n�mero de elementos del historico
+	 * @return N�mero de elementos del historico
+	 */
+	public int getElementsCount();
+	
+	/**
+	 * Obtiene el primer elemento del historico
+	 * @return Object
+	 */
+	public Object getFirst();
+	
+	/**
+	 * Obtiene el �ltimo elemento del historico
+	 * @return Object
+	 */
+	public Object getLast();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/Historical.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/RasterUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/RasterUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/RasterUtils.java	(revision 15423)
@@ -0,0 +1,344 @@
+/* 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.util;
+
+import java.awt.Dimension;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.roi.ROI;
+/**
+ * Raster utilities without gvSIG dependencies
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface RasterUtils {
+	
+	/**
+	 * Devuelve true si el tama�o del dataset es menor que el de la cach� y false 
+	 * si no lo es.
+	 * @param datasource Fuente de datos
+	 * @return true si podemos cargar en memoria el raster
+	 */
+	public boolean loadInMemory(RasterDataStore datasource);
+	
+	/**
+	 * Dadas unas coordenadas pixel y un n�mero de bandas, esta funci�n comprueba si 
+	 * el tama�o de ventana que va a generarse supera el tama�o de la cach� 
+	 * @param coords Coordenadas pixel del raster
+	 * @param bands N�mero de bandas
+	 * @param ds
+	 * @return true si la ventana supera el tama�o de la cach� o false si no lo supera.
+	 */
+	public boolean isBufferTooBig(double[] coords, int bands);
+	
+	/**
+	 * Dadas unas coordenadas pixel y un n�mero de bandas, esta funci�n comprueba si 
+	 * el tama�o de ventana que va a generarse supera el tama�o de la cach� 
+	 * @param coords Coordenadas pixel del raster
+	 * @param bands N�mero de bandas
+	 * @param ds
+	 * @return true si la ventana supera el tama�o de la cach� o false si no lo supera.
+	 */
+	public boolean isBufferTooBig(double[] coords, double resolution, int bands);
+
+	// ---------------------------------------------------------------
+	// TIPOS DE DATOS
+
+	/**
+	 * Conversi�n de los tipos de datos de MrSID a los tipos de datos de RasterBuf
+	 * @param mrsidType Tipo de dato de MrSID
+	 * @return Tipo de dato de RasterBuf
+	 */
+	public int getRasterBufTypeFromMrSIDType(int mrsidType);
+
+	/**
+	 * Obtiene el n�mero de bytes que ocupa un tipo de dato concreto. Los tipos de
+	 * datos son los utilizados en RasterBuffer
+	 * @param rasterBufType Tipo de dato del que se solicita el n�mero de bytes ocupados
+	 * @return
+	 */
+	public int getBytesFromRasterBufType(int rasterBufType);
+
+	/**
+	 * Devuelve el tama�o en bytes de una regi�n de un raster en funci�n de su
+	 * dimensi�n, n�mero de bandas y tipo de dato.
+	 * 
+	 * @param width
+	 * @param height
+	 * @param rasterType
+	 * @param nBands
+	 * @return
+	 */
+	public long getBytesFromRaster(int width, int height,
+			int rasterType, int nBands);
+
+	/**
+	 * Convierte un tipo de dato a cadena
+	 * @param type Tipo de dato
+	 * @return cadena que representa el tipo de dato
+	 */
+	public String typesToString(int type);
+
+	/**
+	 * Parseo de las proyecciones que genera gdal para meter espaciados y saltos
+	 * de l�nea HTML
+	 * @param proj Proyecci�n
+	 * @return Cadena con la proyecci�n parseada
+	 */
+	public String parserGdalProj(String proj);
+
+	
+	// ---------------------------------------------------------------
+	// CONVERSI�N DE COORDENADAS
+
+	/**
+	 * Convierte una ventana en coordenadas del mundo real a sus coordenadas
+	 * relativas en pixels teniendo en cuenta que la coordenada superior izquierda
+	 * es 0,0 y la inferior derecha es maxX y maY
+	 * @param extent Extent de la imagen original
+	 * @param widthPx Ancho en pixeles de la imagen original
+	 * @param heightPx Alto en pixeles de la imagen original
+	 * @param window Ventana en coordenadas reales a transportar a coordenadas pixel
+	 * @return Ventana en coordenadas pixel
+	 */
+	public Rectangle2D getPxRectFromMapRect(Rectangle2D extent, double widthPx, double heightPx, Rectangle2D window);
+
+	/**
+	 * Convierte una ventana en coordenadas del mundo real a sus coordenadas
+	 * relativas en pixels teniendo en cuenta que la coordenada superior izquierda
+	 * es 0,0 y la inferior derecha es maxX y maY
+	 * @param extent Extent de la imagen original
+	 * @param widthPx Ancho en pixeles de la imagen original
+	 * @param heightPx Alto en pixeles de la imagen original
+	 * @param window Ventana en coordenadas reales a transportar a coordenadas pixel
+	 * @return Ventana en coordenadas pixel
+	 */
+	public Rectangle2D getMapRectFromPxRect(Rectangle2D extent, double widthPx, double heightPx, Rectangle2D pxWindow);
+
+	/**
+	 * Convierte un punto en coordenadas del mundo a coordenadas pixel
+	 * @param p Punto a convertir
+	 * @param ext Extent completo de la imagen
+	 * @return Punto en coordenadas pixel
+	 */
+	public Point2D worldPointToRaster(Point2D p, Extent ext, int pxWidth, int pxHeight);
+
+	/**
+	 * Comprueba si un Extent tiene alguna parte en com�n con otro Extent dado, es
+	 * decir, si ambos extents intersectan en alguna zona. La llamada tiene en
+	 * cuenta alguna transformaci�n aplicada al Extent.
+	 * @param e1
+	 * @param e2
+	 * @return true si intersectan y false si no lo hacen
+	 */
+	public boolean intersects(Extent e1, Extent e2, AffineTransform at) throws NoninvertibleTransformException;
+
+	/**
+	 * Computes the extent which intersects both selecteds
+	 * @param e1
+	 * @param e2
+	 * @return intersection
+	 */
+	public Extent intersection(Extent e1, Extent e2);
+	
+	/**
+	 * Comprueba si un punto est� contenido dentro de un extend y devuelve true en
+	 * este caso. Se tiene en cuenta la transformaci�n aplicada al raster.
+	 * @param p1 Punto a comprobar si est� contenido en e1
+	 * @param e1 Extent sobre el que se comprueba si e1 est� dentro el punto
+	 * @return true si p1 est� dentro de e1
+	 */
+	public boolean isInside(Point2D p1, Extent e1, AffineTransform at);
+
+	/**
+	 * Comprueba si un extent est� contenido dentro de otro y devuelve true en
+	 * este caso.
+	 * @param e1 Extent a comprobar si est� contenido en e2
+	 * @param e2 Extent sobre el que se comprueba si e1 est� dentro
+	 * @return true si e1 est� dentro de e1
+	 */
+	public boolean isInside(Extent e1, Extent e2);
+
+	/**
+	 * Comprueba si un punto est� contenido dentro de un extend y devuelve true en
+	 * este caso.
+	 * @param p1 Punto a comprobar si est� contenido en e1
+	 * @param e1 Extent sobre el que se comprueba si e1 est� dentro el punto
+	 * @return true si p1 est� dentro de e1
+	 */
+	public boolean isInside(Point2D p1, Extent e1);
+
+	/**
+	 * Comprueba si un extent est� fuera de otro extent que tenemos como
+	 * referencia.
+	 * @param e1 Extent a comprobar si est� fuera
+	 * @param ref Extent de referencia
+	 * @return Devuelve true si todo el extent cae fuera de ref y false si no est�
+	 *         fuera.
+	 */
+	public boolean isOutside(Extent e1, Extent ref);
+
+	/**
+	 * Compara dos extents y devuelve true si son iguales
+	 * @param e1 Extent a comparar
+	 * @param e2 Extent a comparar
+	 * @return true si los extents pasados por par�metro son iguales y false si no
+	 *         lo son
+	 */
+	public boolean compareExtents(Extent e1, Extent e2);
+
+	/**
+	 * Calcula los par�metros de un worl file a partir de las esquinas del raster.
+	 * 1. X pixel size A 2. X rotation term D 3. Y rotation term B 4. Y pixel size
+	 * E 5. X coordinate of upper left corner C 6. Y coordinate of upper left
+	 * corner F where the real-world coordinates x',y' can be calculated from the
+	 * image coordinates x,y with the equations x' = Ax + By + C and y' = Dx + Ey +
+	 * F. The signs of the first 4 parameters depend on the orientation of the
+	 * image. In the usual case where north is more or less at the top of the
+	 * image, the X pixel size will be positive and the Y pixel size will be
+	 * negative. For a south-up image, these signs would be reversed. You can
+	 * calculate the World file parameters yourself based on the corner
+	 * coordinates. The X and Y pixel sizes can be determined simply by dividing
+	 * the distance between two adjacent corners by the number of columns or rows
+	 * in the image. The rotation terms are calculated with these equations: # B =
+	 * (A * number_of_columns + C - lower_right_x') / number_of_rows * -1 # D = (E *
+	 * number_of_rows + F - lower_right_y') / number_of_columns * -1
+	 * @param corner (tl, tr, br, bl)
+	 * @return
+	 */
+	public double[] cornersToWorldFile(Point2D[] esq, Dimension size);
+
+	/**
+	 * Ajusta el valor del array de puntos pasado como primer par�metro a las
+	 * dimensiones de la imagen. Estas dimensiones ser�n 0-dim.getX() a
+	 * 0-dim.getY(). Para cada valor, si es menor que 0 se pondr� a 0 y si es
+	 * mayor del m�ximo se asignar� al m�ximo.
+	 * @param points Lista de puntos a ajustar
+	 * @param dim Dimension
+	 */
+	public void adjustToPixelSize(Point2D[] points, Point2D dim);
+
+
+	// ---------------------------------------------------------------
+	// VARIOS
+	
+	/**
+	 * Gets the exception trace
+	 * @param e
+	 * @return
+	 */
+	public String getTrace(Exception e);
+
+	/**
+	 * Formatea el tiempo en milisegundos devolviendo un String en formato . dias,
+	 * horas, minutos y segundos.
+	 * @param time Tiempo en milisegundos
+	 */
+	public String formatTime(long time);
+
+	/**
+	 * Obtiene un texto con las coordenadas a partir de n�meros en coma flotante.
+	 * @param minx coordenada m�nima de X
+	 * @param miny coordenada m�nima de Y
+	 * @param maxx coordenada m�xima de X
+	 * @param maxy coordenada m�xima de Y
+	 * @param dec N�mero de decimales a mostrar en la caja de texto
+	 */
+	public String[] getCoord(double minx, double miny, double maxx, double maxy, int dec);
+	
+	/**
+	 * Ajusta la extensi�n pasada por par�metro a los valores m�ximos y m�nimos de
+	 * la imagen. Esto sirve para que la petici�n al driver nunca sobrepase los
+	 * l�mites de la imagen tratada aunque la vista donde se dibuje sea de mayor
+	 * tama�o. Este m�todo tiene en cuenta la rotaci�n aplicada al raster por lo
+	 * que no ajustamos a un extent sino a una matriz de transformaci�n. Esta
+	 * tiene los par�metros de traslaci�n, rotaci�n y escalado del raster destino.
+	 * Esta matriz transforma coordenadas pixel a real y viceversa.
+	 * @param imgExt Extent completo de la vista donde se va a dibujar.
+	 * @param AffineTransform Matriz de transformaci�n del raster destino
+	 * @return adjustedExtent Extent ajustado a m�ximos y m�nimos
+	 */
+	public Extent calculateAdjustedView(Extent extToAdj, AffineTransform at, double w, double h);
+
+
+	/**
+	 * Guarda la informaci�n de georreferenciaci�n de un raster en su fichero rmf
+	 * adjunto.
+	 * @param path
+	 * @param at
+	 * @param dim
+	 * @throws IOException
+	 */
+	public void saveGeoInfo(String outRmf, AffineTransform at, Point2D dim) throws IOException;
+	
+	/**
+	 * Ajusta la extensi�n pasada por par�metro a los valores m�ximos y m�nimos de
+	 * la imagen. Esto sirve para que la petici�n al driver nunca sobrepase los
+	 * l�mites de la imagen tratada aunque la vista donde se dibuje sea de mayor
+	 * tama�o.
+	 * @param imgExt Extent completo de la vista donde se va a dibujar.
+	 * @param extToAdj Extent a ajustar.
+	 * @return adjustedExtent Extent ajustado a m�ximos y m�nimos
+	 */
+	public Extent calculateAdjustedView(Extent extToAdj, Extent imgExt);
+	
+	/**
+	 * Obtiene el extent m�ximo de todas las ROIs pasadas por par�metro.
+	 * @param rois Lista de ROIs para calcular la extensi�n m�xima que ocupan
+	 * @return Entent m�ximo
+	 */
+	public Extent getROIsMaximunExtent(List<ROI> rois);
+	
+	/**
+	 * Convierte un histograma al rango de valores de RGB, en pocas palabras
+	 * aplica una operacion 0xff a cada pixel para quitar los numeros negativos
+	 * y desplazarlos a su rango visual.
+	 * @param histogram
+	 */
+	public BufferHistogram convertHistogramToRGB(BufferHistogram histogram);
+	
+	/**
+	 * Copies a piece of image into another taking into account the different size and proportion
+	 * @param bufResult
+	 * 			output buffer
+	 * @param tileExtent
+	 * 			bounding box of the output buffer
+	 * @param buf
+	 *          input buffer
+	 * @param ex
+	 *          bounding box of the input buffer
+	 * @param rel
+	 * 			ratio between both pixel sizes
+	 * @param hasAlphaBand
+	 *          true if the last band is a alpha band
+	 */
+	public void copyToBuffer(Buffer bufResult, Extent tileExtent,
+			Buffer buf, Extent ex, double rel, boolean hasAlphaBand);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/RasterUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ColorConversion.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ColorConversion.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ColorConversion.java	(revision 15423)
@@ -0,0 +1,137 @@
+/* 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.util;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+
+
+/**
+ * Coversi�n de de colores y valores de pixel aplicando distintos m�todos.
+ * 
+ * 31/10/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface ColorConversion {
+
+	/**
+	 * Conversi�n de RGB a HSL (Hue, Saturation, Lightness)
+	 * @param rojo Banda del rojo del pixel de entrada
+	 * @param verde Banda del verde del pixel de entrada
+	 * @param azul Banda del azul del pixel de entrada
+	 * @return array de 3 valores con los datos HSL correspondiente al pixel de entrada.
+	 */
+	public double[] RGBtoHSL(int rojo, int verde, int azul);
+
+	/**
+	 * Conversi�n de RGB a HSV (Hue, Saturation, Value). El valor de H es el mismo que en
+	 * HSL pero difiere en el calculo de la S y la V.
+	 * @param rojo Banda del rojo del pixel de entrada
+	 * @param verde Banda del verde del pixel de entrada
+	 * @param azul Banda del azul del pixel de entrada
+	 * @return array de 3 valores con los datos HSL correspondiente al pixel de entrada.
+	 */
+	public double[] RGBtoHSV(int rojo, int verde, int azul);
+
+	/**
+	 * Conversi�n de HSL a RGB
+	 * @param h Banda de matiz del pixel de entrada
+	 * @param s Banda de saturaci�n del pixel de entrada
+	 * @param azul Banda de brillo del pixel de entrada
+	 * @return array de 3 valores con los datos RGB correspondiente al pixel de entrada.
+	 */
+	public int[] HSLtoRGB(int h, int s, int i);
+
+
+	/**
+	 * Conversi�n de HSL a RGB
+	 * @param h Banda de matiz del pixel de entrada. Valor entre 0 y 1.
+	 * @param s Banda de saturaci�n del pixel de entrada. Valor entre 0 y 1.
+	 * @param i Banda de brillo del pixel de entrada. Valor entre 0 y 1.
+	 * @return array de 3 valores con los datos RGB correspondiente al pixel de entrada.
+	 */
+	public int[] HSLtoRGB(double h, double s, double i);
+
+	/**
+	 * Conversi�n de RGB a CMYK (Cyan, Magenta, Yellow, Key). 
+	 * @param red Banda del rojo del pixel de entrada
+	 * @param green Banda del verde del pixel de entrada
+	 * @param blue Banda del azul del pixel de entrada
+	 * @param kScale valor entre 0 y 1
+	 * @return array de 4 valores con los datos CMYK correspondiente al pixel de entrada.
+	 */
+	public double[] RGBtoCMYK(int red, int green, int blue, double kScale);
+
+	/**
+	 * Conversi�n de CMYK (Cyan, Magenta, Yellow, Key) a RGB (red, green, blue). 
+	 * @param red Banda del rojo del pixel de entrada
+	 * @param green Banda del verde del pixel de entrada
+	 * @param blue Banda del azul del pixel de entrada
+	 * @param kScale valor entre 0 y 1
+	 * @return array de 4 valores con los datos CMYK correspondiente al pixel de entrada.
+	 */
+	public double[] CMYKtoRGB(double cyan, double magenta, double yellow, double key);
+
+	/**
+	 * Obtiene la luminosidad del RGB pasado por par�metro
+	 * @param red Banda del rojo del pixel de entrada
+	 * @param green Banda del verde del pixel de entrada
+	 * @param blue Banda del azul del pixel de entrada
+	 * @return double que representa la luminosidad. Para tenerlo en un rango de 255 hay que aplicar (lum * 255. + 0.5);
+	 */
+	public double getLuminosity(int red, int green, int blue);
+	
+	/**
+	 * Descompone un entero que representa un ARGB en sus 4 valores byte Obtiene
+	 * un array de 4 elementos donde el elemento 0 es el Rojo, el 1 es el verde,
+	 * el 2 el azul y el 3 el alpha.
+	 * @param rgb Entero con el valor ARGB a descomponer;
+	 * @return Array de cuatro elementos
+	 */
+	public byte[] getARGBFromIntToByteArray(int rgb);
+	
+	/**
+	 * Descompone un entero que representa un ARGB en sus 4 valores byte Obtiene
+	 * un array de 4 elementos donde el elemento 0 es el Rojo, el 1 es el verde,
+	 * el 2 el azul y el 3 el alpha.
+	 * @param rgb Entero con el valor ARGB a descomponer;
+	 * @return
+	 */
+	public int[] getARGBFromIntToIntArray(int rgb);
+	
+	/**
+	 * Obtiene un entero con los valores ARGB pasados por par�metro
+	 * @param a Valor de alpha
+	 * @param r Valor del rojo
+	 * @param g Valor del verde
+	 * @param b Valor del azul
+	 * @return entero con la mezcla de valores
+	 */
+	public int getIntFromARGB(int a, int r, int g, int b);
+	
+	/**
+	 * Mixes two buffers with transparency and returns only one
+	 * @param dst Buffer destino de la mezcla
+	 * @param buf Buffer a mezclar sobre el destino
+	 * @return Buffer destino
+	 */
+	public Buffer mergeTransparencyBuffers(Buffer dst, Buffer buf);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/ColorConversion.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyEvent.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.util;
+
+import java.util.EventObject;
+
+/**
+ * Evento de una propiedad con la forma variable=valor
+ * 
+ * 07/01/2008
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PropertyEvent extends EventObject {
+	private static final long serialVersionUID = -1649548367781607532L;
+	private String name = null;
+	private Object value = null;
+	private Object oldValue = null;
+
+	/**
+	 * Constructor. Se asignan los valores de nombre y valor de la 
+	 * propiedad que ha disparado el evento.
+	 * @param source Objeto fuente
+	 * @param name Nombre de la propiedad
+	 * @param value Valor de la propiedad
+	 */
+	public PropertyEvent(Object source, String name, Object value, Object oldValue) {
+		super(source);
+		this.name = name;
+		this.value = value;
+		this.oldValue = oldValue;
+	}
+
+	/**
+	 * Obtiene el nombre de la propiedad que dispar� el evento
+	 * @return cadena con el nombre de la propiedad que dispar� el evento
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/**
+	 * Obtiene el valor de la propiedad que dispar� el evento
+	 * @return Object con el valor de la propiedad que dispar� el evento
+	 */
+	public Object getOldValue() {
+		return oldValue;
+	}
+	
+	/**
+	 * Obtiene el valor de la propiedad antes de que se modificara.
+	 * @return Object con el valor de la propiedad que dispar� el evento
+	 */
+	public Object getValue() {
+		return value;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/util/PropertyEvent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Band.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Band.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Band.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.tools.dispose.Disposable;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface Band extends Disposable {
+    public final static int TYPE_UNDEFINED = Buffer.TYPE_UNDEFINED;
+    public final static int TYPE_BYTE = Buffer.TYPE_BYTE;
+    public final static int TYPE_SHORT = Buffer.TYPE_SHORT;
+    public final static int TYPE_USHORT = Buffer.TYPE_USHORT;
+    public final static int TYPE_INT = Buffer.TYPE_INT;
+    public final static int TYPE_FLOAT = Buffer.TYPE_FLOAT;
+    public final static int TYPE_DOUBLE = Buffer.TYPE_DOUBLE;
+    public final static int TYPE_IMAGE = -1;
+    
+    /**
+     * Ancho de la banda
+     * @return Entero con el ancho de la banda
+     */
+    public int getWidth();
+
+    /**
+     * Alto de la banda
+     * @return Entero con el alto de la banda
+     */
+    public int getHeight();
+    
+    /**
+     * Obtiene el tipo de dato. Los tipos de dato posibles est�n definidos en IRaster.
+     * @return tipo de datos
+     */
+	public int getDataType();
+	
+	/**
+	 * Obtiene una linea de la banda
+	 * @return
+	 */
+	public Object getLine(int line);
+	
+	/**
+	 * Asigna una linea de la banda
+	 * @param line N�mero de l�nea
+	 * @param value Valor representado por un array del tipo de dato correspondiente
+	 */
+	public void setLine(int line, Object value);
+	
+	/**
+	 * Obtiene el buffer de datos de la banda
+	 * @return Array bidimensional del tipo de dato correspondiente si es un buffer en memoria
+	 * 
+	 */
+	public Object getBuf();
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Band.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DataStructFactory.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DataStructFactory.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DataStructFactory.java	(revision 15423)
@@ -0,0 +1,186 @@
+/* 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.datastruct;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+
+/**
+ * Factory for data structures
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface DataStructFactory {
+
+	/**
+	 * Builds a TransparencyRange object
+	 * @return
+	 */
+	public TransparencyRange createTransparencyRange();
+	
+	/**
+	 * Creates a <code>Transparency</code> object. This object is useful to render
+	 * with transparency information.
+	 * @return
+	 */
+	public Transparency createTransparency(int nBands);
+	
+    /**
+     * Returns the object which represents the color table library
+     * @return
+     */
+    public ColorTableLibrary getColorTableLibrary();
+    
+    /**
+     * Builds a extent using upper left coordinate and lower right coordinate 
+     * @param ul	upper left coordinate
+     * @param lr	lower right coordinate 
+     */
+    public Extent createExtent(Point2D ul, Point2D lr);
+    
+    /**
+     * Builds a extent using the four coordinates 
+     * @param ul upper left coordinate
+     * @param lr lower right coordinate 
+     * @param ur upper right coordinate
+     * @param ll lower left coordinate 
+     */
+    public Extent createExtent(Point2D ul, Point2D lr, Point2D ur, Point2D ll);
+
+    /**
+     * Builds a extent using upper left coordinate and lower right coordinate 
+     * @param x1 X upper left coordinate
+     * @param y1 Y upper left coordinate
+     * @param x2 X lower right coordinate 
+     * @param y2 Y lower right coordinate 
+     */
+    public Extent createExtent(double x1, double y1, double x2, double y2);
+
+    /**
+     * Builds a extent using a rectangle
+     * @param r	Rectangle 2D
+     */
+    public Extent createExtent(Rectangle2D r);
+    
+    /**
+     * Builds an empty extent
+     * @return
+     */
+    public Extent createExtent();
+    
+	/**
+	 * Builds a new NoData object
+	 * @param noData
+	 *        value to assign to all bands
+	 * @param nativeNoData
+	 *        The native is the original value
+	 *        saved in the head of the file or its metadata.
+	 * @param fileName
+	 *        Name of file owner of this nodata value. This string is useful to
+	 *        save the rmf file
+	 * @param bandCount
+	 *        Number of bands of the file
+	 * @return NoData
+	 */
+	public NoData createNoData(Number noData, Number nativeNoData, String fileName, int bandCount);
+	
+	/**
+	 * Builds a new NoData for DEMs
+	 * @param noData
+	 *        value to assign to all bands
+	 * @param nativeNoData
+	 *        The native is the original value
+	 *        saved in the head of the file or its metadata.
+	 * @param fileName
+	 *        Name of file owner of this nodata value. This string is useful to
+	 *        save the rmf file
+	 * @return NoData
+	 */
+	public NoData createNoData(Number noData, Number nativeNoData, String fileName);
+	
+	/**
+	 * Builds a new NoData for DEMs
+	 * @param dataType
+	 *        dataType of this NoData
+	 * @param bandCount
+	 *        Number of bands
+	 * @return NoData
+	 */
+	public NoData createDefaultNoData(int bandCount, int dataType);
+	
+	/**
+	 * Creates a empty DataStore
+	 * @return
+	 */
+	public RasterDataStore createDataStore();
+	
+	/**
+	 * Creates a empty geopoint
+	 * @return
+	 */
+	public GeoPoint createGeoPoint();
+	
+	/**
+	 * Creates a geopoint with values
+	 * @param p
+	 * @param m
+	 * @return
+	 */
+	public GeoPoint createGeoPoint(Point2D p, Point2D m);
+	
+	/**
+	 * Gets a new instance of a ColorInterpretation object
+	 * @param A list of color interpretation strings
+	 * @return
+	 */
+	public ColorInterpretation createColorInterpretation(String[] colorInterp);
+	
+	/**
+	 * Gets a new instance of a ColorInterpretation object
+	 * @param A constant defined in <code>ColorInterpretation</code> interface. 
+	 * It can be RGB, BGR, ARGB, PALETTE or GRAYSCALE 
+	 * @return
+	 */
+	public ColorInterpretation createColorInterpretation(String colorInterpretationConstant);
+	
+	 /**
+     * Builds a new ViewPortData object
+     * @param proj
+     * @param extent
+     * @param size
+     * @return
+     */
+    public ViewPortData createViewPortData(IProjection proj, Extent extent, Dimension2D size);
+    
+    /**
+     * Builds a new ViewPortData object
+     * @return
+     */
+    public ViewPortData createViewPortData();
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DataStructFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/NoData.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/NoData.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/NoData.java	(revision 15423)
@@ -0,0 +1,159 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.datastruct;
+
+/**
+ * This class represents the nodata value.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface NoData {
+	
+	/**
+	 * Gets a unique value for nodata. It doesn't take into account if the raster has
+	 * several bands. Returns the same value for all of them.
+	 * @return the noData
+	 */
+	public Number getValue();
+
+	/**
+	 * Sets a unique value for nodata. It doesn't take into account if the raster has
+	 * several bands. Assigns the same value for all of them.
+	 * @param noData the noData to set
+	 */
+	public void setValue(Number noData);
+	
+	/**
+	 * Returns true if getValue is defined and false if is null
+	 * @return
+	 */
+	public boolean isDefined();
+	
+	/**
+	 * NoData value persistence. Saves the nodata value in the rmf.
+	 */
+	public void save();
+	
+	/**
+	 * Loads this class from the rmf.
+	 */
+	public void load();
+	
+	/**
+	 * Deletes the nodata value.
+	 */
+	public void delete();
+	
+	/**
+	 * Restores native value. The native is the original value
+	 * saved in the head of the file or its metadata. This value
+	 * has to be assign when NoData object is initialize. 
+	 */
+	public void restore();
+	
+	/**
+	 * The native is the original value
+	 * saved in the head of the file or its metadata. This value
+	 * has to be assign when NoData object is initialize
+	 * @return the noData
+	 */
+	public Number getNativeValue();
+	
+	/**
+	 * The native is the original value
+	 * saved in the head of the file or its metadata. This value
+	 * has to be assign when NoData object is initialize.
+	 * @param nativeNoDataValue
+	 */
+	public void setNativeValue(Number nativeNoDataValue);
+	
+	/**
+	 * Sets the file name
+	 * @param bandCount
+	 */
+	public void setFileName(String fileName);
+	
+	/**
+	 * Flag to renderize nodata values as transparent
+	 * @return
+	 */
+	public boolean isNoDataTransparent();
+
+	/**
+	 * Flag to renderize nodata values as transparent
+	 * @param noDataAsTransparent
+	 */
+	public void setNoDataTransparent(boolean noDataAsTransparent);
+	
+	/**
+	 * Gets the NoData data type
+	 * @return
+	 */
+	public int getDataType();
+	
+	/**
+	 * Sets the datatype
+	 */
+	public void setDataType(int datatype);
+	
+	/**
+	 * Compares two NoData objects an returns true if contains the same values
+	 * @param noData
+	 * @return
+	 */
+	public boolean compare(NoData noData);
+	
+	/**
+     * Creates and returns a copy of this object.
+	 * @return
+	 */
+	public Object clone();
+	
+	//***********************************************
+	//Only for file with more than one band
+	
+	/**
+	 * Gets the nodata value by band
+	 * @param nBand
+	 * @return
+	 */
+	public Number getValueByBand(int nBand);
+	
+	/**
+	 * Gets the number of bands
+	 * @return
+	 */
+	public int getBandCount();
+	
+	/**
+	 * Sets the number of bands
+	 * @param bandCount
+	 */
+	public void setBandCount(int bandCount);
+	
+	/**
+	 * Assigns one value in a band
+	 * @param noDataValue
+	 */
+	public void setValueByBand(Number noDataValue, int nBand);
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/NoData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Extent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Extent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Extent.java	(revision 15423)
@@ -0,0 +1,275 @@
+/* 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.datastruct;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.geom.primitive.EnvelopeNotInitializedException;
+import org.gvsig.tools.persistence.Persistent;
+
+/**
+ * Representaci�n de la extensi�n de una imagen.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Extent extends Persistent {
+	/**
+	 * Builds a new GridExtent using this extension
+	 * @param cellSize
+	 * @return
+	 */
+	public GridExtent getGridExtent(double cellSize);
+	
+    /**
+     * Obtiene la coordenada X m�nima
+     * @return valor de la coordenada X m�nima
+     */
+    public double minX();
+
+    /**
+     * Obtiene la coordenada Y m�nima
+     * @return valor de la coordenada X m�nima
+     */
+    public double minY();
+
+    /**
+     * Obtiene la coordenada X m�xima
+     * @return valor de la coordenada X m�xima
+     */
+    public double maxX();
+
+    /**
+     * Obtiene la coordenada Y m�xima
+     * @return valor de la coordenada Y m�xima
+     */
+    public double maxY();
+    
+    /**
+     * Obtiene el punto m�nimo
+     * @return m�nimo
+     */
+    public Point2D getMin();
+
+    /**
+     * Obtiene el punto m�ximo
+     * @return m�ximo
+     */
+    public Point2D getMax();
+
+    /**
+     * Obtiene el ancho
+     * @return
+     */
+    public double width();
+
+    /**
+     * Obtiene el alto
+     * @return
+     */
+    public double height();
+    
+    /**
+     * Obtiene el centro en X del extent
+     * @return
+     */
+    public double getCenterX();
+    
+    /**
+     * Obtiene el centro en Y del extent
+     * @return
+     */
+    public double getCenterY();
+
+
+    public Rectangle2D toRectangle2D();
+    
+    /**
+     * Gets the upper left corner
+     * @return
+     */
+    public Point2D getUL();
+    
+    /**
+     * Gets the lower right corner
+     * @return
+     */
+    public Point2D getLR();
+    
+    /**
+     * Obtiene la coordenada X de la esquina superior izquierda. Esta, en condiciones normales
+     * conincide con el minimo en X pero cuando un raster est� rotado esto puede variar.
+     * @return ulx
+     */
+    public double getULX();
+    
+    /**
+     * Obtiene la coordenada Y de la esquina superior izquierda. Esta, en condiciones normales
+     * conincide con el maximo en Y pero cuando un raster est� rotado esto puede variar.
+     * @return uly
+     */
+    public double getULY();
+    
+    /**
+     * Obtiene la coordenada X de la esquina inferior derecha. Esta, en condiciones normales
+     * conincide con el m�ximo en X pero cuando un raster est� rotado esto puede variar.
+     * @return lrx
+     */
+    public double getLRX();
+    
+    /**
+     * Obtiene la coordenada Y de la esquina inferior derecha. Esta, en condiciones normales
+     * conincide con el minimo en Y pero cuando un raster est� rotado esto puede variar.
+     * @return lry
+     */
+    public double getLRY();
+    
+    /**
+     * Obtiene la coordenada X de la esquina superior derecha. 
+     * @return urx
+     */
+    public double getURX();
+    
+    /**
+     * Obtiene la coordenada Y de la esquina superior derecha.
+     * @return uly
+     */
+    public double getURY();
+    
+    /**
+     * Obtiene la coordenada X de la esquina inferior izquierda.
+     * @return lrx
+     */
+    public double getLLX();
+    
+    /**
+     * Obtiene la coordenada Y de la esquina inferior izquierda.
+     * @return lly
+     */
+    public double getLLY();
+    
+    /**
+     * Asigna la coordenada X de la esquina superior izquierda al m�nimo X
+     */
+    public void setULXToMin();
+    
+    /**
+     * Asigna la coordenada X de la esquina superior izquierda al m�ximo X
+     */
+    public void setULXToMax();
+    
+    /**
+     * Asigna la coordenada Y de la esquina superior izquierda al m�nimo Y
+     */
+    public void setULYToMin();
+    
+    /**
+     * Asigna la coordenada Y de la esquina superior izquierda al m�ximo Y
+     */
+    public void setULYToMax();
+    
+    /**
+     * Asigna la coordenada X de la esquina inferior derecha al m�nimo X
+     */
+    public void setLRXToMin();
+    
+    /**
+     * Asigna la coordenada X de la esquina inferior derecha al m�ximo X
+     */
+    public void setLRXToMax();
+    
+    /**
+     * Asigna la coordenada Y de la esquina inferior derecha al m�nimo Y
+     */
+    public void setLRYToMin();
+    
+    /**
+     * Asigna la coordenada Y de la esquina inferior derecha al m�ximo Y
+     */
+    public void setLRYToMax();
+    
+    /**
+     * Adds the current extent to the selected extent and returns the maximum 
+     * bounding box that enclose both.
+     * @param ext
+     * @return
+     */
+    public Extent encloseBoundinBoxes(Extent ext);
+    
+    /**
+     * Gets the intersection between two bounding box
+     * @param ext
+     * @return
+     */
+    public Extent intersection(Extent ext);
+    
+    /**
+     * Returns true if the selected bounding box intersects with the 
+     * current
+     * @param ext
+     * @return
+     */
+    public boolean intersects(Extent ext);
+    
+    /**
+     * Obtiene la escala
+     * @param width	Ancho
+     * @param height	Alto
+     * @return
+     */
+    public double[] getScale(int width, int height);
+
+    public double[] getScale(double width, double height);
+    
+	/**
+	 * Converts the bounding box to other coordinate reference system
+	 * @param trans
+	 * The CRS conversor
+	 * @return
+	 * A new envelope in other CRS 
+	 * @throws EnvelopeNotInitializedException
+     * if the envelope is empty.
+	 */
+    public Extent convert(ICoordTrans trans);
+    
+	/**
+	 * Given a cell size, converts a point in raster coordinates to world coordinates
+	 * @param pt Point to transform
+	 */
+	public Point2D rasterToWorld(Point2D pt, double cellsize);
+
+	/**
+	 * Given a cell size, converts a point in world coordinates to pixel coordinates
+	 * @param pt Point to transform
+	 */
+	public Point2D worldToRaster(Point2D pt, double cellsize);
+    
+    /**
+     * Compares two extents
+     * @param obj
+     * @return
+     */
+    public boolean equals(Object obj);
+    
+    public Extent clone();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Extent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ViewPortData.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ViewPortData.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ViewPortData.java	(revision 15423)
@@ -0,0 +1,156 @@
+/* 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.datastruct;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+import org.cresques.geo.Projected;
+import org.gvsig.timesupport.Time;
+
+
+/**
+ * Datos de vista sobre las capas.
+ *
+ * Mantiene un conjunto de datos necesarios, que describen el modo de
+ * ver las capas actual.
+ *
+ * @author "Luis W. Sevilla" <sevilla_lui@gva.es>
+ */
+public interface ViewPortData extends Projected {
+   
+    public IProjection getProjection();
+
+    public void setProjection(IProjection proj);
+
+    public void reProject(ICoordTrans rp);
+
+    public void setCoordSys(IProjection cs);
+
+    public AffineTransform getMat();
+
+    public void setMat(AffineTransform mat);
+
+    public Object clone();
+
+    /**
+     * Obtiene el ancho de la vista
+     * @return
+     */
+    public double getWidth();
+
+    /**
+     * Obtiene el alto de la vista
+     * @return
+     */
+    public double getHeight();
+
+    /**
+     * Obtiene el tama�o de la vista
+     */
+    public Dimension2D getSize();
+
+    /**
+     * Asigna el ancho y alto de la vista
+     * @param w Ancho
+     * @param h Alto
+     */
+    public void setSize(double w, double h);
+    
+    public void setSize(Dimension2D sz);
+    
+    public Extent getExtent();
+
+    public void setExtent(Dimension2D sz);
+    
+    /**
+     * Asigna la extensi�n del raster
+     * @param ext Extent
+     */
+    public void setExtent(Extent ext);
+    
+    public void reExtent();
+
+    public void setDPI(int dpi);
+
+    public int getDPI();
+
+    /**
+     * zoom a un marco.
+     *
+     * @param extent
+     */
+    public void zoom(Extent extent);
+
+    /**
+     * zoom centrado en un punto.
+     *
+     * @param zoom
+     * @param pt
+     */
+    public void zoom(double zoom, Point2D pt);
+
+    public void zoom(double zx, double zy, Point2D pt);
+
+    /**
+     * Zoom a una escala (geogr�fica);
+     *
+     * @param scale
+     */
+    public void zoomToCenter(double f);
+
+    /**
+     * Centrar en un punto.
+     *
+     * @param pt
+     */
+    public void centerAt(Point2D pt);
+
+    /**
+     * Desplaza la vista actual.
+     *
+     * @param pt
+     */
+    public void pan(Point2D ptIni, Point2D ptFin);
+
+    public Point2D getCenter();
+    
+    /**
+     * Calcula la transformaci�n af�n.
+     */
+	public void calculateAffineTransform();
+	
+	/**
+	 * Gets the time information of the viewport requested
+	 * @return
+	 */
+	public Time getTime();
+
+	/**
+	 * Sets the time information of the viewport requested
+	 * @return
+	 */
+	public void setTime(Time time);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ViewPortData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DatasetBand.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DatasetBand.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DatasetBand.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import org.gvsig.tools.persistence.Persistent;
+
+
+
+/**
+ * Interfaz que representa a una banda de un fichero.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface DatasetBand extends Persistent {
+	
+	
+	/**
+	 * Resetea la asignaci�n de dibujado de las bandas de la imagen
+	 * sobre el DataImage cuando se hace un update para esta banda.
+	 */
+	public void clearDrawableBands();
+
+	//******************************
+	//Setters and Getters
+	//******************************
+	
+	/**
+	 * Obtiene las banda del RasterBuf sobre la que se pinta
+	 * este objeto banda
+	 * @return bandas del RasterBuf
+	 */
+	public int[] getBufferBandListToDraw();
+	
+	/**
+	 * Obtiene las banda del RasterBuf sobre la que se pinta
+	 * este objeto banda
+	 * @return bandas del RasterBuf
+	 */
+	public int[] getLocalBufferBandListToDraw();
+
+	
+	/**
+	 * Dice si la banda se est� dibujando en el buffers de salida.
+	 * @return true si la banda se est� dibujando y false si no se est� haciendo
+	 */
+	public boolean isDrawing();
+		
+	/**
+	 * Adds a band of the output buffer where the input band is drawn. <code>rasterBufBandToDraw</code>
+	 * is the number of band of the output buffer. This number is added to the list of numbers.
+	 * @param rasterBufBandToDraw number of band of the <code>Buffer</code>
+	 */
+	public void addPositionToDrawInBuffer(int rasterBufBandToDraw);
+	
+	/**
+	 * Obtiene el nombre del fichero al que pertenece la banda
+	 * @return String con el nombre del fichero al 
+	 * que pertenece la banda
+	 */
+	public String getFileName();
+
+	/**
+	 * Asigna el nombre del fichero al que pertenece la banda
+	 * @param fileName String con el nombre del fichero al 
+	 * que pertenece la banda
+	 */
+	public void setFileName(String fileName);
+
+	/**
+	 * Obtiene la posici�n de la banda en el fichero
+	 * @return entero con la posici�n de la banda en el fichero
+	 */
+	public int getPosition();
+
+	/**
+	 * Asigna la posici�n de la banda en el fichero
+	 * @param position Posici�n de la banda en el fichero
+	 */
+	public void setPosition(int position);
+
+	/**
+	 * Obtiene el tipo de dato de la banda
+	 * @return entero con el tipo de dato 
+	 */
+	public int getDataType();
+
+	/**
+	 * Asigna el tipo de dato de la banda
+	 * @param datatype entero con el tipo de dato de la banda
+	 */
+	public void setDataType(int dataType);
+	
+	
+	/**
+	 * Asigna un nombre de fichero adicional al principal. Esto es util para
+	 * mosaicos de raster donde una banda est� compuesta por multiples ficheros.
+	 */
+	public void setAdditionalName(String fileName);
+	
+	/**
+	 * Obtiene la lista de nombres de fichero adicionales.
+	 * @return String[]
+	 */
+	public String[] getAdditionalName();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/DatasetBand.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorTableLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorTableLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorTableLibrary.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.exception.FilePaletteException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+
+
+/**
+ * This interface represents a color table library
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface ColorTableLibrary {
+   
+    /**
+     * Creates an empty color table
+     * @return
+     */
+    public ColorTable createColorTable();
+    
+    /**
+     * Creates a new ColorItem
+     * @return
+     */
+    public ColorItem createColorItem();
+    
+	/**
+	 * Devuelve la lista de ficheros de paletas, si no existe el fichero creara
+	 * una paleta por defecto y la devolvera.
+	 * @param palettesBasePath
+	 * @return
+	 * @throws FilePaletteException 
+	 */
+	public ArrayList<String> getPaletteFileList(String palettesBasePath) throws FilePaletteException;
+	
+	/**
+	 * Lee una paleta del fichero xml de paletas y la carga en la tabla del panel.
+	 * @param palettesPath Camino al fichero de paletas predefinidas.
+	 * @param paletteName Nombre de paleta a cargar desde el fichero xml.
+	 * @return Nombre de la paleta
+	 * @throws FilePaletteException 
+	 */
+	public String loadPalette(String palettesBasePath, String paletteFileName, ArrayList<ColorItem> items) throws FilePaletteException;
+	
+	/**
+	 * Si existe la version de paleta 1.0, la actualizara a la 1.1 y renombrar� la
+	 * antigua version.
+	 * @param palettesBasePath
+	 * @param colorTable
+	 */
+	public void save_to_1_1(String palettesBasePath, ColorTable colorTable);
+	
+	/**
+	 * Lista de formatos soportados por RasterLegendIO
+	 *
+	 * @return
+	 */
+	public String[] getFormats();
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorTableLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Stretch.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Stretch.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Stretch.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+
+public interface Stretch {
+	/**
+	 * Aplica el recorte de colas sobre los extremos de los m�ximos y m�nimos de entrada.
+	 * La aplicaci�n de esta funci�n considera que ya se han calculado los valores con 
+	 * loadTailTrimValues.
+	 */
+	public void applyTrimToStretchs();
+	
+	/**
+	 * Consulta si tiene alg�n valor el recorte de colas
+	 * @return true si tiene valor el recorte de colas y false si no lo tiene
+	 */
+	public boolean hasTailTrim();
+	
+	/**
+	 * Calcula la escala y el desplazamiento teniendo en cuenta que
+	 * ya tenga todos los valores de entrada asignados.
+	 *
+	 */
+	public void calcLinearScaleAndOffset();
+	
+	/**
+	 * Asigna el m�ximo y el m�nimo
+	 * @param stats
+	 * @param type
+	 * @param band
+	 */
+	public void setMaxMin(Statistics stats, int band, boolean rgb);
+	
+	/**
+	 * Aplica el eliminado de extremos. Para ello utiliza el segundo m�ximo y m�nimo de entrada.
+	 */
+	public void applyRemoveEndsToStretchs(Statistics stats, boolean rgb, int band);
+	
+	public double[] getOffset();
+
+	public double getMaxValue();
+
+	public double getMinValue();
+
+	public int getFunctionType();
+	
+	public double[] getStretchIn();
+
+	public int[] getStretchOut();
+	
+	public double getValueFunction();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Stretch.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridExtent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridExtent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridExtent.java	(revision 15423)
@@ -0,0 +1,76 @@
+/* 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.datastruct;
+
+/**
+ * Representaci�n de la extensi�n de un Grid.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface GridExtent extends Extent {
+	public void setXRange(double dXMin, double dXMax);
+	
+	public void setYRange(double dYMin, double dYMax);
+
+	/**
+	 * Get cell size
+	 * @return cell size in double value
+	 */
+	public double getCellSize();
+
+	/**
+	 * Set cell size and recalculate pixel distance in both axis
+	 * @param cellSize cell size in double value
+	 */
+	public void setCellSize(double cellSize);
+
+	/**
+	 * Get pixel width 
+	 * @return A integer with the pixel width value
+	 */
+	public int getNX();
+
+	/**
+	 * Get pixel height 
+	 * @return A integer with the pixel height value
+	 */
+	public int getNY();
+	
+	public boolean contains(double x, double y);
+	
+	public boolean fitsIn(GridExtent extent);
+	
+	/**
+	 * Compare a extent with the current GridExtent
+	 * @param extent extent to compare
+	 * @return true if two extents are equals and false if not
+	 */
+	public boolean equals(GridExtent extent);
+
+	public double getCellSizeX();
+
+	public void setCellSizeX(double cellSizeX);
+
+	public double getCellSizeY();
+
+	public void setCellSizeY(double cellSizeY);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridExtent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/package.html	(revision 15423)
@@ -0,0 +1,22 @@
+<?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.fmap.dal.coverage.datastruct package documentation</title>
+</head>
+<body>
+
+	<p>Data structures which are used in this library.</p>
+	
+	<p>
+	This package contains simple structures which are not dependent of others outside of this package. 
+	Elements like NoData values, color items or a bounding box are represented. Some
+	objects can be instantiated using the DataStructFactory which can be accessed by the manager of
+	this library.<br>
+	
+	<it>DataStructFactory factory = RasterLocator.getManager.getDataStructFactory()</it>  
+	</p>
+
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/RasterLegend.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/RasterLegend.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/RasterLegend.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+/**
+ * Clase de la que debe heredar todo aquel que quiera hacer una clase
+ * de importaci�n o exportaci�n de una tabla de color.
+ *
+ * @version 20/11/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface RasterLegend {
+
+	/**
+	 * Devuelve la descripcion a mostrar en los paneles de JFileChooser.
+	 * Si se devuelve null se mostrar� la decripci�n por defecto.
+	 */
+	public String getDescription();
+
+	/**
+	 * Lee una tabla de color del fichero pasado por parametro
+	 *
+	 * @param input
+	 * @return
+	 * @throws IOException cuando ha fallado la carga
+	 */
+	public ColorTable read(File input) throws IOException;
+
+	/**
+	 * Guarda una tabla de color en el fichero pasado por parametro
+	 *
+	 * @param colorTable
+	 * @param output
+	 * @throws IOException cuando ha fallado la escritura
+	 */
+	public void write(ColorTable colorTable, File output) throws IOException;
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/RasterLegend.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPointList.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPointList.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPointList.java	(revision 15423)
@@ -0,0 +1,32 @@
+/* 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.datastruct;
+
+import java.util.List;
+
+/**
+ * List of GeoPoint. 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface GeoPointList extends List<GeoPoint> {
+	public GeoPointList clone();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPointList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/HistogramClass.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/HistogramClass.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/HistogramClass.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+
+/**
+ * Clase que define un intervalo de datos. Es util para cosas como el calculo de histogramas
+ * con tipo de datos en coma flotante en el cual hay que dividir los intervalos en
+ * clases. Las clases se tendr�n en cuenta como un intervalo el cual el menor es cerrado y el 
+ * mayor abierto, es decir
+ * <PRE>
+ * En las clases:
+ * 0-1000
+ * 1000-2000
+ * los intervalos son 
+ * [0, 1000 [  de 0-999.9p
+ * [1000, 2000[ de 1000-1999.9p
+ * </PRE>
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface HistogramClass {	
+	
+	/**
+	 * Comprueba si el valor pasado por par�metro est� dentro del intervalo
+	 * @param value Valor a comprobar
+	 * @return true si est� dentro del intervalo y false si no lo est�
+	 */
+	public boolean isIn(double value);
+	
+	/**
+	 * Obtiene el valor m�ximo de la clase
+	 * @return Entero que representa al valor m�ximo de la clase
+	 */
+	public double getMax();
+	
+	/**
+	 * Asigna el valor m�ximo de la clase
+	 * @param max Entero que representa al valor m�ximo de la clase
+	 */
+	public void setMax(double max);
+	
+	/**
+	 * Obtiene el valor m�nimo de la clase
+	 * @return Entero que representa al valor m�nimo de la clase
+	 */
+	public double getMin();
+	
+	/**
+	 * ASigna el valor m�nimo de la clase
+	 * @param min Entero que representa al valor m�nimo de la clase
+	 */
+	public void setMin(double min);
+
+	/**
+	 * Obtiene el valor de la clase
+	 * @return double con el valor
+	 */
+	public double getValue();
+
+	/**
+	 * Asigna el valor de la clase
+	 * @param double con el valor
+	 */
+	public void setValue(double value);
+	
+	/**
+	 * Incrementa en n el valor especificado
+	 * @param double n
+	 */
+	public void increment(double n);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/HistogramClass.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Params.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Params.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Params.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import java.util.List;
+
+import org.gvsig.tools.persistence.Persistent;
+
+
+/**
+* Par�metros para los drivers de escritura. Las variables estaticas contenidas representan
+* los tipos de par�metro posibles.
+*
+* @author Nacho Brodin (nachobrodin@gmail.com)
+*/
+public interface Params extends Persistent {
+	public static final int NONE        = -1;
+	public static final int CHECK       = 1;
+	public static final int CHOICE      = 2;
+	public static final int SLIDER      = 3;
+	public static final int MULTI_CHECK = 4;
+
+
+	/**
+	 * Obtiene el par�metro de la posici�n definida por param
+	 * @param param Posici�n del par�metro
+	 * @return Objeto Param
+	 */
+	public Param getParam(int param);
+
+	/**
+	 * Asigna el par�metro pasado a la lista de par�metros necesitados por el driver
+	 * @param param
+	 */
+	public void setParam(Param param);
+	
+	/**
+	 * Asigna un par�metro. Si existe este lo reemplaza.
+	 * @param id Identificador
+	 * @param value Valor
+	 */
+	public void setParam(String id, Object value);
+
+	/**
+	 * Inicializa la lista de par�metros
+	 */
+	public void clear();
+
+	/**
+	 * Obtiene un par�metro de la lista a partir de su identificador
+	 * @param id Identificador del par�metro
+	 * @return Par�metro o null si no existe
+	 */
+	public Param getParamById(String id);
+
+	/**
+	 * Asigna un par�metro. Si existe este lo reemplaza.
+	 * @param id Identificador
+	 * @param value Valor
+	 * @param type Tipo
+	 * @param list Lista de valores
+	 */
+	public void setParam(String id, Object value, int type, String[] list);
+
+	/**
+	 * Borra los parametros asociados a ese id
+	 * @param id
+	 */
+	public void removeParam(String id);
+
+	/**
+	 * Asigna un valor para un par�metro existens. Si no existe no hace nada.
+	 *
+	 * @param id Identificador del par�metro
+	 * @param value Valor a asignar
+	 */
+	public void changeParamValue(String id, Object value);
+
+	/**
+	 * Obtiene el n�mero de par�metros.
+	 * @return N�mero de par�metros.
+	 */
+	public int getNumParams();
+
+	/**
+	 * Devuelve el array de los Params
+	 * @return
+	 */
+	public List<Param> getParams();
+	
+	public void setManagerID(String id);
+	
+	/**
+	 * Clones this object
+	 * @return
+	 * @throws CloneNotSupportedException
+	 */
+	public Object clone() throws CloneNotSupportedException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Params.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPoint.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPoint.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPoint.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import java.awt.geom.Point2D;
+
+
+/**
+ * This class represents a ground control point which can be associated to a
+ * raster. This kind of points has information about real and pixel coordinates
+ * and other information like RMS errors related to it.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface GeoPoint {
+	
+	/**
+	 * Inicializa a 0 los valores de los errores
+	 */
+	public void resetErrors();
+	
+	/**
+	 * Obtiene la predicci�n de la coordenada X
+	 * @return double
+	 */
+	public double getEvaluateX();
+
+	/**
+	 * Asigna la predicci�n de la coordenada X
+	 * @param errorX
+	 */
+	public void setEvaluateX(double xEvaluate);
+
+	/**
+	 * Obtiene la predicci�n de la coordenada Y
+	 * @return double
+	 */
+	public double getEvaluateY();
+
+	/**
+	 * Asigna la predicci�n de la coordenada Y
+	 * @param errorY
+	 */
+	public void setEvaluateY(double yEvaluate);
+	
+	/**
+	 * Obtiene el error en X
+	 * @return double
+	 */
+	public double getErrorX();
+
+	/**
+	 * Asigna el error en X
+	 * @param errorX
+	 */
+	public void setErrorX(double errorX);
+
+	/**
+	 * Obtiene el error en Y
+	 * @return double
+	 */
+	public double getErrorY();
+
+	/**
+	 * Asigna el error en Y
+	 * @param errorY
+	 */
+	public void setErrorY(double errorY);
+
+	/**
+	 * Obtiene el error RMS
+	 * @return
+	 */
+	public double getRms();
+
+	/**
+	 * Asigna el error RMS
+	 * @param rms
+	 */
+	public void setRms(double rms);
+
+	/**
+	 * Hace una copia de la instancia del punto.
+	 * @return GeoPoint
+	 */
+	public GeoPoint cloneGeoPoint();
+	
+	public Point2D getPixelPoint();
+
+	public void setPixelPoint(Point2D pixelPoint);
+
+	public Point2D getMapPoint();
+
+	public void setMapPoint(Point2D mapPoint);
+
+	public boolean isActive();
+
+	public void setActive(boolean active);
+
+	public double getxEvaluate();
+
+	public void setxEvaluate(double xEvaluate);
+
+	public double getyEvaluate();
+
+	public void setyEvaluate(double yEvaluate);
+
+	public int getNumber();
+	
+	public String getLabel();
+	
+	public void setNumber(int number);
+	
+	public void setLabel(String label);
+	
+	/**
+	 * Muestra por consola algunos valores de un geopunto
+	 */
+	public void show();
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GeoPoint.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridCell.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridCell.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridCell.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.datastruct;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface GridCell {
+	
+	public double getValue();
+	
+	public void setValue(double dValue);
+	
+	public int getX();
+	
+	public void setX(int iX);
+	
+	public int getY();
+	
+	public void setY(int iY);
+	
+	public int compareTo(Object cell) throws ClassCastException;
+	 	 
+	public boolean equals(Object obj);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/GridCell.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/TransparencyRange.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/TransparencyRange.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/TransparencyRange.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import java.io.IOException;
+
+import org.gvsig.tools.persistence.Persistent;
+/**
+ * Clase que representa a un conjunto de pixeles con transparencia. Incluye los
+ * rangos de transparencia para cada banda, la cadena que va en la lista y la
+ * operaci�n que se realiza entre ellos. Un And significa que ser�n
+ * transparentes todos los pixeles que cumplan con R con G y con B. Un Or
+ * significar� que tendr�n transparencia todos los pixeles que cumplan con R con
+ * G o con B.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface TransparencyRange extends Persistent {
+
+	/**
+	 * Obtiene la operaci�n  utilizada
+	 * @param and Si es true significa que se usa un AND y false implica
+	 * que se usa un OR
+	 */
+	public boolean isAnd();
+
+	/**
+	 * Asigna la operaci�n AND como la utilizada
+	 * @param and booleano que si est� a true significa que el la operaci�n
+	 * AND es la utilizada como operaci�n.
+	 */
+	public void setAnd(boolean and);
+
+	/**
+	 * Obtiene el intervalo de valores correspondiente a la banda del azul
+	 * @return Array bidimensional de enteros correspondiente a la banda del azul
+	 */
+	public int[] getBlue();
+
+	/**
+	 * Asigna los intervalos de valores correspondientes a las bandas del
+	 * rojo, azul y verde
+	 * @param red Array bidimensional de enteros correspondiente a la banda del rojo
+	 * @param green Array bidimensional de enteros correspondiente a la banda del verde
+	 * @param blue Array bidimensional de enteros correspondiente a la banda del azul
+	 */
+	public void setRGB(int[] red, int[] green, int[] blue);
+
+	/**
+	 * Asigna el intervalo de valores correspondiente a la banda del azul
+	 * @param blue Array bidimensional de enteros correspondiente a la banda del azul
+	 */
+	public void setBlue(int[] blue);
+
+	/**
+	 * Obtiene el intervalo de valores correspondiente a la banda del verde
+	 * @return Array bidimensional de enteros correspondiente a la banda del verde
+	 */
+	public int[] getGreen();
+
+	/**
+	 * Asigna el intervalo de valores correspondiente a la banda del verde
+	 * @param green Array bidimensional de enteros correspondiente a la banda del verde
+	 */
+	public void setGreen(int[] green);
+
+	/**
+	 * Obtiene el intervalo de valores correspondiente a la banda del rojo
+	 * @return Array bidimensional de enteros correspondiente a la banda del rojo
+	 */
+	public int[] getRed();
+
+	/**
+	 * Asigna el intervalo de valores correspondiente a la banda del rojo
+	 * @param red Array bidimensional de enteros correspondiente a la banda del rojo
+	 */
+	public void setRed(int[] red);
+
+	/**
+	 * Obtiene la cadena que representa una entrada en la tabla.
+	 * @return Cadena que representa una entrada en la tabla
+	 */
+	public String getStrEntry();
+
+	/**
+	 * Asigna la cadena que representa una entrada en la tabla.
+	 * @param strEntry Cadena que representa una entrada en la tabla.
+	 */
+	public void setStrEntry(String strEntry);
+
+
+	/**
+	 * Esta funci�n valida la cadena de entrada por medio de una m�quina de estados. Valida las
+	 * siguientes posibilidades en la cadena de entrada:
+	 * <LI>
+	 * <UL>(valor_rojo) & (Valor_verde) & (Valor_azul)</UL>
+	 * <UL>(valor_rojo) | (Valor_verde) | (Valor_azul)</UL>
+	 * </LI>
+	 * Despues de la validaci�n parsea el contenido y carga los par�metros r,g,b con los
+	 * intervalos de valores. Estos par�metros deben ser pasados como arrays de enteros de
+	 * dos elementos.
+	 * @param values
+	 * @param r	Intervalo de rojo
+	 * @param g Intervalo de verde
+	 * @param b Intervalo de azul
+	 * @return Devuelve true si la operaci�n usada en los intervalos es un AND y false si es un OR
+	 */
+	public boolean stringToInterval(String values, int[] r, int[] g, int[] b) throws IOException;
+
+	/**
+	 * Carga la cadena StrEntry leyendo los valores en los vectores que representa los intervalos.
+	 */
+	public void loadStrEntryFromValues();
+
+	/**
+	 * Obtiene el alpha asociado al rango. Por defecto es de 0, es decir
+	 * totalmente transparente pero puede asociarsele un valor distinto
+	 * @return Alpha asociado
+	 */
+	public int getAlpha();
+
+	/**
+	 * Asigna el alpha asociado al rango. Por defecto es de 0, es decir
+	 * totalmente transparente pero puede asociarsele un valor distinto
+	 * @param alpha asociado
+	 */
+	public void setAlpha(int alpha);
+
+	/**
+	 * Realiza la uni�n entre el intervalo actual y el pasado por par�metro
+	 * @param interval intervalo pasado
+	 * @param rgb
+	 * @return union de intervalos
+	 */
+	public int[] union(int[] interval, int rgb);
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/TransparencyRange.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BufferHistogram.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BufferHistogram.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BufferHistogram.java	(revision 15423)
@@ -0,0 +1,176 @@
+/* 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.datastruct;
+
+
+
+/**
+ * Interfaz que representa un histograma.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface BufferHistogram {
+	/**
+	 * Obtiene el n�mero de bandas del histograma 
+	 * @return entero que representa el n�mero de bandas 
+	 */
+	public int getNumBands();
+	
+	/**
+	 * Obtiene la longitud (n�mero de valores) de una banda determinada
+	 * @param band Banda o obtener la longitud
+	 * @return entero con la longitud de la banda
+	 * rangos de valores y DataclassList.
+	 */
+	public int getBandLenght(int band);
+	
+	/**
+	 * Obtiene el tipo de datos del histograma original
+	 * @return
+	 */
+	public int getDataType();
+	
+	/**
+	 * Asigna un valor para una posici�n del histograma segun la posicion en las
+	 * clases
+	 * @param band Valor del pixel o clase a asignar
+	 * @param pos Posicion dentro de la clase. Ejemplo 0..63
+	 * @param value Valor a asignar
+	 */
+	public void setHistogramValueByPos(int band, int pos, long value);
+
+	/**
+	 * Obtiene un valor del histograma segun la posicion dentro de las clases
+	 * @param band N�mero de banda del valor a recuperar
+	 * @param px Pixel o valor de la clase del valor a recuperar
+	 * @return valor
+	 */
+	public double getHistogramValueByPos(int band, int pos);
+	
+	/**
+	 * Obtiene un valor del histograma
+	 * @param band N�mero de banda del valor a recuperar
+	 * @param px Pixel o valor de la clase del valor a recuperar
+	 * @return valor
+	 */
+	public double getHistogramValue(int band, double px);
+	
+	/**
+	 * Realiza la uni�n entre el histograma actual y el pasado 
+	 * por par�metro.
+	 * @param hist
+	 */
+	public boolean union(BufferHistogram hist);
+	
+	/**
+	 * Obtiene la tabla de valores
+	 * @return
+	 */
+	public long[][] getTable();
+	
+	/**
+	 * Asigna la tabla
+	 * @param t
+	 */
+	public void setTable(long[][] t);
+	
+	/**
+	 * Obtiene el histograma sin modificar
+	 * @return array bidimensional donde el primer elemento es el valor del pixel
+	 * o rango y el segundo el n�mero de elementos que aparecen.
+	 */
+	public HistogramClass[][] getHistogram();
+	
+	/**
+	 * Obtiene el histograma de la imagen negativa.
+	 * @return long[][]
+	 */
+	public long[][] getNegativeTable();
+	
+	/**
+	 * Devuelve el minimo valor del histograma
+	 * @return
+	 */
+	public double getMin(int band);
+
+	/**
+	 * Devuelve el maximo valor del histograma
+	 * @return
+	 */
+	public double getMax(int band);
+	
+	/**
+	 * Obtiene el n�mero de valores o clases del histograma
+	 * @return entero que representa el n�mero de valores o clases del histograma
+	 */
+	public int getNumValues();
+	
+	/**
+	 * Devuelve si un histograma esta en un rango RGB aceptable
+	 * @return
+	 */
+	public boolean isInRangeRGB();
+	
+	/**
+	 * Calculo de estad�sticas a partir de un histograma. El resultado de la funci�n es un array
+	 * bidimensional donde el primer �ndice inndica la estadistica y el segundo el n�mero de banda.
+	 * 
+	 * <UL>
+	 * <LI>m�nimo</LI>
+	 * <LI>m�ximo</LI>
+	 * <LI>media</LI>
+	 * <LI>mediana</LI>
+	 * <LI>N�mero de pixels</LI>
+	 * </UL>
+	 * @param histogram
+	 * @param beginPos Posici�n de inicio del histograma para contabilizar estadisticas
+	 * @param endPos Posici�n de fin del histograma para contabilizar estadisticas
+	 * @param bandas solicitadas. Cada elemento del vector representa una banda. Si est� a true se calcula la 
+	 * estadistica para esa banda y si est� a false no se calcular�.
+	 * @return
+	 */
+	public double[][] getBasicStats(double beginPos2, double endPos2, boolean[] bands);
+	
+	/**
+	 * Calculo de estad�sticas a partir de un histograma. El resultado de la funci�n es un array
+	 * bidimensional donde el primer �ndice inndica la estadistica y el segundo el n�mero de banda.
+	 * 
+	 * <UL>
+	 * <LI>m�nimo</LI>
+	 * <LI>m�ximo</LI>
+	 * <LI>media</LI>
+	 * <LI>mediana</LI>
+	 * <LI>N�mero de pixels</LI>
+	 * </UL>
+	 * @param histogram
+	 * @param bandas solicitadas. Cada elemento del vector representa una banda. Si est� a true se calcula la 
+	 * estadistica para esa banda y si est� a false no se calcular�.
+	 * @return
+	 */
+	public double[][] getBasicStats(boolean[] bands);
+	
+	/**
+	 * Adds a new table
+	 * @param table
+	 */
+	public void addTable(long[][] table);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BufferHistogram.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/SerialInfo.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/SerialInfo.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/SerialInfo.java	(revision 15423)
@@ -0,0 +1,133 @@
+/* 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.datastruct;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+
+/**
+ * Time information
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface SerialInfo {
+	public static final int    NUMERIC                    = 0;
+	public static final int    DATE                       = 1;
+	
+	public static final int    SINGLE_VALUES              = 0;
+	public static final int    RANGES                     = 1;
+	
+	/**
+	 * Gets the serial name
+	 * @return
+	 */
+	public String getSerialName();
+
+	/**
+	 * Sets the serial name
+	 * @param serialName
+	 */
+	public void setSerialName(String serialName);
+
+	/**
+	 * Gets the list of dates
+	 * @return
+	 */
+	public ArrayList<?> getTime();
+
+	/**
+	 * Sets the list of dates
+	 * @return
+	 */
+	public void setTime(ArrayList<?> time);
+
+	/**
+	 * Gets the time type
+	 * @return
+	 */
+	public int getTimeType();
+
+	/**
+	 * Sets the time type
+	 * @param timeType
+	 */
+	public void setTimeType(int timeType);
+	
+	/**
+	 * Sets the time type
+	 * @param timeType
+	 */
+	public void setTimeType(String timeType);
+	
+	/**
+	 * Gets the data type
+	 * @return
+	 */
+	public int getDataType();
+
+	/**
+	 * Sets the data type
+	 * @param timeType
+	 */
+	public void setDataType(int dataType);
+	
+	/**
+	 * Adds a new time value in the array. The parameter should be a date.
+	 * @param value
+	 * @throws ParseException
+	 */
+	public void addValue(String value) throws ParseException;
+	
+	/**
+	 * Adds a new time value in the array. The parameter should be a time instant.
+	 * @param value
+	 * @throws ParseException
+	 */
+	public void addValue(double value);
+	
+	/**
+	 * Gets a string which represents a time information for that position.
+	 * Each position is or a single value or a part of a interval.
+	 * @param pos
+	 * @return
+	 */
+	public String getTimeInfo(int pos);
+
+	/**
+	 * Gets the description
+	 * @param description
+	 */
+	public String getDescription();
+
+	/**
+	 * Sets the description
+	 * @return
+	 */
+	public void setDescription(String description);
+	
+	/**
+	 * Returns true if the range selected in the parameters is 
+	 * inside the current.
+	 * @param tInfo
+	 * @return
+	 */
+	public boolean isInRange(SerialInfo tInfo);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/SerialInfo.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorItem.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorItem.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorItem.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import java.awt.Color;
+
+import org.gvsig.tools.persistence.Persistent;
+/**
+ * Valor minimo para un item de una tabla de color. Este tendr� que pixel afecta,
+ * nombre de esa clase, color y como estar� interpolado con el siguiente.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface ColorItem extends Persistent {
+	
+	/**
+	 * Devuelve el color
+	 * @return
+	 */
+	public Color getColor();
+
+	/**
+	 * Definir el color
+	 * @param color
+	 */
+	public void setColor(Color color);
+
+	/**
+	 * Devuelve el valor de interpolaci�n con el siguiente color.
+	 * L�mites: 0..100
+	 * @return
+	 */
+	public double getInterpolated();
+
+	/**
+	 * Definir el valor de interpolaci�n. Si es mayor a 100 o menor a 0 se pone
+	 * entre los valores correctos.
+	 * @param interpolated
+	 */
+	public void setInterpolated(double interpolated);
+
+	/**
+	 * Obtener en que valor estar� dicho color
+	 * @return
+	 */
+	public double getValue();
+
+	/**
+	 * Definir el valor del ColorItem.
+	 * @param value
+	 */
+	public void setValue(double value);
+
+	/**
+	 * Devuelve el nombre de la clase
+	 * @return
+	 */
+	public String getNameClass();
+
+	/**
+	 * Define el nombre de la clase
+	 * @param nameClass
+	 */
+	public void setNameClass(String nameClass);
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/ColorItem.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Param.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Param.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Param.java	(revision 15423)
@@ -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.fmap.dal.coverage.datastruct;
+
+import org.gvsig.tools.persistence.Persistent;
+
+/**
+ * Interfaz que representa un par�metro. Los atributos principales de su implementaci�n ser�n:
+ * <UL>
+ * <LI>type: tipo de par�metro que tendr� un valor correspondiente a las variables estaticas de
+ * Params.</LI>
+ * <LI>id: que contiene el identificador del par�metro en cadena de texto</LI>
+ * <LI>defaultValue: que ser� el valor por defecto asignado al par�metro</LI>
+ * <LI>list: que contiene una lista de valores con datos asociados al par�metro en concreto</LI>
+ * </UL>
+ * . Por ejemplo, para una selecci�n por lista de valores tendr� la lista de valores a
+ * seleccionar. Para un slider tendr� el valor m�ximo, el m�nimo, el intervalo menor
+ * y el mayor. Para una selecci�n por check esta lista puede ser vacia.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface Param extends Persistent {
+	public int getType();
+	public void setType(int type);
+	public String getId();
+	public void setId(String id);
+	public Object getDefaultValue();
+	public void setDefaultValue(Object defaultValue);
+	public String[] getList();
+	public void setList(String[] list);
+	public void setManagerID(String id);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/Param.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BandList.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BandList.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BandList.java	(revision 15423)
@@ -0,0 +1,212 @@
+/* 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.datastruct;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.exception.BandNotFoundInListException;
+
+/**
+ * Esta clase gestiona una lista de bandas que puede pertenecer
+ * a un fichero (la tiene un Dataset) o puede ser una lista 
+ * de bandas de multiples ficheros . Las bandas son
+ * almacenadas en un array donde la posici�n en este es el n�mero de banda.
+ *   
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface BandList {
+	
+	/**
+	 * Asigna el �ltimo array de bandas a escribir solicitadas.
+	 * @param drawableBands
+	 */
+	public void setDrawableBands(int[] drawableBands);
+	
+	/**
+	 * Asigna el array de bandas
+	 * @param bands
+	 */
+	public void setBandArray(ArrayList<DatasetBand> bands);
+	
+	/**
+	 * Obtiene el �ltimo array de bandas a escribir solicitadas.
+	 * @return
+	 */
+	public int[] getDrawableBands();
+	
+	/**
+	 * Encuentra una banda en la lista.
+	 * @param file Fichero al que pertenece la banda buscada.
+	 * @param pos Posici�n que ocupa en el fichero.
+	 * @return true si se ha hallado la banda y false si no se 
+	 * ha encontrado
+	 */
+	public boolean findBand(DatasetBand band);
+		
+	/**
+	 * Obtiene la lista de bandas a pintar sobre el buffer de 
+	 * salida en forma de array. Cada elemento del array es una banda
+	 * del Buffer de salida que ha de dibujarse y el valor que contiene
+	 * ese elemento es la banda de la imagen que va pintada en esa banda 
+	 * del Buffer.
+	 * <table border=1>
+	 * <tr><td>Elem (Buffer)</td><td>Valor (Banda de la imagen)</td></tr>
+	 * <tr><td>0</td><td>1</td></tr>
+	 * <tr><td>1</td><td>0</td></tr>
+	 * <tr><td>2</td><td>-1</td></tr>
+	 * <tr><td>3</td><td>0</td></tr>
+	 * <tr><td>4</td><td>2</td></tr>
+	 * </table>
+	 * El Buffer tendra en la banda 0 dibujada la banda 1 de este Provider, 
+	 * en la banda 1 la 0 del provider, en la banda 2 no habr� ninguna de este provider,
+	 * en la 3 la 0 y en la 4 la 2 de este provider.
+	 * @return lista de bandas a dibujar o un array de un elemento con valor -1.
+	 */
+	public int[] bandsToDrawList(int nBandsDataImage);
+	
+	/**
+	 * Checkea si alguna banda de la lista se est�a dibujando en el buffer de salida.
+	 * @return	true si alguna banda se est� dibujando y false si no
+	 */
+	public boolean isDrawingAnyBand();
+	
+	//******************************
+	//Setters and Getters
+	//******************************
+	
+	/**
+	 * A�ade una banda a la lista.
+	 * @param b banda a a�adir.
+	 * @deprecated Use addBand without position. This call does not use this parameter.
+	 */
+	public void addBand(DatasetBand b, int pos)throws BandNotFoundInListException;
+	
+	/**
+	 * Adds a band to the list
+	 * @param b Band to add.
+	 */
+	public void addBand(DatasetBand b)throws BandNotFoundInListException;
+	
+	/**
+	 * A�ade la lista de bandas pasada por par�metro a la lista
+	 * actual. Si alguna banda ya existe no la a�ade y continua.
+	 * @param bl Lista de bandas
+	 */
+	public void addBandList(BandList bl);
+	
+	/**
+	 * ELimina todas las bandas que tienen un nombre determinado.
+	 * @param name Nombre de las bandas a eliminar
+	 */
+	public void removeBands(String name);
+	
+	/**
+	 * Resetea la asignaci�n de dibujado de las bandas de la imagen
+	 * sobre el DataImage cuando se hace un update para esta banda.
+	 */
+	public void clearDrawableBands();
+	
+	/**
+	 * Para este GeoRasterFile asigna que bandas se pintaran
+	 * sobre el RasterBuf cuando se haga un update. Especificamos a 
+	 * trav�s de los par�metros para que posici�n del RasterBuf ir� 
+	 * dibujada con que banda del fichero de imagen.
+	 * @param posRasterBuf	Posici�n del RasterBuf que queremos pintar.
+	 * @param imageBand	Banda de la imagen que se pintar�
+	 */
+	public void addDrawableBand(int posRasterBuf, int imageBand);
+	
+	/**
+	 * Obtiene el n�mero de bandas de un RasterBuf sobre las que se pintara
+	 * alguna banda de este fichero cuando se llama a un updateBuffer. 
+	 * @return N�mero de bandas. Cero en caso de no tener ninguna asignada. 
+	 */
+	public int getDrawableBandsCount();
+	
+	/**
+	 * Obtiene la banda de la posici�n i.
+	 * @param i Posici�n de la banda a obtener.
+	 * @return Banda.
+	 */
+	public DatasetBand getBand(int i);
+	
+	/**
+	 * Obtiene el n�mero de bandas.
+	 * @return entero con el n�mero de bandas.
+	 */
+	public int getBandCount();
+	
+	/**
+	 * A partir de un nombre de fichero y un n�mero de banda obtiene la banda o bandas del buffer de salida 
+	 * donde se pinta.
+	 * @param fileName Nombre de fichero
+	 * @param band N�mero de banda de la imagen
+	 * @return banda o bandas del buffer de salida donde se dibuja.
+	 */
+	public int[] getBufferBandToDraw(String fileName, int band);
+	
+	/**
+	 * A partir de un nombre de fichero y un n�mero de banda obtiene la banda o bandas del buffer de salida 
+	 * donde se pinta. Esta llamada es igual a getBufferBandToDraw pero esta considera un buffer por cada
+	 * provider. Por ejemplo, si tenemos 3 providers de una banda cada uno el buffer de cada provider tendr� como
+	 * mucho una banda. En el caso anterior consideraria un buffer de 3 bandas
+	 * @param fileName Nombre de fichero
+	 * @param band N�mero de banda de la imagen
+	 * @return banda o bandas del buffer de salida donde se dibuja.
+	 */
+	public int[] getLocalBufferBandToDraw(String fileName, int band);
+	
+	/**
+	 * Obtiene en un array de String la lista de nombres de ficheros
+	 * @return lista de nombres de los ficheros del GeoRasterMultiFile
+	 */
+	public String[] getBandStringList();
+	
+	/**
+	 * Obtiene en un array de enteros con la lista de la posici�n de bandas
+	 * @return lista de la posici�n de bandas
+	 */
+	public int[] getBandPositionList();
+	
+	/**
+	 * Obtiene el tipo de dato de las bandas. Esta llamada supone que todos los tipos de dato
+	 * de las bandas son igual por lo que devolver� el primero. 
+	 * @return Entero que representa el tipo de datos de las bandas
+	 */
+	public int getBandsDataType();
+	
+	/**
+	 * Obtiene la posici�n del fichero en la lista a partir del nombre 
+	 * @param fileName Nombre del fichero
+	 * @return Posici�n del fichero o -1 si no existe. 
+	 */
+	public int getFileNumber(String fileName);
+	
+	/**
+	 * Limpia la lista de bandas
+	 */
+	public void clear();
+	
+	public Object clone();
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/datastruct/BandList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.process package documentation</title>
+</head>
+<body>
+
+	<p>Classes for the implementation of simple tasks to process grids.</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/TaskEventManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/TaskEventManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/TaskEventManager.java	(revision 15423)
@@ -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.fmap.dal.coverage.process;
+
+import java.util.EventObject;
+
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+
+
+/**
+ * Service to send events to a task. To register a new event you have to
+ * use the RasterManager
+ * <code>TaskEventManager task = manager.createRasterTask(this);</code>
+ * You can send events to the task 
+ * <code>task.sendEvent(new CancelEvent(this));</code>
+ * If you want recover a registered task to send it a event you'll have
+ * to use the RasterManager again. To get the task it will use the current
+ * thread ID.
+ * <code>TaskEventManager task = manager.getRasterTask()</code>
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface TaskEventManager {
+	
+	/**
+	 * Removes this task from the repository
+	 * @param 
+	 */
+	public void removeTask();
+	
+	/**
+	 * Sets a event. 
+	 * @param ev EventObject
+	 */
+	public void setEvent(EventObject ev);
+	
+	/**
+	 * Obtiene el evento
+	 * @return EventObject
+	 */
+	public EventObject getEvent();
+	
+	/**
+	 * Gesti�n de las se�ales. Este m�todo define las acciones por defecto para
+	 * cada se�al. No es necesario utilizar estas. Se puede en cada caso, hacer un m�todo
+	 * manageEvent en el que se gestione las acciones concretas de una se�al.
+	 * 
+	 * @param ev Evento a gestionar
+	 */
+	public  void manageEvent(EventObject ev) throws ProcessInterruptedException;
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/TaskEventManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/package.html	(revision 15423)
@@ -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.fmap.dal.coverage. package documentation</title>
+</head>
+<body>
+
+	<p></p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/Vectorization.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/Vectorization.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/Vectorization.java	(revision 15423)
@@ -0,0 +1,112 @@
+/* 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.process.vector;
+
+/**
+ * Este interfaz se usa para poder vectorizar una capa raster.<p>
+ * 
+ * La entrada es una capa raster, ya sea en un fichero, RasterDastaSource o un
+ * RasterDataset.<p>
+ * 
+ * El uso de comunicacion con la libreria jpotrace es como funciona el comando
+ * potrace, de hecho, se pueden a�adir mas opciones si potrace los admite por
+ * linea de comandos.<p>
+ * 
+ * Una vez creada una instancia de Vectorization se definen todos los
+ * parametros deseables o en caso de no definirlos se usaran los valores por
+ * defecto y se invoca al metodo VectorizeBuffer()<p>
+ * 
+ * Este ultimo metodo, devuelve un array de doubles indicando si lo que se ha
+ * devuelto son operaciones tipicas de shapes... MoveTo, LineTo, CurveTo, etc...<p>
+ * 
+ * En la primera posicion se devuelve el tama�o del array.<p>
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Vectorization {
+	public final static int POLICY_BLACK          = 0;
+	public final static int POLICY_WHITE          = 1;
+	public final static int POLICY_RIGHT          = 2;
+	public final static int POLICY_LEFT           = 3;
+	public final static int POLICY_MINORITY       = 4;
+	public final static int POLICY_MAJORITY       = 5;
+	public final static int POLICY_RANDOM         = 6;
+	
+	/**
+	 * Set the corner threshold parameter (default 1)
+	 * @param value
+	 */
+	public void setCornerThreshold(double value);
+
+	/**
+	 * Quantize output to 1/unit pixels (default 10)
+	 * @param value
+	 */
+	public void setOutputQuantization(int value);
+
+	/**
+	 * Suppress speckles of up to this size (default 2)
+	 * @param value
+	 */
+	public void setDespeckle(int value);
+
+	/**
+	 * Set how to resolve ambiguities in path decomposition<p>
+	 * 
+	 * Use:<br><b>
+	 * 	 POLICY_BLACK<br>
+	 *   POLICY_LEFT<br>
+	 *   POLICY_MAJORITY<br>
+	 *   POLICY_MINORITY<br>
+	 *   POLICY_RANDOM<br>
+	 *   POLICY_RIGHT<br>
+	 *   POLICY_WHITE</b>
+	 *  
+	 * @param value
+	 */
+	public void setPolicy(int value);
+	
+	/**
+	 * Set the curve optimization tolerance (default 0.2)
+	 * @param value
+	 */
+	public void setOptimizationTolerance(double value);
+
+	/**
+	 * Return if the curve optimization is enabled or disabled
+	 * @param value
+	 */
+	public boolean isEnabledCurveOptimization();
+
+	/**
+	 * Enable/Disable the curve optimization (default enabled)
+	 * @param value
+	 */
+	public void setEnabledCurveOptimization(boolean value);
+
+	/**
+	 * Hace el proeso de Vectorizacion de un Raster
+	 * @return
+	 * @throws PotraceException
+	 */
+	public double[] VectorizeBuffer();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/vector/Vectorization.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/BaseIncrementableTask.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/BaseIncrementableTask.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/BaseIncrementableTask.java	(revision 15423)
@@ -0,0 +1,19 @@
+package org.gvsig.fmap.dal.coverage.process;
+
+/**
+ * Base class for incrementable tasks
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface BaseIncrementableTask {
+
+	/**
+	 * Gets the increment
+	 * @return int
+	 */
+	public int getPercent();
+
+	/**
+	 * Sets the increment of this task 
+	 */
+	public void setPercent(int value);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/BaseIncrementableTask.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/OverviewBuilder.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/OverviewBuilder.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/OverviewBuilder.java	(revision 15423)
@@ -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.fmap.dal.coverage.process.overview;
+
+import org.gvsig.fmap.dal.coverage.exception.OverviewException;
+import org.gvsig.fmap.dal.coverage.process.BaseIncrementableTask;
+
+/**
+ * Servicios ofrecidos por el proceso de construcci�n de overviews
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface OverviewBuilder {
+	public final static int NEAREST          = 0;
+	public final static int AVERAGE          = 1;
+	public final static int AVERAGE_MP       = 2;
+	public final static int AVERAGE_MAGPHASE = 3;
+	public final static int MODE             = 4;
+	
+	/**
+	 * Construccion de overviews
+	 */
+	public void buildOverviews(int resamplingAlg, String file, int[] overviews) throws OverviewException;
+	
+	/**
+	 * Devuelve el porcentaje del incremento.
+	 * @return int
+	 */
+	public int getPercent();
+
+	/**
+	 * Asigna el porcentaje de incremento de la construccion de overview.
+	 * Esto se hace automaticamente desde el callback que asigna el porcentaje.
+	 */
+	public void setPercent(int value);
+
+	/**
+	 * Asigna el listener para la asignacion del incremento
+	 * @param incr IOverviewIncrement
+	 */
+	public void setIncrementListener(BaseIncrementableTask incr);
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/OverviewBuilder.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.overview package documentation</title>
+</head>
+<body>
+
+	<p>Classes for building overviews.</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/overview/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/CancelEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/CancelEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/CancelEvent.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.process;
+
+import java.util.EventObject;
+
+/**
+ * Evento de cancelaci�n a los procesos registrados en RasterTaskQueue.
+ * 
+ * @version 17/09/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class CancelEvent extends EventObject {
+
+	private static final long serialVersionUID = 7564626429497930401L;
+
+	/**
+	 * Construye un CancelEvent
+	 * @param source
+	 */
+	public CancelEvent(Object source) {
+		super(source);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/CancelEvent.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/Warp.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/Warp.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/Warp.java	(revision 15423)
@@ -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.fmap.dal.coverage.process.warp;
+
+import org.gvsig.fmap.dal.coverage.exception.WarpException;
+
+/**
+ * Servicios ofrecidos por el proceso de construcci�n de repreoyecci�n
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface Warp {
+	/**
+	 * Reproyecta una imagen raster, creando una imagen de salida
+	 * @param proj EPSG:code o proj4
+	 * @param source Ruta del fichero fuente
+	 * @param dest Ruta del fichero destino
+	 * @param format
+	 * @return 0 si ha ocurrido algun error o 1 si la ejecuci�n ha sido correcta.
+	 * @throws GdalException
+	 */
+	public int warpProcess(String t_srs, String source, String dest, String format) throws WarpException; 
+
+	/**
+	 * Indica la proyecci�n del dataset origen
+	 * @param s_srs
+	 */
+	public void setSsrs(String s_srs);
+
+	/**
+	 * Obtiene el porcentaje de proceso que se ha completado
+	 */
+	public int getPercent();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/Warp.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/package.html	(revision 15423)
@@ -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.fmap.dal.coverage.process.wart package documentation</title>
+</head>
+<body>
+
+	<p>Classes to reprojecting a image</p>
+	
+</body>
+</html>
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/warp/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/IncrementableTask.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/IncrementableTask.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/IncrementableTask.java	(revision 15423)
@@ -0,0 +1,51 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.fmap.dal.coverage.process;
+
+/**
+ * This interface defines methods for common tasks 
+ * 
+ * @version 07/05/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface IncrementableTask extends BaseIncrementableTask {
+	/**
+	 * Devuelve el contenido del log del IncrementableTask
+	 * @return String
+	 */
+	public String getLog();
+
+	/**
+	 * <p>Determines if this process can be canceled.</p>
+	 * 
+	 * @return <code>true</code> if this process can be canceled, otherwise <code>false</code>
+	 */
+	public boolean isCancelable();
+
+	/**
+	 * <p>Determines if this process can be paused.</p>
+	 * 
+	 * @return <code>true</code> if this process can be paused, otherwise <code>false</code>
+	 */
+	public boolean isPausable();
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/process/IncrementableTask.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/BufferFactory.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/BufferFactory.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/BufferFactory.java	(revision 15423)
@@ -0,0 +1,80 @@
+package org.gvsig.fmap.dal.coverage;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.BufferParam;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.exception.BufferCreationException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+
+
+/**
+ * Factory for raster buffers
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface BufferFactory {
+
+	/**
+	 * Creates a parameter object for building a buffer. The buffer type is read-write.
+	 * This type could be changed after the creation of a {@link BufferParam} object.
+	 * The buffer will be cached if it's necessary
+	 * @param  w
+	 *         Width
+	 * @param  h
+	 *         Height
+	 * @param  bandCount
+	 * 		   Number of bands
+	 * @param  dataType
+	 *         Type of data        
+	 */
+	public BufferParam createBufferParams(
+			int w, 
+			int h, 
+			int bandCount, 
+			int dataType, 
+			boolean malloc);
+	
+	/**
+	 * Creates a parameter object for building a buffer. The buffer type is read-write.
+	 * This type could be changed after the creation of a {@link BufferParam} object.
+	 * The buffer will be stored in memory.
+	 * @param  w
+	 *         Width
+	 * @param  h
+	 *         Height
+	 * @param  bandCount
+	 * 		   Number of bands
+	 * @param  dataType
+	 *         Type of data        
+	 */
+	public BufferParam createMemoryBufferParams(
+			int w, 
+			int h, 
+			int bandCount, 
+			int dataType, 
+			boolean malloc);
+	
+	/**
+	 * Creates a parameter object for building a buffer. For this call the buffer type 
+	 * is read-only. 
+	 * @return {@link BufferParam}
+	 * @throws IOException 
+	 */
+	public BufferParam createReadOnlyBufferParams(
+			RasterDataStore store,
+			int minx,
+			int miny,
+			int maxx,
+			int maxy,
+			BandList bandList);
+	
+	/**
+	 * Creates a buffer with the selected parameters
+	 * @param param
+	 * @return
+	 * @throws BufferCreationException 
+	 */
+	public Buffer createBuffer(BufferParam param) throws BufferCreationException;
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/java/org/gvsig/fmap/dal/coverage/BufferFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 15423)
@@ -0,0 +1 @@
+org.gvsig.fmap.dal.coverage.RasterLibrary
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api/pom.xml	(revision 15423)
@@ -0,0 +1,89 @@
+<?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.lib.api</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.lib</artifactId>
+		<version>2.2.171</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.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.metadata.lib.basic.api</artifactId>
+            <scope>compile</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.remoteclient</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>

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


Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.api
___________________________________________________________________
Added: svn:ignore
   + target

.settings

.classpath

.project


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

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/test/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/test/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/test/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml	(revision 15423)
@@ -0,0 +1,11253 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<palettes>
+	<palette_list>
+		<name>Ninguna</name>
+		<name>Default</name>
+		<name>purple-red+stripes</name>
+		<name>blue-white</name>
+		<name>ocean</name>
+		<name>red-temperature</name>
+		<name>16level</name>
+		<name>blue-green-red-yellow</name>
+		<name>blue-pastel-red</name>
+		<name>blue-red</name>
+		<name>blue-waves</name>
+		<name>green-red-blue</name>
+		<name>green-white-exponential</name>
+		<name>hardcandy</name>
+		<name>haze</name>
+		<name>mac-style</name>
+		<name>nature</name>
+		<name>pastels</name>
+		<name>plasma</name>
+		<name>prism</name>
+		<name>rainbow</name>
+		<name>red-purple</name>
+		<name>std-gamma-II</name>
+		<name>steps</name>
+		<name>stern-special</name>
+		<name>MDT1</name>
+		<name>MDT2</name>
+		<name>CLASIFICACION</name>
+		<name>1  Forest - Soil  (100)</name>
+		<name>1  Soil - Forest  (100)</name>
+		<name>2  Blues  (35)</name>
+		<name>2  Cool  (100)</name>
+		<name>2  Greens  (35)</name>
+		<name>2  Marine  (24)</name>
+		<name>2  Pumpkin  (24)</name>
+		<name>2  Reds  (35)</name>
+		<name>2  Sand  (24)</name>
+		<name>2  Warm  (64)</name>
+		<name>Candy  (9)</name>
+		<name>Color Wheel Long  (36)</name>
+		<name>Color Wheel Short  (9)</name>
+		<name>Deep Azure  (256)</name>
+		<name>Deep Blue  (256)</name>
+		<name>Deep Chartreuse  (256)</name>
+		<name>Deep Cyan  (256)</name>
+		<name>Deep Green  (256)</name>
+		<name>Deep Magenta  (256)</name>
+		<name>Deep Orange  (256)</name>
+		<name>Deep Red  (256)</name>
+		<name>Deep Rose  (256)</name>
+		<name>Deep Spring Green  (256)</name>
+		<name>Deep Violet  (256)</name>
+		<name>Deep Yellow  (256)</name>
+		<name>Default</name>
+		<name>Lava Lamp 1  (125)</name>
+		<name>Lava Lamp 2  (125)</name>
+		<name>Mosaic 1  (20)</name>
+		<name>Mosaic 2  (20)</name>
+		<name>Mosaic 3  (20)</name>
+		<name>Mosaic 4  (20)</name>
+		<name>Mosaic 5  (20)</name>
+		<name>Mosaic 6  (20)</name>
+		<name>Pastels Long  (36)</name>
+		<name>Pastels Short  (9)</name>
+		<name>Pastels Dark Long  (36)</name>
+		<name>Pastels Dark Short  (9)</name>
+		<name>Stairsteps Blue  (15)</name>
+		<name>Stairsteps Green  (15)</name>
+		<name>Stairsteps Orange  (15)</name>
+		<name>Stairsteps Purple  (15)</name>
+		<name>Stairsteps Yellow  (15)</name>
+		<name>Step Down Blue  (9)</name>
+		<name>Step Down Green  (9)</name>
+		<name>Step Down Red  (9)</name>
+		<name>Step Up Cyan  (9)</name>
+		<name>Step Up Magenta  (9)</name>
+		<name>Step Up Yellow  (9)</name>
+		<name>White-Black  (256)</name>
+	</palette_list>
+
+	<palette name="Default" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="purple-red+stripes" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,0" value="1" />
+			<entry class="" argb="255,127,127,127" value="2" />
+			<entry class="" argb="255,191,0,191" value="3" />
+			<entry class="" argb="255,188,0,192" value="4" />
+			<entry class="" argb="255,186,0,192" value="5" />
+			<entry class="" argb="255,184,0,193" value="6" />
+			<entry class="" argb="255,182,0,194" value="7" />
+			<entry class="" argb="255,179,0,195" value="8" />
+			<entry class="" argb="255,177,0,195" value="9" />
+			<entry class="" argb="255,140,0,157" value="10" />
+			<entry class="" argb="255,138,0,157" value="11" />
+			<entry class="" argb="255,170,0,198" value="12" />
+			<entry class="" argb="255,168,0,198" value="13" />
+			<entry class="" argb="255,165,0,199" value="14" />
+			<entry class="" argb="255,163,0,200" value="15" />
+			<entry class="" argb="255,161,0,201" value="16" />
+			<entry class="" argb="255,158,0,202" value="17" />
+			<entry class="" argb="255,156,0,202" value="18" />
+			<entry class="" argb="255,154,0,203" value="19" />
+			<entry class="" argb="255,121,0,163" value="20" />
+			<entry class="" argb="255,119,0,164" value="21" />
+			<entry class="" argb="255,147,0,205" value="22" />
+			<entry class="" argb="255,145,0,206" value="23" />
+			<entry class="" argb="255,142,0,207" value="24" />
+			<entry class="" argb="255,140,0,208" value="25" />
+			<entry class="" argb="255,138,0,208" value="26" />
+			<entry class="" argb="255,135,0,209" value="27" />
+			<entry class="" argb="255,133,0,210" value="28" />
+			<entry class="" argb="255,131,0,211" value="29" />
+			<entry class="" argb="255,103,0,169" value="30" />
+			<entry class="" argb="255,101,0,170" value="31" />
+			<entry class="" argb="255,124,0,213" value="32" />
+			<entry class="" argb="255,122,0,214" value="33" />
+			<entry class="" argb="255,119,0,215" value="34" />
+			<entry class="" argb="255,117,0,215" value="35" />
+			<entry class="" argb="255,115,0,216" value="36" />
+			<entry class="" argb="255,112,0,217" value="37" />
+			<entry class="" argb="255,110,0,218" value="38" />
+			<entry class="" argb="255,108,0,218" value="39" />
+			<entry class="" argb="255,84,0,175" value="40" />
+			<entry class="" argb="255,82,0,176" value="41" />
+			<entry class="" argb="255,101,0,221" value="42" />
+			<entry class="" argb="255,99,0,221" value="43" />
+			<entry class="" argb="255,96,0,222" value="44" />
+			<entry class="" argb="255,94,0,223" value="45" />
+			<entry class="" argb="255,92,0,224" value="46" />
+			<entry class="" argb="255,89,0,225" value="47" />
+			<entry class="" argb="255,87,0,225" value="48" />
+			<entry class="" argb="255,85,0,226" value="49" />
+			<entry class="" argb="255,66,0,181" value="50" />
+			<entry class="" argb="255,64,0,182" value="51" />
+			<entry class="" argb="255,78,0,228" value="52" />
+			<entry class="" argb="255,76,0,229" value="53" />
+			<entry class="" argb="255,73,0,230" value="54" />
+			<entry class="" argb="255,71,0,231" value="55" />
+			<entry class="" argb="255,69,0,231" value="56" />
+			<entry class="" argb="255,66,0,232" value="57" />
+			<entry class="" argb="255,64,0,233" value="58" />
+			<entry class="" argb="255,62,0,234" value="59" />
+			<entry class="" argb="255,47,0,188" value="60" />
+			<entry class="" argb="255,46,0,188" value="61" />
+			<entry class="" argb="255,55,0,236" value="62" />
+			<entry class="" argb="255,52,0,237" value="63" />
+			<entry class="" argb="255,50,0,238" value="64" />
+			<entry class="" argb="255,48,0,238" value="65" />
+			<entry class="" argb="255,46,0,239" value="66" />
+			<entry class="" argb="255,43,0,240" value="67" />
+			<entry class="" argb="255,41,0,241" value="68" />
+			<entry class="" argb="255,39,0,241" value="69" />
+			<entry class="" argb="255,29,0,194" value="70" />
+			<entry class="" argb="255,27,0,194" value="71" />
+			<entry class="" argb="255,32,0,244" value="72" />
+			<entry class="" argb="255,29,0,245" value="73" />
+			<entry class="" argb="255,27,0,245" value="74" />
+			<entry class="" argb="255,25,0,246" value="75" />
+			<entry class="" argb="255,23,0,247" value="76" />
+			<entry class="" argb="255,20,0,248" value="77" />
+			<entry class="" argb="255,18,0,248" value="78" />
+			<entry class="" argb="255,16,0,249" value="79" />
+			<entry class="" argb="255,11,0,200" value="80" />
+			<entry class="" argb="255,9,0,200" value="81" />
+			<entry class="" argb="255,9,0,251" value="82" />
+			<entry class="" argb="255,6,0,252" value="83" />
+			<entry class="" argb="255,4,0,253" value="84" />
+			<entry class="" argb="255,2,0,254" value="85" />
+			<entry class="" argb="255,0,0,255" value="86" />
+			<entry class="" argb="255,0,6,255" value="87" />
+			<entry class="" argb="255,0,12,255" value="88" />
+			<entry class="" argb="255,0,18,255" value="89" />
+			<entry class="" argb="255,0,19,204" value="90" />
+			<entry class="" argb="255,0,24,204" value="91" />
+			<entry class="" argb="255,0,36,255" value="92" />
+			<entry class="" argb="255,0,42,255" value="93" />
+			<entry class="" argb="255,0,48,255" value="94" />
+			<entry class="" argb="255,0,54,255" value="95" />
+			<entry class="" argb="255,0,60,255" value="96" />
+			<entry class="" argb="255,0,66,255" value="97" />
+			<entry class="" argb="255,0,72,255" value="98" />
+			<entry class="" argb="255,0,78,255" value="99" />
+			<entry class="" argb="255,0,68,204" value="100" />
+			<entry class="" argb="255,0,72,204" value="101" />
+			<entry class="" argb="255,0,97,255" value="102" />
+			<entry class="" argb="255,0,103,255" value="103" />
+			<entry class="" argb="255,0,109,255" value="104" />
+			<entry class="" argb="255,0,115,255" value="105" />
+			<entry class="" argb="255,0,121,255" value="106" />
+			<entry class="" argb="255,0,127,255" value="107" />
+			<entry class="" argb="255,0,133,255" value="108" />
+			<entry class="" argb="255,0,139,255" value="109" />
+			<entry class="" argb="255,0,116,204" value="110" />
+			<entry class="" argb="255,0,121,204" value="111" />
+			<entry class="" argb="255,0,157,255" value="112" />
+			<entry class="" argb="255,0,163,255" value="113" />
+			<entry class="" argb="255,0,170,255" value="114" />
+			<entry class="" argb="255,0,176,255" value="115" />
+			<entry class="" argb="255,0,182,255" value="116" />
+			<entry class="" argb="255,0,188,255" value="117" />
+			<entry class="" argb="255,0,194,255" value="118" />
+			<entry class="" argb="255,0,200,255" value="119" />
+			<entry class="" argb="255,0,165,204" value="120" />
+			<entry class="" argb="255,0,170,204" value="121" />
+			<entry class="" argb="255,0,218,255" value="122" />
+			<entry class="" argb="255,0,224,255" value="123" />
+			<entry class="" argb="255,0,230,255" value="124" />
+			<entry class="" argb="255,0,236,255" value="125" />
+			<entry class="" argb="255,0,242,255" value="126" />
+			<entry class="" argb="255,0,248,255" value="127" />
+			<entry class="" argb="255,0,255,255" value="128" />
+			<entry class="" argb="255,0,255,248" value="129" />
+			<entry class="" argb="255,0,204,194" value="130" />
+			<entry class="" argb="255,0,204,189" value="131" />
+			<entry class="" argb="255,0,255,230" value="132" />
+			<entry class="" argb="255,0,255,224" value="133" />
+			<entry class="" argb="255,0,255,218" value="134" />
+			<entry class="" argb="255,0,255,212" value="135" />
+			<entry class="" argb="255,0,255,206" value="136" />
+			<entry class="" argb="255,0,255,200" value="137" />
+			<entry class="" argb="255,0,255,194" value="138" />
+			<entry class="" argb="255,0,255,188" value="139" />
+			<entry class="" argb="255,0,204,145" value="140" />
+			<entry class="" argb="255,0,204,140" value="141" />
+			<entry class="" argb="255,0,255,169" value="142" />
+			<entry class="" argb="255,0,255,163" value="143" />
+			<entry class="" argb="255,0,255,157" value="144" />
+			<entry class="" argb="255,0,255,151" value="145" />
+			<entry class="" argb="255,0,255,145" value="146" />
+			<entry class="" argb="255,0,255,139" value="147" />
+			<entry class="" argb="255,0,255,133" value="148" />
+			<entry class="" argb="255,0,255,127" value="149" />
+			<entry class="" argb="255,0,204,97" value="150" />
+			<entry class="" argb="255,0,204,92" value="151" />
+			<entry class="" argb="255,0,255,109" value="152" />
+			<entry class="" argb="255,0,255,103" value="153" />
+			<entry class="" argb="255,0,255,97" value="154" />
+			<entry class="" argb="255,0,255,91" value="155" />
+			<entry class="" argb="255,0,255,84" value="156" />
+			<entry class="" argb="255,0,255,78" value="157" />
+			<entry class="" argb="255,0,255,72" value="158" />
+			<entry class="" argb="255,0,255,66" value="159" />
+			<entry class="" argb="255,0,204,48" value="160" />
+			<entry class="" argb="255,0,204,43" value="161" />
+			<entry class="" argb="255,0,255,48" value="162" />
+			<entry class="" argb="255,0,255,42" value="163" />
+			<entry class="" argb="255,0,255,36" value="164" />
+			<entry class="" argb="255,0,255,30" value="165" />
+			<entry class="" argb="255,0,255,24" value="166" />
+			<entry class="" argb="255,0,255,18" value="167" />
+			<entry class="" argb="255,0,255,12" value="168" />
+			<entry class="" argb="255,0,255,6" value="169" />
+			<entry class="" argb="255,0,204,0" value="170" />
+			<entry class="" argb="255,4,204,0" value="171" />
+			<entry class="" argb="255,12,255,0" value="172" />
+			<entry class="" argb="255,18,255,0" value="173" />
+			<entry class="" argb="255,24,255,0" value="174" />
+			<entry class="" argb="255,30,255,0" value="175" />
+			<entry class="" argb="255,36,255,0" value="176" />
+			<entry class="" argb="255,42,255,0" value="177" />
+			<entry class="" argb="255,48,255,0" value="178" />
+			<entry class="" argb="255,54,255,0" value="179" />
+			<entry class="" argb="255,48,204,0" value="180" />
+			<entry class="" argb="255,53,204,0" value="181" />
+			<entry class="" argb="255,72,255,0" value="182" />
+			<entry class="" argb="255,78,255,0" value="183" />
+			<entry class="" argb="255,85,255,0" value="184" />
+			<entry class="" argb="255,91,255,0" value="185" />
+			<entry class="" argb="255,97,255,0" value="186" />
+			<entry class="" argb="255,103,255,0" value="187" />
+			<entry class="" argb="255,109,255,0" value="188" />
+			<entry class="" argb="255,115,255,0" value="189" />
+			<entry class="" argb="255,97,204,0" value="190" />
+			<entry class="" argb="255,102,204,0" value="191" />
+			<entry class="" argb="255,133,255,0" value="192" />
+			<entry class="" argb="255,139,255,0" value="193" />
+			<entry class="" argb="255,145,255,0" value="194" />
+			<entry class="" argb="255,151,255,0" value="195" />
+			<entry class="" argb="255,157,255,0" value="196" />
+			<entry class="" argb="255,163,255,0" value="197" />
+			<entry class="" argb="255,170,255,0" value="198" />
+			<entry class="" argb="255,176,255,0" value="199" />
+			<entry class="" argb="255,145,204,0" value="200" />
+			<entry class="" argb="255,150,204,0" value="201" />
+			<entry class="" argb="255,194,255,0" value="202" />
+			<entry class="" argb="255,200,255,0" value="203" />
+			<entry class="" argb="255,206,255,0" value="204" />
+			<entry class="" argb="255,212,255,0" value="205" />
+			<entry class="" argb="255,218,255,0" value="206" />
+			<entry class="" argb="255,224,255,0" value="207" />
+			<entry class="" argb="255,230,255,0" value="208" />
+			<entry class="" argb="255,236,255,0" value="209" />
+			<entry class="" argb="255,194,204,0" value="210" />
+			<entry class="" argb="255,199,204,0" value="211" />
+			<entry class="" argb="255,255,255,0" value="212" />
+			<entry class="" argb="255,255,248,2" value="213" />
+			<entry class="" argb="255,255,242,5" value="214" />
+			<entry class="" argb="255,255,235,7" value="215" />
+			<entry class="" argb="255,255,229,10" value="216" />
+			<entry class="" argb="255,255,223,12" value="217" />
+			<entry class="" argb="255,255,216,15" value="218" />
+			<entry class="" argb="255,255,210,17" value="219" />
+			<entry class="" argb="255,204,163,16" value="220" />
+			<entry class="" argb="255,204,158,18" value="221" />
+			<entry class="" argb="255,255,191,25" value="222" />
+			<entry class="" argb="255,255,184,28" value="223" />
+			<entry class="" argb="255,255,178,30" value="224" />
+			<entry class="" argb="255,255,172,33" value="225" />
+			<entry class="" argb="255,255,165,35" value="226" />
+			<entry class="" argb="255,255,159,38" value="227" />
+			<entry class="" argb="255,255,153,40" value="228" />
+			<entry class="" argb="255,255,146,43" value="229" />
+			<entry class="" argb="255,204,112,36" value="230" />
+			<entry class="" argb="255,204,107,38" value="231" />
+			<entry class="" argb="255,255,127,51" value="232" />
+			<entry class="" argb="255,255,121,48" value="233" />
+			<entry class="" argb="255,255,115,46" value="234" />
+			<entry class="" argb="255,255,110,44" value="235" />
+			<entry class="" argb="255,255,104,41" value="236" />
+			<entry class="" argb="255,255,98,39" value="237" />
+			<entry class="" argb="255,255,92,37" value="238" />
+			<entry class="" argb="255,255,86,34" value="239" />
+			<entry class="" argb="255,204,64,25" value="240" />
+			<entry class="" argb="255,204,60,24" value="241" />
+			<entry class="" argb="255,255,69,27" value="242" />
+			<entry class="" argb="255,255,63,25" value="243" />
+			<entry class="" argb="255,255,57,23" value="244" />
+			<entry class="" argb="255,255,52,20" value="245" />
+			<entry class="" argb="255,255,46,18" value="246" />
+			<entry class="" argb="255,255,40,16" value="247" />
+			<entry class="" argb="255,255,34,13" value="248" />
+			<entry class="" argb="255,255,28,11" value="249" />
+			<entry class="" argb="255,204,18,7" value="250" />
+			<entry class="" argb="255,204,13,5" value="251" />
+			<entry class="" argb="255,255,11,4" value="252" />
+			<entry class="" argb="255,255,5,2" value="253" />
+			<entry class="" argb="255,255,0,0" value="254" />
+			<entry class="" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-white" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,1" value="1" />
+			<entry class="" argb="255,0,0,2" value="2" />
+			<entry class="" argb="255,0,0,4" value="3" />
+			<entry class="" argb="255,0,0,5" value="4" />
+			<entry class="" argb="255,0,0,6" value="5" />
+			<entry class="" argb="255,0,0,8" value="6" />
+			<entry class="" argb="255,0,0,9" value="7" />
+			<entry class="" argb="255,0,0,10" value="8" />
+			<entry class="" argb="255,0,0,12" value="9" />
+			<entry class="" argb="255,0,0,13" value="10" />
+			<entry class="" argb="255,0,0,14" value="11" />
+			<entry class="" argb="255,0,0,16" value="12" />
+			<entry class="" argb="255,0,0,17" value="13" />
+			<entry class="" argb="255,0,0,18" value="14" />
+			<entry class="" argb="255,0,0,20" value="15" />
+			<entry class="" argb="255,0,0,21" value="16" />
+			<entry class="" argb="255,0,0,23" value="17" />
+			<entry class="" argb="255,0,0,24" value="18" />
+			<entry class="" argb="255,0,0,25" value="19" />
+			<entry class="" argb="255,0,0,27" value="20" />
+			<entry class="" argb="255,0,0,28" value="21" />
+			<entry class="" argb="255,0,0,29" value="22" />
+			<entry class="" argb="255,0,0,31" value="23" />
+			<entry class="" argb="255,0,0,32" value="24" />
+			<entry class="" argb="255,0,0,33" value="25" />
+			<entry class="" argb="255,0,0,35" value="26" />
+			<entry class="" argb="255,0,0,36" value="27" />
+			<entry class="" argb="255,0,0,37" value="28" />
+			<entry class="" argb="255,0,0,39" value="29" />
+			<entry class="" argb="255,0,0,40" value="30" />
+			<entry class="" argb="255,0,0,42" value="31" />
+			<entry class="" argb="255,0,0,43" value="32" />
+			<entry class="" argb="255,0,0,44" value="33" />
+			<entry class="" argb="255,0,0,46" value="34" />
+			<entry class="" argb="255,0,0,47" value="35" />
+			<entry class="" argb="255,0,0,48" value="36" />
+			<entry class="" argb="255,0,0,50" value="37" />
+			<entry class="" argb="255,0,0,51" value="38" />
+			<entry class="" argb="255,0,0,52" value="39" />
+			<entry class="" argb="255,0,0,54" value="40" />
+			<entry class="" argb="255,0,0,55" value="41" />
+			<entry class="" argb="255,0,0,56" value="42" />
+			<entry class="" argb="255,0,0,58" value="43" />
+			<entry class="" argb="255,0,0,59" value="44" />
+			<entry class="" argb="255,0,0,61" value="45" />
+			<entry class="" argb="255,0,0,62" value="46" />
+			<entry class="" argb="255,0,0,63" value="47" />
+			<entry class="" argb="255,0,0,65" value="48" />
+			<entry class="" argb="255,0,0,66" value="49" />
+			<entry class="" argb="255,0,0,67" value="50" />
+			<entry class="" argb="255,0,0,69" value="51" />
+			<entry class="" argb="255,0,0,70" value="52" />
+			<entry class="" argb="255,0,0,71" value="53" />
+			<entry class="" argb="255,0,0,73" value="54" />
+			<entry class="" argb="255,0,0,74" value="55" />
+			<entry class="" argb="255,0,0,75" value="56" />
+			<entry class="" argb="255,0,0,77" value="57" />
+			<entry class="" argb="255,0,0,78" value="58" />
+			<entry class="" argb="255,0,0,80" value="59" />
+			<entry class="" argb="255,0,0,81" value="60" />
+			<entry class="" argb="255,0,0,82" value="61" />
+			<entry class="" argb="255,0,0,84" value="62" />
+			<entry class="" argb="255,0,0,85" value="63" />
+			<entry class="" argb="255,0,0,86" value="64" />
+			<entry class="" argb="255,0,0,88" value="65" />
+			<entry class="" argb="255,0,0,89" value="66" />
+			<entry class="" argb="255,0,0,90" value="67" />
+			<entry class="" argb="255,0,0,92" value="68" />
+			<entry class="" argb="255,0,0,93" value="69" />
+			<entry class="" argb="255,0,0,94" value="70" />
+			<entry class="" argb="255,0,0,96" value="71" />
+			<entry class="" argb="255,0,0,97" value="72" />
+			<entry class="" argb="255,0,0,99" value="73" />
+			<entry class="" argb="255,0,0,100" value="74" />
+			<entry class="" argb="255,0,0,101" value="75" />
+			<entry class="" argb="255,0,0,103" value="76" />
+			<entry class="" argb="255,0,0,104" value="77" />
+			<entry class="" argb="255,0,0,105" value="78" />
+			<entry class="" argb="255,0,0,107" value="79" />
+			<entry class="" argb="255,0,0,108" value="80" />
+			<entry class="" argb="255,0,0,109" value="81" />
+			<entry class="" argb="255,0,0,111" value="82" />
+			<entry class="" argb="255,0,0,112" value="83" />
+			<entry class="" argb="255,0,0,113" value="84" />
+			<entry class="" argb="255,0,0,115" value="85" />
+			<entry class="" argb="255,0,0,116" value="86" />
+			<entry class="" argb="255,0,0,118" value="87" />
+			<entry class="" argb="255,0,0,119" value="88" />
+			<entry class="" argb="255,0,0,120" value="89" />
+			<entry class="" argb="255,0,0,122" value="90" />
+			<entry class="" argb="255,0,0,123" value="91" />
+			<entry class="" argb="255,0,0,124" value="92" />
+			<entry class="" argb="255,0,0,126" value="93" />
+			<entry class="" argb="255,0,0,127" value="94" />
+			<entry class="" argb="255,0,0,128" value="95" />
+			<entry class="" argb="255,0,0,130" value="96" />
+			<entry class="" argb="255,0,2,131" value="97" />
+			<entry class="" argb="255,0,4,132" value="98" />
+			<entry class="" argb="255,0,5,134" value="99" />
+			<entry class="" argb="255,0,7,135" value="100" />
+			<entry class="" argb="255,0,9,136" value="101" />
+			<entry class="" argb="255,0,10,138" value="102" />
+			<entry class="" argb="255,0,12,139" value="103" />
+			<entry class="" argb="255,0,13,141" value="104" />
+			<entry class="" argb="255,0,15,142" value="105" />
+			<entry class="" argb="255,0,17,143" value="106" />
+			<entry class="" argb="255,0,18,145" value="107" />
+			<entry class="" argb="255,0,20,146" value="108" />
+			<entry class="" argb="255,0,21,147" value="109" />
+			<entry class="" argb="255,0,23,149" value="110" />
+			<entry class="" argb="255,0,25,150" value="111" />
+			<entry class="" argb="255,0,26,151" value="112" />
+			<entry class="" argb="255,0,28,153" value="113" />
+			<entry class="" argb="255,0,29,154" value="114" />
+			<entry class="" argb="255,0,31,155" value="115" />
+			<entry class="" argb="255,0,33,157" value="116" />
+			<entry class="" argb="255,0,34,158" value="117" />
+			<entry class="" argb="255,0,36,160" value="118" />
+			<entry class="" argb="255,0,37,161" value="119" />
+			<entry class="" argb="255,0,39,162" value="120" />
+			<entry class="" argb="255,0,41,164" value="121" />
+			<entry class="" argb="255,0,42,165" value="122" />
+			<entry class="" argb="255,0,44,166" value="123" />
+			<entry class="" argb="255,0,45,168" value="124" />
+			<entry class="" argb="255,0,47,169" value="125" />
+			<entry class="" argb="255,0,49,170" value="126" />
+			<entry class="" argb="255,0,50,172" value="127" />
+			<entry class="" argb="255,0,52,173" value="128" />
+			<entry class="" argb="255,0,53,174" value="129" />
+			<entry class="" argb="255,0,55,176" value="130" />
+			<entry class="" argb="255,0,57,177" value="131" />
+			<entry class="" argb="255,0,58,179" value="132" />
+			<entry class="" argb="255,0,60,180" value="133" />
+			<entry class="" argb="255,0,61,181" value="134" />
+			<entry class="" argb="255,0,63,183" value="135" />
+			<entry class="" argb="255,0,65,184" value="136" />
+			<entry class="" argb="255,0,66,185" value="137" />
+			<entry class="" argb="255,0,68,187" value="138" />
+			<entry class="" argb="255,0,69,188" value="139" />
+			<entry class="" argb="255,0,71,189" value="140" />
+			<entry class="" argb="255,0,73,191" value="141" />
+			<entry class="" argb="255,0,74,192" value="142" />
+			<entry class="" argb="255,0,76,193" value="143" />
+			<entry class="" argb="255,0,77,195" value="144" />
+			<entry class="" argb="255,0,79,196" value="145" />
+			<entry class="" argb="255,0,81,198" value="146" />
+			<entry class="" argb="255,0,82,199" value="147" />
+			<entry class="" argb="255,0,84,200" value="148" />
+			<entry class="" argb="255,0,85,202" value="149" />
+			<entry class="" argb="255,0,87,203" value="150" />
+			<entry class="" argb="255,0,89,204" value="151" />
+			<entry class="" argb="255,0,90,206" value="152" />
+			<entry class="" argb="255,0,92,207" value="153" />
+			<entry class="" argb="255,0,94,208" value="154" />
+			<entry class="" argb="255,0,95,210" value="155" />
+			<entry class="" argb="255,0,97,211" value="156" />
+			<entry class="" argb="255,0,98,212" value="157" />
+			<entry class="" argb="255,0,100,214" value="158" />
+			<entry class="" argb="255,0,102,215" value="159" />
+			<entry class="" argb="255,0,103,217" value="160" />
+			<entry class="" argb="255,0,105,218" value="161" />
+			<entry class="" argb="255,0,106,219" value="162" />
+			<entry class="" argb="255,0,108,221" value="163" />
+			<entry class="" argb="255,0,110,222" value="164" />
+			<entry class="" argb="255,0,111,223" value="165" />
+			<entry class="" argb="255,0,113,225" value="166" />
+			<entry class="" argb="255,0,114,226" value="167" />
+			<entry class="" argb="255,0,116,227" value="168" />
+			<entry class="" argb="255,0,118,229" value="169" />
+			<entry class="" argb="255,0,119,230" value="170" />
+			<entry class="" argb="255,0,121,231" value="171" />
+			<entry class="" argb="255,0,122,233" value="172" />
+			<entry class="" argb="255,0,124,234" value="173" />
+			<entry class="" argb="255,0,126,236" value="174" />
+			<entry class="" argb="255,0,127,237" value="175" />
+			<entry class="" argb="255,0,129,238" value="176" />
+			<entry class="" argb="255,0,130,240" value="177" />
+			<entry class="" argb="255,0,132,241" value="178" />
+			<entry class="" argb="255,0,134,242" value="179" />
+			<entry class="" argb="255,0,135,244" value="180" />
+			<entry class="" argb="255,0,137,245" value="181" />
+			<entry class="" argb="255,0,138,246" value="182" />
+			<entry class="" argb="255,0,140,248" value="183" />
+			<entry class="" argb="255,0,142,249" value="184" />
+			<entry class="" argb="255,0,143,250" value="185" />
+			<entry class="" argb="255,0,145,252" value="186" />
+			<entry class="" argb="255,0,146,253" value="187" />
+			<entry class="" argb="255,0,148,255" value="188" />
+			<entry class="" argb="255,0,150,255" value="189" />
+			<entry class="" argb="255,0,151,255" value="190" />
+			<entry class="" argb="255,0,153,255" value="191" />
+			<entry class="" argb="255,0,154,255" value="192" />
+			<entry class="" argb="255,5,156,255" value="193" />
+			<entry class="" argb="255,9,158,255" value="194" />
+			<entry class="" argb="255,13,159,255" value="195" />
+			<entry class="" argb="255,17,161,255" value="196" />
+			<entry class="" argb="255,21,162,255" value="197" />
+			<entry class="" argb="255,25,164,255" value="198" />
+			<entry class="" argb="255,29,166,255" value="199" />
+			<entry class="" argb="255,33,167,255" value="200" />
+			<entry class="" argb="255,37,169,255" value="201" />
+			<entry class="" argb="255,41,170,255" value="202" />
+			<entry class="" argb="255,45,172,255" value="203" />
+			<entry class="" argb="255,49,174,255" value="204" />
+			<entry class="" argb="255,53,175,255" value="205" />
+			<entry class="" argb="255,57,177,255" value="206" />
+			<entry class="" argb="255,61,179,255" value="207" />
+			<entry class="" argb="255,65,180,255" value="208" />
+			<entry class="" argb="255,69,182,255" value="209" />
+			<entry class="" argb="255,73,183,255" value="210" />
+			<entry class="" argb="255,77,185,255" value="211" />
+			<entry class="" argb="255,81,187,255" value="212" />
+			<entry class="" argb="255,85,188,255" value="213" />
+			<entry class="" argb="255,90,190,255" value="214" />
+			<entry class="" argb="255,94,191,255" value="215" />
+			<entry class="" argb="255,98,193,255" value="216" />
+			<entry class="" argb="255,102,195,255" value="217" />
+			<entry class="" argb="255,106,196,255" value="218" />
+			<entry class="" argb="255,110,198,255" value="219" />
+			<entry class="" argb="255,114,199,255" value="220" />
+			<entry class="" argb="255,118,201,255" value="221" />
+			<entry class="" argb="255,122,203,255" value="222" />
+			<entry class="" argb="255,126,204,255" value="223" />
+			<entry class="" argb="255,130,206,255" value="224" />
+			<entry class="" argb="255,134,207,255" value="225" />
+			<entry class="" argb="255,138,209,255" value="226" />
+			<entry class="" argb="255,142,211,255" value="227" />
+			<entry class="" argb="255,146,212,255" value="228" />
+			<entry class="" argb="255,150,214,255" value="229" />
+			<entry class="" argb="255,154,215,255" value="230" />
+			<entry class="" argb="255,158,217,255" value="231" />
+			<entry class="" argb="255,162,219,255" value="232" />
+			<entry class="" argb="255,166,220,255" value="233" />
+			<entry class="" argb="255,170,222,255" value="234" />
+			<entry class="" argb="255,175,223,255" value="235" />
+			<entry class="" argb="255,179,225,255" value="236" />
+			<entry class="" argb="255,183,227,255" value="237" />
+			<entry class="" argb="255,187,228,255" value="238" />
+			<entry class="" argb="255,191,230,255" value="239" />
+			<entry class="" argb="255,195,231,255" value="240" />
+			<entry class="" argb="255,199,233,255" value="241" />
+			<entry class="" argb="255,203,235,255" value="242" />
+			<entry class="" argb="255,207,236,255" value="243" />
+			<entry class="" argb="255,211,238,255" value="244" />
+			<entry class="" argb="255,215,239,255" value="245" />
+			<entry class="" argb="255,219,241,255" value="246" />
+			<entry class="" argb="255,223,243,255" value="247" />
+			<entry class="" argb="255,227,244,255" value="248" />
+			<entry class="" argb="255,231,246,255" value="249" />
+			<entry class="" argb="255,235,247,255" value="250" />
+			<entry class="" argb="255,239,249,255" value="251" />
+			<entry class="" argb="255,243,251,255" value="252" />
+			<entry class="" argb="255,247,252,255" value="253" />
+			<entry class="" argb="255,251,254,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="ocean" interpolate="false">
+		<table>
+			<entry class="" argb="255,54,67,141" value="0" />
+			<entry class="" argb="255,54,67,141" value="1" />
+			<entry class="" argb="255,59,67,153" value="2" />
+			<entry class="" argb="255,63,67,165" value="3" />
+			<entry class="" argb="255,68,67,177" value="4" />
+			<entry class="" argb="255,73,67,189" value="5" />
+			<entry class="" argb="255,77,67,202" value="6" />
+			<entry class="" argb="255,82,66,214" value="7" />
+			<entry class="" argb="255,82,66,214" value="8" />
+			<entry class="" argb="255,87,66,227" value="9" />
+			<entry class="" argb="255,91,65,239" value="10" />
+			<entry class="" argb="255,96,64,251" value="11" />
+			<entry class="" argb="255,100,64,246" value="12" />
+			<entry class="" argb="255,105,63,234" value="13" />
+			<entry class="" argb="255,110,62,222" value="14" />
+			<entry class="" argb="255,114,61,210" value="15" />
+			<entry class="" argb="255,119,60,198" value="16" />
+			<entry class="" argb="255,123,59,186" value="17" />
+			<entry class="" argb="255,127,57,175" value="18" />
+			<entry class="" argb="255,131,56,164" value="19" />
+			<entry class="" argb="255,135,55,153" value="20" />
+			<entry class="" argb="255,139,54,142" value="21" />
+			<entry class="" argb="255,143,53,132" value="22" />
+			<entry class="" argb="255,143,53,132" value="23" />
+			<entry class="" argb="255,147,52,122" value="24" />
+			<entry class="" argb="255,150,51,113" value="25" />
+			<entry class="" argb="255,154,49,104" value="26" />
+			<entry class="" argb="255,157,48,95" value="27" />
+			<entry class="" argb="255,160,47,87" value="28" />
+			<entry class="" argb="255,163,47,79" value="29" />
+			<entry class="" argb="255,165,46,72" value="30" />
+			<entry class="" argb="255,168,45,66" value="31" />
+			<entry class="" argb="255,170,44,59" value="32" />
+			<entry class="" argb="255,172,44,54" value="33" />
+			<entry class="" argb="255,174,44,49" value="34" />
+			<entry class="" argb="255,176,43,44" value="35" />
+			<entry class="" argb="255,177,43,40" value="36" />
+			<entry class="" argb="255,177,43,40" value="37" />
+			<entry class="" argb="255,179,43,37" value="38" />
+			<entry class="" argb="255,180,43,34" value="39" />
+			<entry class="" argb="255,180,44,32" value="40" />
+			<entry class="" argb="255,181,44,31" value="41" />
+			<entry class="" argb="255,181,45,30" value="42" />
+			<entry class="" argb="255,182,46,29" value="43" />
+			<entry class="" argb="255,181,47,30" value="44" />
+			<entry class="" argb="255,181,48,31" value="45" />
+			<entry class="" argb="255,180,50,32" value="46" />
+			<entry class="" argb="255,180,51,34" value="47" />
+			<entry class="" argb="255,179,53,37" value="48" />
+			<entry class="" argb="255,177,55,40" value="49" />
+			<entry class="" argb="255,176,57,44" value="50" />
+			<entry class="" argb="255,174,60,49" value="51" />
+			<entry class="" argb="255,174,60,49" value="52" />
+			<entry class="" argb="255,172,62,54" value="53" />
+			<entry class="" argb="255,170,65,59" value="54" />
+			<entry class="" argb="255,168,68,66" value="55" />
+			<entry class="" argb="255,165,71,72" value="56" />
+			<entry class="" argb="255,163,74,79" value="57" />
+			<entry class="" argb="255,160,78,87" value="58" />
+			<entry class="" argb="255,157,81,95" value="59" />
+			<entry class="" argb="255,154,85,104" value="60" />
+			<entry class="" argb="255,150,88,113" value="61" />
+			<entry class="" argb="255,147,92,122" value="62" />
+			<entry class="" argb="255,143,96,132" value="63" />
+			<entry class="" argb="255,139,100,142" value="64" />
+			<entry class="" argb="255,135,104,153" value="65" />
+			<entry class="" argb="255,131,108,164" value="66" />
+			<entry class="" argb="255,131,108,164" value="67" />
+			<entry class="" argb="255,127,112,175" value="68" />
+			<entry class="" argb="255,123,116,186" value="69" />
+			<entry class="" argb="255,119,120,198" value="70" />
+			<entry class="" argb="255,114,124,210" value="71" />
+			<entry class="" argb="255,110,128,222" value="72" />
+			<entry class="" argb="255,105,132,234" value="73" />
+			<entry class="" argb="255,100,136,246" value="74" />
+			<entry class="" argb="255,96,140,251" value="75" />
+			<entry class="" argb="255,91,144,239" value="76" />
+			<entry class="" argb="255,86,148,226" value="77" />
+			<entry class="" argb="255,82,151,214" value="78" />
+			<entry class="" argb="255,77,154,202" value="79" />
+			<entry class="" argb="255,73,158,189" value="80" />
+			<entry class="" argb="255,68,161,177" value="81" />
+			<entry class="" argb="255,68,161,177" value="82" />
+			<entry class="" argb="255,63,164,165" value="83" />
+			<entry class="" argb="255,59,166,153" value="84" />
+			<entry class="" argb="255,54,169,141" value="85" />
+			<entry class="" argb="255,50,171,129" value="86" />
+			<entry class="" argb="255,46,173,118" value="87" />
+			<entry class="" argb="255,42,175,107" value="88" />
+			<entry class="" argb="255,38,176,96" value="89" />
+			<entry class="" argb="255,34,178,85" value="90" />
+			<entry class="" argb="255,30,179,75" value="91" />
+			<entry class="" argb="255,26,180,65" value="92" />
+			<entry class="" argb="255,23,180,56" value="93" />
+			<entry class="" argb="255,19,180,47" value="94" />
+			<entry class="" argb="255,16,180,38" value="95" />
+			<entry class="" argb="255,13,180,30" value="96" />
+			<entry class="" argb="255,13,180,30" value="97" />
+			<entry class="" argb="255,13,179,22" value="98" />
+			<entry class="" argb="255,8,179,15" value="99" />
+			<entry class="" argb="255,5,178,9" value="100" />
+			<entry class="" argb="255,3,176,2" value="101" />
+			<entry class="" argb="255,1,175,2" value="102" />
+			<entry class="" argb="255,0,173,7" value="103" />
+			<entry class="" argb="255,2,171,12" value="104" />
+			<entry class="" argb="255,3,169,16" value="105" />
+			<entry class="" argb="255,5,166,19" value="106" />
+			<entry class="" argb="255,6,164,22" value="107" />
+			<entry class="" argb="255,6,161,24" value="108" />
+			<entry class="" argb="255,7,158,25" value="109" />
+			<entry class="" argb="255,7,155,26" value="110" />
+			<entry class="" argb="255,8,152,27" value="111" />
+			<entry class="" argb="255,8,152,27" value="112" />
+			<entry class="" argb="255,7,148,26" value="113" />
+			<entry class="" argb="255,7,145,25" value="114" />
+			<entry class="" argb="255,6,141,24" value="115" />
+			<entry class="" argb="255,6,138,22" value="116" />
+			<entry class="" argb="255,5,134,19" value="117" />
+			<entry class="" argb="255,3,131,16" value="118" />
+			<entry class="" argb="255,2,127,12" value="119" />
+			<entry class="" argb="255,0,124,7" value="120" />
+			<entry class="" argb="255,1,120,2" value="121" />
+			<entry class="" argb="255,3,117,2" value="122" />
+			<entry class="" argb="255,5,113,9" value="123" />
+			<entry class="" argb="255,8,110,15" value="124" />
+			<entry class="" argb="255,13,107,22" value="125" />
+			<entry class="" argb="255,13,104,30" value="126" />
+			<entry class="" argb="255,13,104,30" value="127" />
+			<entry class="" argb="255,16,101,38" value="128" />
+			<entry class="" argb="255,19,99,47" value="129" />
+			<entry class="" argb="255,23,97,56" value="130" />
+			<entry class="" argb="255,26,95,65" value="131" />
+			<entry class="" argb="255,30,93,75" value="132" />
+			<entry class="" argb="255,34,91,85" value="133" />
+			<entry class="" argb="255,38,90,96" value="134" />
+			<entry class="" argb="255,42,89,107" value="135" />
+			<entry class="" argb="255,46,88,118" value="136" />
+			<entry class="" argb="255,50,88,129" value="137" />
+			<entry class="" argb="255,54,88,141" value="138" />
+			<entry class="" argb="255,59,88,153" value="139" />
+			<entry class="" argb="255,63,88,165" value="140" />
+			<entry class="" argb="255,68,89,177" value="141" />
+			<entry class="" argb="255,68,89,177" value="142" />
+			<entry class="" argb="255,73,91,189" value="143" />
+			<entry class="" argb="255,77,92,202" value="144" />
+			<entry class="" argb="255,82,94,214" value="145" />
+			<entry class="" argb="255,87,96,227" value="146" />
+			<entry class="" argb="255,91,99,239" value="147" />
+			<entry class="" argb="255,96,102,251" value="148" />
+			<entry class="" argb="255,100,105,246" value="149" />
+			<entry class="" argb="255,105,109,234" value="150" />
+			<entry class="" argb="255,110,113,222" value="151" />
+			<entry class="" argb="255,114,117,210" value="152" />
+			<entry class="" argb="255,119,122,198" value="153" />
+			<entry class="" argb="255,123,127,186" value="154" />
+			<entry class="" argb="255,127,132,175" value="155" />
+			<entry class="" argb="255,131,137,164" value="156" />
+			<entry class="" argb="255,131,137,164" value="157" />
+			<entry class="" argb="255,135,142,153" value="158" />
+			<entry class="" argb="255,139,148,142" value="159" />
+			<entry class="" argb="255,143,154,132" value="160" />
+			<entry class="" argb="255,147,160,122" value="161" />
+			<entry class="" argb="255,150,166,113" value="162" />
+			<entry class="" argb="255,154,173,104" value="163" />
+			<entry class="" argb="255,157,179,95" value="164" />
+			<entry class="" argb="255,160,186,87" value="165" />
+			<entry class="" argb="255,163,192,79" value="166" />
+			<entry class="" argb="255,165,199,72" value="167" />
+			<entry class="" argb="255,168,205,66" value="168" />
+			<entry class="" argb="255,170,212,59" value="169" />
+			<entry class="" argb="255,172,218,54" value="170" />
+			<entry class="" argb="255,172,218,54" value="171" />
+			<entry class="" argb="255,174,225,49" value="172" />
+			<entry class="" argb="255,176,231,44" value="173" />
+			<entry class="" argb="255,177,237,40" value="174" />
+			<entry class="" argb="255,179,243,37" value="175" />
+			<entry class="" argb="255,180,248,34" value="176" />
+			<entry class="" argb="255,180,254,32" value="177" />
+			<entry class="" argb="255,181,251,31" value="178" />
+			<entry class="" argb="255,181,246,30" value="179" />
+			<entry class="" argb="255,182,241,29" value="180" />
+			<entry class="" argb="255,181,237,30" value="181" />
+			<entry class="" argb="255,181,233,31" value="182" />
+			<entry class="" argb="255,180,229,32" value="183" />
+			<entry class="" argb="255,180,226,34" value="184" />
+			<entry class="" argb="255,179,223,37" value="185" />
+			<entry class="" argb="255,179,223,37" value="186" />
+			<entry class="" argb="255,177,220,40" value="187" />
+			<entry class="" argb="255,176,218,44" value="188" />
+			<entry class="" argb="255,174,216,49" value="189" />
+			<entry class="" argb="255,172,215,54" value="190" />
+			<entry class="" argb="255,170,214,59" value="191" />
+			<entry class="" argb="255,168,213,66" value="192" />
+			<entry class="" argb="255,165,213,72" value="193" />
+			<entry class="" argb="255,163,214,79" value="194" />
+			<entry class="" argb="255,160,214,87" value="195" />
+			<entry class="" argb="255,157,216,95" value="196" />
+			<entry class="" argb="255,154,217,104" value="197" />
+			<entry class="" argb="255,150,219,113" value="198" />
+			<entry class="" argb="255,147,222,122" value="199" />
+			<entry class="" argb="255,143,224,132" value="200" />
+			<entry class="" argb="255,143,224,132" value="201" />
+			<entry class="" argb="255,139,228,142" value="202" />
+			<entry class="" argb="255,135,231,153" value="203" />
+			<entry class="" argb="255,131,235,164" value="204" />
+			<entry class="" argb="255,127,239,175" value="205" />
+			<entry class="" argb="255,123,244,186" value="206" />
+			<entry class="" argb="255,119,248,198" value="207" />
+			<entry class="" argb="255,114,253,210" value="208" />
+			<entry class="" argb="255,110,251,222" value="209" />
+			<entry class="" argb="255,105,246,234" value="210" />
+			<entry class="" argb="255,105,246,234" value="211" />
+			<entry class="" argb="255,105,246,234" value="212" />
+			<entry class="" argb="255,105,246,234" value="213" />
+			<entry class="" argb="255,105,246,234" value="214" />
+			<entry class="" argb="255,105,246,234" value="215" />
+			<entry class="" argb="255,105,246,234" value="216" />
+			<entry class="" argb="255,105,246,234" value="217" />
+			<entry class="" argb="255,105,246,234" value="218" />
+			<entry class="" argb="255,105,246,234" value="219" />
+			<entry class="" argb="255,105,246,234" value="220" />
+			<entry class="" argb="255,105,246,234" value="221" />
+			<entry class="" argb="255,105,246,234" value="222" />
+			<entry class="" argb="255,105,246,234" value="223" />
+			<entry class="" argb="255,105,246,234" value="224" />
+			<entry class="" argb="255,105,246,234" value="225" />
+			<entry class="" argb="255,105,246,234" value="226" />
+			<entry class="" argb="255,105,246,234" value="227" />
+			<entry class="" argb="255,105,246,234" value="228" />
+			<entry class="" argb="255,105,246,234" value="229" />
+			<entry class="" argb="255,105,246,234" value="230" />
+			<entry class="" argb="255,105,246,234" value="231" />
+			<entry class="" argb="255,105,246,234" value="232" />
+			<entry class="" argb="255,105,246,234" value="233" />
+			<entry class="" argb="255,105,246,234" value="234" />
+			<entry class="" argb="255,105,246,234" value="235" />
+			<entry class="" argb="255,105,246,234" value="236" />
+			<entry class="" argb="255,105,246,234" value="237" />
+			<entry class="" argb="255,105,246,234" value="238" />
+			<entry class="" argb="255,105,246,234" value="239" />
+			<entry class="" argb="255,105,246,234" value="240" />
+			<entry class="" argb="255,105,246,234" value="241" />
+			<entry class="" argb="255,105,246,234" value="242" />
+			<entry class="" argb="255,105,246,234" value="243" />
+			<entry class="" argb="255,105,246,234" value="244" />
+			<entry class="" argb="255,105,246,234" value="245" />
+			<entry class="" argb="255,105,246,234" value="246" />
+			<entry class="" argb="255,105,246,234" value="247" />
+			<entry class="" argb="255,105,246,234" value="248" />
+			<entry class="" argb="255,105,246,234" value="249" />
+			<entry class="" argb="255,105,246,234" value="250" />
+			<entry class="" argb="255,105,246,234" value="251" />
+			<entry class="" argb="255,105,246,234" value="252" />
+			<entry class="" argb="255,0,0,0" value="253" />
+			<entry class="" argb="255,255,255,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="red-temperature" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,1,0,0" value="1" />
+			<entry class="" argb="255,2,0,0" value="2" />
+			<entry class="" argb="255,4,0,0" value="3" />
+			<entry class="" argb="255,5,0,0" value="4" />
+			<entry class="" argb="255,7,0,0" value="5" />
+			<entry class="" argb="255,8,0,0" value="6" />
+			<entry class="" argb="255,10,0,0" value="7" />
+			<entry class="" argb="255,11,0,0" value="8" />
+			<entry class="" argb="255,13,0,0" value="9" />
+			<entry class="" argb="255,14,0,0" value="10" />
+			<entry class="" argb="255,15,0,0" value="11" />
+			<entry class="" argb="255,17,0,0" value="12" />
+			<entry class="" argb="255,18,0,0" value="13" />
+			<entry class="" argb="255,20,0,0" value="14" />
+			<entry class="" argb="255,21,0,0" value="15" />
+			<entry class="" argb="255,23,0,0" value="16" />
+			<entry class="" argb="255,24,0,0" value="17" />
+			<entry class="" argb="255,26,0,0" value="18" />
+			<entry class="" argb="255,27,0,0" value="19" />
+			<entry class="" argb="255,28,0,0" value="20" />
+			<entry class="" argb="255,30,0,0" value="21" />
+			<entry class="" argb="255,31,0,0" value="22" />
+			<entry class="" argb="255,33,0,0" value="23" />
+			<entry class="" argb="255,34,0,0" value="24" />
+			<entry class="" argb="255,36,0,0" value="25" />
+			<entry class="" argb="255,37,0,0" value="26" />
+			<entry class="" argb="255,39,0,0" value="27" />
+			<entry class="" argb="255,40,0,0" value="28" />
+			<entry class="" argb="255,42,0,0" value="29" />
+			<entry class="" argb="255,43,0,0" value="30" />
+			<entry class="" argb="255,44,0,0" value="31" />
+			<entry class="" argb="255,46,0,0" value="32" />
+			<entry class="" argb="255,47,0,0" value="33" />
+			<entry class="" argb="255,49,0,0" value="34" />
+			<entry class="" argb="255,50,0,0" value="35" />
+			<entry class="" argb="255,52,0,0" value="36" />
+			<entry class="" argb="255,53,0,0" value="37" />
+			<entry class="" argb="255,55,0,0" value="38" />
+			<entry class="" argb="255,56,0,0" value="39" />
+			<entry class="" argb="255,57,0,0" value="40" />
+			<entry class="" argb="255,59,0,0" value="41" />
+			<entry class="" argb="255,60,0,0" value="42" />
+			<entry class="" argb="255,62,0,0" value="43" />
+			<entry class="" argb="255,63,0,0" value="44" />
+			<entry class="" argb="255,65,0,0" value="45" />
+			<entry class="" argb="255,66,0,0" value="46" />
+			<entry class="" argb="255,68,0,0" value="47" />
+			<entry class="" argb="255,69,0,0" value="48" />
+			<entry class="" argb="255,70,0,0" value="49" />
+			<entry class="" argb="255,72,0,0" value="50" />
+			<entry class="" argb="255,73,0,0" value="51" />
+			<entry class="" argb="255,75,0,0" value="52" />
+			<entry class="" argb="255,76,0,0" value="53" />
+			<entry class="" argb="255,78,0,0" value="54" />
+			<entry class="" argb="255,79,0,0" value="55" />
+			<entry class="" argb="255,81,0,0" value="56" />
+			<entry class="" argb="255,82,0,0" value="57" />
+			<entry class="" argb="255,84,0,0" value="58" />
+			<entry class="" argb="255,85,0,0" value="59" />
+			<entry class="" argb="255,86,0,0" value="60" />
+			<entry class="" argb="255,88,0,0" value="61" />
+			<entry class="" argb="255,89,0,0" value="62" />
+			<entry class="" argb="255,91,0,0" value="63" />
+			<entry class="" argb="255,92,0,0" value="64" />
+			<entry class="" argb="255,94,0,0" value="65" />
+			<entry class="" argb="255,95,0,0" value="66" />
+			<entry class="" argb="255,97,0,0" value="67" />
+			<entry class="" argb="255,98,0,0" value="68" />
+			<entry class="" argb="255,99,0,0" value="69" />
+			<entry class="" argb="255,101,0,0" value="70" />
+			<entry class="" argb="255,102,0,0" value="71" />
+			<entry class="" argb="255,104,0,0" value="72" />
+			<entry class="" argb="255,105,0,0" value="73" />
+			<entry class="" argb="255,107,0,0" value="74" />
+			<entry class="" argb="255,108,0,0" value="75" />
+			<entry class="" argb="255,110,0,0" value="76" />
+			<entry class="" argb="255,111,0,0" value="77" />
+			<entry class="" argb="255,113,0,0" value="78" />
+			<entry class="" argb="255,114,0,0" value="79" />
+			<entry class="" argb="255,115,0,0" value="80" />
+			<entry class="" argb="255,117,0,0" value="81" />
+			<entry class="" argb="255,118,0,0" value="82" />
+			<entry class="" argb="255,120,0,0" value="83" />
+			<entry class="" argb="255,121,0,0" value="84" />
+			<entry class="" argb="255,123,0,0" value="85" />
+			<entry class="" argb="255,124,0,0" value="86" />
+			<entry class="" argb="255,126,0,0" value="87" />
+			<entry class="" argb="255,127,0,0" value="88" />
+			<entry class="" argb="255,128,0,0" value="89" />
+			<entry class="" argb="255,130,0,0" value="90" />
+			<entry class="" argb="255,131,0,0" value="91" />
+			<entry class="" argb="255,133,0,0" value="92" />
+			<entry class="" argb="255,134,0,0" value="93" />
+			<entry class="" argb="255,136,0,0" value="94" />
+			<entry class="" argb="255,137,0,0" value="95" />
+			<entry class="" argb="255,139,0,0" value="96" />
+			<entry class="" argb="255,140,0,0" value="97" />
+			<entry class="" argb="255,141,0,0" value="98" />
+			<entry class="" argb="255,143,0,0" value="99" />
+			<entry class="" argb="255,144,0,0" value="100" />
+			<entry class="" argb="255,146,0,0" value="101" />
+			<entry class="" argb="255,147,0,0" value="102" />
+			<entry class="" argb="255,149,0,0" value="103" />
+			<entry class="" argb="255,150,0,0" value="104" />
+			<entry class="" argb="255,152,0,0" value="105" />
+			<entry class="" argb="255,153,0,0" value="106" />
+			<entry class="" argb="255,155,0,0" value="107" />
+			<entry class="" argb="255,156,0,0" value="108" />
+			<entry class="" argb="255,157,0,0" value="109" />
+			<entry class="" argb="255,159,0,0" value="110" />
+			<entry class="" argb="255,160,0,0" value="111" />
+			<entry class="" argb="255,162,0,0" value="112" />
+			<entry class="" argb="255,163,0,0" value="113" />
+			<entry class="" argb="255,165,0,0" value="114" />
+			<entry class="" argb="255,166,0,0" value="115" />
+			<entry class="" argb="255,168,0,0" value="116" />
+			<entry class="" argb="255,169,0,0" value="117" />
+			<entry class="" argb="255,170,0,0" value="118" />
+			<entry class="" argb="255,172,0,0" value="119" />
+			<entry class="" argb="255,173,0,0" value="120" />
+			<entry class="" argb="255,175,1,0" value="121" />
+			<entry class="" argb="255,176,3,0" value="122" />
+			<entry class="" argb="255,178,5,0" value="123" />
+			<entry class="" argb="255,179,7,0" value="124" />
+			<entry class="" argb="255,181,9,0" value="125" />
+			<entry class="" argb="255,182,11,0" value="126" />
+			<entry class="" argb="255,184,13,0" value="127" />
+			<entry class="" argb="255,185,15,0" value="128" />
+			<entry class="" argb="255,186,17,0" value="129" />
+			<entry class="" argb="255,188,18,0" value="130" />
+			<entry class="" argb="255,189,20,0" value="131" />
+			<entry class="" argb="255,191,22,0" value="132" />
+			<entry class="" argb="255,192,24,0" value="133" />
+			<entry class="" argb="255,194,26,0" value="134" />
+			<entry class="" argb="255,195,28,0" value="135" />
+			<entry class="" argb="255,197,30,0" value="136" />
+			<entry class="" argb="255,198,32,0" value="137" />
+			<entry class="" argb="255,199,34,0" value="138" />
+			<entry class="" argb="255,201,35,0" value="139" />
+			<entry class="" argb="255,202,37,0" value="140" />
+			<entry class="" argb="255,204,39,0" value="141" />
+			<entry class="" argb="255,205,41,0" value="142" />
+			<entry class="" argb="255,207,43,0" value="143" />
+			<entry class="" argb="255,208,45,0" value="144" />
+			<entry class="" argb="255,210,47,0" value="145" />
+			<entry class="" argb="255,211,49,0" value="146" />
+			<entry class="" argb="255,212,51,0" value="147" />
+			<entry class="" argb="255,214,52,0" value="148" />
+			<entry class="" argb="255,215,54,0" value="149" />
+			<entry class="" argb="255,217,56,0" value="150" />
+			<entry class="" argb="255,218,58,0" value="151" />
+			<entry class="" argb="255,220,60,0" value="152" />
+			<entry class="" argb="255,221,62,0" value="153" />
+			<entry class="" argb="255,223,64,0" value="154" />
+			<entry class="" argb="255,224,66,0" value="155" />
+			<entry class="" argb="255,226,68,0" value="156" />
+			<entry class="" argb="255,227,69,0" value="157" />
+			<entry class="" argb="255,228,71,0" value="158" />
+			<entry class="" argb="255,230,73,0" value="159" />
+			<entry class="" argb="255,231,75,0" value="160" />
+			<entry class="" argb="255,233,77,0" value="161" />
+			<entry class="" argb="255,234,79,0" value="162" />
+			<entry class="" argb="255,236,81,0" value="163" />
+			<entry class="" argb="255,237,83,0" value="164" />
+			<entry class="" argb="255,239,85,0" value="165" />
+			<entry class="" argb="255,240,86,0" value="166" />
+			<entry class="" argb="255,241,88,0" value="167" />
+			<entry class="" argb="255,243,90,0" value="168" />
+			<entry class="" argb="255,244,92,0" value="169" />
+			<entry class="" argb="255,246,94,0" value="170" />
+			<entry class="" argb="255,247,96,0" value="171" />
+			<entry class="" argb="255,249,98,0" value="172" />
+			<entry class="" argb="255,250,100,0" value="173" />
+			<entry class="" argb="255,252,102,0" value="174" />
+			<entry class="" argb="255,253,103,0" value="175" />
+			<entry class="" argb="255,255,105,0" value="176" />
+			<entry class="" argb="255,255,107,0" value="177" />
+			<entry class="" argb="255,255,109,0" value="178" />
+			<entry class="" argb="255,255,111,0" value="179" />
+			<entry class="" argb="255,255,113,0" value="180" />
+			<entry class="" argb="255,255,115,0" value="181" />
+			<entry class="" argb="255,255,117,0" value="182" />
+			<entry class="" argb="255,255,119,0" value="183" />
+			<entry class="" argb="255,255,120,0" value="184" />
+			<entry class="" argb="255,255,122,0" value="185" />
+			<entry class="" argb="255,255,124,0" value="186" />
+			<entry class="" argb="255,255,126,0" value="187" />
+			<entry class="" argb="255,255,128,0" value="188" />
+			<entry class="" argb="255,255,130,0" value="189" />
+			<entry class="" argb="255,255,132,0" value="190" />
+			<entry class="" argb="255,255,134,3" value="191" />
+			<entry class="" argb="255,255,136,7" value="192" />
+			<entry class="" argb="255,255,137,11" value="193" />
+			<entry class="" argb="255,255,139,15" value="194" />
+			<entry class="" argb="255,255,141,19" value="195" />
+			<entry class="" argb="255,255,143,23" value="196" />
+			<entry class="" argb="255,255,145,27" value="197" />
+			<entry class="" argb="255,255,147,31" value="198" />
+			<entry class="" argb="255,255,149,35" value="199" />
+			<entry class="" argb="255,255,151,39" value="200" />
+			<entry class="" argb="255,255,153,43" value="201" />
+			<entry class="" argb="255,255,154,47" value="202" />
+			<entry class="" argb="255,255,156,51" value="203" />
+			<entry class="" argb="255,255,158,54" value="204" />
+			<entry class="" argb="255,255,160,58" value="205" />
+			<entry class="" argb="255,255,162,62" value="206" />
+			<entry class="" argb="255,255,164,66" value="207" />
+			<entry class="" argb="255,255,166,70" value="208" />
+			<entry class="" argb="255,255,168,74" value="209" />
+			<entry class="" argb="255,255,170,78" value="210" />
+			<entry class="" argb="255,255,171,82" value="211" />
+			<entry class="" argb="255,255,173,86" value="212" />
+			<entry class="" argb="255,255,175,90" value="213" />
+			<entry class="" argb="255,255,177,94" value="214" />
+			<entry class="" argb="255,255,179,98" value="215" />
+			<entry class="" argb="255,255,181,102" value="216" />
+			<entry class="" argb="255,255,183,105" value="217" />
+			<entry class="" argb="255,255,185,109" value="218" />
+			<entry class="" argb="255,255,187,113" value="219" />
+			<entry class="" argb="255,255,188,117" value="220" />
+			<entry class="" argb="255,255,190,121" value="221" />
+			<entry class="" argb="255,255,192,125" value="222" />
+			<entry class="" argb="255,255,194,129" value="223" />
+			<entry class="" argb="255,255,196,133" value="224" />
+			<entry class="" argb="255,255,198,137" value="225" />
+			<entry class="" argb="255,255,200,141" value="226" />
+			<entry class="" argb="255,255,202,145" value="227" />
+			<entry class="" argb="255,255,204,149" value="228" />
+			<entry class="" argb="255,255,205,153" value="229" />
+			<entry class="" argb="255,255,207,156" value="230" />
+			<entry class="" argb="255,255,209,160" value="231" />
+			<entry class="" argb="255,255,211,164" value="232" />
+			<entry class="" argb="255,255,213,168" value="233" />
+			<entry class="" argb="255,255,215,172" value="234" />
+			<entry class="" argb="255,255,217,176" value="235" />
+			<entry class="" argb="255,255,219,180" value="236" />
+			<entry class="" argb="255,255,221,184" value="237" />
+			<entry class="" argb="255,255,222,188" value="238" />
+			<entry class="" argb="255,255,224,192" value="239" />
+			<entry class="" argb="255,255,226,196" value="240" />
+			<entry class="" argb="255,255,228,200" value="241" />
+			<entry class="" argb="255,255,230,204" value="242" />
+			<entry class="" argb="255,255,232,207" value="243" />
+			<entry class="" argb="255,255,234,211" value="244" />
+			<entry class="" argb="255,255,236,215" value="245" />
+			<entry class="" argb="255,255,238,219" value="246" />
+			<entry class="" argb="255,255,239,223" value="247" />
+			<entry class="" argb="255,255,241,227" value="248" />
+			<entry class="" argb="255,255,243,231" value="249" />
+			<entry class="" argb="255,255,245,235" value="250" />
+			<entry class="" argb="255,255,247,239" value="251" />
+			<entry class="" argb="255,255,249,243" value="252" />
+			<entry class="" argb="255,255,251,247" value="253" />
+			<entry class="" argb="255,255,253,251" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="16level" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,84,0" value="1" />
+			<entry class="" argb="255,0,84,0" value="2" />
+			<entry class="" argb="255,0,84,0" value="3" />
+			<entry class="" argb="255,0,84,0" value="4" />
+			<entry class="" argb="255,0,84,0" value="5" />
+			<entry class="" argb="255,0,84,0" value="6" />
+			<entry class="" argb="255,0,84,0" value="7" />
+			<entry class="" argb="255,0,84,0" value="8" />
+			<entry class="" argb="255,0,84,0" value="9" />
+			<entry class="" argb="255,0,84,0" value="10" />
+			<entry class="" argb="255,0,84,0" value="11" />
+			<entry class="" argb="255,0,84,0" value="12" />
+			<entry class="" argb="255,0,84,0" value="13" />
+			<entry class="" argb="255,0,84,0" value="14" />
+			<entry class="" argb="255,0,84,0" value="15" />
+			<entry class="" argb="255,0,168,0" value="16" />
+			<entry class="" argb="255,0,168,0" value="17" />
+			<entry class="" argb="255,0,168,0" value="18" />
+			<entry class="" argb="255,0,168,0" value="19" />
+			<entry class="" argb="255,0,168,0" value="20" />
+			<entry class="" argb="255,0,168,0" value="21" />
+			<entry class="" argb="255,0,168,0" value="22" />
+			<entry class="" argb="255,0,168,0" value="23" />
+			<entry class="" argb="255,0,168,0" value="24" />
+			<entry class="" argb="255,0,168,0" value="25" />
+			<entry class="" argb="255,0,168,0" value="26" />
+			<entry class="" argb="255,0,168,0" value="27" />
+			<entry class="" argb="255,0,168,0" value="28" />
+			<entry class="" argb="255,0,168,0" value="29" />
+			<entry class="" argb="255,0,168,0" value="30" />
+			<entry class="" argb="255,0,168,0" value="31" />
+			<entry class="" argb="255,0,255,0" value="32" />
+			<entry class="" argb="255,0,255,0" value="33" />
+			<entry class="" argb="255,0,255,0" value="34" />
+			<entry class="" argb="255,0,255,0" value="35" />
+			<entry class="" argb="255,0,255,0" value="36" />
+			<entry class="" argb="255,0,255,0" value="37" />
+			<entry class="" argb="255,0,255,0" value="38" />
+			<entry class="" argb="255,0,255,0" value="39" />
+			<entry class="" argb="255,0,255,0" value="40" />
+			<entry class="" argb="255,0,255,0" value="41" />
+			<entry class="" argb="255,0,255,0" value="42" />
+			<entry class="" argb="255,0,255,0" value="43" />
+			<entry class="" argb="255,0,255,0" value="44" />
+			<entry class="" argb="255,0,255,0" value="45" />
+			<entry class="" argb="255,0,255,0" value="46" />
+			<entry class="" argb="255,0,255,0" value="47" />
+			<entry class="" argb="255,0,255,84" value="48" />
+			<entry class="" argb="255,0,255,84" value="49" />
+			<entry class="" argb="255,0,255,84" value="50" />
+			<entry class="" argb="255,0,255,84" value="51" />
+			<entry class="" argb="255,0,255,84" value="52" />
+			<entry class="" argb="255,0,255,84" value="53" />
+			<entry class="" argb="255,0,255,84" value="54" />
+			<entry class="" argb="255,0,255,84" value="55" />
+			<entry class="" argb="255,0,255,84" value="56" />
+			<entry class="" argb="255,0,255,84" value="57" />
+			<entry class="" argb="255,0,255,84" value="58" />
+			<entry class="" argb="255,0,255,84" value="59" />
+			<entry class="" argb="255,0,255,84" value="60" />
+			<entry class="" argb="255,0,255,84" value="61" />
+			<entry class="" argb="255,0,255,84" value="62" />
+			<entry class="" argb="255,0,255,84" value="63" />
+			<entry class="" argb="255,0,255,168" value="64" />
+			<entry class="" argb="255,0,255,168" value="65" />
+			<entry class="" argb="255,0,255,168" value="66" />
+			<entry class="" argb="255,0,255,168" value="67" />
+			<entry class="" argb="255,0,255,168" value="68" />
+			<entry class="" argb="255,0,255,168" value="69" />
+			<entry class="" argb="255,0,255,168" value="70" />
+			<entry class="" argb="255,0,255,168" value="71" />
+			<entry class="" argb="255,0,255,168" value="72" />
+			<entry class="" argb="255,0,255,168" value="73" />
+			<entry class="" argb="255,0,255,168" value="74" />
+			<entry class="" argb="255,0,255,168" value="75" />
+			<entry class="" argb="255,0,255,168" value="76" />
+			<entry class="" argb="255,0,255,168" value="77" />
+			<entry class="" argb="255,0,255,168" value="78" />
+			<entry class="" argb="255,0,255,168" value="79" />
+			<entry class="" argb="255,0,255,255" value="80" />
+			<entry class="" argb="255,0,255,255" value="81" />
+			<entry class="" argb="255,0,255,255" value="82" />
+			<entry class="" argb="255,0,255,255" value="83" />
+			<entry class="" argb="255,0,255,255" value="84" />
+			<entry class="" argb="255,0,255,255" value="85" />
+			<entry class="" argb="255,0,255,255" value="86" />
+			<entry class="" argb="255,0,255,255" value="87" />
+			<entry class="" argb="255,0,255,255" value="88" />
+			<entry class="" argb="255,0,255,255" value="89" />
+			<entry class="" argb="255,0,255,255" value="90" />
+			<entry class="" argb="255,0,255,255" value="91" />
+			<entry class="" argb="255,0,255,255" value="92" />
+			<entry class="" argb="255,0,255,255" value="93" />
+			<entry class="" argb="255,0,255,255" value="94" />
+			<entry class="" argb="255,0,255,255" value="95" />
+			<entry class="" argb="255,0,0,255" value="96" />
+			<entry class="" argb="255,0,0,255" value="97" />
+			<entry class="" argb="255,0,0,255" value="98" />
+			<entry class="" argb="255,0,0,255" value="99" />
+			<entry class="" argb="255,0,0,255" value="100" />
+			<entry class="" argb="255,0,0,255" value="101" />
+			<entry class="" argb="255,0,0,255" value="102" />
+			<entry class="" argb="255,0,0,255" value="103" />
+			<entry class="" argb="255,0,0,255" value="104" />
+			<entry class="" argb="255,0,0,255" value="105" />
+			<entry class="" argb="255,0,0,255" value="106" />
+			<entry class="" argb="255,0,0,255" value="107" />
+			<entry class="" argb="255,0,0,255" value="108" />
+			<entry class="" argb="255,0,0,255" value="109" />
+			<entry class="" argb="255,0,0,255" value="110" />
+			<entry class="" argb="255,0,0,255" value="111" />
+			<entry class="" argb="255,128,0,255" value="112" />
+			<entry class="" argb="255,128,0,255" value="113" />
+			<entry class="" argb="255,128,0,255" value="114" />
+			<entry class="" argb="255,128,0,255" value="115" />
+			<entry class="" argb="255,128,0,255" value="116" />
+			<entry class="" argb="255,128,0,255" value="117" />
+			<entry class="" argb="255,128,0,255" value="118" />
+			<entry class="" argb="255,128,0,255" value="119" />
+			<entry class="" argb="255,128,0,255" value="120" />
+			<entry class="" argb="255,128,0,255" value="121" />
+			<entry class="" argb="255,128,0,255" value="122" />
+			<entry class="" argb="255,128,0,255" value="123" />
+			<entry class="" argb="255,128,0,255" value="124" />
+			<entry class="" argb="255,128,0,255" value="125" />
+			<entry class="" argb="255,128,0,255" value="126" />
+			<entry class="" argb="255,128,0,255" value="127" />
+			<entry class="" argb="255,255,0,220" value="128" />
+			<entry class="" argb="255,255,0,220" value="129" />
+			<entry class="" argb="255,255,0,220" value="130" />
+			<entry class="" argb="255,255,0,220" value="131" />
+			<entry class="" argb="255,255,0,220" value="132" />
+			<entry class="" argb="255,255,0,220" value="133" />
+			<entry class="" argb="255,255,0,220" value="134" />
+			<entry class="" argb="255,255,0,220" value="135" />
+			<entry class="" argb="255,255,0,220" value="136" />
+			<entry class="" argb="255,255,0,220" value="137" />
+			<entry class="" argb="255,255,0,220" value="138" />
+			<entry class="" argb="255,255,0,220" value="139" />
+			<entry class="" argb="255,255,0,220" value="140" />
+			<entry class="" argb="255,255,0,220" value="141" />
+			<entry class="" argb="255,255,0,220" value="142" />
+			<entry class="" argb="255,255,0,220" value="143" />
+			<entry class="" argb="255,255,0,180" value="144" />
+			<entry class="" argb="255,255,0,180" value="145" />
+			<entry class="" argb="255,255,0,180" value="146" />
+			<entry class="" argb="255,255,0,180" value="147" />
+			<entry class="" argb="255,255,0,180" value="148" />
+			<entry class="" argb="255,255,0,180" value="149" />
+			<entry class="" argb="255,255,0,180" value="150" />
+			<entry class="" argb="255,255,0,180" value="151" />
+			<entry class="" argb="255,255,0,180" value="152" />
+			<entry class="" argb="255,255,0,180" value="153" />
+			<entry class="" argb="255,255,0,180" value="154" />
+			<entry class="" argb="255,255,0,180" value="155" />
+			<entry class="" argb="255,255,0,180" value="156" />
+			<entry class="" argb="255,255,0,180" value="157" />
+			<entry class="" argb="255,255,0,180" value="158" />
+			<entry class="" argb="255,255,0,180" value="159" />
+			<entry class="" argb="255,255,0,128" value="160" />
+			<entry class="" argb="255,255,0,128" value="161" />
+			<entry class="" argb="255,255,0,128" value="162" />
+			<entry class="" argb="255,255,0,128" value="163" />
+			<entry class="" argb="255,255,0,128" value="164" />
+			<entry class="" argb="255,255,0,128" value="165" />
+			<entry class="" argb="255,255,0,128" value="166" />
+			<entry class="" argb="255,255,0,128" value="167" />
+			<entry class="" argb="255,255,0,128" value="168" />
+			<entry class="" argb="255,255,0,128" value="169" />
+			<entry class="" argb="255,255,0,128" value="170" />
+			<entry class="" argb="255,255,0,128" value="171" />
+			<entry class="" argb="255,255,0,128" value="172" />
+			<entry class="" argb="255,255,0,128" value="173" />
+			<entry class="" argb="255,255,0,128" value="174" />
+			<entry class="" argb="255,255,0,128" value="175" />
+			<entry class="" argb="255,255,0,64" value="176" />
+			<entry class="" argb="255,255,0,64" value="177" />
+			<entry class="" argb="255,255,0,64" value="178" />
+			<entry class="" argb="255,255,0,64" value="179" />
+			<entry class="" argb="255,255,0,64" value="180" />
+			<entry class="" argb="255,255,0,64" value="181" />
+			<entry class="" argb="255,255,0,64" value="182" />
+			<entry class="" argb="255,255,0,64" value="183" />
+			<entry class="" argb="255,255,0,64" value="184" />
+			<entry class="" argb="255,255,0,64" value="185" />
+			<entry class="" argb="255,255,0,64" value="186" />
+			<entry class="" argb="255,255,0,64" value="187" />
+			<entry class="" argb="255,255,0,64" value="188" />
+			<entry class="" argb="255,255,0,64" value="189" />
+			<entry class="" argb="255,255,0,64" value="190" />
+			<entry class="" argb="255,255,0,64" value="191" />
+			<entry class="" argb="255,255,0,0" value="192" />
+			<entry class="" argb="255,255,0,0" value="193" />
+			<entry class="" argb="255,255,0,0" value="194" />
+			<entry class="" argb="255,255,0,0" value="195" />
+			<entry class="" argb="255,255,0,0" value="196" />
+			<entry class="" argb="255,255,0,0" value="197" />
+			<entry class="" argb="255,255,0,0" value="198" />
+			<entry class="" argb="255,255,0,0" value="199" />
+			<entry class="" argb="255,255,0,0" value="200" />
+			<entry class="" argb="255,255,0,0" value="201" />
+			<entry class="" argb="255,255,0,0" value="202" />
+			<entry class="" argb="255,255,0,0" value="203" />
+			<entry class="" argb="255,255,0,0" value="204" />
+			<entry class="" argb="255,255,0,0" value="205" />
+			<entry class="" argb="255,255,0,0" value="206" />
+			<entry class="" argb="255,255,0,0" value="207" />
+			<entry class="" argb="255,220,190,190" value="208" />
+			<entry class="" argb="255,220,190,190" value="209" />
+			<entry class="" argb="255,220,190,190" value="210" />
+			<entry class="" argb="255,220,190,190" value="211" />
+			<entry class="" argb="255,220,190,190" value="212" />
+			<entry class="" argb="255,221,190,190" value="213" />
+			<entry class="" argb="255,221,190,190" value="214" />
+			<entry class="" argb="255,221,190,190" value="215" />
+			<entry class="" argb="255,221,190,190" value="216" />
+			<entry class="" argb="255,221,190,190" value="217" />
+			<entry class="" argb="255,222,190,190" value="218" />
+			<entry class="" argb="255,222,190,190" value="219" />
+			<entry class="" argb="255,222,190,190" value="220" />
+			<entry class="" argb="255,222,190,190" value="221" />
+			<entry class="" argb="255,222,190,190" value="222" />
+			<entry class="" argb="255,223,190,190" value="223" />
+			<entry class="" argb="255,220,220,220" value="224" />
+			<entry class="" argb="255,220,220,220" value="225" />
+			<entry class="" argb="255,220,220,220" value="226" />
+			<entry class="" argb="255,220,220,220" value="227" />
+			<entry class="" argb="255,220,220,220" value="228" />
+			<entry class="" argb="255,220,220,220" value="229" />
+			<entry class="" argb="255,220,220,220" value="230" />
+			<entry class="" argb="255,220,220,220" value="231" />
+			<entry class="" argb="255,220,220,220" value="232" />
+			<entry class="" argb="255,220,220,220" value="233" />
+			<entry class="" argb="255,220,220,220" value="234" />
+			<entry class="" argb="255,220,220,220" value="235" />
+			<entry class="" argb="255,220,220,220" value="236" />
+			<entry class="" argb="255,220,220,220" value="237" />
+			<entry class="" argb="255,220,220,220" value="238" />
+			<entry class="" argb="255,220,220,220" value="239" />
+			<entry class="" argb="255,255,255,255" value="240" />
+			<entry class="" argb="255,255,255,255" value="241" />
+			<entry class="" argb="255,255,255,255" value="242" />
+			<entry class="" argb="255,255,255,255" value="243" />
+			<entry class="" argb="255,255,255,255" value="244" />
+			<entry class="" argb="255,255,255,255" value="245" />
+			<entry class="" argb="255,255,255,255" value="246" />
+			<entry class="" argb="255,255,255,255" value="247" />
+			<entry class="" argb="255,255,255,255" value="248" />
+			<entry class="" argb="255,255,255,255" value="249" />
+			<entry class="" argb="255,255,255,255" value="250" />
+			<entry class="" argb="255,255,255,255" value="251" />
+			<entry class="" argb="255,255,255,255" value="252" />
+			<entry class="" argb="255,255,255,255" value="253" />
+			<entry class="" argb="255,255,255,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-green-red-yellow" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,2" value="1" />
+			<entry class="" argb="255,0,0,4" value="2" />
+			<entry class="" argb="255,0,0,6" value="3" />
+			<entry class="" argb="255,0,0,8" value="4" />
+			<entry class="" argb="255,0,0,10" value="5" />
+			<entry class="" argb="255,0,0,12" value="6" />
+			<entry class="" argb="255,0,0,14" value="7" />
+			<entry class="" argb="255,0,0,16" value="8" />
+			<entry class="" argb="255,0,0,18" value="9" />
+			<entry class="" argb="255,0,0,20" value="10" />
+			<entry class="" argb="255,0,0,22" value="11" />
+			<entry class="" argb="255,0,0,25" value="12" />
+			<entry class="" argb="255,0,0,27" value="13" />
+			<entry class="" argb="255,0,0,29" value="14" />
+			<entry class="" argb="255,0,0,31" value="15" />
+			<entry class="" argb="255,0,0,33" value="16" />
+			<entry class="" argb="255,0,0,35" value="17" />
+			<entry class="" argb="255,0,0,37" value="18" />
+			<entry class="" argb="255,0,0,39" value="19" />
+			<entry class="" argb="255,0,0,41" value="20" />
+			<entry class="" argb="255,0,0,43" value="21" />
+			<entry class="" argb="255,0,0,45" value="22" />
+			<entry class="" argb="255,0,0,47" value="23" />
+			<entry class="" argb="255,0,0,50" value="24" />
+			<entry class="" argb="255,0,0,52" value="25" />
+			<entry class="" argb="255,0,0,54" value="26" />
+			<entry class="" argb="255,0,0,56" value="27" />
+			<entry class="" argb="255,0,0,58" value="28" />
+			<entry class="" argb="255,0,0,60" value="29" />
+			<entry class="" argb="255,0,0,62" value="30" />
+			<entry class="" argb="255,0,0,64" value="31" />
+			<entry class="" argb="255,0,0,66" value="32" />
+			<entry class="" argb="255,0,3,68" value="33" />
+			<entry class="" argb="255,0,6,70" value="34" />
+			<entry class="" argb="255,0,9,72" value="35" />
+			<entry class="" argb="255,0,12,75" value="36" />
+			<entry class="" argb="255,0,15,77" value="37" />
+			<entry class="" argb="255,0,18,79" value="38" />
+			<entry class="" argb="255,0,21,81" value="39" />
+			<entry class="" argb="255,0,25,83" value="40" />
+			<entry class="" argb="255,0,28,85" value="41" />
+			<entry class="" argb="255,0,31,87" value="42" />
+			<entry class="" argb="255,0,34,89" value="43" />
+			<entry class="" argb="255,0,37,91" value="44" />
+			<entry class="" argb="255,0,40,93" value="45" />
+			<entry class="" argb="255,0,43,95" value="46" />
+			<entry class="" argb="255,0,46,97" value="47" />
+			<entry class="" argb="255,0,50,100" value="48" />
+			<entry class="" argb="255,0,53,100" value="49" />
+			<entry class="" argb="255,0,56,100" value="50" />
+			<entry class="" argb="255,0,59,100" value="51" />
+			<entry class="" argb="255,0,62,100" value="52" />
+			<entry class="" argb="255,0,65,100" value="53" />
+			<entry class="" argb="255,0,68,100" value="54" />
+			<entry class="" argb="255,0,71,100" value="55" />
+			<entry class="" argb="255,0,75,100" value="56" />
+			<entry class="" argb="255,0,78,100" value="57" />
+			<entry class="" argb="255,0,81,100" value="58" />
+			<entry class="" argb="255,0,84,100" value="59" />
+			<entry class="" argb="255,0,87,100" value="60" />
+			<entry class="" argb="255,0,90,100" value="61" />
+			<entry class="" argb="255,0,93,100" value="62" />
+			<entry class="" argb="255,0,96,100" value="63" />
+			<entry class="" argb="255,0,100,100" value="64" />
+			<entry class="" argb="255,0,103,100" value="65" />
+			<entry class="" argb="255,0,106,100" value="66" />
+			<entry class="" argb="255,0,109,100" value="67" />
+			<entry class="" argb="255,0,112,100" value="68" />
+			<entry class="" argb="255,0,115,100" value="69" />
+			<entry class="" argb="255,0,118,100" value="70" />
+			<entry class="" argb="255,0,121,100" value="71" />
+			<entry class="" argb="255,0,125,100" value="72" />
+			<entry class="" argb="255,0,128,100" value="73" />
+			<entry class="" argb="255,0,131,100" value="74" />
+			<entry class="" argb="255,0,134,100" value="75" />
+			<entry class="" argb="255,0,137,100" value="76" />
+			<entry class="" argb="255,0,140,100" value="77" />
+			<entry class="" argb="255,0,143,100" value="78" />
+			<entry class="" argb="255,0,146,100" value="79" />
+			<entry class="" argb="255,0,150,100" value="80" />
+			<entry class="" argb="255,0,150,96" value="81" />
+			<entry class="" argb="255,0,150,93" value="82" />
+			<entry class="" argb="255,0,150,90" value="83" />
+			<entry class="" argb="255,0,150,87" value="84" />
+			<entry class="" argb="255,0,150,84" value="85" />
+			<entry class="" argb="255,0,150,81" value="86" />
+			<entry class="" argb="255,0,150,78" value="87" />
+			<entry class="" argb="255,0,150,75" value="88" />
+			<entry class="" argb="255,0,150,71" value="89" />
+			<entry class="" argb="255,0,150,68" value="90" />
+			<entry class="" argb="255,0,150,65" value="91" />
+			<entry class="" argb="255,0,150,62" value="92" />
+			<entry class="" argb="255,0,150,59" value="93" />
+			<entry class="" argb="255,0,150,56" value="94" />
+			<entry class="" argb="255,0,150,53" value="95" />
+			<entry class="" argb="255,0,150,50" value="96" />
+			<entry class="" argb="255,0,149,46" value="97" />
+			<entry class="" argb="255,0,148,43" value="98" />
+			<entry class="" argb="255,0,148,40" value="99" />
+			<entry class="" argb="255,0,147,37" value="100" />
+			<entry class="" argb="255,0,146,34" value="101" />
+			<entry class="" argb="255,0,146,31" value="102" />
+			<entry class="" argb="255,0,145,28" value="103" />
+			<entry class="" argb="255,0,145,25" value="104" />
+			<entry class="" argb="255,0,144,21" value="105" />
+			<entry class="" argb="255,0,143,18" value="106" />
+			<entry class="" argb="255,0,143,15" value="107" />
+			<entry class="" argb="255,0,142,12" value="108" />
+			<entry class="" argb="255,0,141,9" value="109" />
+			<entry class="" argb="255,0,141,6" value="110" />
+			<entry class="" argb="255,0,140,3" value="111" />
+			<entry class="" argb="255,0,140,0" value="112" />
+			<entry class="" argb="255,7,137,0" value="113" />
+			<entry class="" argb="255,15,135,0" value="114" />
+			<entry class="" argb="255,22,132,0" value="115" />
+			<entry class="" argb="255,30,130,0" value="116" />
+			<entry class="" argb="255,37,127,0" value="117" />
+			<entry class="" argb="255,45,125,0" value="118" />
+			<entry class="" argb="255,52,122,0" value="119" />
+			<entry class="" argb="255,60,120,0" value="120" />
+			<entry class="" argb="255,67,117,0" value="121" />
+			<entry class="" argb="255,75,115,0" value="122" />
+			<entry class="" argb="255,82,112,0" value="123" />
+			<entry class="" argb="255,90,110,0" value="124" />
+			<entry class="" argb="255,97,107,0" value="125" />
+			<entry class="" argb="255,105,105,0" value="126" />
+			<entry class="" argb="255,112,102,0" value="127" />
+			<entry class="" argb="255,120,100,0" value="128" />
+			<entry class="" argb="255,125,93,0" value="129" />
+			<entry class="" argb="255,130,87,0" value="130" />
+			<entry class="" argb="255,135,81,0" value="131" />
+			<entry class="" argb="255,140,75,0" value="132" />
+			<entry class="" argb="255,145,68,0" value="133" />
+			<entry class="" argb="255,150,62,0" value="134" />
+			<entry class="" argb="255,155,56,0" value="135" />
+			<entry class="" argb="255,160,50,0" value="136" />
+			<entry class="" argb="255,165,43,0" value="137" />
+			<entry class="" argb="255,170,37,0" value="138" />
+			<entry class="" argb="255,175,31,0" value="139" />
+			<entry class="" argb="255,180,25,0" value="140" />
+			<entry class="" argb="255,185,18,0" value="141" />
+			<entry class="" argb="255,190,12,0" value="142" />
+			<entry class="" argb="255,195,6,0" value="143" />
+			<entry class="" argb="255,200,0,0" value="144" />
+			<entry class="" argb="255,200,2,0" value="145" />
+			<entry class="" argb="255,201,4,0" value="146" />
+			<entry class="" argb="255,201,6,0" value="147" />
+			<entry class="" argb="255,202,9,0" value="148" />
+			<entry class="" argb="255,202,11,0" value="149" />
+			<entry class="" argb="255,203,13,0" value="150" />
+			<entry class="" argb="255,203,16,0" value="151" />
+			<entry class="" argb="255,204,18,0" value="152" />
+			<entry class="" argb="255,204,20,0" value="153" />
+			<entry class="" argb="255,205,23,0" value="154" />
+			<entry class="" argb="255,205,25,0" value="155" />
+			<entry class="" argb="255,206,27,0" value="156" />
+			<entry class="" argb="255,206,29,0" value="157" />
+			<entry class="" argb="255,207,32,0" value="158" />
+			<entry class="" argb="255,207,34,0" value="159" />
+			<entry class="" argb="255,208,36,0" value="160" />
+			<entry class="" argb="255,208,39,0" value="161" />
+			<entry class="" argb="255,209,41,0" value="162" />
+			<entry class="" argb="255,209,43,0" value="163" />
+			<entry class="" argb="255,210,46,0" value="164" />
+			<entry class="" argb="255,210,48,0" value="165" />
+			<entry class="" argb="255,211,50,0" value="166" />
+			<entry class="" argb="255,211,53,0" value="167" />
+			<entry class="" argb="255,212,55,0" value="168" />
+			<entry class="" argb="255,212,57,0" value="169" />
+			<entry class="" argb="255,213,59,0" value="170" />
+			<entry class="" argb="255,213,62,0" value="171" />
+			<entry class="" argb="255,214,64,0" value="172" />
+			<entry class="" argb="255,214,66,0" value="173" />
+			<entry class="" argb="255,215,69,0" value="174" />
+			<entry class="" argb="255,215,71,0" value="175" />
+			<entry class="" argb="255,216,73,0" value="176" />
+			<entry class="" argb="255,216,76,0" value="177" />
+			<entry class="" argb="255,217,78,0" value="178" />
+			<entry class="" argb="255,217,80,0" value="179" />
+			<entry class="" argb="255,218,83,0" value="180" />
+			<entry class="" argb="255,218,85,0" value="181" />
+			<entry class="" argb="255,219,87,0" value="182" />
+			<entry class="" argb="255,219,89,0" value="183" />
+			<entry class="" argb="255,220,92,0" value="184" />
+			<entry class="" argb="255,220,94,0" value="185" />
+			<entry class="" argb="255,221,96,0" value="186" />
+			<entry class="" argb="255,221,99,0" value="187" />
+			<entry class="" argb="255,222,101,0" value="188" />
+			<entry class="" argb="255,222,103,0" value="189" />
+			<entry class="" argb="255,223,106,0" value="190" />
+			<entry class="" argb="255,223,108,0" value="191" />
+			<entry class="" argb="255,224,110,0" value="192" />
+			<entry class="" argb="255,224,113,0" value="193" />
+			<entry class="" argb="255,225,115,0" value="194" />
+			<entry class="" argb="255,225,117,0" value="195" />
+			<entry class="" argb="255,226,119,0" value="196" />
+			<entry class="" argb="255,226,122,0" value="197" />
+			<entry class="" argb="255,227,124,0" value="198" />
+			<entry class="" argb="255,227,126,0" value="199" />
+			<entry class="" argb="255,228,129,0" value="200" />
+			<entry class="" argb="255,228,131,0" value="201" />
+			<entry class="" argb="255,229,133,0" value="202" />
+			<entry class="" argb="255,229,136,0" value="203" />
+			<entry class="" argb="255,230,138,0" value="204" />
+			<entry class="" argb="255,230,140,0" value="205" />
+			<entry class="" argb="255,231,142,0" value="206" />
+			<entry class="" argb="255,231,145,0" value="207" />
+			<entry class="" argb="255,232,147,0" value="208" />
+			<entry class="" argb="255,232,149,0" value="209" />
+			<entry class="" argb="255,233,152,0" value="210" />
+			<entry class="" argb="255,233,154,0" value="211" />
+			<entry class="" argb="255,234,156,0" value="212" />
+			<entry class="" argb="255,234,159,0" value="213" />
+			<entry class="" argb="255,235,161,0" value="214" />
+			<entry class="" argb="255,235,163,0" value="215" />
+			<entry class="" argb="255,236,166,0" value="216" />
+			<entry class="" argb="255,236,168,0" value="217" />
+			<entry class="" argb="255,237,170,0" value="218" />
+			<entry class="" argb="255,237,172,0" value="219" />
+			<entry class="" argb="255,238,175,0" value="220" />
+			<entry class="" argb="255,238,177,0" value="221" />
+			<entry class="" argb="255,239,179,0" value="222" />
+			<entry class="" argb="255,239,182,0" value="223" />
+			<entry class="" argb="255,240,184,0" value="224" />
+			<entry class="" argb="255,240,186,0" value="225" />
+			<entry class="" argb="255,241,189,0" value="226" />
+			<entry class="" argb="255,241,191,0" value="227" />
+			<entry class="" argb="255,242,193,0" value="228" />
+			<entry class="" argb="255,242,196,0" value="229" />
+			<entry class="" argb="255,243,198,0" value="230" />
+			<entry class="" argb="255,243,200,0" value="231" />
+			<entry class="" argb="255,244,202,0" value="232" />
+			<entry class="" argb="255,244,205,0" value="233" />
+			<entry class="" argb="255,245,207,0" value="234" />
+			<entry class="" argb="255,245,209,0" value="235" />
+			<entry class="" argb="255,246,212,0" value="236" />
+			<entry class="" argb="255,246,214,0" value="237" />
+			<entry class="" argb="255,247,216,0" value="238" />
+			<entry class="" argb="255,247,219,0" value="239" />
+			<entry class="" argb="255,248,221,0" value="240" />
+			<entry class="" argb="255,248,223,0" value="241" />
+			<entry class="" argb="255,249,226,0" value="242" />
+			<entry class="" argb="255,249,228,0" value="243" />
+			<entry class="" argb="255,250,230,0" value="244" />
+			<entry class="" argb="255,250,232,0" value="245" />
+			<entry class="" argb="255,251,235,0" value="246" />
+			<entry class="" argb="255,251,237,0" value="247" />
+			<entry class="" argb="255,252,239,0" value="248" />
+			<entry class="" argb="255,252,242,0" value="249" />
+			<entry class="" argb="255,253,244,0" value="250" />
+			<entry class="" argb="255,253,246,0" value="251" />
+			<entry class="" argb="255,254,249,0" value="252" />
+			<entry class="" argb="255,254,251,0" value="253" />
+			<entry class="" argb="255,255,253,0" value="254" />
+			<entry class="" argb="255,255,255,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-pastel-red" interpolate="false">
+		<table>
+			<entry class="" argb="255,33,0,96" value="0" />
+			<entry class="" argb="255,33,0,96" value="1" />
+			<entry class="" argb="255,32,0,97" value="2" />
+			<entry class="" argb="255,31,0,99" value="3" />
+			<entry class="" argb="255,31,0,100" value="4" />
+			<entry class="" argb="255,30,0,101" value="5" />
+			<entry class="" argb="255,29,0,102" value="6" />
+			<entry class="" argb="255,28,0,104" value="7" />
+			<entry class="" argb="255,27,0,105" value="8" />
+			<entry class="" argb="255,26,0,106" value="9" />
+			<entry class="" argb="255,25,0,107" value="10" />
+			<entry class="" argb="255,24,0,108" value="11" />
+			<entry class="" argb="255,23,0,110" value="12" />
+			<entry class="" argb="255,22,0,111" value="13" />
+			<entry class="" argb="255,21,0,112" value="14" />
+			<entry class="" argb="255,20,0,113" value="15" />
+			<entry class="" argb="255,19,0,115" value="16" />
+			<entry class="" argb="255,17,0,116" value="17" />
+			<entry class="" argb="255,16,0,117" value="18" />
+			<entry class="" argb="255,15,0,118" value="19" />
+			<entry class="" argb="255,14,0,119" value="20" />
+			<entry class="" argb="255,12,0,121" value="21" />
+			<entry class="" argb="255,11,0,122" value="22" />
+			<entry class="" argb="255,13,0,123" value="23" />
+			<entry class="" argb="255,8,0,124" value="24" />
+			<entry class="" argb="255,7,0,125" value="25" />
+			<entry class="" argb="255,5,0,127" value="26" />
+			<entry class="" argb="255,4,0,128" value="27" />
+			<entry class="" argb="255,2,0,129" value="28" />
+			<entry class="" argb="255,1,0,130" value="29" />
+			<entry class="" argb="255,0,0,132" value="30" />
+			<entry class="" argb="255,0,1,133" value="31" />
+			<entry class="" argb="255,0,3,134" value="32" />
+			<entry class="" argb="255,0,5,135" value="33" />
+			<entry class="" argb="255,0,6,136" value="34" />
+			<entry class="" argb="255,0,8,138" value="35" />
+			<entry class="" argb="255,0,13,139" value="36" />
+			<entry class="" argb="255,0,12,140" value="37" />
+			<entry class="" argb="255,0,13,141" value="38" />
+			<entry class="" argb="255,0,15,143" value="39" />
+			<entry class="" argb="255,0,17,144" value="40" />
+			<entry class="" argb="255,0,19,145" value="41" />
+			<entry class="" argb="255,0,21,146" value="42" />
+			<entry class="" argb="255,0,23,147" value="43" />
+			<entry class="" argb="255,0,25,149" value="44" />
+			<entry class="" argb="255,0,27,150" value="45" />
+			<entry class="" argb="255,0,29,151" value="46" />
+			<entry class="" argb="255,0,31,152" value="47" />
+			<entry class="" argb="255,0,33,154" value="48" />
+			<entry class="" argb="255,0,35,155" value="49" />
+			<entry class="" argb="255,0,37,156" value="50" />
+			<entry class="" argb="255,0,39,157" value="51" />
+			<entry class="" argb="255,0,42,158" value="52" />
+			<entry class="" argb="255,0,44,160" value="53" />
+			<entry class="" argb="255,0,46,161" value="54" />
+			<entry class="" argb="255,0,49,162" value="55" />
+			<entry class="" argb="255,0,51,163" value="56" />
+			<entry class="" argb="255,0,53,164" value="57" />
+			<entry class="" argb="255,0,56,166" value="58" />
+			<entry class="" argb="255,0,58,167" value="59" />
+			<entry class="" argb="255,0,60,168" value="60" />
+			<entry class="" argb="255,0,63,169" value="61" />
+			<entry class="" argb="255,0,65,171" value="62" />
+			<entry class="" argb="255,0,68,172" value="63" />
+			<entry class="" argb="255,0,71,173" value="64" />
+			<entry class="" argb="255,0,73,174" value="65" />
+			<entry class="" argb="255,0,76,175" value="66" />
+			<entry class="" argb="255,0,78,177" value="67" />
+			<entry class="" argb="255,0,81,178" value="68" />
+			<entry class="" argb="255,0,84,179" value="69" />
+			<entry class="" argb="255,0,87,180" value="70" />
+			<entry class="" argb="255,0,89,182" value="71" />
+			<entry class="" argb="255,0,92,183" value="72" />
+			<entry class="" argb="255,0,95,184" value="73" />
+			<entry class="" argb="255,0,98,185" value="74" />
+			<entry class="" argb="255,0,101,186" value="75" />
+			<entry class="" argb="255,0,104,188" value="76" />
+			<entry class="" argb="255,0,107,189" value="77" />
+			<entry class="" argb="255,0,110,190" value="78" />
+			<entry class="" argb="255,0,113,191" value="79" />
+			<entry class="" argb="255,0,116,193" value="80" />
+			<entry class="" argb="255,0,119,194" value="81" />
+			<entry class="" argb="255,0,122,195" value="82" />
+			<entry class="" argb="255,0,125,196" value="83" />
+			<entry class="" argb="255,0,128,197" value="84" />
+			<entry class="" argb="255,0,131,199" value="85" />
+			<entry class="" argb="255,0,134,200" value="86" />
+			<entry class="" argb="255,0,138,201" value="87" />
+			<entry class="" argb="255,0,141,202" value="88" />
+			<entry class="" argb="255,0,144,203" value="89" />
+			<entry class="" argb="255,0,148,205" value="90" />
+			<entry class="" argb="255,0,151,206" value="91" />
+			<entry class="" argb="255,0,154,207" value="92" />
+			<entry class="" argb="255,0,158,208" value="93" />
+			<entry class="" argb="255,0,161,210" value="94" />
+			<entry class="" argb="255,0,165,211" value="95" />
+			<entry class="" argb="255,0,168,212" value="96" />
+			<entry class="" argb="255,0,172,213" value="97" />
+			<entry class="" argb="255,0,175,214" value="98" />
+			<entry class="" argb="255,0,179,216" value="99" />
+			<entry class="" argb="255,0,182,217" value="100" />
+			<entry class="" argb="255,0,186,218" value="101" />
+			<entry class="" argb="255,0,190,219" value="102" />
+			<entry class="" argb="255,0,193,221" value="103" />
+			<entry class="" argb="255,0,197,222" value="104" />
+			<entry class="" argb="255,0,201,223" value="105" />
+			<entry class="" argb="255,0,205,224" value="106" />
+			<entry class="" argb="255,0,209,225" value="107" />
+			<entry class="" argb="255,0,212,227" value="108" />
+			<entry class="" argb="255,0,216,228" value="109" />
+			<entry class="" argb="255,0,220,229" value="110" />
+			<entry class="" argb="255,0,224,230" value="111" />
+			<entry class="" argb="255,0,228,232" value="112" />
+			<entry class="" argb="255,0,232,233" value="113" />
+			<entry class="" argb="255,0,234,232" value="114" />
+			<entry class="" argb="255,0,235,230" value="115" />
+			<entry class="" argb="255,0,236,229" value="116" />
+			<entry class="" argb="255,0,238,227" value="117" />
+			<entry class="" argb="255,0,239,225" value="118" />
+			<entry class="" argb="255,0,240,223" value="119" />
+			<entry class="" argb="255,0,241,222" value="120" />
+			<entry class="" argb="255,0,243,220" value="121" />
+			<entry class="" argb="255,0,244,218" value="122" />
+			<entry class="" argb="255,0,245,216" value="123" />
+			<entry class="" argb="255,0,246,214" value="124" />
+			<entry class="" argb="255,0,247,212" value="125" />
+			<entry class="" argb="255,0,249,210" value="126" />
+			<entry class="" argb="255,0,249,208" value="127" />
+			<entry class="" argb="255,0,246,149" value="128" />
+			<entry class="" argb="255,0,244,142" value="129" />
+			<entry class="" argb="255,0,241,135" value="130" />
+			<entry class="" argb="255,0,237,127" value="131" />
+			<entry class="" argb="255,2,232,118" value="132" />
+			<entry class="" argb="255,4,227,111" value="133" />
+			<entry class="" argb="255,5,223,103" value="134" />
+			<entry class="" argb="255,7,218,95" value="135" />
+			<entry class="" argb="255,8,214,88" value="136" />
+			<entry class="" argb="255,13,209,81" value="137" />
+			<entry class="" argb="255,11,205,74" value="138" />
+			<entry class="" argb="255,13,201,67" value="139" />
+			<entry class="" argb="255,14,196,60" value="140" />
+			<entry class="" argb="255,15,192,53" value="141" />
+			<entry class="" argb="255,17,188,47" value="142" />
+			<entry class="" argb="255,18,184,40" value="143" />
+			<entry class="" argb="255,19,180,34" value="144" />
+			<entry class="" argb="255,20,175,28" value="145" />
+			<entry class="" argb="255,21,171,22" value="146" />
+			<entry class="" argb="255,29,167,22" value="147" />
+			<entry class="" argb="255,36,163,23" value="148" />
+			<entry class="" argb="255,42,160,24" value="149" />
+			<entry class="" argb="255,48,156,25" value="150" />
+			<entry class="" argb="255,53,152,26" value="151" />
+			<entry class="" argb="255,58,148,27" value="152" />
+			<entry class="" argb="255,61,144,28" value="153" />
+			<entry class="" argb="255,65,141,28" value="154" />
+			<entry class="" argb="255,68,137,29" value="155" />
+			<entry class="" argb="255,70,133,30" value="156" />
+			<entry class="" argb="255,72,130,30" value="157" />
+			<entry class="" argb="255,73,126,31" value="158" />
+			<entry class="" argb="255,74,123,31" value="159" />
+			<entry class="" argb="255,74,119,32" value="160" />
+			<entry class="" argb="255,74,116,32" value="161" />
+			<entry class="" argb="255,75,116,29" value="162" />
+			<entry class="" argb="255,75,115,28" value="163" />
+			<entry class="" argb="255,76,113,26" value="164" />
+			<entry class="" argb="255,76,112,25" value="165" />
+			<entry class="" argb="255,76,110,23" value="166" />
+			<entry class="" argb="255,77,109,22" value="167" />
+			<entry class="" argb="255,76,104,20" value="168" />
+			<entry class="" argb="255,77,104,18" value="169" />
+			<entry class="" argb="255,78,103,17" value="170" />
+			<entry class="" argb="255,79,102,16" value="171" />
+			<entry class="" argb="255,80,101,15" value="172" />
+			<entry class="" argb="255,81,100,14" value="173" />
+			<entry class="" argb="255,83,99,13" value="174" />
+			<entry class="" argb="255,84,98,12" value="175" />
+			<entry class="" argb="255,85,97,11" value="176" />
+			<entry class="" argb="255,86,96,13" value="177" />
+			<entry class="" argb="255,88,95,9" value="178" />
+			<entry class="" argb="255,89,94,8" value="179" />
+			<entry class="" argb="255,91,93,7" value="180" />
+			<entry class="" argb="255,92,92,6" value="181" />
+			<entry class="" argb="255,91,88,5" value="182" />
+			<entry class="" argb="255,94,88,5" value="183" />
+			<entry class="" argb="255,96,88,4" value="184" />
+			<entry class="" argb="255,98,87,3" value="185" />
+			<entry class="" argb="255,100,86,3" value="186" />
+			<entry class="" argb="255,102,85,2" value="187" />
+			<entry class="" argb="255,104,85,1" value="188" />
+			<entry class="" argb="255,106,84,0" value="189" />
+			<entry class="" argb="255,108,83,0" value="190" />
+			<entry class="" argb="255,109,82,0" value="191" />
+			<entry class="" argb="255,111,80,0" value="192" />
+			<entry class="" argb="255,112,79,0" value="193" />
+			<entry class="" argb="255,113,78,0" value="194" />
+			<entry class="" argb="255,115,76,0" value="195" />
+			<entry class="" argb="255,116,75,0" value="196" />
+			<entry class="" argb="255,117,74,0" value="197" />
+			<entry class="" argb="255,119,73,0" value="198" />
+			<entry class="" argb="255,120,71,0" value="199" />
+			<entry class="" argb="255,121,70,0" value="200" />
+			<entry class="" argb="255,123,69,0" value="201" />
+			<entry class="" argb="255,124,68,0" value="202" />
+			<entry class="" argb="255,125,67,0" value="203" />
+			<entry class="" argb="255,127,66,0" value="204" />
+			<entry class="" argb="255,128,64,0" value="205" />
+			<entry class="" argb="255,129,63,0" value="206" />
+			<entry class="" argb="255,131,61,0" value="207" />
+			<entry class="" argb="255,132,58,0" value="208" />
+			<entry class="" argb="255,133,56,0" value="209" />
+			<entry class="" argb="255,135,54,0" value="210" />
+			<entry class="" argb="255,136,52,0" value="211" />
+			<entry class="" argb="255,137,49,0" value="212" />
+			<entry class="" argb="255,138,47,0" value="213" />
+			<entry class="" argb="255,140,45,0" value="214" />
+			<entry class="" argb="255,141,43,0" value="215" />
+			<entry class="" argb="255,142,41,0" value="216" />
+			<entry class="" argb="255,144,40,0" value="217" />
+			<entry class="" argb="255,145,38,0" value="218" />
+			<entry class="" argb="255,146,36,0" value="219" />
+			<entry class="" argb="255,148,34,0" value="220" />
+			<entry class="" argb="255,149,33,0" value="221" />
+			<entry class="" argb="255,150,31,0" value="222" />
+			<entry class="" argb="255,152,29,0" value="223" />
+			<entry class="" argb="255,153,28,0" value="224" />
+			<entry class="" argb="255,154,26,0" value="225" />
+			<entry class="" argb="255,156,25,0" value="226" />
+			<entry class="" argb="255,157,23,0" value="227" />
+			<entry class="" argb="255,158,22,0" value="228" />
+			<entry class="" argb="255,160,21,0" value="229" />
+			<entry class="" argb="255,161,19,0" value="230" />
+			<entry class="" argb="255,162,18,0" value="231" />
+			<entry class="" argb="255,164,17,0" value="232" />
+			<entry class="" argb="255,165,16,0" value="233" />
+			<entry class="" argb="255,166,14,0" value="234" />
+			<entry class="" argb="255,168,13,0" value="235" />
+			<entry class="" argb="255,169,12,0" value="236" />
+			<entry class="" argb="255,170,11,0" value="237" />
+			<entry class="" argb="255,172,13,0" value="238" />
+			<entry class="" argb="255,173,9,0" value="239" />
+			<entry class="" argb="255,174,8,0" value="240" />
+			<entry class="" argb="255,175,7,0" value="241" />
+			<entry class="" argb="255,177,7,0" value="242" />
+			<entry class="" argb="255,178,6,0" value="243" />
+			<entry class="" argb="255,179,5,0" value="244" />
+			<entry class="" argb="255,181,4,0" value="245" />
+			<entry class="" argb="255,182,4,0" value="246" />
+			<entry class="" argb="255,183,3,0" value="247" />
+			<entry class="" argb="255,185,2,0" value="248" />
+			<entry class="" argb="255,186,2,0" value="249" />
+			<entry class="" argb="255,187,1,0" value="250" />
+			<entry class="" argb="255,189,1,0" value="251" />
+			<entry class="" argb="255,190,0,0" value="252" />
+			<entry class="" argb="255,191,0,0" value="253" />
+			<entry class="" argb="255,193,0,0" value="254" />
+			<entry class="" argb="255,193,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-red" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,1,1" value="1" />
+			<entry class="" argb="255,0,2,2" value="2" />
+			<entry class="" argb="255,0,3,3" value="3" />
+			<entry class="" argb="255,0,4,4" value="4" />
+			<entry class="" argb="255,0,8,8" value="5" />
+			<entry class="" argb="255,0,12,12" value="6" />
+			<entry class="" argb="255,0,16,16" value="7" />
+			<entry class="" argb="255,0,21,21" value="8" />
+			<entry class="" argb="255,0,25,25" value="9" />
+			<entry class="" argb="255,0,29,29" value="10" />
+			<entry class="" argb="255,0,33,33" value="11" />
+			<entry class="" argb="255,0,38,38" value="12" />
+			<entry class="" argb="255,0,42,42" value="13" />
+			<entry class="" argb="255,0,46,46" value="14" />
+			<entry class="" argb="255,0,50,50" value="15" />
+			<entry class="" argb="255,0,55,55" value="16" />
+			<entry class="" argb="255,0,59,59" value="17" />
+			<entry class="" argb="255,0,63,63" value="18" />
+			<entry class="" argb="255,0,67,67" value="19" />
+			<entry class="" argb="255,0,72,72" value="20" />
+			<entry class="" argb="255,0,76,76" value="21" />
+			<entry class="" argb="255,0,80,80" value="22" />
+			<entry class="" argb="255,0,84,84" value="23" />
+			<entry class="" argb="255,0,89,89" value="24" />
+			<entry class="" argb="255,0,93,93" value="25" />
+			<entry class="" argb="255,0,97,97" value="26" />
+			<entry class="" argb="255,0,101,101" value="27" />
+			<entry class="" argb="255,0,106,106" value="28" />
+			<entry class="" argb="255,0,110,110" value="29" />
+			<entry class="" argb="255,0,114,114" value="30" />
+			<entry class="" argb="255,0,118,118" value="31" />
+			<entry class="" argb="255,0,123,123" value="32" />
+			<entry class="" argb="255,0,127,127" value="33" />
+			<entry class="" argb="255,0,131,131" value="34" />
+			<entry class="" argb="255,0,135,135" value="35" />
+			<entry class="" argb="255,0,140,140" value="36" />
+			<entry class="" argb="255,0,144,144" value="37" />
+			<entry class="" argb="255,0,148,148" value="38" />
+			<entry class="" argb="255,0,152,152" value="39" />
+			<entry class="" argb="255,0,157,157" value="40" />
+			<entry class="" argb="255,0,161,161" value="41" />
+			<entry class="" argb="255,0,165,165" value="42" />
+			<entry class="" argb="255,0,169,169" value="43" />
+			<entry class="" argb="255,0,174,174" value="44" />
+			<entry class="" argb="255,0,178,178" value="45" />
+			<entry class="" argb="255,0,182,182" value="46" />
+			<entry class="" argb="255,0,186,186" value="47" />
+			<entry class="" argb="255,0,191,191" value="48" />
+			<entry class="" argb="255,0,195,195" value="49" />
+			<entry class="" argb="255,0,199,199" value="50" />
+			<entry class="" argb="255,0,203,203" value="51" />
+			<entry class="" argb="255,0,208,208" value="52" />
+			<entry class="" argb="255,0,212,212" value="53" />
+			<entry class="" argb="255,0,216,216" value="54" />
+			<entry class="" argb="255,0,220,220" value="55" />
+			<entry class="" argb="255,0,225,225" value="56" />
+			<entry class="" argb="255,0,229,229" value="57" />
+			<entry class="" argb="255,0,233,233" value="58" />
+			<entry class="" argb="255,0,237,237" value="59" />
+			<entry class="" argb="255,0,242,242" value="60" />
+			<entry class="" argb="255,0,246,246" value="61" />
+			<entry class="" argb="255,0,250,250" value="62" />
+			<entry class="" argb="255,0,255,255" value="63" />
+			<entry class="" argb="255,0,255,255" value="64" />
+			<entry class="" argb="255,0,251,255" value="65" />
+			<entry class="" argb="255,0,247,255" value="66" />
+			<entry class="" argb="255,0,243,255" value="67" />
+			<entry class="" argb="255,0,239,255" value="68" />
+			<entry class="" argb="255,0,235,255" value="69" />
+			<entry class="" argb="255,0,231,255" value="70" />
+			<entry class="" argb="255,0,227,255" value="71" />
+			<entry class="" argb="255,0,223,255" value="72" />
+			<entry class="" argb="255,0,219,255" value="73" />
+			<entry class="" argb="255,0,215,255" value="74" />
+			<entry class="" argb="255,0,211,255" value="75" />
+			<entry class="" argb="255,0,207,255" value="76" />
+			<entry class="" argb="255,0,203,255" value="77" />
+			<entry class="" argb="255,0,199,255" value="78" />
+			<entry class="" argb="255,0,195,255" value="79" />
+			<entry class="" argb="255,0,191,255" value="80" />
+			<entry class="" argb="255,0,187,255" value="81" />
+			<entry class="" argb="255,0,183,255" value="82" />
+			<entry class="" argb="255,0,179,255" value="83" />
+			<entry class="" argb="255,0,175,255" value="84" />
+			<entry class="" argb="255,0,170,255" value="85" />
+			<entry class="" argb="255,0,166,255" value="86" />
+			<entry class="" argb="255,0,162,255" value="87" />
+			<entry class="" argb="255,0,158,255" value="88" />
+			<entry class="" argb="255,0,154,255" value="89" />
+			<entry class="" argb="255,0,150,255" value="90" />
+			<entry class="" argb="255,0,146,255" value="91" />
+			<entry class="" argb="255,0,142,255" value="92" />
+			<entry class="" argb="255,0,138,255" value="93" />
+			<entry class="" argb="255,0,134,255" value="94" />
+			<entry class="" argb="255,0,130,255" value="95" />
+			<entry class="" argb="255,0,126,255" value="96" />
+			<entry class="" argb="255,0,122,255" value="97" />
+			<entry class="" argb="255,0,118,255" value="98" />
+			<entry class="" argb="255,0,114,255" value="99" />
+			<entry class="" argb="255,0,110,255" value="100" />
+			<entry class="" argb="255,0,106,255" value="101" />
+			<entry class="" argb="255,0,102,255" value="102" />
+			<entry class="" argb="255,0,98,255" value="103" />
+			<entry class="" argb="255,0,94,255" value="104" />
+			<entry class="" argb="255,0,90,255" value="105" />
+			<entry class="" argb="255,0,85,255" value="106" />
+			<entry class="" argb="255,0,81,255" value="107" />
+			<entry class="" argb="255,0,77,255" value="108" />
+			<entry class="" argb="255,0,73,255" value="109" />
+			<entry class="" argb="255,0,69,255" value="110" />
+			<entry class="" argb="255,0,65,255" value="111" />
+			<entry class="" argb="255,0,61,255" value="112" />
+			<entry class="" argb="255,0,57,255" value="113" />
+			<entry class="" argb="255,0,53,255" value="114" />
+			<entry class="" argb="255,0,49,255" value="115" />
+			<entry class="" argb="255,0,45,255" value="116" />
+			<entry class="" argb="255,0,41,255" value="117" />
+			<entry class="" argb="255,0,37,255" value="118" />
+			<entry class="" argb="255,0,33,255" value="119" />
+			<entry class="" argb="255,0,29,255" value="120" />
+			<entry class="" argb="255,0,25,255" value="121" />
+			<entry class="" argb="255,0,21,255" value="122" />
+			<entry class="" argb="255,0,17,255" value="123" />
+			<entry class="" argb="255,0,13,255" value="124" />
+			<entry class="" argb="255,0,9,255" value="125" />
+			<entry class="" argb="255,0,5,255" value="126" />
+			<entry class="" argb="255,0,0,255" value="127" />
+			<entry class="" argb="255,0,0,255" value="128" />
+			<entry class="" argb="255,4,0,255" value="129" />
+			<entry class="" argb="255,8,0,255" value="130" />
+			<entry class="" argb="255,12,0,255" value="131" />
+			<entry class="" argb="255,16,0,255" value="132" />
+			<entry class="" argb="255,20,0,255" value="133" />
+			<entry class="" argb="255,24,0,255" value="134" />
+			<entry class="" argb="255,28,0,255" value="135" />
+			<entry class="" argb="255,32,0,255" value="136" />
+			<entry class="" argb="255,36,0,255" value="137" />
+			<entry class="" argb="255,40,0,255" value="138" />
+			<entry class="" argb="255,44,0,255" value="139" />
+			<entry class="" argb="255,48,0,255" value="140" />
+			<entry class="" argb="255,52,0,255" value="141" />
+			<entry class="" argb="255,56,0,255" value="142" />
+			<entry class="" argb="255,60,0,255" value="143" />
+			<entry class="" argb="255,64,0,255" value="144" />
+			<entry class="" argb="255,68,0,255" value="145" />
+			<entry class="" argb="255,72,0,255" value="146" />
+			<entry class="" argb="255,76,0,255" value="147" />
+			<entry class="" argb="255,80,0,255" value="148" />
+			<entry class="" argb="255,85,0,255" value="149" />
+			<entry class="" argb="255,89,0,255" value="150" />
+			<entry class="" argb="255,93,0,255" value="151" />
+			<entry class="" argb="255,97,0,255" value="152" />
+			<entry class="" argb="255,101,0,255" value="153" />
+			<entry class="" argb="255,105,0,255" value="154" />
+			<entry class="" argb="255,109,0,255" value="155" />
+			<entry class="" argb="255,113,0,255" value="156" />
+			<entry class="" argb="255,117,0,255" value="157" />
+			<entry class="" argb="255,121,0,255" value="158" />
+			<entry class="" argb="255,125,0,255" value="159" />
+			<entry class="" argb="255,129,0,255" value="160" />
+			<entry class="" argb="255,133,0,255" value="161" />
+			<entry class="" argb="255,137,0,255" value="162" />
+			<entry class="" argb="255,141,0,255" value="163" />
+			<entry class="" argb="255,145,0,255" value="164" />
+			<entry class="" argb="255,149,0,255" value="165" />
+			<entry class="" argb="255,153,0,255" value="166" />
+			<entry class="" argb="255,157,0,255" value="167" />
+			<entry class="" argb="255,161,0,255" value="168" />
+			<entry class="" argb="255,165,0,255" value="169" />
+			<entry class="" argb="255,170,0,255" value="170" />
+			<entry class="" argb="255,174,0,255" value="171" />
+			<entry class="" argb="255,178,0,255" value="172" />
+			<entry class="" argb="255,182,0,255" value="173" />
+			<entry class="" argb="255,186,0,255" value="174" />
+			<entry class="" argb="255,190,0,255" value="175" />
+			<entry class="" argb="255,194,0,255" value="176" />
+			<entry class="" argb="255,198,0,255" value="177" />
+			<entry class="" argb="255,202,0,255" value="178" />
+			<entry class="" argb="255,206,0,255" value="179" />
+			<entry class="" argb="255,210,0,255" value="180" />
+			<entry class="" argb="255,214,0,255" value="181" />
+			<entry class="" argb="255,218,0,255" value="182" />
+			<entry class="" argb="255,222,0,255" value="183" />
+			<entry class="" argb="255,226,0,255" value="184" />
+			<entry class="" argb="255,230,0,255" value="185" />
+			<entry class="" argb="255,234,0,255" value="186" />
+			<entry class="" argb="255,238,0,255" value="187" />
+			<entry class="" argb="255,242,0,255" value="188" />
+			<entry class="" argb="255,246,0,255" value="189" />
+			<entry class="" argb="255,250,0,255" value="190" />
+			<entry class="" argb="255,255,0,255" value="191" />
+			<entry class="" argb="255,255,0,255" value="192" />
+			<entry class="" argb="255,255,0,251" value="193" />
+			<entry class="" argb="255,255,0,247" value="194" />
+			<entry class="" argb="255,255,0,243" value="195" />
+			<entry class="" argb="255,255,0,239" value="196" />
+			<entry class="" argb="255,255,0,235" value="197" />
+			<entry class="" argb="255,255,0,231" value="198" />
+			<entry class="" argb="255,255,0,227" value="199" />
+			<entry class="" argb="255,255,0,223" value="200" />
+			<entry class="" argb="255,255,0,218" value="201" />
+			<entry class="" argb="255,255,0,214" value="202" />
+			<entry class="" argb="255,255,0,210" value="203" />
+			<entry class="" argb="255,255,0,206" value="204" />
+			<entry class="" argb="255,255,0,202" value="205" />
+			<entry class="" argb="255,255,0,198" value="206" />
+			<entry class="" argb="255,255,0,194" value="207" />
+			<entry class="" argb="255,255,0,190" value="208" />
+			<entry class="" argb="255,255,0,186" value="209" />
+			<entry class="" argb="255,255,0,181" value="210" />
+			<entry class="" argb="255,255,0,177" value="211" />
+			<entry class="" argb="255,255,0,173" value="212" />
+			<entry class="" argb="255,255,0,169" value="213" />
+			<entry class="" argb="255,255,0,165" value="214" />
+			<entry class="" argb="255,255,0,161" value="215" />
+			<entry class="" argb="255,255,0,157" value="216" />
+			<entry class="" argb="255,255,0,153" value="217" />
+			<entry class="" argb="255,255,0,149" value="218" />
+			<entry class="" argb="255,255,0,144" value="219" />
+			<entry class="" argb="255,255,0,140" value="220" />
+			<entry class="" argb="255,255,0,136" value="221" />
+			<entry class="" argb="255,255,0,132" value="222" />
+			<entry class="" argb="255,255,0,128" value="223" />
+			<entry class="" argb="255,255,0,124" value="224" />
+			<entry class="" argb="255,255,0,120" value="225" />
+			<entry class="" argb="255,255,0,116" value="226" />
+			<entry class="" argb="255,255,0,112" value="227" />
+			<entry class="" argb="255,255,0,107" value="228" />
+			<entry class="" argb="255,255,0,103" value="229" />
+			<entry class="" argb="255,255,0,99" value="230" />
+			<entry class="" argb="255,255,0,95" value="231" />
+			<entry class="" argb="255,255,0,91" value="232" />
+			<entry class="" argb="255,255,0,87" value="233" />
+			<entry class="" argb="255,255,0,83" value="234" />
+			<entry class="" argb="255,255,0,79" value="235" />
+			<entry class="" argb="255,255,0,75" value="236" />
+			<entry class="" argb="255,255,0,70" value="237" />
+			<entry class="" argb="255,255,0,66" value="238" />
+			<entry class="" argb="255,255,0,62" value="239" />
+			<entry class="" argb="255,255,0,58" value="240" />
+			<entry class="" argb="255,255,0,54" value="241" />
+			<entry class="" argb="255,255,0,50" value="242" />
+			<entry class="" argb="255,255,0,46" value="243" />
+			<entry class="" argb="255,255,0,42" value="244" />
+			<entry class="" argb="255,255,0,38" value="245" />
+			<entry class="" argb="255,255,0,33" value="246" />
+			<entry class="" argb="255,255,0,29" value="247" />
+			<entry class="" argb="255,255,0,25" value="248" />
+			<entry class="" argb="255,255,0,21" value="249" />
+			<entry class="" argb="255,255,0,17" value="250" />
+			<entry class="" argb="255,255,0,13" value="251" />
+			<entry class="" argb="255,255,0,9" value="252" />
+			<entry class="" argb="255,255,0,5" value="253" />
+			<entry class="" argb="255,255,0,0" value="254" />
+			<entry class="" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-waves" interpolate="false">
+		<table>
+			<entry class="" argb="255,82,0,214" value="0" />
+			<entry class="" argb="255,82,0,214" value="1" />
+			<entry class="" argb="255,77,1,202" value="2" />
+			<entry class="" argb="255,73,1,189" value="3" />
+			<entry class="" argb="255,68,2,177" value="4" />
+			<entry class="" argb="255,63,2,165" value="5" />
+			<entry class="" argb="255,59,3,153" value="6" />
+			<entry class="" argb="255,54,4,141" value="7" />
+			<entry class="" argb="255,50,4,129" value="8" />
+			<entry class="" argb="255,46,5,118" value="9" />
+			<entry class="" argb="255,42,6,107" value="10" />
+			<entry class="" argb="255,38,6,96" value="11" />
+			<entry class="" argb="255,34,7,85" value="12" />
+			<entry class="" argb="255,30,8,75" value="13" />
+			<entry class="" argb="255,26,9,65" value="14" />
+			<entry class="" argb="255,23,13,56" value="15" />
+			<entry class="" argb="255,19,11,47" value="16" />
+			<entry class="" argb="255,16,12,38" value="17" />
+			<entry class="" argb="255,13,13,30" value="18" />
+			<entry class="" argb="255,13,15,22" value="19" />
+			<entry class="" argb="255,8,16,15" value="20" />
+			<entry class="" argb="255,5,17,9" value="21" />
+			<entry class="" argb="255,3,19,2" value="22" />
+			<entry class="" argb="255,1,20,2" value="23" />
+			<entry class="" argb="255,0,22,7" value="24" />
+			<entry class="" argb="255,2,23,12" value="25" />
+			<entry class="" argb="255,3,25,16" value="26" />
+			<entry class="" argb="255,5,27,19" value="27" />
+			<entry class="" argb="255,6,28,22" value="28" />
+			<entry class="" argb="255,6,30,24" value="29" />
+			<entry class="" argb="255,7,32,25" value="30" />
+			<entry class="" argb="255,7,34,26" value="31" />
+			<entry class="" argb="255,8,35,27" value="32" />
+			<entry class="" argb="255,7,37,26" value="33" />
+			<entry class="" argb="255,7,39,25" value="34" />
+			<entry class="" argb="255,6,41,24" value="35" />
+			<entry class="" argb="255,6,43,22" value="36" />
+			<entry class="" argb="255,5,45,19" value="37" />
+			<entry class="" argb="255,3,46,16" value="38" />
+			<entry class="" argb="255,2,48,12" value="39" />
+			<entry class="" argb="255,0,50,7" value="40" />
+			<entry class="" argb="255,1,51,2" value="41" />
+			<entry class="" argb="255,3,53,2" value="42" />
+			<entry class="" argb="255,5,55,9" value="43" />
+			<entry class="" argb="255,8,56,15" value="44" />
+			<entry class="" argb="255,13,58,22" value="45" />
+			<entry class="" argb="255,13,59,30" value="46" />
+			<entry class="" argb="255,16,60,38" value="47" />
+			<entry class="" argb="255,19,61,47" value="48" />
+			<entry class="" argb="255,23,62,56" value="49" />
+			<entry class="" argb="255,26,63,65" value="50" />
+			<entry class="" argb="255,30,64,75" value="51" />
+			<entry class="" argb="255,34,65,85" value="52" />
+			<entry class="" argb="255,38,66,96" value="53" />
+			<entry class="" argb="255,42,66,107" value="54" />
+			<entry class="" argb="255,46,67,118" value="55" />
+			<entry class="" argb="255,50,67,129" value="56" />
+			<entry class="" argb="255,54,67,141" value="57" />
+			<entry class="" argb="255,59,67,153" value="58" />
+			<entry class="" argb="255,63,67,165" value="59" />
+			<entry class="" argb="255,68,67,177" value="60" />
+			<entry class="" argb="255,73,67,189" value="61" />
+			<entry class="" argb="255,77,67,202" value="62" />
+			<entry class="" argb="255,82,66,214" value="63" />
+			<entry class="" argb="255,87,66,227" value="64" />
+			<entry class="" argb="255,91,65,239" value="65" />
+			<entry class="" argb="255,96,64,251" value="66" />
+			<entry class="" argb="255,100,64,246" value="67" />
+			<entry class="" argb="255,105,63,234" value="68" />
+			<entry class="" argb="255,110,62,222" value="69" />
+			<entry class="" argb="255,114,61,210" value="70" />
+			<entry class="" argb="255,119,60,198" value="71" />
+			<entry class="" argb="255,123,59,186" value="72" />
+			<entry class="" argb="255,127,57,175" value="73" />
+			<entry class="" argb="255,131,56,164" value="74" />
+			<entry class="" argb="255,135,55,153" value="75" />
+			<entry class="" argb="255,139,54,142" value="76" />
+			<entry class="" argb="255,143,53,132" value="77" />
+			<entry class="" argb="255,147,52,122" value="78" />
+			<entry class="" argb="255,150,51,113" value="79" />
+			<entry class="" argb="255,154,49,104" value="80" />
+			<entry class="" argb="255,157,48,95" value="81" />
+			<entry class="" argb="255,160,47,87" value="82" />
+			<entry class="" argb="255,163,47,79" value="83" />
+			<entry class="" argb="255,165,46,72" value="84" />
+			<entry class="" argb="255,168,45,66" value="85" />
+			<entry class="" argb="255,170,44,59" value="86" />
+			<entry class="" argb="255,172,44,54" value="87" />
+			<entry class="" argb="255,174,44,49" value="88" />
+			<entry class="" argb="255,176,43,44" value="89" />
+			<entry class="" argb="255,177,43,40" value="90" />
+			<entry class="" argb="255,179,43,37" value="91" />
+			<entry class="" argb="255,180,43,34" value="92" />
+			<entry class="" argb="255,180,44,32" value="93" />
+			<entry class="" argb="255,181,44,31" value="94" />
+			<entry class="" argb="255,181,45,30" value="95" />
+			<entry class="" argb="255,182,46,29" value="96" />
+			<entry class="" argb="255,181,47,30" value="97" />
+			<entry class="" argb="255,181,48,31" value="98" />
+			<entry class="" argb="255,180,50,32" value="99" />
+			<entry class="" argb="255,180,51,34" value="100" />
+			<entry class="" argb="255,179,53,37" value="101" />
+			<entry class="" argb="255,177,55,40" value="102" />
+			<entry class="" argb="255,176,57,44" value="103" />
+			<entry class="" argb="255,174,60,49" value="104" />
+			<entry class="" argb="255,172,62,54" value="105" />
+			<entry class="" argb="255,170,65,59" value="106" />
+			<entry class="" argb="255,168,68,66" value="107" />
+			<entry class="" argb="255,165,71,72" value="108" />
+			<entry class="" argb="255,163,74,79" value="109" />
+			<entry class="" argb="255,160,78,87" value="110" />
+			<entry class="" argb="255,157,81,95" value="111" />
+			<entry class="" argb="255,154,85,104" value="112" />
+			<entry class="" argb="255,150,88,113" value="113" />
+			<entry class="" argb="255,147,92,122" value="114" />
+			<entry class="" argb="255,143,96,132" value="115" />
+			<entry class="" argb="255,139,100,142" value="116" />
+			<entry class="" argb="255,135,104,153" value="117" />
+			<entry class="" argb="255,131,108,164" value="118" />
+			<entry class="" argb="255,127,112,175" value="119" />
+			<entry class="" argb="255,123,116,186" value="120" />
+			<entry class="" argb="255,119,120,198" value="121" />
+			<entry class="" argb="255,114,124,210" value="122" />
+			<entry class="" argb="255,110,128,222" value="123" />
+			<entry class="" argb="255,105,132,234" value="124" />
+			<entry class="" argb="255,100,136,246" value="125" />
+			<entry class="" argb="255,96,140,251" value="126" />
+			<entry class="" argb="255,91,144,239" value="127" />
+			<entry class="" argb="255,86,148,226" value="128" />
+			<entry class="" argb="255,82,151,214" value="129" />
+			<entry class="" argb="255,77,154,202" value="130" />
+			<entry class="" argb="255,73,158,189" value="131" />
+			<entry class="" argb="255,68,161,177" value="132" />
+			<entry class="" argb="255,63,164,165" value="133" />
+			<entry class="" argb="255,59,166,153" value="134" />
+			<entry class="" argb="255,54,169,141" value="135" />
+			<entry class="" argb="255,50,171,129" value="136" />
+			<entry class="" argb="255,46,173,118" value="137" />
+			<entry class="" argb="255,42,175,107" value="138" />
+			<entry class="" argb="255,38,176,96" value="139" />
+			<entry class="" argb="255,34,178,85" value="140" />
+			<entry class="" argb="255,30,179,75" value="141" />
+			<entry class="" argb="255,26,180,65" value="142" />
+			<entry class="" argb="255,23,180,56" value="143" />
+			<entry class="" argb="255,19,180,47" value="144" />
+			<entry class="" argb="255,16,180,38" value="145" />
+			<entry class="" argb="255,13,180,30" value="146" />
+			<entry class="" argb="255,13,179,22" value="147" />
+			<entry class="" argb="255,8,179,15" value="148" />
+			<entry class="" argb="255,5,178,9" value="149" />
+			<entry class="" argb="255,3,176,2" value="150" />
+			<entry class="" argb="255,1,175,2" value="151" />
+			<entry class="" argb="255,0,173,7" value="152" />
+			<entry class="" argb="255,2,171,12" value="153" />
+			<entry class="" argb="255,3,169,16" value="154" />
+			<entry class="" argb="255,5,166,19" value="155" />
+			<entry class="" argb="255,6,164,22" value="156" />
+			<entry class="" argb="255,6,161,24" value="157" />
+			<entry class="" argb="255,7,158,25" value="158" />
+			<entry class="" argb="255,7,155,26" value="159" />
+			<entry class="" argb="255,8,152,27" value="160" />
+			<entry class="" argb="255,7,148,26" value="161" />
+			<entry class="" argb="255,7,145,25" value="162" />
+			<entry class="" argb="255,6,141,24" value="163" />
+			<entry class="" argb="255,6,138,22" value="164" />
+			<entry class="" argb="255,5,134,19" value="165" />
+			<entry class="" argb="255,3,131,16" value="166" />
+			<entry class="" argb="255,2,127,12" value="167" />
+			<entry class="" argb="255,0,124,7" value="168" />
+			<entry class="" argb="255,1,120,2" value="169" />
+			<entry class="" argb="255,3,117,2" value="170" />
+			<entry class="" argb="255,5,113,9" value="171" />
+			<entry class="" argb="255,8,110,15" value="172" />
+			<entry class="" argb="255,13,107,22" value="173" />
+			<entry class="" argb="255,13,104,30" value="174" />
+			<entry class="" argb="255,16,101,38" value="175" />
+			<entry class="" argb="255,19,99,47" value="176" />
+			<entry class="" argb="255,23,97,56" value="177" />
+			<entry class="" argb="255,26,95,65" value="178" />
+			<entry class="" argb="255,30,93,75" value="179" />
+			<entry class="" argb="255,34,91,85" value="180" />
+			<entry class="" argb="255,38,90,96" value="181" />
+			<entry class="" argb="255,42,89,107" value="182" />
+			<entry class="" argb="255,46,88,118" value="183" />
+			<entry class="" argb="255,50,88,129" value="184" />
+			<entry class="" argb="255,54,88,141" value="185" />
+			<entry class="" argb="255,59,88,153" value="186" />
+			<entry class="" argb="255,63,88,165" value="187" />
+			<entry class="" argb="255,68,89,177" value="188" />
+			<entry class="" argb="255,73,91,189" value="189" />
+			<entry class="" argb="255,77,92,202" value="190" />
+			<entry class="" argb="255,82,94,214" value="191" />
+			<entry class="" argb="255,87,96,227" value="192" />
+			<entry class="" argb="255,91,99,239" value="193" />
+			<entry class="" argb="255,96,102,251" value="194" />
+			<entry class="" argb="255,100,105,246" value="195" />
+			<entry class="" argb="255,105,109,234" value="196" />
+			<entry class="" argb="255,110,113,222" value="197" />
+			<entry class="" argb="255,114,117,210" value="198" />
+			<entry class="" argb="255,119,122,198" value="199" />
+			<entry class="" argb="255,123,127,186" value="200" />
+			<entry class="" argb="255,127,132,175" value="201" />
+			<entry class="" argb="255,131,137,164" value="202" />
+			<entry class="" argb="255,135,142,153" value="203" />
+			<entry class="" argb="255,139,148,142" value="204" />
+			<entry class="" argb="255,143,154,132" value="205" />
+			<entry class="" argb="255,147,160,122" value="206" />
+			<entry class="" argb="255,150,166,113" value="207" />
+			<entry class="" argb="255,154,173,104" value="208" />
+			<entry class="" argb="255,157,179,95" value="209" />
+			<entry class="" argb="255,160,186,87" value="210" />
+			<entry class="" argb="255,163,192,79" value="211" />
+			<entry class="" argb="255,165,199,72" value="212" />
+			<entry class="" argb="255,168,205,66" value="213" />
+			<entry class="" argb="255,170,212,59" value="214" />
+			<entry class="" argb="255,172,218,54" value="215" />
+			<entry class="" argb="255,174,225,49" value="216" />
+			<entry class="" argb="255,176,231,44" value="217" />
+			<entry class="" argb="255,177,237,40" value="218" />
+			<entry class="" argb="255,179,243,37" value="219" />
+			<entry class="" argb="255,180,248,34" value="220" />
+			<entry class="" argb="255,180,254,32" value="221" />
+			<entry class="" argb="255,181,251,31" value="222" />
+			<entry class="" argb="255,181,246,30" value="223" />
+			<entry class="" argb="255,182,241,29" value="224" />
+			<entry class="" argb="255,181,237,30" value="225" />
+			<entry class="" argb="255,181,233,31" value="226" />
+			<entry class="" argb="255,180,229,32" value="227" />
+			<entry class="" argb="255,180,226,34" value="228" />
+			<entry class="" argb="255,179,223,37" value="229" />
+			<entry class="" argb="255,177,220,40" value="230" />
+			<entry class="" argb="255,176,218,44" value="231" />
+			<entry class="" argb="255,174,216,49" value="232" />
+			<entry class="" argb="255,172,215,54" value="233" />
+			<entry class="" argb="255,170,214,59" value="234" />
+			<entry class="" argb="255,168,213,66" value="235" />
+			<entry class="" argb="255,165,213,72" value="236" />
+			<entry class="" argb="255,163,214,79" value="237" />
+			<entry class="" argb="255,160,214,87" value="238" />
+			<entry class="" argb="255,157,216,95" value="239" />
+			<entry class="" argb="255,154,217,104" value="240" />
+			<entry class="" argb="255,150,219,113" value="241" />
+			<entry class="" argb="255,147,222,122" value="242" />
+			<entry class="" argb="255,143,224,132" value="243" />
+			<entry class="" argb="255,139,228,142" value="244" />
+			<entry class="" argb="255,135,231,153" value="245" />
+			<entry class="" argb="255,131,235,164" value="246" />
+			<entry class="" argb="255,127,239,175" value="247" />
+			<entry class="" argb="255,123,244,186" value="248" />
+			<entry class="" argb="255,119,248,198" value="249" />
+			<entry class="" argb="255,114,253,210" value="250" />
+			<entry class="" argb="255,110,251,222" value="251" />
+			<entry class="" argb="255,105,246,234" value="252" />
+			<entry class="" argb="255,100,240,246" value="253" />
+			<entry class="" argb="255,96,234,251" value="254" />
+			<entry class="" argb="255,96,234,251" value="255" />
+		</table>
+	</palette>
+
+	<palette name="green-red-blue" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,36,0" value="1" />
+			<entry class="" argb="255,0,72,0" value="2" />
+			<entry class="" argb="255,0,75,0" value="3" />
+			<entry class="" argb="255,0,79,0" value="4" />
+			<entry class="" argb="255,0,82,0" value="5" />
+			<entry class="" argb="255,0,86,0" value="6" />
+			<entry class="" argb="255,0,90,0" value="7" />
+			<entry class="" argb="255,0,93,0" value="8" />
+			<entry class="" argb="255,0,97,0" value="9" />
+			<entry class="" argb="255,0,100,0" value="10" />
+			<entry class="" argb="255,0,104,0" value="11" />
+			<entry class="" argb="255,0,108,0" value="12" />
+			<entry class="" argb="255,0,117,0" value="13" />
+			<entry class="" argb="255,0,126,0" value="14" />
+			<entry class="" argb="255,0,135,0" value="15" />
+			<entry class="" argb="255,0,144,0" value="16" />
+			<entry class="" argb="255,0,153,0" value="17" />
+			<entry class="" argb="255,0,162,0" value="18" />
+			<entry class="" argb="255,0,171,0" value="19" />
+			<entry class="" argb="255,0,180,0" value="20" />
+			<entry class="" argb="255,0,189,0" value="21" />
+			<entry class="" argb="255,0,198,0" value="22" />
+			<entry class="" argb="255,0,207,0" value="23" />
+			<entry class="" argb="255,0,216,0" value="24" />
+			<entry class="" argb="255,0,225,0" value="25" />
+			<entry class="" argb="255,0,234,0" value="26" />
+			<entry class="" argb="255,0,243,0" value="27" />
+			<entry class="" argb="255,0,252,0" value="28" />
+			<entry class="" argb="255,6,249,0" value="29" />
+			<entry class="" argb="255,12,246,0" value="30" />
+			<entry class="" argb="255,18,243,0" value="31" />
+			<entry class="" argb="255,24,240,0" value="32" />
+			<entry class="" argb="255,30,234,0" value="33" />
+			<entry class="" argb="255,36,228,0" value="34" />
+			<entry class="" argb="255,42,222,0" value="35" />
+			<entry class="" argb="255,48,216,0" value="36" />
+			<entry class="" argb="255,54,210,0" value="37" />
+			<entry class="" argb="255,60,204,0" value="38" />
+			<entry class="" argb="255,66,198,0" value="39" />
+			<entry class="" argb="255,72,192,0" value="40" />
+			<entry class="" argb="255,78,186,0" value="41" />
+			<entry class="" argb="255,84,180,0" value="42" />
+			<entry class="" argb="255,90,174,0" value="43" />
+			<entry class="" argb="255,96,168,0" value="44" />
+			<entry class="" argb="255,102,162,0" value="45" />
+			<entry class="" argb="255,108,156,0" value="46" />
+			<entry class="" argb="255,114,150,0" value="47" />
+			<entry class="" argb="255,120,144,0" value="48" />
+			<entry class="" argb="255,126,138,0" value="49" />
+			<entry class="" argb="255,132,132,0" value="50" />
+			<entry class="" argb="255,138,126,0" value="51" />
+			<entry class="" argb="255,144,120,0" value="52" />
+			<entry class="" argb="255,150,114,0" value="53" />
+			<entry class="" argb="255,156,108,0" value="54" />
+			<entry class="" argb="255,162,102,0" value="55" />
+			<entry class="" argb="255,168,96,0" value="56" />
+			<entry class="" argb="255,174,90,0" value="57" />
+			<entry class="" argb="255,180,84,0" value="58" />
+			<entry class="" argb="255,186,78,0" value="59" />
+			<entry class="" argb="255,192,72,0" value="60" />
+			<entry class="" argb="255,198,66,0" value="61" />
+			<entry class="" argb="255,204,60,0" value="62" />
+			<entry class="" argb="255,210,54,0" value="63" />
+			<entry class="" argb="255,216,48,0" value="64" />
+			<entry class="" argb="255,222,42,0" value="65" />
+			<entry class="" argb="255,228,36,0" value="66" />
+			<entry class="" argb="255,234,30,0" value="67" />
+			<entry class="" argb="255,240,24,0" value="68" />
+			<entry class="" argb="255,243,18,0" value="69" />
+			<entry class="" argb="255,246,12,0" value="70" />
+			<entry class="" argb="255,249,6,0" value="71" />
+			<entry class="" argb="255,252,0,0" value="72" />
+			<entry class="" argb="255,252,0,0" value="73" />
+			<entry class="" argb="255,252,0,0" value="74" />
+			<entry class="" argb="255,252,0,0" value="75" />
+			<entry class="" argb="255,252,0,1" value="76" />
+			<entry class="" argb="255,251,0,3" value="77" />
+			<entry class="" argb="255,250,0,5" value="78" />
+			<entry class="" argb="255,249,0,7" value="79" />
+			<entry class="" argb="255,248,0,9" value="80" />
+			<entry class="" argb="255,248,0,10" value="81" />
+			<entry class="" argb="255,248,0,12" value="82" />
+			<entry class="" argb="255,248,0,14" value="83" />
+			<entry class="" argb="255,248,0,16" value="84" />
+			<entry class="" argb="255,247,0,18" value="85" />
+			<entry class="" argb="255,246,0,20" value="86" />
+			<entry class="" argb="255,245,0,22" value="87" />
+			<entry class="" argb="255,244,0,25" value="88" />
+			<entry class="" argb="255,243,0,27" value="89" />
+			<entry class="" argb="255,242,0,29" value="90" />
+			<entry class="" argb="255,241,0,31" value="91" />
+			<entry class="" argb="255,240,0,34" value="92" />
+			<entry class="" argb="255,240,0,35" value="93" />
+			<entry class="" argb="255,239,0,37" value="94" />
+			<entry class="" argb="255,238,0,39" value="95" />
+			<entry class="" argb="255,237,0,41" value="96" />
+			<entry class="" argb="255,236,0,43" value="97" />
+			<entry class="" argb="255,236,0,45" value="98" />
+			<entry class="" argb="255,236,0,47" value="99" />
+			<entry class="" argb="255,236,0,50" value="100" />
+			<entry class="" argb="255,235,0,52" value="101" />
+			<entry class="" argb="255,234,0,54" value="102" />
+			<entry class="" argb="255,233,0,56" value="103" />
+			<entry class="" argb="255,232,0,59" value="104" />
+			<entry class="" argb="255,231,0,61" value="105" />
+			<entry class="" argb="255,230,0,63" value="106" />
+			<entry class="" argb="255,229,0,65" value="107" />
+			<entry class="" argb="255,228,0,67" value="108" />
+			<entry class="" argb="255,228,0,68" value="109" />
+			<entry class="" argb="255,228,0,70" value="110" />
+			<entry class="" argb="255,228,0,72" value="111" />
+			<entry class="" argb="255,228,0,74" value="112" />
+			<entry class="" argb="255,227,0,76" value="113" />
+			<entry class="" argb="255,226,0,78" value="114" />
+			<entry class="" argb="255,225,0,80" value="115" />
+			<entry class="" argb="255,224,0,83" value="116" />
+			<entry class="" argb="255,223,0,85" value="117" />
+			<entry class="" argb="255,222,0,87" value="118" />
+			<entry class="" argb="255,221,0,89" value="119" />
+			<entry class="" argb="255,220,1,92" value="120" />
+			<entry class="" argb="255,219,1,94" value="121" />
+			<entry class="" argb="255,218,1,96" value="122" />
+			<entry class="" argb="255,217,1,98" value="123" />
+			<entry class="" argb="255,216,0,101" value="124" />
+			<entry class="" argb="255,216,0,102" value="125" />
+			<entry class="" argb="255,216,0,104" value="126" />
+			<entry class="" argb="255,216,0,106" value="127" />
+			<entry class="" argb="255,216,0,108" value="128" />
+			<entry class="" argb="255,215,0,110" value="129" />
+			<entry class="" argb="255,214,0,112" value="130" />
+			<entry class="" argb="255,213,0,114" value="131" />
+			<entry class="" argb="255,212,0,116" value="132" />
+			<entry class="" argb="255,211,0,118" value="133" />
+			<entry class="" argb="255,210,0,120" value="134" />
+			<entry class="" argb="255,209,0,122" value="135" />
+			<entry class="" argb="255,208,0,125" value="136" />
+			<entry class="" argb="255,207,0,127" value="137" />
+			<entry class="" argb="255,206,0,129" value="138" />
+			<entry class="" argb="255,205,0,131" value="139" />
+			<entry class="" argb="255,204,0,134" value="140" />
+			<entry class="" argb="255,204,0,135" value="141" />
+			<entry class="" argb="255,204,0,137" value="142" />
+			<entry class="" argb="255,204,0,139" value="143" />
+			<entry class="" argb="255,204,0,141" value="144" />
+			<entry class="" argb="255,203,0,143" value="145" />
+			<entry class="" argb="255,202,0,145" value="146" />
+			<entry class="" argb="255,201,0,147" value="147" />
+			<entry class="" argb="255,200,0,150" value="148" />
+			<entry class="" argb="255,199,0,152" value="149" />
+			<entry class="" argb="255,198,0,154" value="150" />
+			<entry class="" argb="255,197,0,156" value="151" />
+			<entry class="" argb="255,196,0,159" value="152" />
+			<entry class="" argb="255,196,0,160" value="153" />
+			<entry class="" argb="255,196,0,162" value="154" />
+			<entry class="" argb="255,196,0,163" value="155" />
+			<entry class="" argb="255,196,0,165" value="156" />
+			<entry class="" argb="255,195,0,167" value="157" />
+			<entry class="" argb="255,194,0,169" value="158" />
+			<entry class="" argb="255,193,0,171" value="159" />
+			<entry class="" argb="255,192,0,174" value="160" />
+			<entry class="" argb="255,191,0,176" value="161" />
+			<entry class="" argb="255,190,0,178" value="162" />
+			<entry class="" argb="255,189,0,180" value="163" />
+			<entry class="" argb="255,188,0,183" value="164" />
+			<entry class="" argb="255,187,0,185" value="165" />
+			<entry class="" argb="255,186,0,187" value="166" />
+			<entry class="" argb="255,185,0,189" value="167" />
+			<entry class="" argb="255,184,0,192" value="168" />
+			<entry class="" argb="255,184,0,193" value="169" />
+			<entry class="" argb="255,184,0,195" value="170" />
+			<entry class="" argb="255,184,0,197" value="171" />
+			<entry class="" argb="255,184,0,199" value="172" />
+			<entry class="" argb="255,183,0,201" value="173" />
+			<entry class="" argb="255,182,0,203" value="174" />
+			<entry class="" argb="255,181,0,205" value="175" />
+			<entry class="" argb="255,180,0,208" value="176" />
+			<entry class="" argb="255,179,0,210" value="177" />
+			<entry class="" argb="255,178,0,212" value="178" />
+			<entry class="" argb="255,177,0,214" value="179" />
+			<entry class="" argb="255,176,0,216" value="180" />
+			<entry class="" argb="255,176,0,217" value="181" />
+			<entry class="" argb="255,176,0,219" value="182" />
+			<entry class="" argb="255,176,0,221" value="183" />
+			<entry class="" argb="255,176,0,223" value="184" />
+			<entry class="" argb="255,175,0,225" value="185" />
+			<entry class="" argb="255,174,0,227" value="186" />
+			<entry class="" argb="255,173,0,229" value="187" />
+			<entry class="" argb="255,172,0,232" value="188" />
+			<entry class="" argb="255,171,0,234" value="189" />
+			<entry class="" argb="255,170,0,236" value="190" />
+			<entry class="" argb="255,169,0,238" value="191" />
+			<entry class="" argb="255,168,0,241" value="192" />
+			<entry class="" argb="255,167,0,243" value="193" />
+			<entry class="" argb="255,166,0,245" value="194" />
+			<entry class="" argb="255,165,0,247" value="195" />
+			<entry class="" argb="255,164,0,250" value="196" />
+			<entry class="" argb="255,164,0,251" value="197" />
+			<entry class="" argb="255,164,0,252" value="198" />
+			<entry class="" argb="255,164,0,253" value="199" />
+			<entry class="" argb="255,164,0,255" value="200" />
+			<entry class="" argb="255,163,0,255" value="201" />
+			<entry class="" argb="255,162,0,255" value="202" />
+			<entry class="" argb="255,161,0,255" value="203" />
+			<entry class="" argb="255,160,0,255" value="204" />
+			<entry class="" argb="255,159,0,255" value="205" />
+			<entry class="" argb="255,158,0,255" value="206" />
+			<entry class="" argb="255,157,0,255" value="207" />
+			<entry class="" argb="255,156,0,255" value="208" />
+			<entry class="" argb="255,155,0,255" value="209" />
+			<entry class="" argb="255,154,0,255" value="210" />
+			<entry class="" argb="255,153,0,255" value="211" />
+			<entry class="" argb="255,152,0,255" value="212" />
+			<entry class="" argb="255,152,0,255" value="213" />
+			<entry class="" argb="255,152,0,255" value="214" />
+			<entry class="" argb="255,152,0,255" value="215" />
+			<entry class="" argb="255,152,0,255" value="216" />
+			<entry class="" argb="255,151,0,255" value="217" />
+			<entry class="" argb="255,150,0,255" value="218" />
+			<entry class="" argb="255,149,0,255" value="219" />
+			<entry class="" argb="255,148,0,255" value="220" />
+			<entry class="" argb="255,151,8,255" value="221" />
+			<entry class="" argb="255,154,16,255" value="222" />
+			<entry class="" argb="255,157,24,255" value="223" />
+			<entry class="" argb="255,160,32,255" value="224" />
+			<entry class="" argb="255,163,40,255" value="225" />
+			<entry class="" argb="255,166,48,255" value="226" />
+			<entry class="" argb="255,169,56,255" value="227" />
+			<entry class="" argb="255,172,64,255" value="228" />
+			<entry class="" argb="255,176,72,255" value="229" />
+			<entry class="" argb="255,180,80,255" value="230" />
+			<entry class="" argb="255,184,88,255" value="231" />
+			<entry class="" argb="255,188,96,255" value="232" />
+			<entry class="" argb="255,191,104,255" value="233" />
+			<entry class="" argb="255,194,112,255" value="234" />
+			<entry class="" argb="255,197,120,255" value="235" />
+			<entry class="" argb="255,200,128,255" value="236" />
+			<entry class="" argb="255,203,135,255" value="237" />
+			<entry class="" argb="255,206,142,255" value="238" />
+			<entry class="" argb="255,209,149,255" value="239" />
+			<entry class="" argb="255,212,156,255" value="240" />
+			<entry class="" argb="255,215,164,255" value="241" />
+			<entry class="" argb="255,218,172,255" value="242" />
+			<entry class="" argb="255,221,180,255" value="243" />
+			<entry class="" argb="255,224,188,255" value="244" />
+			<entry class="" argb="255,228,196,255" value="245" />
+			<entry class="" argb="255,232,204,255" value="246" />
+			<entry class="" argb="255,236,212,255" value="247" />
+			<entry class="" argb="255,240,220,255" value="248" />
+			<entry class="" argb="255,243,228,255" value="249" />
+			<entry class="" argb="255,246,236,255" value="250" />
+			<entry class="" argb="255,249,244,255" value="251" />
+			<entry class="" argb="255,252,252,255" value="252" />
+			<entry class="" argb="255,253,253,255" value="253" />
+			<entry class="" argb="255,254,254,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="green-white-exponential" interpolate="false">
+		<table>
+			<entry class="" argb="255,1,0,0" value="0" />
+			<entry class="" argb="255,1,0,0" value="1" />
+			<entry class="" argb="255,1,1,0" value="2" />
+			<entry class="" argb="255,2,2,0" value="3" />
+			<entry class="" argb="255,2,2,1" value="4" />
+			<entry class="" argb="255,2,3,1" value="5" />
+			<entry class="" argb="255,3,4,1" value="6" />
+			<entry class="" argb="255,3,4,1" value="7" />
+			<entry class="" argb="255,4,5,2" value="8" />
+			<entry class="" argb="255,4,6,2" value="9" />
+			<entry class="" argb="255,4,6,2" value="10" />
+			<entry class="" argb="255,5,7,2" value="11" />
+			<entry class="" argb="255,5,8,3" value="12" />
+			<entry class="" argb="255,5,8,3" value="13" />
+			<entry class="" argb="255,6,9,3" value="14" />
+			<entry class="" argb="255,6,10,3" value="15" />
+			<entry class="" argb="255,7,10,4" value="16" />
+			<entry class="" argb="255,7,11,4" value="17" />
+			<entry class="" argb="255,7,12,4" value="18" />
+			<entry class="" argb="255,8,12,5" value="19" />
+			<entry class="" argb="255,8,13,5" value="20" />
+			<entry class="" argb="255,9,14,5" value="21" />
+			<entry class="" argb="255,9,14,5" value="22" />
+			<entry class="" argb="255,9,15,6" value="23" />
+			<entry class="" argb="255,10,16,6" value="24" />
+			<entry class="" argb="255,10,16,6" value="25" />
+			<entry class="" argb="255,10,17,6" value="26" />
+			<entry class="" argb="255,11,18,7" value="27" />
+			<entry class="" argb="255,11,18,7" value="28" />
+			<entry class="" argb="255,12,19,7" value="29" />
+			<entry class="" argb="255,12,20,7" value="30" />
+			<entry class="" argb="255,12,20,8" value="31" />
+			<entry class="" argb="255,13,21,8" value="32" />
+			<entry class="" argb="255,13,22,8" value="33" />
+			<entry class="" argb="255,13,22,8" value="34" />
+			<entry class="" argb="255,14,23,9" value="35" />
+			<entry class="" argb="255,14,24,9" value="36" />
+			<entry class="" argb="255,15,24,9" value="37" />
+			<entry class="" argb="255,15,25,10" value="38" />
+			<entry class="" argb="255,15,26,10" value="39" />
+			<entry class="" argb="255,16,26,10" value="40" />
+			<entry class="" argb="255,16,27,10" value="41" />
+			<entry class="" argb="255,17,28,11" value="42" />
+			<entry class="" argb="255,17,28,11" value="43" />
+			<entry class="" argb="255,17,29,11" value="44" />
+			<entry class="" argb="255,18,30,11" value="45" />
+			<entry class="" argb="255,18,30,12" value="46" />
+			<entry class="" argb="255,18,31,12" value="47" />
+			<entry class="" argb="255,19,32,12" value="48" />
+			<entry class="" argb="255,19,32,12" value="49" />
+			<entry class="" argb="255,20,33,13" value="50" />
+			<entry class="" argb="255,20,34,13" value="51" />
+			<entry class="" argb="255,20,34,13" value="52" />
+			<entry class="" argb="255,21,35,13" value="53" />
+			<entry class="" argb="255,21,36,14" value="54" />
+			<entry class="" argb="255,21,36,14" value="55" />
+			<entry class="" argb="255,22,37,14" value="56" />
+			<entry class="" argb="255,22,38,15" value="57" />
+			<entry class="" argb="255,23,38,15" value="58" />
+			<entry class="" argb="255,23,39,15" value="59" />
+			<entry class="" argb="255,23,40,15" value="60" />
+			<entry class="" argb="255,24,40,16" value="61" />
+			<entry class="" argb="255,24,41,16" value="62" />
+			<entry class="" argb="255,25,42,16" value="63" />
+			<entry class="" argb="255,25,42,16" value="64" />
+			<entry class="" argb="255,25,43,17" value="65" />
+			<entry class="" argb="255,26,44,17" value="66" />
+			<entry class="" argb="255,26,44,17" value="67" />
+			<entry class="" argb="255,26,45,17" value="68" />
+			<entry class="" argb="255,27,46,18" value="69" />
+			<entry class="" argb="255,27,46,18" value="70" />
+			<entry class="" argb="255,28,47,18" value="71" />
+			<entry class="" argb="255,28,48,18" value="72" />
+			<entry class="" argb="255,28,48,19" value="73" />
+			<entry class="" argb="255,29,49,19" value="74" />
+			<entry class="" argb="255,29,50,19" value="75" />
+			<entry class="" argb="255,29,50,20" value="76" />
+			<entry class="" argb="255,30,51,20" value="77" />
+			<entry class="" argb="255,30,52,20" value="78" />
+			<entry class="" argb="255,31,52,20" value="79" />
+			<entry class="" argb="255,31,53,21" value="80" />
+			<entry class="" argb="255,31,54,21" value="81" />
+			<entry class="" argb="255,32,54,21" value="82" />
+			<entry class="" argb="255,32,55,21" value="83" />
+			<entry class="" argb="255,33,56,22" value="84" />
+			<entry class="" argb="255,33,56,22" value="85" />
+			<entry class="" argb="255,33,57,22" value="86" />
+			<entry class="" argb="255,34,58,22" value="87" />
+			<entry class="" argb="255,34,58,23" value="88" />
+			<entry class="" argb="255,34,59,23" value="89" />
+			<entry class="" argb="255,35,60,23" value="90" />
+			<entry class="" argb="255,35,60,23" value="91" />
+			<entry class="" argb="255,36,61,24" value="92" />
+			<entry class="" argb="255,36,62,24" value="93" />
+			<entry class="" argb="255,36,62,24" value="94" />
+			<entry class="" argb="255,37,63,25" value="95" />
+			<entry class="" argb="255,37,64,25" value="96" />
+			<entry class="" argb="255,37,64,25" value="97" />
+			<entry class="" argb="255,38,65,25" value="98" />
+			<entry class="" argb="255,38,66,26" value="99" />
+			<entry class="" argb="255,39,66,26" value="100" />
+			<entry class="" argb="255,39,67,26" value="101" />
+			<entry class="" argb="255,39,68,26" value="102" />
+			<entry class="" argb="255,40,68,27" value="103" />
+			<entry class="" argb="255,40,69,27" value="104" />
+			<entry class="" argb="255,41,70,27" value="105" />
+			<entry class="" argb="255,41,70,27" value="106" />
+			<entry class="" argb="255,41,71,28" value="107" />
+			<entry class="" argb="255,42,72,28" value="108" />
+			<entry class="" argb="255,42,72,28" value="109" />
+			<entry class="" argb="255,42,73,28" value="110" />
+			<entry class="" argb="255,43,74,29" value="111" />
+			<entry class="" argb="255,43,74,29" value="112" />
+			<entry class="" argb="255,44,75,29" value="113" />
+			<entry class="" argb="255,44,76,30" value="114" />
+			<entry class="" argb="255,44,76,30" value="115" />
+			<entry class="" argb="255,45,77,30" value="116" />
+			<entry class="" argb="255,45,78,30" value="117" />
+			<entry class="" argb="255,45,78,31" value="118" />
+			<entry class="" argb="255,46,79,31" value="119" />
+			<entry class="" argb="255,46,80,31" value="120" />
+			<entry class="" argb="255,47,80,31" value="121" />
+			<entry class="" argb="255,47,81,32" value="122" />
+			<entry class="" argb="255,47,82,32" value="123" />
+			<entry class="" argb="255,48,82,32" value="124" />
+			<entry class="" argb="255,48,83,32" value="125" />
+			<entry class="" argb="255,49,84,33" value="126" />
+			<entry class="" argb="255,49,84,33" value="127" />
+			<entry class="" argb="255,49,85,33" value="128" />
+			<entry class="" argb="255,50,86,33" value="129" />
+			<entry class="" argb="255,50,87,34" value="130" />
+			<entry class="" argb="255,50,88,34" value="131" />
+			<entry class="" argb="255,51,90,34" value="132" />
+			<entry class="" argb="255,51,91,35" value="133" />
+			<entry class="" argb="255,52,92,35" value="134" />
+			<entry class="" argb="255,52,94,35" value="135" />
+			<entry class="" argb="255,52,95,35" value="136" />
+			<entry class="" argb="255,54,96,36" value="137" />
+			<entry class="" argb="255,54,98,36" value="138" />
+			<entry class="" argb="255,55,99,36" value="139" />
+			<entry class="" argb="255,56,100,36" value="140" />
+			<entry class="" argb="255,56,102,37" value="141" />
+			<entry class="" argb="255,57,103,37" value="142" />
+			<entry class="" argb="255,58,104,37" value="143" />
+			<entry class="" argb="255,58,106,37" value="144" />
+			<entry class="" argb="255,59,107,38" value="145" />
+			<entry class="" argb="255,60,108,38" value="146" />
+			<entry class="" argb="255,60,110,38" value="147" />
+			<entry class="" argb="255,61,111,38" value="148" />
+			<entry class="" argb="255,62,112,39" value="149" />
+			<entry class="" argb="255,62,114,39" value="150" />
+			<entry class="" argb="255,63,115,39" value="151" />
+			<entry class="" argb="255,64,116,40" value="152" />
+			<entry class="" argb="255,64,118,40" value="153" />
+			<entry class="" argb="255,66,119,40" value="154" />
+			<entry class="" argb="255,68,120,40" value="155" />
+			<entry class="" argb="255,70,122,41" value="156" />
+			<entry class="" argb="255,71,123,41" value="157" />
+			<entry class="" argb="255,73,124,41" value="158" />
+			<entry class="" argb="255,75,126,41" value="159" />
+			<entry class="" argb="255,77,127,42" value="160" />
+			<entry class="" argb="255,79,128,42" value="161" />
+			<entry class="" argb="255,81,130,42" value="162" />
+			<entry class="" argb="255,83,131,42" value="163" />
+			<entry class="" argb="255,85,132,43" value="164" />
+			<entry class="" argb="255,86,134,43" value="165" />
+			<entry class="" argb="255,88,135,43" value="166" />
+			<entry class="" argb="255,90,136,43" value="167" />
+			<entry class="" argb="255,92,138,44" value="168" />
+			<entry class="" argb="255,94,139,44" value="169" />
+			<entry class="" argb="255,96,140,44" value="170" />
+			<entry class="" argb="255,98,142,45" value="171" />
+			<entry class="" argb="255,99,143,45" value="172" />
+			<entry class="" argb="255,101,145,45" value="173" />
+			<entry class="" argb="255,103,146,45" value="174" />
+			<entry class="" argb="255,105,147,46" value="175" />
+			<entry class="" argb="255,107,149,46" value="176" />
+			<entry class="" argb="255,109,150,46" value="177" />
+			<entry class="" argb="255,111,151,46" value="178" />
+			<entry class="" argb="255,113,153,47" value="179" />
+			<entry class="" argb="255,114,154,47" value="180" />
+			<entry class="" argb="255,116,155,47" value="181" />
+			<entry class="" argb="255,118,157,47" value="182" />
+			<entry class="" argb="255,120,158,48" value="183" />
+			<entry class="" argb="255,122,159,47" value="184" />
+			<entry class="" argb="255,124,161,49" value="185" />
+			<entry class="" argb="255,126,162,52" value="186" />
+			<entry class="" argb="255,127,163,55" value="187" />
+			<entry class="" argb="255,129,165,58" value="188" />
+			<entry class="" argb="255,131,166,61" value="189" />
+			<entry class="" argb="255,133,167,64" value="190" />
+			<entry class="" argb="255,135,169,67" value="191" />
+			<entry class="" argb="255,137,170,70" value="192" />
+			<entry class="" argb="255,139,171,73" value="193" />
+			<entry class="" argb="255,141,173,76" value="194" />
+			<entry class="" argb="255,142,174,79" value="195" />
+			<entry class="" argb="255,144,175,82" value="196" />
+			<entry class="" argb="255,146,177,85" value="197" />
+			<entry class="" argb="255,148,178,88" value="198" />
+			<entry class="" argb="255,150,179,90" value="199" />
+			<entry class="" argb="255,152,181,93" value="200" />
+			<entry class="" argb="255,154,182,96" value="201" />
+			<entry class="" argb="255,156,183,99" value="202" />
+			<entry class="" argb="255,157,185,102" value="203" />
+			<entry class="" argb="255,159,186,105" value="204" />
+			<entry class="" argb="255,161,187,108" value="205" />
+			<entry class="" argb="255,163,189,111" value="206" />
+			<entry class="" argb="255,165,190,114" value="207" />
+			<entry class="" argb="255,167,191,117" value="208" />
+			<entry class="" argb="255,169,193,120" value="209" />
+			<entry class="" argb="255,170,194,123" value="210" />
+			<entry class="" argb="255,172,195,126" value="211" />
+			<entry class="" argb="255,174,197,129" value="212" />
+			<entry class="" argb="255,176,198,131" value="213" />
+			<entry class="" argb="255,178,200,134" value="214" />
+			<entry class="" argb="255,180,201,137" value="215" />
+			<entry class="" argb="255,182,202,140" value="216" />
+			<entry class="" argb="255,184,204,143" value="217" />
+			<entry class="" argb="255,185,205,146" value="218" />
+			<entry class="" argb="255,187,206,149" value="219" />
+			<entry class="" argb="255,189,208,152" value="220" />
+			<entry class="" argb="255,191,209,155" value="221" />
+			<entry class="" argb="255,193,210,158" value="222" />
+			<entry class="" argb="255,195,212,161" value="223" />
+			<entry class="" argb="255,197,213,164" value="224" />
+			<entry class="" argb="255,198,214,167" value="225" />
+			<entry class="" argb="255,200,216,170" value="226" />
+			<entry class="" argb="255,202,217,172" value="227" />
+			<entry class="" argb="255,204,218,175" value="228" />
+			<entry class="" argb="255,206,220,178" value="229" />
+			<entry class="" argb="255,208,221,181" value="230" />
+			<entry class="" argb="255,210,222,184" value="231" />
+			<entry class="" argb="255,212,224,187" value="232" />
+			<entry class="" argb="255,213,225,190" value="233" />
+			<entry class="" argb="255,215,226,193" value="234" />
+			<entry class="" argb="255,217,228,196" value="235" />
+			<entry class="" argb="255,219,229,199" value="236" />
+			<entry class="" argb="255,221,230,202" value="237" />
+			<entry class="" argb="255,223,232,205" value="238" />
+			<entry class="" argb="255,225,233,208" value="239" />
+			<entry class="" argb="255,226,234,211" value="240" />
+			<entry class="" argb="255,228,236,213" value="241" />
+			<entry class="" argb="255,230,237,216" value="242" />
+			<entry class="" argb="255,232,238,219" value="243" />
+			<entry class="" argb="255,234,240,222" value="244" />
+			<entry class="" argb="255,236,241,225" value="245" />
+			<entry class="" argb="255,238,242,228" value="246" />
+			<entry class="" argb="255,240,244,231" value="247" />
+			<entry class="" argb="255,241,245,234" value="248" />
+			<entry class="" argb="255,243,246,237" value="249" />
+			<entry class="" argb="255,245,248,240" value="250" />
+			<entry class="" argb="255,247,249,243" value="251" />
+			<entry class="" argb="255,249,250,246" value="252" />
+			<entry class="" argb="255,251,252,249" value="253" />
+			<entry class="" argb="255,253,253,252" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="hardcandy" interpolate="false">
+		<table>
+			<entry class="" argb="255,4,51,116" value="0" />
+			<entry class="" argb="255,4,51,116" value="1" />
+			<entry class="" argb="255,5,58,105" value="2" />
+			<entry class="" argb="255,7,65,94" value="3" />
+			<entry class="" argb="255,9,72,84" value="4" />
+			<entry class="" argb="255,11,79,74" value="5" />
+			<entry class="" argb="255,12,85,64" value="6" />
+			<entry class="" argb="255,14,92,55" value="7" />
+			<entry class="" argb="255,15,99,46" value="8" />
+			<entry class="" argb="255,16,105,38" value="9" />
+			<entry class="" argb="255,17,111,30" value="10" />
+			<entry class="" argb="255,17,117,24" value="11" />
+			<entry class="" argb="255,18,124,18" value="12" />
+			<entry class="" argb="255,18,129,12" value="13" />
+			<entry class="" argb="255,18,135,8" value="14" />
+			<entry class="" argb="255,17,141,5" value="15" />
+			<entry class="" argb="255,16,146,2" value="16" />
+			<entry class="" argb="255,15,152,0" value="17" />
+			<entry class="" argb="255,14,157,0" value="18" />
+			<entry class="" argb="255,13,162,0" value="19" />
+			<entry class="" argb="255,11,167,1" value="20" />
+			<entry class="" argb="255,13,171,3" value="21" />
+			<entry class="" argb="255,8,176,6" value="22" />
+			<entry class="" argb="255,5,180,13" value="23" />
+			<entry class="" argb="255,3,184,14" value="24" />
+			<entry class="" argb="255,1,188,20" value="25" />
+			<entry class="" argb="255,0,191,26" value="26" />
+			<entry class="" argb="255,3,195,33" value="27" />
+			<entry class="" argb="255,5,198,41" value="28" />
+			<entry class="" argb="255,7,201,50" value="29" />
+			<entry class="" argb="255,13,203,59" value="30" />
+			<entry class="" argb="255,12,206,68" value="31" />
+			<entry class="" argb="255,13,208,78" value="32" />
+			<entry class="" argb="255,15,210,88" value="33" />
+			<entry class="" argb="255,17,212,99" value="34" />
+			<entry class="" argb="255,18,213,109" value="35" />
+			<entry class="" argb="255,19,214,120" value="36" />
+			<entry class="" argb="255,19,215,131" value="37" />
+			<entry class="" argb="255,19,216,142" value="38" />
+			<entry class="" argb="255,19,216,153" value="39" />
+			<entry class="" argb="255,19,216,163" value="40" />
+			<entry class="" argb="255,18,216,174" value="41" />
+			<entry class="" argb="255,16,216,184" value="42" />
+			<entry class="" argb="255,14,215,193" value="43" />
+			<entry class="" argb="255,12,215,202" value="44" />
+			<entry class="" argb="255,9,213,211" value="45" />
+			<entry class="" argb="255,5,212,218" value="46" />
+			<entry class="" argb="255,2,210,226" value="47" />
+			<entry class="" argb="255,2,209,232" value="48" />
+			<entry class="" argb="255,6,206,238" value="49" />
+			<entry class="" argb="255,11,204,243" value="50" />
+			<entry class="" argb="255,17,201,247" value="51" />
+			<entry class="" argb="255,23,199,250" value="52" />
+			<entry class="" argb="255,29,195,252" value="53" />
+			<entry class="" argb="255,36,192,253" value="54" />
+			<entry class="" argb="255,42,189,253" value="55" />
+			<entry class="" argb="255,49,185,253" value="56" />
+			<entry class="" argb="255,56,181,251" value="57" />
+			<entry class="" argb="255,64,177,249" value="58" />
+			<entry class="" argb="255,71,172,246" value="59" />
+			<entry class="" argb="255,78,168,241" value="60" />
+			<entry class="" argb="255,85,163,236" value="61" />
+			<entry class="" argb="255,93,158,230" value="62" />
+			<entry class="" argb="255,100,153,224" value="63" />
+			<entry class="" argb="255,106,148,216" value="64" />
+			<entry class="" argb="255,113,142,208" value="65" />
+			<entry class="" argb="255,119,137,200" value="66" />
+			<entry class="" argb="255,125,131,190" value="67" />
+			<entry class="" argb="255,130,125,181" value="68" />
+			<entry class="" argb="255,135,119,171" value="69" />
+			<entry class="" argb="255,139,113,160" value="70" />
+			<entry class="" argb="255,143,106,150" value="71" />
+			<entry class="" argb="255,146,100,139" value="72" />
+			<entry class="" argb="255,149,93,128" value="73" />
+			<entry class="" argb="255,150,87,117" value="74" />
+			<entry class="" argb="255,151,80,106" value="75" />
+			<entry class="" argb="255,152,73,96" value="76" />
+			<entry class="" argb="255,151,67,85" value="77" />
+			<entry class="" argb="255,150,60,75" value="78" />
+			<entry class="" argb="255,148,53,65" value="79" />
+			<entry class="" argb="255,145,46,56" value="80" />
+			<entry class="" argb="255,142,39,47" value="81" />
+			<entry class="" argb="255,138,32,39" value="82" />
+			<entry class="" argb="255,133,25,31" value="83" />
+			<entry class="" argb="255,127,18,24" value="84" />
+			<entry class="" argb="255,121,11,18" value="85" />
+			<entry class="" argb="255,114,4,13" value="86" />
+			<entry class="" argb="255,107,2,9" value="87" />
+			<entry class="" argb="255,99,9,5" value="88" />
+			<entry class="" argb="255,90,16,2" value="89" />
+			<entry class="" argb="255,82,22,0" value="90" />
+			<entry class="" argb="255,73,29,0" value="91" />
+			<entry class="" argb="255,63,36,0" value="92" />
+			<entry class="" argb="255,54,42,1" value="93" />
+			<entry class="" argb="255,44,49,3" value="94" />
+			<entry class="" argb="255,35,55,5" value="95" />
+			<entry class="" argb="255,25,61,9" value="96" />
+			<entry class="" argb="255,16,68,14" value="97" />
+			<entry class="" argb="255,6,74,19" value="98" />
+			<entry class="" argb="255,1,79,25" value="99" />
+			<entry class="" argb="255,13,85,32" value="100" />
+			<entry class="" argb="255,18,91,40" value="101" />
+			<entry class="" argb="255,25,96,48" value="102" />
+			<entry class="" argb="255,32,101,57" value="103" />
+			<entry class="" argb="255,38,106,67" value="104" />
+			<entry class="" argb="255,44,111,76" value="105" />
+			<entry class="" argb="255,48,116,87" value="106" />
+			<entry class="" argb="255,52,120,97" value="107" />
+			<entry class="" argb="255,55,125,108" value="108" />
+			<entry class="" argb="255,56,129,119" value="109" />
+			<entry class="" argb="255,57,133,130" value="110" />
+			<entry class="" argb="255,57,136,140" value="111" />
+			<entry class="" argb="255,56,140,151" value="112" />
+			<entry class="" argb="255,53,143,162" value="113" />
+			<entry class="" argb="255,50,146,172" value="114" />
+			<entry class="" argb="255,45,149,182" value="115" />
+			<entry class="" argb="255,39,151,192" value="116" />
+			<entry class="" argb="255,33,153,201" value="117" />
+			<entry class="" argb="255,25,155,209" value="118" />
+			<entry class="" argb="255,16,157,217" value="119" />
+			<entry class="" argb="255,6,159,225" value="120" />
+			<entry class="" argb="255,3,160,231" value="121" />
+			<entry class="" argb="255,15,161,237" value="122" />
+			<entry class="" argb="255,27,162,242" value="123" />
+			<entry class="" argb="255,40,162,246" value="124" />
+			<entry class="" argb="255,53,162,249" value="125" />
+			<entry class="" argb="255,67,162,252" value="126" />
+			<entry class="" argb="255,81,162,253" value="127" />
+			<entry class="" argb="255,96,162,254" value="128" />
+			<entry class="" argb="255,111,161,253" value="129" />
+			<entry class="" argb="255,126,160,252" value="130" />
+			<entry class="" argb="255,141,159,249" value="131" />
+			<entry class="" argb="255,156,157,246" value="132" />
+			<entry class="" argb="255,170,155,242" value="133" />
+			<entry class="" argb="255,185,153,237" value="134" />
+			<entry class="" argb="255,199,151,231" value="135" />
+			<entry class="" argb="255,212,148,225" value="136" />
+			<entry class="" argb="255,225,146,217" value="137" />
+			<entry class="" argb="255,237,143,209" value="138" />
+			<entry class="" argb="255,248,139,201" value="139" />
+			<entry class="" argb="255,252,136,192" value="140" />
+			<entry class="" argb="255,242,132,182" value="141" />
+			<entry class="" argb="255,234,128,172" value="142" />
+			<entry class="" argb="255,227,124,162" value="143" />
+			<entry class="" argb="255,222,120,151" value="144" />
+			<entry class="" argb="255,217,115,140" value="145" />
+			<entry class="" argb="255,214,111,130" value="146" />
+			<entry class="" argb="255,212,106,119" value="147" />
+			<entry class="" argb="255,212,101,108" value="148" />
+			<entry class="" argb="255,213,95,97" value="149" />
+			<entry class="" argb="255,216,90,87" value="150" />
+			<entry class="" argb="255,220,84,76" value="151" />
+			<entry class="" argb="255,225,79,67" value="152" />
+			<entry class="" argb="255,232,73,57" value="153" />
+			<entry class="" argb="255,240,67,48" value="154" />
+			<entry class="" argb="255,249,61,40" value="155" />
+			<entry class="" argb="255,251,54,32" value="156" />
+			<entry class="" argb="255,239,48,25" value="157" />
+			<entry class="" argb="255,226,42,19" value="158" />
+			<entry class="" argb="255,213,35,14" value="159" />
+			<entry class="" argb="255,198,28,9" value="160" />
+			<entry class="" argb="255,183,22,5" value="161" />
+			<entry class="" argb="255,167,15,3" value="162" />
+			<entry class="" argb="255,150,8,1" value="163" />
+			<entry class="" argb="255,133,1,0" value="164" />
+			<entry class="" argb="255,116,5,0" value="165" />
+			<entry class="" argb="255,98,12,0" value="166" />
+			<entry class="" argb="255,81,19,2" value="167" />
+			<entry class="" argb="255,64,26,5" value="168" />
+			<entry class="" argb="255,47,33,9" value="169" />
+			<entry class="" argb="255,30,40,13" value="170" />
+			<entry class="" argb="255,14,47,18" value="171" />
+			<entry class="" argb="255,1,54,24" value="172" />
+			<entry class="" argb="255,15,61,31" value="173" />
+			<entry class="" argb="255,29,67,39" value="174" />
+			<entry class="" argb="255,42,74,47" value="175" />
+			<entry class="" argb="255,54,81,56" value="176" />
+			<entry class="" argb="255,64,88,65" value="177" />
+			<entry class="" argb="255,73,94,75" value="178" />
+			<entry class="" argb="255,81,101,85" value="179" />
+			<entry class="" argb="255,87,107,96" value="180" />
+			<entry class="" argb="255,91,113,106" value="181" />
+			<entry class="" argb="255,94,120,117" value="182" />
+			<entry class="" argb="255,95,126,128" value="183" />
+			<entry class="" argb="255,95,131,139" value="184" />
+			<entry class="" argb="255,92,137,150" value="185" />
+			<entry class="" argb="255,88,143,160" value="186" />
+			<entry class="" argb="255,82,148,171" value="187" />
+			<entry class="" argb="255,75,154,181" value="188" />
+			<entry class="" argb="255,66,159,190" value="189" />
+			<entry class="" argb="255,55,164,200" value="190" />
+			<entry class="" argb="255,42,168,208" value="191" />
+			<entry class="" argb="255,28,173,216" value="192" />
+			<entry class="" argb="255,13,177,224" value="193" />
+			<entry class="" argb="255,3,181,230" value="194" />
+			<entry class="" argb="255,21,185,236" value="195" />
+			<entry class="" argb="255,40,189,241" value="196" />
+			<entry class="" argb="255,60,193,246" value="197" />
+			<entry class="" argb="255,81,196,249" value="198" />
+			<entry class="" argb="255,103,199,251" value="199" />
+			<entry class="" argb="255,125,202,253" value="200" />
+			<entry class="" argb="255,147,204,253" value="201" />
+			<entry class="" argb="255,170,207,253" value="202" />
+			<entry class="" argb="255,193,209,252" value="203" />
+			<entry class="" argb="255,216,211,250" value="204" />
+			<entry class="" argb="255,239,212,247" value="205" />
+			<entry class="" argb="255,249,214,243" value="206" />
+			<entry class="" argb="255,228,215,238" value="207" />
+			<entry class="" argb="255,207,216,232" value="208" />
+			<entry class="" argb="255,187,216,226" value="209" />
+			<entry class="" argb="255,168,216,218" value="210" />
+			<entry class="" argb="255,151,216,211" value="211" />
+			<entry class="" argb="255,134,216,202" value="212" />
+			<entry class="" argb="255,119,216,193" value="213" />
+			<entry class="" argb="255,106,215,184" value="214" />
+			<entry class="" argb="255,95,214,174" value="215" />
+			<entry class="" argb="255,85,213,163" value="216" />
+			<entry class="" argb="255,77,212,153" value="217" />
+			<entry class="" argb="255,71,210,142" value="218" />
+			<entry class="" argb="255,67,208,131" value="219" />
+			<entry class="" argb="255,65,206,120" value="220" />
+			<entry class="" argb="255,66,203,109" value="221" />
+			<entry class="" argb="255,68,201,99" value="222" />
+			<entry class="" argb="255,72,198,88" value="223" />
+			<entry class="" argb="255,79,194,78" value="224" />
+			<entry class="" argb="255,87,191,68" value="225" />
+			<entry class="" argb="255,98,187,59" value="226" />
+			<entry class="" argb="255,110,184,50" value="227" />
+			<entry class="" argb="255,124,180,41" value="228" />
+			<entry class="" argb="255,140,175,33" value="229" />
+			<entry class="" argb="255,158,171,26" value="230" />
+			<entry class="" argb="255,177,166,20" value="231" />
+			<entry class="" argb="255,197,161,14" value="232" />
+			<entry class="" argb="255,219,156,13" value="233" />
+			<entry class="" argb="255,241,151,6" value="234" />
+			<entry class="" argb="255,245,146,3" value="235" />
+			<entry class="" argb="255,221,140,1" value="236" />
+			<entry class="" argb="255,196,135,0" value="237" />
+			<entry class="" argb="255,171,129,0" value="238" />
+			<entry class="" argb="255,145,123,0" value="239" />
+			<entry class="" argb="255,120,117,2" value="240" />
+			<entry class="" argb="255,95,111,5" value="241" />
+			<entry class="" argb="255,70,104,8" value="242" />
+			<entry class="" argb="255,46,98,12" value="243" />
+			<entry class="" argb="255,23,91,18" value="244" />
+			<entry class="" argb="255,1,85,24" value="245" />
+			<entry class="" argb="255,19,78,30" value="246" />
+			<entry class="" argb="255,39,71,38" value="247" />
+			<entry class="" argb="255,57,64,46" value="248" />
+			<entry class="" argb="255,74,57,55" value="249" />
+			<entry class="" argb="255,89,50,64" value="250" />
+			<entry class="" argb="255,102,44,74" value="251" />
+			<entry class="" argb="255,112,37,84" value="252" />
+			<entry class="" argb="255,121,30,94" value="253" />
+			<entry class="" argb="255,127,23,105" value="254" />
+			<entry class="" argb="255,127,23,105" value="255" />
+		</table>
+	</palette>
+
+	<palette name="haze" interpolate="false">
+		<table>
+			<entry class="" argb="255,167,112,255" value="0" />
+			<entry class="" argb="255,167,112,255" value="1" />
+			<entry class="" argb="255,255,213,254" value="2" />
+			<entry class="" argb="255,254,212,251" value="3" />
+			<entry class="" argb="255,249,210,250" value="4" />
+			<entry class="" argb="255,247,209,249" value="5" />
+			<entry class="" argb="255,245,208,248" value="6" />
+			<entry class="" argb="255,243,206,247" value="7" />
+			<entry class="" argb="255,242,205,246" value="8" />
+			<entry class="" argb="255,240,203,245" value="9" />
+			<entry class="" argb="255,238,202,244" value="10" />
+			<entry class="" argb="255,236,200,243" value="11" />
+			<entry class="" argb="255,234,199,242" value="12" />
+			<entry class="" argb="255,232,198,241" value="13" />
+			<entry class="" argb="255,230,196,240" value="14" />
+			<entry class="" argb="255,228,195,239" value="15" />
+			<entry class="" argb="255,226,193,238" value="16" />
+			<entry class="" argb="255,224,192,237" value="17" />
+			<entry class="" argb="255,222,191,236" value="18" />
+			<entry class="" argb="255,220,189,235" value="19" />
+			<entry class="" argb="255,218,188,234" value="20" />
+			<entry class="" argb="255,216,186,233" value="21" />
+			<entry class="" argb="255,214,185,232" value="22" />
+			<entry class="" argb="255,212,183,231" value="23" />
+			<entry class="" argb="255,210,182,230" value="24" />
+			<entry class="" argb="255,208,181,229" value="25" />
+			<entry class="" argb="255,206,179,228" value="26" />
+			<entry class="" argb="255,204,178,227" value="27" />
+			<entry class="" argb="255,202,176,226" value="28" />
+			<entry class="" argb="255,200,175,225" value="29" />
+			<entry class="" argb="255,198,174,224" value="30" />
+			<entry class="" argb="255,196,172,223" value="31" />
+			<entry class="" argb="255,194,171,222" value="32" />
+			<entry class="" argb="255,192,169,221" value="33" />
+			<entry class="" argb="255,190,168,220" value="34" />
+			<entry class="" argb="255,188,166,219" value="35" />
+			<entry class="" argb="255,186,165,218" value="36" />
+			<entry class="" argb="255,184,164,217" value="37" />
+			<entry class="" argb="255,182,162,216" value="38" />
+			<entry class="" argb="255,180,161,215" value="39" />
+			<entry class="" argb="255,178,159,214" value="40" />
+			<entry class="" argb="255,176,158,213" value="41" />
+			<entry class="" argb="255,174,157,212" value="42" />
+			<entry class="" argb="255,172,155,211" value="43" />
+			<entry class="" argb="255,170,154,210" value="44" />
+			<entry class="" argb="255,168,152,209" value="45" />
+			<entry class="" argb="255,166,151,208" value="46" />
+			<entry class="" argb="255,164,150,207" value="47" />
+			<entry class="" argb="255,162,148,206" value="48" />
+			<entry class="" argb="255,160,147,205" value="49" />
+			<entry class="" argb="255,158,145,204" value="50" />
+			<entry class="" argb="255,156,144,203" value="51" />
+			<entry class="" argb="255,154,142,202" value="52" />
+			<entry class="" argb="255,152,141,201" value="53" />
+			<entry class="" argb="255,150,140,200" value="54" />
+			<entry class="" argb="255,148,138,199" value="55" />
+			<entry class="" argb="255,146,137,198" value="56" />
+			<entry class="" argb="255,144,135,197" value="57" />
+			<entry class="" argb="255,142,134,196" value="58" />
+			<entry class="" argb="255,141,133,195" value="59" />
+			<entry class="" argb="255,139,131,194" value="60" />
+			<entry class="" argb="255,137,130,193" value="61" />
+			<entry class="" argb="255,135,128,192" value="62" />
+			<entry class="" argb="255,133,127,191" value="63" />
+			<entry class="" argb="255,131,125,190" value="64" />
+			<entry class="" argb="255,129,124,189" value="65" />
+			<entry class="" argb="255,127,123,188" value="66" />
+			<entry class="" argb="255,125,121,187" value="67" />
+			<entry class="" argb="255,123,120,186" value="68" />
+			<entry class="" argb="255,121,118,185" value="69" />
+			<entry class="" argb="255,119,117,184" value="70" />
+			<entry class="" argb="255,117,116,183" value="71" />
+			<entry class="" argb="255,115,114,182" value="72" />
+			<entry class="" argb="255,113,113,181" value="73" />
+			<entry class="" argb="255,111,111,180" value="74" />
+			<entry class="" argb="255,109,110,179" value="75" />
+			<entry class="" argb="255,107,109,178" value="76" />
+			<entry class="" argb="255,105,107,177" value="77" />
+			<entry class="" argb="255,103,106,176" value="78" />
+			<entry class="" argb="255,101,104,175" value="79" />
+			<entry class="" argb="255,99,103,174" value="80" />
+			<entry class="" argb="255,97,101,173" value="81" />
+			<entry class="" argb="255,95,100,172" value="82" />
+			<entry class="" argb="255,93,99,171" value="83" />
+			<entry class="" argb="255,91,97,170" value="84" />
+			<entry class="" argb="255,89,96,169" value="85" />
+			<entry class="" argb="255,87,94,168" value="86" />
+			<entry class="" argb="255,85,93,167" value="87" />
+			<entry class="" argb="255,83,92,166" value="88" />
+			<entry class="" argb="255,81,90,165" value="89" />
+			<entry class="" argb="255,79,89,164" value="90" />
+			<entry class="" argb="255,77,87,163" value="91" />
+			<entry class="" argb="255,75,86,162" value="92" />
+			<entry class="" argb="255,73,84,161" value="93" />
+			<entry class="" argb="255,71,83,160" value="94" />
+			<entry class="" argb="255,69,82,159" value="95" />
+			<entry class="" argb="255,67,80,158" value="96" />
+			<entry class="" argb="255,65,79,157" value="97" />
+			<entry class="" argb="255,63,77,156" value="98" />
+			<entry class="" argb="255,61,76,155" value="99" />
+			<entry class="" argb="255,59,75,154" value="100" />
+			<entry class="" argb="255,57,73,153" value="101" />
+			<entry class="" argb="255,55,72,152" value="102" />
+			<entry class="" argb="255,53,70,151" value="103" />
+			<entry class="" argb="255,51,69,150" value="104" />
+			<entry class="" argb="255,49,68,149" value="105" />
+			<entry class="" argb="255,47,66,148" value="106" />
+			<entry class="" argb="255,45,65,147" value="107" />
+			<entry class="" argb="255,43,63,146" value="108" />
+			<entry class="" argb="255,41,62,145" value="109" />
+			<entry class="" argb="255,40,60,144" value="110" />
+			<entry class="" argb="255,38,59,143" value="111" />
+			<entry class="" argb="255,36,58,142" value="112" />
+			<entry class="" argb="255,34,56,141" value="113" />
+			<entry class="" argb="255,32,55,140" value="114" />
+			<entry class="" argb="255,30,53,139" value="115" />
+			<entry class="" argb="255,28,52,138" value="116" />
+			<entry class="" argb="255,26,51,137" value="117" />
+			<entry class="" argb="255,24,49,136" value="118" />
+			<entry class="" argb="255,22,48,135" value="119" />
+			<entry class="" argb="255,20,46,134" value="120" />
+			<entry class="" argb="255,18,45,133" value="121" />
+			<entry class="" argb="255,16,43,132" value="122" />
+			<entry class="" argb="255,14,42,131" value="123" />
+			<entry class="" argb="255,12,41,130" value="124" />
+			<entry class="" argb="255,13,39,129" value="125" />
+			<entry class="" argb="255,8,38,128" value="126" />
+			<entry class="" argb="255,6,36,127" value="127" />
+			<entry class="" argb="255,4,35,126" value="128" />
+			<entry class="" argb="255,4,34,125" value="129" />
+			<entry class="" argb="255,6,32,124" value="130" />
+			<entry class="" argb="255,7,31,123" value="131" />
+			<entry class="" argb="255,9,32,122" value="132" />
+			<entry class="" argb="255,11,33,121" value="133" />
+			<entry class="" argb="255,13,34,120" value="134" />
+			<entry class="" argb="255,15,36,119" value="135" />
+			<entry class="" argb="255,17,37,118" value="136" />
+			<entry class="" argb="255,19,38,117" value="137" />
+			<entry class="" argb="255,21,40,116" value="138" />
+			<entry class="" argb="255,23,41,115" value="139" />
+			<entry class="" argb="255,25,42,114" value="140" />
+			<entry class="" argb="255,27,44,113" value="141" />
+			<entry class="" argb="255,29,45,112" value="142" />
+			<entry class="" argb="255,31,46,111" value="143" />
+			<entry class="" argb="255,33,48,110" value="144" />
+			<entry class="" argb="255,35,49,109" value="145" />
+			<entry class="" argb="255,37,50,108" value="146" />
+			<entry class="" argb="255,39,52,107" value="147" />
+			<entry class="" argb="255,41,53,106" value="148" />
+			<entry class="" argb="255,43,54,105" value="149" />
+			<entry class="" argb="255,45,56,104" value="150" />
+			<entry class="" argb="255,47,57,103" value="151" />
+			<entry class="" argb="255,49,58,102" value="152" />
+			<entry class="" argb="255,51,60,101" value="153" />
+			<entry class="" argb="255,53,61,100" value="154" />
+			<entry class="" argb="255,55,62,99" value="155" />
+			<entry class="" argb="255,57,64,98" value="156" />
+			<entry class="" argb="255,59,65,97" value="157" />
+			<entry class="" argb="255,61,66,96" value="158" />
+			<entry class="" argb="255,63,68,95" value="159" />
+			<entry class="" argb="255,65,69,94" value="160" />
+			<entry class="" argb="255,67,70,93" value="161" />
+			<entry class="" argb="255,69,72,92" value="162" />
+			<entry class="" argb="255,71,73,91" value="163" />
+			<entry class="" argb="255,73,75,90" value="164" />
+			<entry class="" argb="255,75,76,89" value="165" />
+			<entry class="" argb="255,77,77,88" value="166" />
+			<entry class="" argb="255,79,79,87" value="167" />
+			<entry class="" argb="255,81,80,86" value="168" />
+			<entry class="" argb="255,83,81,85" value="169" />
+			<entry class="" argb="255,85,83,84" value="170" />
+			<entry class="" argb="255,87,84,83" value="171" />
+			<entry class="" argb="255,89,85,82" value="172" />
+			<entry class="" argb="255,91,87,81" value="173" />
+			<entry class="" argb="255,93,88,80" value="174" />
+			<entry class="" argb="255,95,89,79" value="175" />
+			<entry class="" argb="255,97,91,78" value="176" />
+			<entry class="" argb="255,99,92,77" value="177" />
+			<entry class="" argb="255,101,93,76" value="178" />
+			<entry class="" argb="255,103,95,75" value="179" />
+			<entry class="" argb="255,105,96,74" value="180" />
+			<entry class="" argb="255,107,97,73" value="181" />
+			<entry class="" argb="255,108,99,72" value="182" />
+			<entry class="" argb="255,110,100,71" value="183" />
+			<entry class="" argb="255,112,101,70" value="184" />
+			<entry class="" argb="255,114,103,69" value="185" />
+			<entry class="" argb="255,116,104,68" value="186" />
+			<entry class="" argb="255,118,105,67" value="187" />
+			<entry class="" argb="255,120,107,66" value="188" />
+			<entry class="" argb="255,122,108,65" value="189" />
+			<entry class="" argb="255,124,109,64" value="190" />
+			<entry class="" argb="255,126,111,63" value="191" />
+			<entry class="" argb="255,128,112,62" value="192" />
+			<entry class="" argb="255,130,113,61" value="193" />
+			<entry class="" argb="255,132,115,60" value="194" />
+			<entry class="" argb="255,134,116,59" value="195" />
+			<entry class="" argb="255,136,117,58" value="196" />
+			<entry class="" argb="255,138,119,57" value="197" />
+			<entry class="" argb="255,140,120,56" value="198" />
+			<entry class="" argb="255,142,121,55" value="199" />
+			<entry class="" argb="255,144,123,54" value="200" />
+			<entry class="" argb="255,146,124,53" value="201" />
+			<entry class="" argb="255,148,125,52" value="202" />
+			<entry class="" argb="255,150,127,51" value="203" />
+			<entry class="" argb="255,152,128,50" value="204" />
+			<entry class="" argb="255,154,129,49" value="205" />
+			<entry class="" argb="255,156,131,48" value="206" />
+			<entry class="" argb="255,158,132,47" value="207" />
+			<entry class="" argb="255,160,133,46" value="208" />
+			<entry class="" argb="255,162,135,45" value="209" />
+			<entry class="" argb="255,164,136,44" value="210" />
+			<entry class="" argb="255,166,137,43" value="211" />
+			<entry class="" argb="255,168,139,42" value="212" />
+			<entry class="" argb="255,170,140,41" value="213" />
+			<entry class="" argb="255,172,141,40" value="214" />
+			<entry class="" argb="255,174,143,39" value="215" />
+			<entry class="" argb="255,176,144,38" value="216" />
+			<entry class="" argb="255,178,145,37" value="217" />
+			<entry class="" argb="255,180,147,36" value="218" />
+			<entry class="" argb="255,182,148,35" value="219" />
+			<entry class="" argb="255,184,149,34" value="220" />
+			<entry class="" argb="255,186,151,33" value="221" />
+			<entry class="" argb="255,188,152,32" value="222" />
+			<entry class="" argb="255,190,153,31" value="223" />
+			<entry class="" argb="255,192,155,30" value="224" />
+			<entry class="" argb="255,194,156,29" value="225" />
+			<entry class="" argb="255,196,157,28" value="226" />
+			<entry class="" argb="255,198,159,27" value="227" />
+			<entry class="" argb="255,200,160,26" value="228" />
+			<entry class="" argb="255,202,161,25" value="229" />
+			<entry class="" argb="255,204,163,24" value="230" />
+			<entry class="" argb="255,206,164,23" value="231" />
+			<entry class="" argb="255,208,165,22" value="232" />
+			<entry class="" argb="255,210,167,21" value="233" />
+			<entry class="" argb="255,211,168,20" value="234" />
+			<entry class="" argb="255,213,169,19" value="235" />
+			<entry class="" argb="255,215,171,18" value="236" />
+			<entry class="" argb="255,217,172,17" value="237" />
+			<entry class="" argb="255,219,173,16" value="238" />
+			<entry class="" argb="255,221,175,15" value="239" />
+			<entry class="" argb="255,223,176,14" value="240" />
+			<entry class="" argb="255,225,177,13" value="241" />
+			<entry class="" argb="255,227,179,12" value="242" />
+			<entry class="" argb="255,229,180,11" value="243" />
+			<entry class="" argb="255,231,181,13" value="244" />
+			<entry class="" argb="255,233,183,9" value="245" />
+			<entry class="" argb="255,235,184,8" value="246" />
+			<entry class="" argb="255,237,185,7" value="247" />
+			<entry class="" argb="255,239,187,6" value="248" />
+			<entry class="" argb="255,241,188,5" value="249" />
+			<entry class="" argb="255,243,189,4" value="250" />
+			<entry class="" argb="255,245,191,3" value="251" />
+			<entry class="" argb="255,247,192,2" value="252" />
+			<entry class="" argb="255,249,193,1" value="253" />
+			<entry class="" argb="255,251,195,0" value="254" />
+			<entry class="" argb="255,251,195,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="mac-style" interpolate="false">
+		<table>
+			<entry class="" argb="255,124,0,255" value="0" />
+			<entry class="" argb="255,124,0,255" value="1" />
+			<entry class="" argb="255,120,0,254" value="2" />
+			<entry class="" argb="255,115,0,255" value="3" />
+			<entry class="" argb="255,111,0,254" value="4" />
+			<entry class="" argb="255,106,0,255" value="5" />
+			<entry class="" argb="255,102,0,254" value="6" />
+			<entry class="" argb="255,97,0,255" value="7" />
+			<entry class="" argb="255,93,0,254" value="8" />
+			<entry class="" argb="255,88,0,255" value="9" />
+			<entry class="" argb="255,84,0,254" value="10" />
+			<entry class="" argb="255,79,0,255" value="11" />
+			<entry class="" argb="255,75,0,254" value="12" />
+			<entry class="" argb="255,70,0,255" value="13" />
+			<entry class="" argb="255,66,0,254" value="14" />
+			<entry class="" argb="255,61,0,255" value="15" />
+			<entry class="" argb="255,57,0,254" value="16" />
+			<entry class="" argb="255,52,0,255" value="17" />
+			<entry class="" argb="255,48,0,254" value="18" />
+			<entry class="" argb="255,43,0,255" value="19" />
+			<entry class="" argb="255,39,0,254" value="20" />
+			<entry class="" argb="255,34,0,255" value="21" />
+			<entry class="" argb="255,30,0,254" value="22" />
+			<entry class="" argb="255,25,0,255" value="23" />
+			<entry class="" argb="255,21,0,254" value="24" />
+			<entry class="" argb="255,16,0,255" value="25" />
+			<entry class="" argb="255,12,0,254" value="26" />
+			<entry class="" argb="255,7,0,255" value="27" />
+			<entry class="" argb="255,3,0,254" value="28" />
+			<entry class="" argb="255,0,2,255" value="29" />
+			<entry class="" argb="255,0,6,254" value="30" />
+			<entry class="" argb="255,0,11,255" value="31" />
+			<entry class="" argb="255,0,15,254" value="32" />
+			<entry class="" argb="255,0,20,255" value="33" />
+			<entry class="" argb="255,0,24,254" value="34" />
+			<entry class="" argb="255,0,29,255" value="35" />
+			<entry class="" argb="255,0,33,254" value="36" />
+			<entry class="" argb="255,0,38,255" value="37" />
+			<entry class="" argb="255,0,42,254" value="38" />
+			<entry class="" argb="255,0,47,255" value="39" />
+			<entry class="" argb="255,0,51,254" value="40" />
+			<entry class="" argb="255,0,56,255" value="41" />
+			<entry class="" argb="255,0,60,254" value="42" />
+			<entry class="" argb="255,0,65,255" value="43" />
+			<entry class="" argb="255,0,69,254" value="44" />
+			<entry class="" argb="255,0,74,255" value="45" />
+			<entry class="" argb="255,0,78,254" value="46" />
+			<entry class="" argb="255,0,83,255" value="47" />
+			<entry class="" argb="255,0,87,254" value="48" />
+			<entry class="" argb="255,0,92,255" value="49" />
+			<entry class="" argb="255,0,96,254" value="50" />
+			<entry class="" argb="255,0,101,255" value="51" />
+			<entry class="" argb="255,0,105,254" value="52" />
+			<entry class="" argb="255,0,110,255" value="53" />
+			<entry class="" argb="255,0,114,254" value="54" />
+			<entry class="" argb="255,0,119,255" value="55" />
+			<entry class="" argb="255,0,122,254" value="56" />
+			<entry class="" argb="255,0,128,255" value="57" />
+			<entry class="" argb="255,0,131,254" value="58" />
+			<entry class="" argb="255,0,137,255" value="59" />
+			<entry class="" argb="255,0,140,254" value="60" />
+			<entry class="" argb="255,0,146,255" value="61" />
+			<entry class="" argb="255,0,149,254" value="62" />
+			<entry class="" argb="255,0,155,255" value="63" />
+			<entry class="" argb="255,0,158,254" value="64" />
+			<entry class="" argb="255,0,164,255" value="65" />
+			<entry class="" argb="255,0,167,254" value="66" />
+			<entry class="" argb="255,0,173,255" value="67" />
+			<entry class="" argb="255,0,176,254" value="68" />
+			<entry class="" argb="255,0,182,255" value="69" />
+			<entry class="" argb="255,0,185,254" value="70" />
+			<entry class="" argb="255,0,191,255" value="71" />
+			<entry class="" argb="255,0,194,254" value="72" />
+			<entry class="" argb="255,0,200,255" value="73" />
+			<entry class="" argb="255,0,203,254" value="74" />
+			<entry class="" argb="255,0,209,255" value="75" />
+			<entry class="" argb="255,0,212,254" value="76" />
+			<entry class="" argb="255,0,218,255" value="77" />
+			<entry class="" argb="255,0,221,254" value="78" />
+			<entry class="" argb="255,0,227,255" value="79" />
+			<entry class="" argb="255,0,230,254" value="80" />
+			<entry class="" argb="255,0,236,255" value="81" />
+			<entry class="" argb="255,0,240,254" value="82" />
+			<entry class="" argb="255,0,245,255" value="83" />
+			<entry class="" argb="255,0,249,254" value="84" />
+			<entry class="" argb="255,0,254,255" value="85" />
+			<entry class="" argb="255,0,254,250" value="86" />
+			<entry class="" argb="255,0,255,247" value="87" />
+			<entry class="" argb="255,0,254,241" value="88" />
+			<entry class="" argb="255,0,255,238" value="89" />
+			<entry class="" argb="255,0,254,232" value="90" />
+			<entry class="" argb="255,0,255,229" value="91" />
+			<entry class="" argb="255,0,254,223" value="92" />
+			<entry class="" argb="255,0,255,220" value="93" />
+			<entry class="" argb="255,0,254,214" value="94" />
+			<entry class="" argb="255,0,255,211" value="95" />
+			<entry class="" argb="255,0,254,205" value="96" />
+			<entry class="" argb="255,0,255,202" value="97" />
+			<entry class="" argb="255,0,254,196" value="98" />
+			<entry class="" argb="255,0,255,193" value="99" />
+			<entry class="" argb="255,0,254,187" value="100" />
+			<entry class="" argb="255,0,255,184" value="101" />
+			<entry class="" argb="255,0,254,178" value="102" />
+			<entry class="" argb="255,0,255,175" value="103" />
+			<entry class="" argb="255,0,254,169" value="104" />
+			<entry class="" argb="255,0,255,166" value="105" />
+			<entry class="" argb="255,0,254,160" value="106" />
+			<entry class="" argb="255,0,255,157" value="107" />
+			<entry class="" argb="255,0,254,151" value="108" />
+			<entry class="" argb="255,0,255,148" value="109" />
+			<entry class="" argb="255,0,254,142" value="110" />
+			<entry class="" argb="255,0,255,139" value="111" />
+			<entry class="" argb="255,0,254,133" value="112" />
+			<entry class="" argb="255,0,255,130" value="113" />
+			<entry class="" argb="255,0,254,125" value="114" />
+			<entry class="" argb="255,0,255,121" value="115" />
+			<entry class="" argb="255,0,254,116" value="116" />
+			<entry class="" argb="255,0,255,112" value="117" />
+			<entry class="" argb="255,0,254,107" value="118" />
+			<entry class="" argb="255,0,255,103" value="119" />
+			<entry class="" argb="255,0,254,98" value="120" />
+			<entry class="" argb="255,0,255,94" value="121" />
+			<entry class="" argb="255,0,254,89" value="122" />
+			<entry class="" argb="255,0,255,85" value="123" />
+			<entry class="" argb="255,0,254,80" value="124" />
+			<entry class="" argb="255,0,255,76" value="125" />
+			<entry class="" argb="255,0,254,71" value="126" />
+			<entry class="" argb="255,0,255,67" value="127" />
+			<entry class="" argb="255,0,254,62" value="128" />
+			<entry class="" argb="255,0,255,58" value="129" />
+			<entry class="" argb="255,0,254,53" value="130" />
+			<entry class="" argb="255,0,255,49" value="131" />
+			<entry class="" argb="255,0,254,44" value="132" />
+			<entry class="" argb="255,0,255,40" value="133" />
+			<entry class="" argb="255,0,254,35" value="134" />
+			<entry class="" argb="255,0,255,31" value="135" />
+			<entry class="" argb="255,0,254,26" value="136" />
+			<entry class="" argb="255,0,255,22" value="137" />
+			<entry class="" argb="255,0,254,17" value="138" />
+			<entry class="" argb="255,0,255,13" value="139" />
+			<entry class="" argb="255,0,254,8" value="140" />
+			<entry class="" argb="255,0,255,4" value="141" />
+			<entry class="" argb="255,1,254,0" value="142" />
+			<entry class="" argb="255,5,255,0" value="143" />
+			<entry class="" argb="255,13,254,0" value="144" />
+			<entry class="" argb="255,14,255,0" value="145" />
+			<entry class="" argb="255,19,254,0" value="146" />
+			<entry class="" argb="255,23,255,0" value="147" />
+			<entry class="" argb="255,28,254,0" value="148" />
+			<entry class="" argb="255,32,255,0" value="149" />
+			<entry class="" argb="255,37,254,0" value="150" />
+			<entry class="" argb="255,41,255,0" value="151" />
+			<entry class="" argb="255,46,254,0" value="152" />
+			<entry class="" argb="255,50,255,0" value="153" />
+			<entry class="" argb="255,55,254,0" value="154" />
+			<entry class="" argb="255,59,255,0" value="155" />
+			<entry class="" argb="255,64,254,0" value="156" />
+			<entry class="" argb="255,68,255,0" value="157" />
+			<entry class="" argb="255,73,254,0" value="158" />
+			<entry class="" argb="255,77,255,0" value="159" />
+			<entry class="" argb="255,82,254,0" value="160" />
+			<entry class="" argb="255,86,255,0" value="161" />
+			<entry class="" argb="255,91,254,0" value="162" />
+			<entry class="" argb="255,95,255,0" value="163" />
+			<entry class="" argb="255,100,254,0" value="164" />
+			<entry class="" argb="255,104,255,0" value="165" />
+			<entry class="" argb="255,109,254,0" value="166" />
+			<entry class="" argb="255,113,255,0" value="167" />
+			<entry class="" argb="255,118,254,0" value="168" />
+			<entry class="" argb="255,123,255,0" value="169" />
+			<entry class="" argb="255,126,254,0" value="170" />
+			<entry class="" argb="255,132,255,0" value="171" />
+			<entry class="" argb="255,135,254,0" value="172" />
+			<entry class="" argb="255,141,255,0" value="173" />
+			<entry class="" argb="255,144,254,0" value="174" />
+			<entry class="" argb="255,150,255,0" value="175" />
+			<entry class="" argb="255,153,254,0" value="176" />
+			<entry class="" argb="255,159,255,0" value="177" />
+			<entry class="" argb="255,162,254,0" value="178" />
+			<entry class="" argb="255,168,255,0" value="179" />
+			<entry class="" argb="255,171,254,0" value="180" />
+			<entry class="" argb="255,177,255,0" value="181" />
+			<entry class="" argb="255,180,254,0" value="182" />
+			<entry class="" argb="255,186,255,0" value="183" />
+			<entry class="" argb="255,189,254,0" value="184" />
+			<entry class="" argb="255,195,255,0" value="185" />
+			<entry class="" argb="255,198,254,0" value="186" />
+			<entry class="" argb="255,204,255,0" value="187" />
+			<entry class="" argb="255,207,254,0" value="188" />
+			<entry class="" argb="255,213,255,0" value="189" />
+			<entry class="" argb="255,216,254,0" value="190" />
+			<entry class="" argb="255,222,255,0" value="191" />
+			<entry class="" argb="255,225,254,0" value="192" />
+			<entry class="" argb="255,231,255,0" value="193" />
+			<entry class="" argb="255,234,254,0" value="194" />
+			<entry class="" argb="255,240,255,0" value="195" />
+			<entry class="" argb="255,243,254,0" value="196" />
+			<entry class="" argb="255,249,255,0" value="197" />
+			<entry class="" argb="255,252,254,0" value="198" />
+			<entry class="" argb="255,255,252,0" value="199" />
+			<entry class="" argb="255,254,247,0" value="200" />
+			<entry class="" argb="255,255,243,0" value="201" />
+			<entry class="" argb="255,254,238,0" value="202" />
+			<entry class="" argb="255,255,234,0" value="203" />
+			<entry class="" argb="255,254,229,0" value="204" />
+			<entry class="" argb="255,255,225,0" value="205" />
+			<entry class="" argb="255,254,220,0" value="206" />
+			<entry class="" argb="255,255,216,0" value="207" />
+			<entry class="" argb="255,254,211,0" value="208" />
+			<entry class="" argb="255,255,207,0" value="209" />
+			<entry class="" argb="255,254,202,0" value="210" />
+			<entry class="" argb="255,255,198,0" value="211" />
+			<entry class="" argb="255,254,193,0" value="212" />
+			<entry class="" argb="255,255,189,0" value="213" />
+			<entry class="" argb="255,254,184,0" value="214" />
+			<entry class="" argb="255,255,180,0" value="215" />
+			<entry class="" argb="255,254,175,0" value="216" />
+			<entry class="" argb="255,255,171,0" value="217" />
+			<entry class="" argb="255,254,166,0" value="218" />
+			<entry class="" argb="255,255,162,0" value="219" />
+			<entry class="" argb="255,254,157,0" value="220" />
+			<entry class="" argb="255,255,153,0" value="221" />
+			<entry class="" argb="255,254,148,0" value="222" />
+			<entry class="" argb="255,255,144,0" value="223" />
+			<entry class="" argb="255,254,139,0" value="224" />
+			<entry class="" argb="255,255,135,0" value="225" />
+			<entry class="" argb="255,254,131,0" value="226" />
+			<entry class="" argb="255,255,126,0" value="227" />
+			<entry class="" argb="255,254,122,0" value="228" />
+			<entry class="" argb="255,255,117,0" value="229" />
+			<entry class="" argb="255,254,113,0" value="230" />
+			<entry class="" argb="255,255,108,0" value="231" />
+			<entry class="" argb="255,254,104,0" value="232" />
+			<entry class="" argb="255,255,99,0" value="233" />
+			<entry class="" argb="255,254,95,0" value="234" />
+			<entry class="" argb="255,255,90,0" value="235" />
+			<entry class="" argb="255,254,86,0" value="236" />
+			<entry class="" argb="255,255,81,0" value="237" />
+			<entry class="" argb="255,254,77,0" value="238" />
+			<entry class="" argb="255,255,72,0" value="239" />
+			<entry class="" argb="255,254,68,0" value="240" />
+			<entry class="" argb="255,255,63,0" value="241" />
+			<entry class="" argb="255,254,59,0" value="242" />
+			<entry class="" argb="255,255,54,0" value="243" />
+			<entry class="" argb="255,254,50,0" value="244" />
+			<entry class="" argb="255,255,45,0" value="245" />
+			<entry class="" argb="255,254,41,0" value="246" />
+			<entry class="" argb="255,255,36,0" value="247" />
+			<entry class="" argb="255,254,32,0" value="248" />
+			<entry class="" argb="255,255,27,0" value="249" />
+			<entry class="" argb="255,254,23,0" value="250" />
+			<entry class="" argb="255,255,18,0" value="251" />
+			<entry class="" argb="255,254,14,0" value="252" />
+			<entry class="" argb="255,255,9,0" value="253" />
+			<entry class="" argb="255,255,5,0" value="254" />
+			<entry class="" argb="255,255,5,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="nature" interpolate="false">
+		<table>
+			<entry class="" argb="255,105,246,234" value="0" />
+			<entry class="" argb="255,105,246,234" value="1" />
+			<entry class="" argb="255,105,246,234" value="2" />
+			<entry class="" argb="255,105,246,234" value="3" />
+			<entry class="" argb="255,105,246,234" value="4" />
+			<entry class="" argb="255,105,246,234" value="5" />
+			<entry class="" argb="255,105,246,234" value="6" />
+			<entry class="" argb="255,105,246,234" value="7" />
+			<entry class="" argb="255,105,246,234" value="8" />
+			<entry class="" argb="255,110,251,222" value="9" />
+			<entry class="" argb="255,114,253,210" value="10" />
+			<entry class="" argb="255,123,244,186" value="11" />
+			<entry class="" argb="255,127,239,175" value="12" />
+			<entry class="" argb="255,131,235,164" value="13" />
+			<entry class="" argb="255,135,231,153" value="14" />
+			<entry class="" argb="255,143,224,132" value="15" />
+			<entry class="" argb="255,147,222,122" value="16" />
+			<entry class="" argb="255,150,219,113" value="17" />
+			<entry class="" argb="255,157,216,95" value="18" />
+			<entry class="" argb="255,160,214,87" value="19" />
+			<entry class="" argb="255,163,214,79" value="20" />
+			<entry class="" argb="255,165,213,72" value="21" />
+			<entry class="" argb="255,170,214,59" value="22" />
+			<entry class="" argb="255,172,215,54" value="23" />
+			<entry class="" argb="255,174,216,49" value="24" />
+			<entry class="" argb="255,176,218,44" value="25" />
+			<entry class="" argb="255,179,223,37" value="26" />
+			<entry class="" argb="255,180,226,34" value="27" />
+			<entry class="" argb="255,180,229,32" value="28" />
+			<entry class="" argb="255,181,237,30" value="29" />
+			<entry class="" argb="255,182,241,29" value="30" />
+			<entry class="" argb="255,181,246,30" value="31" />
+			<entry class="" argb="255,181,251,31" value="32" />
+			<entry class="" argb="255,180,248,34" value="33" />
+			<entry class="" argb="255,179,243,37" value="34" />
+			<entry class="" argb="255,177,237,40" value="35" />
+			<entry class="" argb="255,174,225,49" value="36" />
+			<entry class="" argb="255,172,218,54" value="37" />
+			<entry class="" argb="255,170,212,59" value="38" />
+			<entry class="" argb="255,168,205,66" value="39" />
+			<entry class="" argb="255,163,192,79" value="40" />
+			<entry class="" argb="255,160,186,87" value="41" />
+			<entry class="" argb="255,157,179,95" value="42" />
+			<entry class="" argb="255,154,173,104" value="43" />
+			<entry class="" argb="255,147,160,122" value="44" />
+			<entry class="" argb="255,143,154,132" value="45" />
+			<entry class="" argb="255,139,148,142" value="46" />
+			<entry class="" argb="255,131,137,164" value="47" />
+			<entry class="" argb="255,127,132,175" value="48" />
+			<entry class="" argb="255,123,127,186" value="49" />
+			<entry class="" argb="255,119,122,198" value="50" />
+			<entry class="" argb="255,110,113,222" value="51" />
+			<entry class="" argb="255,105,109,234" value="52" />
+			<entry class="" argb="255,100,105,246" value="53" />
+			<entry class="" argb="255,96,102,251" value="54" />
+			<entry class="" argb="255,87,96,227" value="55" />
+			<entry class="" argb="255,82,94,214" value="56" />
+			<entry class="" argb="255,77,92,202" value="57" />
+			<entry class="" argb="255,68,89,177" value="58" />
+			<entry class="" argb="255,63,88,165" value="59" />
+			<entry class="" argb="255,59,88,153" value="60" />
+			<entry class="" argb="255,54,88,141" value="61" />
+			<entry class="" argb="255,46,88,118" value="62" />
+			<entry class="" argb="255,42,89,107" value="63" />
+			<entry class="" argb="255,38,90,96" value="64" />
+			<entry class="" argb="255,30,93,75" value="65" />
+			<entry class="" argb="255,26,95,65" value="66" />
+			<entry class="" argb="255,23,97,56" value="67" />
+			<entry class="" argb="255,19,99,47" value="68" />
+			<entry class="" argb="255,13,104,30" value="69" />
+			<entry class="" argb="255,13,107,22" value="70" />
+			<entry class="" argb="255,8,110,15" value="71" />
+			<entry class="" argb="255,5,113,9" value="72" />
+			<entry class="" argb="255,1,120,2" value="73" />
+			<entry class="" argb="255,0,124,7" value="74" />
+			<entry class="" argb="255,2,127,12" value="75" />
+			<entry class="" argb="255,5,134,19" value="76" />
+			<entry class="" argb="255,6,138,22" value="77" />
+			<entry class="" argb="255,6,141,24" value="78" />
+			<entry class="" argb="255,7,145,25" value="79" />
+			<entry class="" argb="255,8,152,27" value="80" />
+			<entry class="" argb="255,7,155,26" value="81" />
+			<entry class="" argb="255,7,158,25" value="82" />
+			<entry class="" argb="255,6,164,22" value="83" />
+			<entry class="" argb="255,5,166,19" value="84" />
+			<entry class="" argb="255,3,169,16" value="85" />
+			<entry class="" argb="255,2,171,12" value="86" />
+			<entry class="" argb="255,1,175,2" value="87" />
+			<entry class="" argb="255,3,176,2" value="88" />
+			<entry class="" argb="255,5,178,9" value="89" />
+			<entry class="" argb="255,8,179,15" value="90" />
+			<entry class="" argb="255,13,180,30" value="91" />
+			<entry class="" argb="255,16,180,38" value="92" />
+			<entry class="" argb="255,19,180,47" value="93" />
+			<entry class="" argb="255,26,180,65" value="94" />
+			<entry class="" argb="255,30,179,75" value="95" />
+			<entry class="" argb="255,34,178,85" value="96" />
+			<entry class="" argb="255,38,176,96" value="97" />
+			<entry class="" argb="255,46,173,118" value="98" />
+			<entry class="" argb="255,50,171,129" value="99" />
+			<entry class="" argb="255,54,169,141" value="100" />
+			<entry class="" argb="255,59,166,153" value="101" />
+			<entry class="" argb="255,68,161,177" value="102" />
+			<entry class="" argb="255,73,158,189" value="103" />
+			<entry class="" argb="255,77,154,202" value="104" />
+			<entry class="" argb="255,86,148,226" value="105" />
+			<entry class="" argb="255,91,144,239" value="106" />
+			<entry class="" argb="255,96,140,251" value="107" />
+			<entry class="" argb="255,100,136,246" value="108" />
+			<entry class="" argb="255,110,128,222" value="109" />
+			<entry class="" argb="255,114,124,210" value="110" />
+			<entry class="" argb="255,119,120,198" value="111" />
+			<entry class="" argb="255,127,112,175" value="112" />
+			<entry class="" argb="255,131,108,164" value="113" />
+			<entry class="" argb="255,135,104,153" value="114" />
+			<entry class="" argb="255,139,100,142" value="115" />
+			<entry class="" argb="255,147,92,122" value="116" />
+			<entry class="" argb="255,150,88,113" value="117" />
+			<entry class="" argb="255,154,85,104" value="118" />
+			<entry class="" argb="255,157,81,95" value="119" />
+			<entry class="" argb="255,163,74,79" value="120" />
+			<entry class="" argb="255,165,71,72" value="121" />
+			<entry class="" argb="255,168,68,66" value="122" />
+			<entry class="" argb="255,172,62,54" value="123" />
+			<entry class="" argb="255,174,60,49" value="124" />
+			<entry class="" argb="255,176,57,44" value="125" />
+			<entry class="" argb="255,177,55,40" value="126" />
+			<entry class="" argb="255,180,51,34" value="127" />
+			<entry class="" argb="255,180,50,32" value="128" />
+			<entry class="" argb="255,181,48,31" value="129" />
+			<entry class="" argb="255,182,46,29" value="130" />
+			<entry class="" argb="255,181,45,30" value="131" />
+			<entry class="" argb="255,181,44,31" value="132" />
+			<entry class="" argb="255,180,44,32" value="133" />
+			<entry class="" argb="255,179,43,37" value="134" />
+			<entry class="" argb="255,177,43,40" value="135" />
+			<entry class="" argb="255,176,43,44" value="136" />
+			<entry class="" argb="255,174,44,49" value="137" />
+			<entry class="" argb="255,170,44,59" value="138" />
+			<entry class="" argb="255,168,45,66" value="139" />
+			<entry class="" argb="255,165,46,72" value="140" />
+			<entry class="" argb="255,160,47,87" value="141" />
+			<entry class="" argb="255,157,48,95" value="142" />
+			<entry class="" argb="255,154,49,104" value="143" />
+			<entry class="" argb="255,150,51,113" value="144" />
+			<entry class="" argb="255,143,53,132" value="145" />
+			<entry class="" argb="255,139,54,142" value="146" />
+			<entry class="" argb="255,135,55,153" value="147" />
+			<entry class="" argb="255,127,57,175" value="148" />
+			<entry class="" argb="255,123,59,186" value="149" />
+			<entry class="" argb="255,119,60,198" value="150" />
+			<entry class="" argb="255,114,61,210" value="151" />
+			<entry class="" argb="255,105,63,234" value="152" />
+			<entry class="" argb="255,100,64,246" value="153" />
+			<entry class="" argb="255,96,64,251" value="154" />
+			<entry class="" argb="255,91,65,239" value="155" />
+			<entry class="" argb="255,82,66,214" value="156" />
+			<entry class="" argb="255,77,67,202" value="157" />
+			<entry class="" argb="255,73,67,189" value="158" />
+			<entry class="" argb="255,63,67,165" value="159" />
+			<entry class="" argb="255,59,67,153" value="160" />
+			<entry class="" argb="255,54,67,141" value="161" />
+			<entry class="" argb="255,50,67,129" value="162" />
+			<entry class="" argb="255,42,66,107" value="163" />
+			<entry class="" argb="255,38,66,96" value="164" />
+			<entry class="" argb="255,34,65,85" value="165" />
+			<entry class="" argb="255,30,64,75" value="166" />
+			<entry class="" argb="255,23,62,56" value="167" />
+			<entry class="" argb="255,19,61,47" value="168" />
+			<entry class="" argb="255,16,60,38" value="169" />
+			<entry class="" argb="255,13,58,22" value="170" />
+			<entry class="" argb="255,8,56,15" value="171" />
+			<entry class="" argb="255,5,55,9" value="172" />
+			<entry class="" argb="255,3,53,2" value="173" />
+			<entry class="" argb="255,0,50,7" value="174" />
+			<entry class="" argb="255,2,48,12" value="175" />
+			<entry class="" argb="255,3,46,16" value="176" />
+			<entry class="" argb="255,6,43,22" value="177" />
+			<entry class="" argb="255,6,41,24" value="178" />
+			<entry class="" argb="255,7,39,25" value="179" />
+			<entry class="" argb="255,7,37,26" value="180" />
+			<entry class="" argb="255,7,34,26" value="181" />
+			<entry class="" argb="255,7,32,25" value="182" />
+			<entry class="" argb="255,6,30,24" value="183" />
+			<entry class="" argb="255,6,28,22" value="184" />
+			<entry class="" argb="255,3,25,16" value="185" />
+			<entry class="" argb="255,2,23,12" value="186" />
+			<entry class="" argb="255,0,22,7" value="187" />
+			<entry class="" argb="255,3,19,2" value="188" />
+			<entry class="" argb="255,5,17,9" value="189" />
+			<entry class="" argb="255,8,16,15" value="190" />
+			<entry class="" argb="255,13,15,22" value="191" />
+			<entry class="" argb="255,16,12,38" value="192" />
+			<entry class="" argb="255,19,11,47" value="193" />
+			<entry class="" argb="255,23,13,56" value="194" />
+			<entry class="" argb="255,30,8,75" value="195" />
+			<entry class="" argb="255,34,7,85" value="196" />
+			<entry class="" argb="255,38,6,96" value="197" />
+			<entry class="" argb="255,42,6,107" value="198" />
+			<entry class="" argb="255,50,4,129" value="199" />
+			<entry class="" argb="255,54,4,141" value="200" />
+			<entry class="" argb="255,59,3,153" value="201" />
+			<entry class="" argb="255,63,2,165" value="202" />
+			<entry class="" argb="255,73,1,189" value="203" />
+			<entry class="" argb="255,77,1,202" value="204" />
+			<entry class="" argb="255,82,0,214" value="205" />
+			<entry class="" argb="255,82,0,214" value="206" />
+			<entry class="" argb="255,82,0,214" value="207" />
+			<entry class="" argb="255,82,0,214" value="208" />
+			<entry class="" argb="255,82,0,214" value="209" />
+			<entry class="" argb="255,82,0,214" value="210" />
+			<entry class="" argb="255,82,0,214" value="211" />
+			<entry class="" argb="255,82,0,214" value="212" />
+			<entry class="" argb="255,82,0,214" value="213" />
+			<entry class="" argb="255,82,0,214" value="214" />
+			<entry class="" argb="255,82,0,214" value="215" />
+			<entry class="" argb="255,82,0,214" value="216" />
+			<entry class="" argb="255,82,0,214" value="217" />
+			<entry class="" argb="255,82,0,214" value="218" />
+			<entry class="" argb="255,82,0,214" value="219" />
+			<entry class="" argb="255,82,0,214" value="220" />
+			<entry class="" argb="255,82,0,214" value="221" />
+			<entry class="" argb="255,82,0,214" value="222" />
+			<entry class="" argb="255,82,0,214" value="223" />
+			<entry class="" argb="255,82,0,214" value="224" />
+			<entry class="" argb="255,82,0,214" value="225" />
+			<entry class="" argb="255,82,0,214" value="226" />
+			<entry class="" argb="255,82,0,214" value="227" />
+			<entry class="" argb="255,82,0,214" value="228" />
+			<entry class="" argb="255,82,0,214" value="229" />
+			<entry class="" argb="255,82,0,214" value="230" />
+			<entry class="" argb="255,82,0,214" value="231" />
+			<entry class="" argb="255,82,0,214" value="232" />
+			<entry class="" argb="255,82,0,214" value="233" />
+			<entry class="" argb="255,82,0,214" value="234" />
+			<entry class="" argb="255,82,0,214" value="235" />
+			<entry class="" argb="255,82,0,214" value="236" />
+			<entry class="" argb="255,82,0,214" value="237" />
+			<entry class="" argb="255,82,0,214" value="238" />
+			<entry class="" argb="255,82,0,214" value="239" />
+			<entry class="" argb="255,82,0,214" value="240" />
+			<entry class="" argb="255,82,0,214" value="241" />
+			<entry class="" argb="255,82,0,214" value="242" />
+			<entry class="" argb="255,82,0,214" value="243" />
+			<entry class="" argb="255,82,0,214" value="244" />
+			<entry class="" argb="255,82,0,214" value="245" />
+			<entry class="" argb="255,82,0,214" value="246" />
+			<entry class="" argb="255,82,0,214" value="247" />
+			<entry class="" argb="255,82,0,214" value="248" />
+			<entry class="" argb="255,82,0,214" value="249" />
+			<entry class="" argb="255,82,0,214" value="250" />
+			<entry class="" argb="255,82,0,214" value="251" />
+			<entry class="" argb="255,82,0,214" value="252" />
+			<entry class="" argb="255,0,0,0" value="253" />
+			<entry class="" argb="255,255,255,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="pastels" interpolate="false">
+		<table>
+			<entry class="" argb="255,255,0,72" value="0" />
+			<entry class="" argb="255,255,0,72" value="1" />
+			<entry class="" argb="255,255,0,74" value="2" />
+			<entry class="" argb="255,255,0,76" value="3" />
+			<entry class="" argb="255,255,0,78" value="4" />
+			<entry class="" argb="255,255,0,80" value="5" />
+			<entry class="" argb="255,255,0,82" value="6" />
+			<entry class="" argb="255,255,0,84" value="7" />
+			<entry class="" argb="255,255,0,86" value="8" />
+			<entry class="" argb="255,255,0,88" value="9" />
+			<entry class="" argb="255,255,0,90" value="10" />
+			<entry class="" argb="255,255,0,91" value="11" />
+			<entry class="" argb="255,255,0,93" value="12" />
+			<entry class="" argb="255,255,0,95" value="13" />
+			<entry class="" argb="255,255,0,97" value="14" />
+			<entry class="" argb="255,255,0,99" value="15" />
+			<entry class="" argb="255,255,0,101" value="16" />
+			<entry class="" argb="255,255,0,103" value="17" />
+			<entry class="" argb="255,255,0,105" value="18" />
+			<entry class="" argb="255,255,0,107" value="19" />
+			<entry class="" argb="255,255,0,109" value="20" />
+			<entry class="" argb="255,255,0,111" value="21" />
+			<entry class="" argb="255,255,0,113" value="22" />
+			<entry class="" argb="255,255,0,115" value="23" />
+			<entry class="" argb="255,255,0,117" value="24" />
+			<entry class="" argb="255,255,0,119" value="25" />
+			<entry class="" argb="255,255,0,121" value="26" />
+			<entry class="" argb="255,255,0,123" value="27" />
+			<entry class="" argb="255,255,0,125" value="28" />
+			<entry class="" argb="255,255,0,127" value="29" />
+			<entry class="" argb="255,255,0,129" value="30" />
+			<entry class="" argb="255,255,0,131" value="31" />
+			<entry class="" argb="255,255,0,133" value="32" />
+			<entry class="" argb="255,255,0,135" value="33" />
+			<entry class="" argb="255,255,0,137" value="34" />
+			<entry class="" argb="255,255,0,139" value="35" />
+			<entry class="" argb="255,255,0,141" value="36" />
+			<entry class="" argb="255,255,0,142" value="37" />
+			<entry class="" argb="255,255,0,144" value="38" />
+			<entry class="" argb="255,255,0,146" value="39" />
+			<entry class="" argb="255,255,0,148" value="40" />
+			<entry class="" argb="255,255,0,150" value="41" />
+			<entry class="" argb="255,255,0,152" value="42" />
+			<entry class="" argb="255,255,0,154" value="43" />
+			<entry class="" argb="255,255,0,156" value="44" />
+			<entry class="" argb="255,255,0,158" value="45" />
+			<entry class="" argb="255,255,0,160" value="46" />
+			<entry class="" argb="255,255,0,162" value="47" />
+			<entry class="" argb="255,255,0,164" value="48" />
+			<entry class="" argb="255,255,0,166" value="49" />
+			<entry class="" argb="255,255,0,168" value="50" />
+			<entry class="" argb="255,255,0,170" value="51" />
+			<entry class="" argb="255,255,0,172" value="52" />
+			<entry class="" argb="255,255,0,174" value="53" />
+			<entry class="" argb="255,255,0,176" value="54" />
+			<entry class="" argb="255,255,0,178" value="55" />
+			<entry class="" argb="255,255,0,180" value="56" />
+			<entry class="" argb="255,255,0,182" value="57" />
+			<entry class="" argb="255,255,0,184" value="58" />
+			<entry class="" argb="255,255,0,186" value="59" />
+			<entry class="" argb="255,255,0,188" value="60" />
+			<entry class="" argb="255,255,0,190" value="61" />
+			<entry class="" argb="255,255,0,191" value="62" />
+			<entry class="" argb="255,255,0,193" value="63" />
+			<entry class="" argb="255,255,0,195" value="64" />
+			<entry class="" argb="255,255,0,197" value="65" />
+			<entry class="" argb="255,255,0,199" value="66" />
+			<entry class="" argb="255,255,0,201" value="67" />
+			<entry class="" argb="255,255,0,203" value="68" />
+			<entry class="" argb="255,255,0,205" value="69" />
+			<entry class="" argb="255,255,0,207" value="70" />
+			<entry class="" argb="255,255,0,209" value="71" />
+			<entry class="" argb="255,255,0,211" value="72" />
+			<entry class="" argb="255,255,0,213" value="73" />
+			<entry class="" argb="255,255,0,215" value="74" />
+			<entry class="" argb="255,255,0,217" value="75" />
+			<entry class="" argb="255,255,0,219" value="76" />
+			<entry class="" argb="255,255,0,221" value="77" />
+			<entry class="" argb="255,255,0,223" value="78" />
+			<entry class="" argb="255,255,0,225" value="79" />
+			<entry class="" argb="255,255,0,227" value="80" />
+			<entry class="" argb="255,255,0,229" value="81" />
+			<entry class="" argb="255,255,0,231" value="82" />
+			<entry class="" argb="255,255,0,233" value="83" />
+			<entry class="" argb="255,255,0,235" value="84" />
+			<entry class="" argb="255,255,0,237" value="85" />
+			<entry class="" argb="255,255,0,239" value="86" />
+			<entry class="" argb="255,255,0,241" value="87" />
+			<entry class="" argb="255,255,0,242" value="88" />
+			<entry class="" argb="255,255,0,244" value="89" />
+			<entry class="" argb="255,255,0,246" value="90" />
+			<entry class="" argb="255,255,0,248" value="91" />
+			<entry class="" argb="255,255,0,250" value="92" />
+			<entry class="" argb="255,255,0,252" value="93" />
+			<entry class="" argb="255,255,0,254" value="94" />
+			<entry class="" argb="255,253,0,255" value="95" />
+			<entry class="" argb="255,251,0,255" value="96" />
+			<entry class="" argb="255,249,0,255" value="97" />
+			<entry class="" argb="255,247,0,255" value="98" />
+			<entry class="" argb="255,245,0,255" value="99" />
+			<entry class="" argb="255,243,0,255" value="100" />
+			<entry class="" argb="255,241,0,255" value="101" />
+			<entry class="" argb="255,239,0,255" value="102" />
+			<entry class="" argb="255,237,0,255" value="103" />
+			<entry class="" argb="255,235,0,255" value="104" />
+			<entry class="" argb="255,233,0,255" value="105" />
+			<entry class="" argb="255,231,0,255" value="106" />
+			<entry class="" argb="255,229,0,255" value="107" />
+			<entry class="" argb="255,227,0,255" value="108" />
+			<entry class="" argb="255,225,0,255" value="109" />
+			<entry class="" argb="255,223,0,255" value="110" />
+			<entry class="" argb="255,221,0,255" value="111" />
+			<entry class="" argb="255,219,0,255" value="112" />
+			<entry class="" argb="255,217,0,255" value="113" />
+			<entry class="" argb="255,216,0,255" value="114" />
+			<entry class="" argb="255,214,0,255" value="115" />
+			<entry class="" argb="255,212,0,255" value="116" />
+			<entry class="" argb="255,210,0,255" value="117" />
+			<entry class="" argb="255,208,0,255" value="118" />
+			<entry class="" argb="255,206,0,255" value="119" />
+			<entry class="" argb="255,204,0,255" value="120" />
+			<entry class="" argb="255,202,0,255" value="121" />
+			<entry class="" argb="255,200,0,255" value="122" />
+			<entry class="" argb="255,198,0,255" value="123" />
+			<entry class="" argb="255,196,0,255" value="124" />
+			<entry class="" argb="255,194,0,255" value="125" />
+			<entry class="" argb="255,192,0,255" value="126" />
+			<entry class="" argb="255,190,0,255" value="127" />
+			<entry class="" argb="255,188,0,255" value="128" />
+			<entry class="" argb="255,186,0,255" value="129" />
+			<entry class="" argb="255,0,140,255" value="130" />
+			<entry class="" argb="255,0,146,255" value="131" />
+			<entry class="" argb="255,0,152,255" value="132" />
+			<entry class="" argb="255,0,157,255" value="133" />
+			<entry class="" argb="255,0,163,255" value="134" />
+			<entry class="" argb="255,0,169,255" value="135" />
+			<entry class="" argb="255,0,174,255" value="136" />
+			<entry class="" argb="255,0,180,255" value="137" />
+			<entry class="" argb="255,0,186,255" value="138" />
+			<entry class="" argb="255,0,192,255" value="139" />
+			<entry class="" argb="255,0,197,255" value="140" />
+			<entry class="" argb="255,0,203,255" value="141" />
+			<entry class="" argb="255,0,209,255" value="142" />
+			<entry class="" argb="255,0,214,255" value="143" />
+			<entry class="" argb="255,0,220,255" value="144" />
+			<entry class="" argb="255,0,226,255" value="145" />
+			<entry class="" argb="255,0,232,255" value="146" />
+			<entry class="" argb="255,0,237,255" value="147" />
+			<entry class="" argb="255,0,243,255" value="148" />
+			<entry class="" argb="255,0,249,255" value="149" />
+			<entry class="" argb="255,0,255,255" value="150" />
+			<entry class="" argb="255,0,255,249" value="151" />
+			<entry class="" argb="255,0,255,243" value="152" />
+			<entry class="" argb="255,0,255,237" value="153" />
+			<entry class="" argb="255,0,255,232" value="154" />
+			<entry class="" argb="255,0,255,226" value="155" />
+			<entry class="" argb="255,0,255,220" value="156" />
+			<entry class="" argb="255,0,255,214" value="157" />
+			<entry class="" argb="255,0,255,209" value="158" />
+			<entry class="" argb="255,0,255,203" value="159" />
+			<entry class="" argb="255,0,255,197" value="160" />
+			<entry class="" argb="255,0,255,192" value="161" />
+			<entry class="" argb="255,0,255,186" value="162" />
+			<entry class="" argb="255,0,255,180" value="163" />
+			<entry class="" argb="255,0,255,174" value="164" />
+			<entry class="" argb="255,0,255,169" value="165" />
+			<entry class="" argb="255,0,255,163" value="166" />
+			<entry class="" argb="255,0,255,157" value="167" />
+			<entry class="" argb="255,0,255,152" value="168" />
+			<entry class="" argb="255,0,255,146" value="169" />
+			<entry class="" argb="255,0,255,140" value="170" />
+			<entry class="" argb="255,0,255,134" value="171" />
+			<entry class="" argb="255,0,255,129" value="172" />
+			<entry class="" argb="255,0,255,123" value="173" />
+			<entry class="" argb="255,0,255,117" value="174" />
+			<entry class="" argb="255,0,255,112" value="175" />
+			<entry class="" argb="255,0,255,106" value="176" />
+			<entry class="" argb="255,0,255,100" value="177" />
+			<entry class="" argb="255,0,255,94" value="178" />
+			<entry class="" argb="255,0,255,89" value="179" />
+			<entry class="" argb="255,0,255,83" value="180" />
+			<entry class="" argb="255,0,255,77" value="181" />
+			<entry class="" argb="255,0,255,71" value="182" />
+			<entry class="" argb="255,0,255,66" value="183" />
+			<entry class="" argb="255,0,255,60" value="184" />
+			<entry class="" argb="255,0,255,54" value="185" />
+			<entry class="" argb="255,0,255,49" value="186" />
+			<entry class="" argb="255,0,255,43" value="187" />
+			<entry class="" argb="255,0,255,37" value="188" />
+			<entry class="" argb="255,0,255,31" value="189" />
+			<entry class="" argb="255,0,255,26" value="190" />
+			<entry class="" argb="255,0,255,20" value="191" />
+			<entry class="" argb="255,0,255,14" value="192" />
+			<entry class="" argb="255,0,255,9" value="193" />
+			<entry class="" argb="255,0,255,3" value="194" />
+			<entry class="" argb="255,2,255,0" value="195" />
+			<entry class="" argb="255,8,255,0" value="196" />
+			<entry class="" argb="255,13,255,0" value="197" />
+			<entry class="" argb="255,19,255,0" value="198" />
+			<entry class="" argb="255,25,255,0" value="199" />
+			<entry class="" argb="255,30,255,0" value="200" />
+			<entry class="" argb="255,36,255,0" value="201" />
+			<entry class="" argb="255,42,255,0" value="202" />
+			<entry class="" argb="255,48,255,0" value="203" />
+			<entry class="" argb="255,53,255,0" value="204" />
+			<entry class="" argb="255,59,255,0" value="205" />
+			<entry class="" argb="255,65,255,0" value="206" />
+			<entry class="" argb="255,71,255,0" value="207" />
+			<entry class="" argb="255,76,255,0" value="208" />
+			<entry class="" argb="255,82,255,0" value="209" />
+			<entry class="" argb="255,88,255,0" value="210" />
+			<entry class="" argb="255,93,255,0" value="211" />
+			<entry class="" argb="255,99,255,0" value="212" />
+			<entry class="" argb="255,105,255,0" value="213" />
+			<entry class="" argb="255,111,255,0" value="214" />
+			<entry class="" argb="255,116,255,0" value="215" />
+			<entry class="" argb="255,122,255,0" value="216" />
+			<entry class="" argb="255,128,255,0" value="217" />
+			<entry class="" argb="255,133,255,0" value="218" />
+			<entry class="" argb="255,139,255,0" value="219" />
+			<entry class="" argb="255,145,255,0" value="220" />
+			<entry class="" argb="255,151,255,0" value="221" />
+			<entry class="" argb="255,156,255,0" value="222" />
+			<entry class="" argb="255,162,255,0" value="223" />
+			<entry class="" argb="255,168,255,0" value="224" />
+			<entry class="" argb="255,173,255,0" value="225" />
+			<entry class="" argb="255,179,255,0" value="226" />
+			<entry class="" argb="255,185,255,0" value="227" />
+			<entry class="" argb="255,191,255,0" value="228" />
+			<entry class="" argb="255,196,255,0" value="229" />
+			<entry class="" argb="255,202,255,0" value="230" />
+			<entry class="" argb="255,208,255,0" value="231" />
+			<entry class="" argb="255,214,255,0" value="232" />
+			<entry class="" argb="255,219,255,0" value="233" />
+			<entry class="" argb="255,225,255,0" value="234" />
+			<entry class="" argb="255,231,255,0" value="235" />
+			<entry class="" argb="255,236,255,0" value="236" />
+			<entry class="" argb="255,242,255,0" value="237" />
+			<entry class="" argb="255,248,255,0" value="238" />
+			<entry class="" argb="255,254,255,0" value="239" />
+			<entry class="" argb="255,255,250,0" value="240" />
+			<entry class="" argb="255,255,244,0" value="241" />
+			<entry class="" argb="255,255,238,0" value="242" />
+			<entry class="" argb="255,255,233,0" value="243" />
+			<entry class="" argb="255,255,227,0" value="244" />
+			<entry class="" argb="255,255,221,0" value="245" />
+			<entry class="" argb="255,255,215,0" value="246" />
+			<entry class="" argb="255,255,210,0" value="247" />
+			<entry class="" argb="255,255,204,0" value="248" />
+			<entry class="" argb="255,255,198,0" value="249" />
+			<entry class="" argb="255,255,193,0" value="250" />
+			<entry class="" argb="255,255,187,0" value="251" />
+			<entry class="" argb="255,255,181,0" value="252" />
+			<entry class="" argb="255,255,175,0" value="253" />
+			<entry class="" argb="255,255,170,0" value="254" />
+			<entry class="" argb="255,255,170,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="plasma" interpolate="false">
+		<table>
+			<entry class="" argb="255,2,19,7" value="0" />
+			<entry class="" argb="255,2,19,7" value="1" />
+			<entry class="" argb="255,3,20,11" value="2" />
+			<entry class="" argb="255,4,22,15" value="3" />
+			<entry class="" argb="255,5,25,19" value="4" />
+			<entry class="" argb="255,6,29,22" value="5" />
+			<entry class="" argb="255,7,33,26" value="6" />
+			<entry class="" argb="255,8,38,30" value="7" />
+			<entry class="" argb="255,9,44,34" value="8" />
+			<entry class="" argb="255,13,51,39" value="9" />
+			<entry class="" argb="255,11,58,43" value="10" />
+			<entry class="" argb="255,13,65,47" value="11" />
+			<entry class="" argb="255,14,73,51" value="12" />
+			<entry class="" argb="255,15,81,55" value="13" />
+			<entry class="" argb="255,16,89,59" value="14" />
+			<entry class="" argb="255,17,98,63" value="15" />
+			<entry class="" argb="255,18,106,67" value="16" />
+			<entry class="" argb="255,19,115,71" value="17" />
+			<entry class="" argb="255,21,124,75" value="18" />
+			<entry class="" argb="255,22,132,78" value="19" />
+			<entry class="" argb="255,23,140,82" value="20" />
+			<entry class="" argb="255,24,148,86" value="21" />
+			<entry class="" argb="255,25,155,90" value="22" />
+			<entry class="" argb="255,26,162,93" value="23" />
+			<entry class="" argb="255,27,169,97" value="24" />
+			<entry class="" argb="255,28,175,100" value="25" />
+			<entry class="" argb="255,30,180,103" value="26" />
+			<entry class="" argb="255,31,184,107" value="27" />
+			<entry class="" argb="255,32,188,110" value="28" />
+			<entry class="" argb="255,33,191,113" value="29" />
+			<entry class="" argb="255,34,193,116" value="30" />
+			<entry class="" argb="255,35,194,119" value="31" />
+			<entry class="" argb="255,36,195,122" value="32" />
+			<entry class="" argb="255,37,194,125" value="33" />
+			<entry class="" argb="255,38,193,128" value="34" />
+			<entry class="" argb="255,39,191,130" value="35" />
+			<entry class="" argb="255,39,188,133" value="36" />
+			<entry class="" argb="255,40,184,136" value="37" />
+			<entry class="" argb="255,41,180,139" value="38" />
+			<entry class="" argb="255,42,175,141" value="39" />
+			<entry class="" argb="255,43,169,144" value="40" />
+			<entry class="" argb="255,44,162,147" value="41" />
+			<entry class="" argb="255,45,155,150" value="42" />
+			<entry class="" argb="255,46,148,153" value="43" />
+			<entry class="" argb="255,46,140,156" value="44" />
+			<entry class="" argb="255,47,132,159" value="45" />
+			<entry class="" argb="255,48,124,162" value="46" />
+			<entry class="" argb="255,49,115,165" value="47" />
+			<entry class="" argb="255,50,107,169" value="48" />
+			<entry class="" argb="255,51,98,172" value="49" />
+			<entry class="" argb="255,52,89,176" value="50" />
+			<entry class="" argb="255,53,81,180" value="51" />
+			<entry class="" argb="255,54,73,184" value="52" />
+			<entry class="" argb="255,55,65,188" value="53" />
+			<entry class="" argb="255,56,58,192" value="54" />
+			<entry class="" argb="255,57,51,196" value="55" />
+			<entry class="" argb="255,58,44,201" value="56" />
+			<entry class="" argb="255,59,38,205" value="57" />
+			<entry class="" argb="255,60,33,210" value="58" />
+			<entry class="" argb="255,61,29,215" value="59" />
+			<entry class="" argb="255,62,25,220" value="60" />
+			<entry class="" argb="255,63,22,225" value="61" />
+			<entry class="" argb="255,65,20,230" value="62" />
+			<entry class="" argb="255,66,19,235" value="63" />
+			<entry class="" argb="255,67,19,241" value="64" />
+			<entry class="" argb="255,68,19,246" value="65" />
+			<entry class="" argb="255,70,20,251" value="66" />
+			<entry class="" argb="255,71,22,253" value="67" />
+			<entry class="" argb="255,72,25,248" value="68" />
+			<entry class="" argb="255,74,29,243" value="69" />
+			<entry class="" argb="255,75,33,237" value="70" />
+			<entry class="" argb="255,77,38,232" value="71" />
+			<entry class="" argb="255,78,44,227" value="72" />
+			<entry class="" argb="255,79,51,222" value="73" />
+			<entry class="" argb="255,81,58,217" value="74" />
+			<entry class="" argb="255,82,65,212" value="75" />
+			<entry class="" argb="255,84,73,207" value="76" />
+			<entry class="" argb="255,85,81,202" value="77" />
+			<entry class="" argb="255,86,89,198" value="78" />
+			<entry class="" argb="255,88,98,194" value="79" />
+			<entry class="" argb="255,89,107,190" value="80" />
+			<entry class="" argb="255,90,115,186" value="81" />
+			<entry class="" argb="255,92,124,182" value="82" />
+			<entry class="" argb="255,93,132,179" value="83" />
+			<entry class="" argb="255,94,140,176" value="84" />
+			<entry class="" argb="255,95,148,172" value="85" />
+			<entry class="" argb="255,97,155,170" value="86" />
+			<entry class="" argb="255,98,162,167" value="87" />
+			<entry class="" argb="255,99,169,165" value="88" />
+			<entry class="" argb="255,100,175,162" value="89" />
+			<entry class="" argb="255,101,180,160" value="90" />
+			<entry class="" argb="255,102,184,158" value="91" />
+			<entry class="" argb="255,103,188,157" value="92" />
+			<entry class="" argb="255,103,191,155" value="93" />
+			<entry class="" argb="255,104,193,154" value="94" />
+			<entry class="" argb="255,105,194,152" value="95" />
+			<entry class="" argb="255,106,195,151" value="96" />
+			<entry class="" argb="255,107,194,150" value="97" />
+			<entry class="" argb="255,107,193,148" value="98" />
+			<entry class="" argb="255,108,191,147" value="99" />
+			<entry class="" argb="255,108,188,146" value="100" />
+			<entry class="" argb="255,109,184,144" value="101" />
+			<entry class="" argb="255,110,180,143" value="102" />
+			<entry class="" argb="255,110,175,141" value="103" />
+			<entry class="" argb="255,111,169,140" value="104" />
+			<entry class="" argb="255,111,162,138" value="105" />
+			<entry class="" argb="255,112,155,136" value="106" />
+			<entry class="" argb="255,113,148,134" value="107" />
+			<entry class="" argb="255,113,140,132" value="108" />
+			<entry class="" argb="255,114,132,129" value="109" />
+			<entry class="" argb="255,114,124,126" value="110" />
+			<entry class="" argb="255,115,115,123" value="111" />
+			<entry class="" argb="255,116,106,120" value="112" />
+			<entry class="" argb="255,117,98,116" value="113" />
+			<entry class="" argb="255,117,89,113" value="114" />
+			<entry class="" argb="255,118,81,108" value="115" />
+			<entry class="" argb="255,119,73,104" value="116" />
+			<entry class="" argb="255,120,65,99" value="117" />
+			<entry class="" argb="255,121,58,94" value="118" />
+			<entry class="" argb="255,122,51,89" value="119" />
+			<entry class="" argb="255,123,44,83" value="120" />
+			<entry class="" argb="255,124,38,78" value="121" />
+			<entry class="" argb="255,125,33,72" value="122" />
+			<entry class="" argb="255,127,29,65" value="123" />
+			<entry class="" argb="255,128,25,59" value="124" />
+			<entry class="" argb="255,129,22,53" value="125" />
+			<entry class="" argb="255,131,20,46" value="126" />
+			<entry class="" argb="255,132,19,39" value="127" />
+			<entry class="" argb="255,134,19,32" value="128" />
+			<entry class="" argb="255,135,19,25" value="129" />
+			<entry class="" argb="255,137,20,18" value="130" />
+			<entry class="" argb="255,138,22,11" value="131" />
+			<entry class="" argb="255,140,25,5" value="132" />
+			<entry class="" argb="255,142,29,253" value="133" />
+			<entry class="" argb="255,143,33,246" value="134" />
+			<entry class="" argb="255,145,38,239" value="135" />
+			<entry class="" argb="255,147,44,233" value="136" />
+			<entry class="" argb="255,149,51,227" value="137" />
+			<entry class="" argb="255,150,58,221" value="138" />
+			<entry class="" argb="255,152,65,215" value="139" />
+			<entry class="" argb="255,154,73,210" value="140" />
+			<entry class="" argb="255,155,81,205" value="141" />
+			<entry class="" argb="255,157,89,200" value="142" />
+			<entry class="" argb="255,158,98,195" value="143" />
+			<entry class="" argb="255,160,107,191" value="144" />
+			<entry class="" argb="255,161,115,188" value="145" />
+			<entry class="" argb="255,163,124,184" value="146" />
+			<entry class="" argb="255,164,132,181" value="147" />
+			<entry class="" argb="255,166,140,178" value="148" />
+			<entry class="" argb="255,167,148,176" value="149" />
+			<entry class="" argb="255,168,155,174" value="150" />
+			<entry class="" argb="255,169,162,172" value="151" />
+			<entry class="" argb="255,170,169,171" value="152" />
+			<entry class="" argb="255,171,175,170" value="153" />
+			<entry class="" argb="255,172,180,169" value="154" />
+			<entry class="" argb="255,173,184,169" value="155" />
+			<entry class="" argb="255,174,188,168" value="156" />
+			<entry class="" argb="255,174,191,168" value="157" />
+			<entry class="" argb="255,175,193,168" value="158" />
+			<entry class="" argb="255,175,194,168" value="159" />
+			<entry class="" argb="255,176,195,169" value="160" />
+			<entry class="" argb="255,176,194,169" value="161" />
+			<entry class="" argb="255,177,193,169" value="162" />
+			<entry class="" argb="255,177,191,169" value="163" />
+			<entry class="" argb="255,178,188,170" value="164" />
+			<entry class="" argb="255,178,184,170" value="165" />
+			<entry class="" argb="255,178,180,170" value="166" />
+			<entry class="" argb="255,178,175,169" value="167" />
+			<entry class="" argb="255,179,169,169" value="168" />
+			<entry class="" argb="255,179,162,168" value="169" />
+			<entry class="" argb="255,179,155,167" value="170" />
+			<entry class="" argb="255,180,148,166" value="171" />
+			<entry class="" argb="255,180,140,164" value="172" />
+			<entry class="" argb="255,180,132,162" value="173" />
+			<entry class="" argb="255,181,124,160" value="174" />
+			<entry class="" argb="255,181,115,157" value="175" />
+			<entry class="" argb="255,182,106,154" value="176" />
+			<entry class="" argb="255,182,98,150" value="177" />
+			<entry class="" argb="255,183,89,146" value="178" />
+			<entry class="" argb="255,184,81,141" value="179" />
+			<entry class="" argb="255,184,73,136" value="180" />
+			<entry class="" argb="255,185,65,131" value="181" />
+			<entry class="" argb="255,186,58,125" value="182" />
+			<entry class="" argb="255,187,51,119" value="183" />
+			<entry class="" argb="255,188,44,112" value="184" />
+			<entry class="" argb="255,190,38,106" value="185" />
+			<entry class="" argb="255,191,33,98" value="186" />
+			<entry class="" argb="255,192,29,91" value="187" />
+			<entry class="" argb="255,194,25,83" value="188" />
+			<entry class="" argb="255,195,22,75" value="189" />
+			<entry class="" argb="255,197,20,67" value="190" />
+			<entry class="" argb="255,198,19,58" value="191" />
+			<entry class="" argb="255,200,19,50" value="192" />
+			<entry class="" argb="255,202,19,41" value="193" />
+			<entry class="" argb="255,204,20,33" value="194" />
+			<entry class="" argb="255,206,22,24" value="195" />
+			<entry class="" argb="255,208,25,16" value="196" />
+			<entry class="" argb="255,210,29,8" value="197" />
+			<entry class="" argb="255,212,33,255" value="198" />
+			<entry class="" argb="255,214,38,247" value="199" />
+			<entry class="" argb="255,216,44,239" value="200" />
+			<entry class="" argb="255,218,51,232" value="201" />
+			<entry class="" argb="255,220,58,225" value="202" />
+			<entry class="" argb="255,222,65,219" value="203" />
+			<entry class="" argb="255,224,73,213" value="204" />
+			<entry class="" argb="255,225,81,207" value="205" />
+			<entry class="" argb="255,227,89,202" value="206" />
+			<entry class="" argb="255,229,98,197" value="207" />
+			<entry class="" argb="255,231,107,193" value="208" />
+			<entry class="" argb="255,232,115,189" value="209" />
+			<entry class="" argb="255,234,124,186" value="210" />
+			<entry class="" argb="255,236,132,183" value="211" />
+			<entry class="" argb="255,237,140,181" value="212" />
+			<entry class="" argb="255,238,148,179" value="213" />
+			<entry class="" argb="255,239,155,178" value="214" />
+			<entry class="" argb="255,241,162,177" value="215" />
+			<entry class="" argb="255,242,169,177" value="216" />
+			<entry class="" argb="255,242,175,177" value="217" />
+			<entry class="" argb="255,243,180,178" value="218" />
+			<entry class="" argb="255,244,184,179" value="219" />
+			<entry class="" argb="255,245,188,180" value="220" />
+			<entry class="" argb="255,245,191,181" value="221" />
+			<entry class="" argb="255,246,193,183" value="222" />
+			<entry class="" argb="255,246,194,184" value="223" />
+			<entry class="" argb="255,246,195,186" value="224" />
+			<entry class="" argb="255,246,194,188" value="225" />
+			<entry class="" argb="255,246,193,190" value="226" />
+			<entry class="" argb="255,247,191,192" value="227" />
+			<entry class="" argb="255,247,188,193" value="228" />
+			<entry class="" argb="255,247,184,195" value="229" />
+			<entry class="" argb="255,247,180,196" value="230" />
+			<entry class="" argb="255,247,175,197" value="231" />
+			<entry class="" argb="255,247,169,198" value="232" />
+			<entry class="" argb="255,247,162,198" value="233" />
+			<entry class="" argb="255,247,155,198" value="234" />
+			<entry class="" argb="255,247,148,198" value="235" />
+			<entry class="" argb="255,247,140,197" value="236" />
+			<entry class="" argb="255,247,132,195" value="237" />
+			<entry class="" argb="255,247,124,193" value="238" />
+			<entry class="" argb="255,247,115,191" value="239" />
+			<entry class="" argb="255,248,106,188" value="240" />
+			<entry class="" argb="255,248,98,184" value="241" />
+			<entry class="" argb="255,248,89,180" value="242" />
+			<entry class="" argb="255,249,81,175" value="243" />
+			<entry class="" argb="255,250,73,169" value="244" />
+			<entry class="" argb="255,251,65,163" value="245" />
+			<entry class="" argb="255,251,58,156" value="246" />
+			<entry class="" argb="255,252,51,149" value="247" />
+			<entry class="" argb="255,254,44,142" value="248" />
+			<entry class="" argb="255,255,38,133" value="249" />
+			<entry class="" argb="255,254,33,125" value="250" />
+			<entry class="" argb="255,252,29,116" value="251" />
+			<entry class="" argb="255,251,25,107" value="252" />
+			<entry class="" argb="255,249,22,97" value="253" />
+			<entry class="" argb="255,247,20,87" value="254" />
+			<entry class="" argb="255,247,20,87" value="255" />
+		</table>
+	</palette>
+
+	<palette name="prism" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,3,0,0" value="1" />
+			<entry class="" argb="255,7,0,0" value="2" />
+			<entry class="" argb="255,11,0,0" value="3" />
+			<entry class="" argb="255,15,0,0" value="4" />
+			<entry class="" argb="255,19,0,0" value="5" />
+			<entry class="" argb="255,22,0,0" value="6" />
+			<entry class="" argb="255,26,0,0" value="7" />
+			<entry class="" argb="255,30,0,0" value="8" />
+			<entry class="" argb="255,34,0,0" value="9" />
+			<entry class="" argb="255,38,0,0" value="10" />
+			<entry class="" argb="255,41,0,0" value="11" />
+			<entry class="" argb="255,45,0,0" value="12" />
+			<entry class="" argb="255,49,0,0" value="13" />
+			<entry class="" argb="255,53,0,0" value="14" />
+			<entry class="" argb="255,57,0,0" value="15" />
+			<entry class="" argb="255,60,0,0" value="16" />
+			<entry class="" argb="255,64,0,0" value="17" />
+			<entry class="" argb="255,68,0,0" value="18" />
+			<entry class="" argb="255,72,0,0" value="19" />
+			<entry class="" argb="255,76,0,0" value="20" />
+			<entry class="" argb="255,79,0,0" value="21" />
+			<entry class="" argb="255,83,0,0" value="22" />
+			<entry class="" argb="255,87,0,0" value="23" />
+			<entry class="" argb="255,91,0,0" value="24" />
+			<entry class="" argb="255,95,0,0" value="25" />
+			<entry class="" argb="255,98,0,0" value="26" />
+			<entry class="" argb="255,102,0,0" value="27" />
+			<entry class="" argb="255,106,0,0" value="28" />
+			<entry class="" argb="255,110,0,0" value="29" />
+			<entry class="" argb="255,114,0,0" value="30" />
+			<entry class="" argb="255,117,0,0" value="31" />
+			<entry class="" argb="255,121,0,0" value="32" />
+			<entry class="" argb="255,125,0,0" value="33" />
+			<entry class="" argb="255,129,0,0" value="34" />
+			<entry class="" argb="255,133,0,0" value="35" />
+			<entry class="" argb="255,137,0,0" value="36" />
+			<entry class="" argb="255,140,0,0" value="37" />
+			<entry class="" argb="255,144,0,0" value="38" />
+			<entry class="" argb="255,148,0,0" value="39" />
+			<entry class="" argb="255,152,0,0" value="40" />
+			<entry class="" argb="255,156,0,0" value="41" />
+			<entry class="" argb="255,159,0,0" value="42" />
+			<entry class="" argb="255,163,0,0" value="43" />
+			<entry class="" argb="255,167,0,0" value="44" />
+			<entry class="" argb="255,171,0,0" value="45" />
+			<entry class="" argb="255,175,0,0" value="46" />
+			<entry class="" argb="255,178,0,0" value="47" />
+			<entry class="" argb="255,182,0,0" value="48" />
+			<entry class="" argb="255,186,0,0" value="49" />
+			<entry class="" argb="255,190,0,0" value="50" />
+			<entry class="" argb="255,194,0,0" value="51" />
+			<entry class="" argb="255,197,0,0" value="52" />
+			<entry class="" argb="255,201,0,0" value="53" />
+			<entry class="" argb="255,205,0,0" value="54" />
+			<entry class="" argb="255,209,0,0" value="55" />
+			<entry class="" argb="255,213,0,0" value="56" />
+			<entry class="" argb="255,216,0,0" value="57" />
+			<entry class="" argb="255,220,0,0" value="58" />
+			<entry class="" argb="255,224,0,0" value="59" />
+			<entry class="" argb="255,228,0,0" value="60" />
+			<entry class="" argb="255,232,0,0" value="61" />
+			<entry class="" argb="255,235,0,0" value="62" />
+			<entry class="" argb="255,239,0,0" value="63" />
+			<entry class="" argb="255,243,0,0" value="64" />
+			<entry class="" argb="255,247,3,0" value="65" />
+			<entry class="" argb="255,251,7,0" value="66" />
+			<entry class="" argb="255,255,11,0" value="67" />
+			<entry class="" argb="255,251,15,0" value="68" />
+			<entry class="" argb="255,247,19,0" value="69" />
+			<entry class="" argb="255,243,23,0" value="70" />
+			<entry class="" argb="255,239,27,0" value="71" />
+			<entry class="" argb="255,235,31,0" value="72" />
+			<entry class="" argb="255,230,35,0" value="73" />
+			<entry class="" argb="255,226,39,0" value="74" />
+			<entry class="" argb="255,222,43,0" value="75" />
+			<entry class="" argb="255,218,47,0" value="76" />
+			<entry class="" argb="255,214,51,0" value="77" />
+			<entry class="" argb="255,210,55,0" value="78" />
+			<entry class="" argb="255,205,59,0" value="79" />
+			<entry class="" argb="255,201,63,0" value="80" />
+			<entry class="" argb="255,197,67,0" value="81" />
+			<entry class="" argb="255,193,71,0" value="82" />
+			<entry class="" argb="255,189,75,0" value="83" />
+			<entry class="" argb="255,184,79,0" value="84" />
+			<entry class="" argb="255,180,83,0" value="85" />
+			<entry class="" argb="255,176,87,0" value="86" />
+			<entry class="" argb="255,172,91,0" value="87" />
+			<entry class="" argb="255,168,95,0" value="88" />
+			<entry class="" argb="255,164,99,0" value="89" />
+			<entry class="" argb="255,159,103,0" value="90" />
+			<entry class="" argb="255,155,107,0" value="91" />
+			<entry class="" argb="255,151,111,0" value="92" />
+			<entry class="" argb="255,147,115,0" value="93" />
+			<entry class="" argb="255,143,119,0" value="94" />
+			<entry class="" argb="255,138,123,0" value="95" />
+			<entry class="" argb="255,134,127,0" value="96" />
+			<entry class="" argb="255,130,131,0" value="97" />
+			<entry class="" argb="255,126,135,0" value="98" />
+			<entry class="" argb="255,122,139,0" value="99" />
+			<entry class="" argb="255,118,143,0" value="100" />
+			<entry class="" argb="255,113,147,0" value="101" />
+			<entry class="" argb="255,109,151,0" value="102" />
+			<entry class="" argb="255,105,155,0" value="103" />
+			<entry class="" argb="255,101,159,0" value="104" />
+			<entry class="" argb="255,97,163,0" value="105" />
+			<entry class="" argb="255,92,167,0" value="106" />
+			<entry class="" argb="255,88,171,0" value="107" />
+			<entry class="" argb="255,84,175,0" value="108" />
+			<entry class="" argb="255,80,179,0" value="109" />
+			<entry class="" argb="255,76,183,0" value="110" />
+			<entry class="" argb="255,72,187,0" value="111" />
+			<entry class="" argb="255,67,191,0" value="112" />
+			<entry class="" argb="255,63,195,0" value="113" />
+			<entry class="" argb="255,59,199,0" value="114" />
+			<entry class="" argb="255,55,203,0" value="115" />
+			<entry class="" argb="255,51,207,0" value="116" />
+			<entry class="" argb="255,46,211,0" value="117" />
+			<entry class="" argb="255,42,215,0" value="118" />
+			<entry class="" argb="255,38,219,0" value="119" />
+			<entry class="" argb="255,34,223,0" value="120" />
+			<entry class="" argb="255,30,227,0" value="121" />
+			<entry class="" argb="255,26,231,0" value="122" />
+			<entry class="" argb="255,21,235,0" value="123" />
+			<entry class="" argb="255,17,239,0" value="124" />
+			<entry class="" argb="255,13,243,0" value="125" />
+			<entry class="" argb="255,9,247,0" value="126" />
+			<entry class="" argb="255,5,251,3" value="127" />
+			<entry class="" argb="255,0,255,7" value="128" />
+			<entry class="" argb="255,0,251,11" value="129" />
+			<entry class="" argb="255,0,247,15" value="130" />
+			<entry class="" argb="255,0,243,19" value="131" />
+			<entry class="" argb="255,0,239,23" value="132" />
+			<entry class="" argb="255,0,235,27" value="133" />
+			<entry class="" argb="255,0,231,30" value="134" />
+			<entry class="" argb="255,0,227,34" value="135" />
+			<entry class="" argb="255,0,223,38" value="136" />
+			<entry class="" argb="255,0,219,42" value="137" />
+			<entry class="" argb="255,0,215,46" value="138" />
+			<entry class="" argb="255,0,211,50" value="139" />
+			<entry class="" argb="255,0,207,54" value="140" />
+			<entry class="" argb="255,0,203,57" value="141" />
+			<entry class="" argb="255,0,199,61" value="142" />
+			<entry class="" argb="255,0,195,65" value="143" />
+			<entry class="" argb="255,0,191,69" value="144" />
+			<entry class="" argb="255,0,187,73" value="145" />
+			<entry class="" argb="255,0,183,77" value="146" />
+			<entry class="" argb="255,0,179,81" value="147" />
+			<entry class="" argb="255,0,175,85" value="148" />
+			<entry class="" argb="255,0,170,88" value="149" />
+			<entry class="" argb="255,0,166,92" value="150" />
+			<entry class="" argb="255,0,162,96" value="151" />
+			<entry class="" argb="255,0,158,100" value="152" />
+			<entry class="" argb="255,0,154,104" value="153" />
+			<entry class="" argb="255,0,150,108" value="154" />
+			<entry class="" argb="255,0,146,112" value="155" />
+			<entry class="" argb="255,0,142,115" value="156" />
+			<entry class="" argb="255,0,138,119" value="157" />
+			<entry class="" argb="255,0,134,123" value="158" />
+			<entry class="" argb="255,0,130,127" value="159" />
+			<entry class="" argb="255,0,126,131" value="160" />
+			<entry class="" argb="255,0,122,135" value="161" />
+			<entry class="" argb="255,0,118,139" value="162" />
+			<entry class="" argb="255,0,114,142" value="163" />
+			<entry class="" argb="255,0,110,146" value="164" />
+			<entry class="" argb="255,0,106,150" value="165" />
+			<entry class="" argb="255,0,102,154" value="166" />
+			<entry class="" argb="255,0,98,158" value="167" />
+			<entry class="" argb="255,0,94,162" value="168" />
+			<entry class="" argb="255,0,90,166" value="169" />
+			<entry class="" argb="255,0,85,170" value="170" />
+			<entry class="" argb="255,0,81,173" value="171" />
+			<entry class="" argb="255,0,77,177" value="172" />
+			<entry class="" argb="255,0,73,181" value="173" />
+			<entry class="" argb="255,0,69,185" value="174" />
+			<entry class="" argb="255,0,65,189" value="175" />
+			<entry class="" argb="255,0,61,193" value="176" />
+			<entry class="" argb="255,0,57,197" value="177" />
+			<entry class="" argb="255,0,53,200" value="178" />
+			<entry class="" argb="255,0,49,204" value="179" />
+			<entry class="" argb="255,0,45,208" value="180" />
+			<entry class="" argb="255,0,41,212" value="181" />
+			<entry class="" argb="255,0,37,216" value="182" />
+			<entry class="" argb="255,0,33,220" value="183" />
+			<entry class="" argb="255,0,29,224" value="184" />
+			<entry class="" argb="255,0,25,227" value="185" />
+			<entry class="" argb="255,0,21,231" value="186" />
+			<entry class="" argb="255,0,17,235" value="187" />
+			<entry class="" argb="255,0,13,239" value="188" />
+			<entry class="" argb="255,0,9,243" value="189" />
+			<entry class="" argb="255,0,5,247" value="190" />
+			<entry class="" argb="255,0,0,251" value="191" />
+			<entry class="" argb="255,0,0,255" value="192" />
+			<entry class="" argb="255,0,0,251" value="193" />
+			<entry class="" argb="255,0,0,247" value="194" />
+			<entry class="" argb="255,0,0,243" value="195" />
+			<entry class="" argb="255,0,0,239" value="196" />
+			<entry class="" argb="255,0,0,235" value="197" />
+			<entry class="" argb="255,0,0,231" value="198" />
+			<entry class="" argb="255,0,0,227" value="199" />
+			<entry class="" argb="255,0,0,223" value="200" />
+			<entry class="" argb="255,0,0,219" value="201" />
+			<entry class="" argb="255,0,0,215" value="202" />
+			<entry class="" argb="255,0,0,211" value="203" />
+			<entry class="" argb="255,0,0,207" value="204" />
+			<entry class="" argb="255,0,0,203" value="205" />
+			<entry class="" argb="255,0,0,199" value="206" />
+			<entry class="" argb="255,0,0,195" value="207" />
+			<entry class="" argb="255,0,0,191" value="208" />
+			<entry class="" argb="255,0,0,187" value="209" />
+			<entry class="" argb="255,0,0,183" value="210" />
+			<entry class="" argb="255,0,0,179" value="211" />
+			<entry class="" argb="255,0,0,175" value="212" />
+			<entry class="" argb="255,0,0,170" value="213" />
+			<entry class="" argb="255,0,0,166" value="214" />
+			<entry class="" argb="255,0,0,162" value="215" />
+			<entry class="" argb="255,0,0,158" value="216" />
+			<entry class="" argb="255,0,0,154" value="217" />
+			<entry class="" argb="255,0,0,150" value="218" />
+			<entry class="" argb="255,0,0,146" value="219" />
+			<entry class="" argb="255,0,0,142" value="220" />
+			<entry class="" argb="255,0,0,138" value="221" />
+			<entry class="" argb="255,0,0,134" value="222" />
+			<entry class="" argb="255,0,0,130" value="223" />
+			<entry class="" argb="255,0,0,126" value="224" />
+			<entry class="" argb="255,0,0,122" value="225" />
+			<entry class="" argb="255,0,0,118" value="226" />
+			<entry class="" argb="255,0,0,114" value="227" />
+			<entry class="" argb="255,0,0,110" value="228" />
+			<entry class="" argb="255,0,0,106" value="229" />
+			<entry class="" argb="255,0,0,102" value="230" />
+			<entry class="" argb="255,0,0,98" value="231" />
+			<entry class="" argb="255,0,0,94" value="232" />
+			<entry class="" argb="255,0,0,90" value="233" />
+			<entry class="" argb="255,0,0,85" value="234" />
+			<entry class="" argb="255,0,0,81" value="235" />
+			<entry class="" argb="255,0,0,77" value="236" />
+			<entry class="" argb="255,0,0,73" value="237" />
+			<entry class="" argb="255,0,0,69" value="238" />
+			<entry class="" argb="255,0,0,65" value="239" />
+			<entry class="" argb="255,0,0,61" value="240" />
+			<entry class="" argb="255,0,0,57" value="241" />
+			<entry class="" argb="255,0,0,53" value="242" />
+			<entry class="" argb="255,0,0,49" value="243" />
+			<entry class="" argb="255,0,0,45" value="244" />
+			<entry class="" argb="255,0,0,41" value="245" />
+			<entry class="" argb="255,0,0,37" value="246" />
+			<entry class="" argb="255,0,0,33" value="247" />
+			<entry class="" argb="255,0,0,29" value="248" />
+			<entry class="" argb="255,0,0,25" value="249" />
+			<entry class="" argb="255,0,0,21" value="250" />
+			<entry class="" argb="255,0,0,17" value="251" />
+			<entry class="" argb="255,0,0,13" value="252" />
+			<entry class="" argb="255,0,0,9" value="253" />
+			<entry class="" argb="255,0,0,5" value="254" />
+			<entry class="" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="rainbow" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,4,0,3" value="1" />
+			<entry class="" argb="255,9,0,7" value="2" />
+			<entry class="" argb="255,13,0,10" value="3" />
+			<entry class="" argb="255,18,0,14" value="4" />
+			<entry class="" argb="255,22,0,19" value="5" />
+			<entry class="" argb="255,27,0,23" value="6" />
+			<entry class="" argb="255,31,0,28" value="7" />
+			<entry class="" argb="255,36,0,32" value="8" />
+			<entry class="" argb="255,40,0,38" value="9" />
+			<entry class="" argb="255,45,0,43" value="10" />
+			<entry class="" argb="255,50,0,48" value="11" />
+			<entry class="" argb="255,54,0,53" value="12" />
+			<entry class="" argb="255,58,0,59" value="13" />
+			<entry class="" argb="255,61,0,63" value="14" />
+			<entry class="" argb="255,64,0,68" value="15" />
+			<entry class="" argb="255,68,0,72" value="16" />
+			<entry class="" argb="255,69,0,77" value="17" />
+			<entry class="" argb="255,72,0,81" value="18" />
+			<entry class="" argb="255,74,0,86" value="19" />
+			<entry class="" argb="255,77,0,91" value="20" />
+			<entry class="" argb="255,79,0,95" value="21" />
+			<entry class="" argb="255,80,0,100" value="22" />
+			<entry class="" argb="255,82,0,104" value="23" />
+			<entry class="" argb="255,83,0,109" value="24" />
+			<entry class="" argb="255,85,0,113" value="25" />
+			<entry class="" argb="255,84,0,118" value="26" />
+			<entry class="" argb="255,86,0,122" value="27" />
+			<entry class="" argb="255,87,0,127" value="28" />
+			<entry class="" argb="255,88,0,132" value="29" />
+			<entry class="" argb="255,86,0,136" value="30" />
+			<entry class="" argb="255,87,0,141" value="31" />
+			<entry class="" argb="255,87,0,145" value="32" />
+			<entry class="" argb="255,87,0,150" value="33" />
+			<entry class="" argb="255,85,0,154" value="34" />
+			<entry class="" argb="255,84,0,159" value="35" />
+			<entry class="" argb="255,84,0,163" value="36" />
+			<entry class="" argb="255,84,0,168" value="37" />
+			<entry class="" argb="255,83,0,173" value="38" />
+			<entry class="" argb="255,79,0,177" value="39" />
+			<entry class="" argb="255,78,0,182" value="40" />
+			<entry class="" argb="255,77,0,186" value="41" />
+			<entry class="" argb="255,76,0,191" value="42" />
+			<entry class="" argb="255,71,0,195" value="43" />
+			<entry class="" argb="255,70,0,200" value="44" />
+			<entry class="" argb="255,68,0,204" value="45" />
+			<entry class="" argb="255,66,0,209" value="46" />
+			<entry class="" argb="255,60,0,214" value="47" />
+			<entry class="" argb="255,58,0,218" value="48" />
+			<entry class="" argb="255,55,0,223" value="49" />
+			<entry class="" argb="255,53,0,227" value="50" />
+			<entry class="" argb="255,46,0,232" value="51" />
+			<entry class="" argb="255,43,0,236" value="52" />
+			<entry class="" argb="255,40,0,241" value="53" />
+			<entry class="" argb="255,36,0,245" value="54" />
+			<entry class="" argb="255,33,0,250" value="55" />
+			<entry class="" argb="255,25,0,255" value="56" />
+			<entry class="" argb="255,21,0,255" value="57" />
+			<entry class="" argb="255,16,0,255" value="58" />
+			<entry class="" argb="255,12,0,255" value="59" />
+			<entry class="" argb="255,4,0,255" value="60" />
+			<entry class="" argb="255,0,0,255" value="61" />
+			<entry class="" argb="255,0,4,255" value="62" />
+			<entry class="" argb="255,0,8,255" value="63" />
+			<entry class="" argb="255,0,16,255" value="64" />
+			<entry class="" argb="255,0,21,255" value="65" />
+			<entry class="" argb="255,0,25,255" value="66" />
+			<entry class="" argb="255,0,29,255" value="67" />
+			<entry class="" argb="255,0,38,255" value="68" />
+			<entry class="" argb="255,0,42,255" value="69" />
+			<entry class="" argb="255,0,46,255" value="70" />
+			<entry class="" argb="255,0,51,255" value="71" />
+			<entry class="" argb="255,0,55,255" value="72" />
+			<entry class="" argb="255,0,63,255" value="73" />
+			<entry class="" argb="255,0,67,255" value="74" />
+			<entry class="" argb="255,0,72,255" value="75" />
+			<entry class="" argb="255,0,76,255" value="76" />
+			<entry class="" argb="255,0,84,255" value="77" />
+			<entry class="" argb="255,0,89,255" value="78" />
+			<entry class="" argb="255,0,93,255" value="79" />
+			<entry class="" argb="255,0,97,255" value="80" />
+			<entry class="" argb="255,0,106,255" value="81" />
+			<entry class="" argb="255,0,110,255" value="82" />
+			<entry class="" argb="255,0,114,255" value="83" />
+			<entry class="" argb="255,0,119,255" value="84" />
+			<entry class="" argb="255,0,127,255" value="85" />
+			<entry class="" argb="255,0,131,255" value="86" />
+			<entry class="" argb="255,0,135,255" value="87" />
+			<entry class="" argb="255,0,140,255" value="88" />
+			<entry class="" argb="255,0,144,255" value="89" />
+			<entry class="" argb="255,0,152,255" value="90" />
+			<entry class="" argb="255,0,157,255" value="91" />
+			<entry class="" argb="255,0,161,255" value="92" />
+			<entry class="" argb="255,0,165,255" value="93" />
+			<entry class="" argb="255,0,174,255" value="94" />
+			<entry class="" argb="255,0,178,255" value="95" />
+			<entry class="" argb="255,0,182,255" value="96" />
+			<entry class="" argb="255,0,187,255" value="97" />
+			<entry class="" argb="255,0,195,255" value="98" />
+			<entry class="" argb="255,0,199,255" value="99" />
+			<entry class="" argb="255,0,203,255" value="100" />
+			<entry class="" argb="255,0,208,255" value="101" />
+			<entry class="" argb="255,0,216,255" value="102" />
+			<entry class="" argb="255,0,220,255" value="103" />
+			<entry class="" argb="255,0,225,255" value="104" />
+			<entry class="" argb="255,0,229,255" value="105" />
+			<entry class="" argb="255,0,233,255" value="106" />
+			<entry class="" argb="255,0,242,255" value="107" />
+			<entry class="" argb="255,0,246,255" value="108" />
+			<entry class="" argb="255,0,250,255" value="109" />
+			<entry class="" argb="255,0,255,255" value="110" />
+			<entry class="" argb="255,0,255,246" value="111" />
+			<entry class="" argb="255,0,255,242" value="112" />
+			<entry class="" argb="255,0,255,238" value="113" />
+			<entry class="" argb="255,0,255,233" value="114" />
+			<entry class="" argb="255,0,255,225" value="115" />
+			<entry class="" argb="255,0,255,220" value="116" />
+			<entry class="" argb="255,0,255,216" value="117" />
+			<entry class="" argb="255,0,255,212" value="118" />
+			<entry class="" argb="255,0,255,203" value="119" />
+			<entry class="" argb="255,0,255,199" value="120" />
+			<entry class="" argb="255,0,255,195" value="121" />
+			<entry class="" argb="255,0,255,191" value="122" />
+			<entry class="" argb="255,0,255,187" value="123" />
+			<entry class="" argb="255,0,255,178" value="124" />
+			<entry class="" argb="255,0,255,174" value="125" />
+			<entry class="" argb="255,0,255,170" value="126" />
+			<entry class="" argb="255,0,255,165" value="127" />
+			<entry class="" argb="255,0,255,157" value="128" />
+			<entry class="" argb="255,0,255,152" value="129" />
+			<entry class="" argb="255,0,255,148" value="130" />
+			<entry class="" argb="255,0,255,144" value="131" />
+			<entry class="" argb="255,0,255,135" value="132" />
+			<entry class="" argb="255,0,255,131" value="133" />
+			<entry class="" argb="255,0,255,127" value="134" />
+			<entry class="" argb="255,0,255,123" value="135" />
+			<entry class="" argb="255,0,255,114" value="136" />
+			<entry class="" argb="255,0,255,110" value="137" />
+			<entry class="" argb="255,0,255,106" value="138" />
+			<entry class="" argb="255,0,255,102" value="139" />
+			<entry class="" argb="255,0,255,97" value="140" />
+			<entry class="" argb="255,0,255,89" value="141" />
+			<entry class="" argb="255,0,255,84" value="142" />
+			<entry class="" argb="255,0,255,80" value="143" />
+			<entry class="" argb="255,0,255,76" value="144" />
+			<entry class="" argb="255,0,255,67" value="145" />
+			<entry class="" argb="255,0,255,63" value="146" />
+			<entry class="" argb="255,0,255,59" value="147" />
+			<entry class="" argb="255,0,255,55" value="148" />
+			<entry class="" argb="255,0,255,46" value="149" />
+			<entry class="" argb="255,0,255,42" value="150" />
+			<entry class="" argb="255,0,255,38" value="151" />
+			<entry class="" argb="255,0,255,34" value="152" />
+			<entry class="" argb="255,0,255,25" value="153" />
+			<entry class="" argb="255,0,255,21" value="154" />
+			<entry class="" argb="255,0,255,16" value="155" />
+			<entry class="" argb="255,0,255,12" value="156" />
+			<entry class="" argb="255,0,255,8" value="157" />
+			<entry class="" argb="255,0,255,0" value="158" />
+			<entry class="" argb="255,4,255,0" value="159" />
+			<entry class="" argb="255,8,255,0" value="160" />
+			<entry class="" argb="255,12,255,0" value="161" />
+			<entry class="" argb="255,21,255,0" value="162" />
+			<entry class="" argb="255,25,255,0" value="163" />
+			<entry class="" argb="255,29,255,0" value="164" />
+			<entry class="" argb="255,33,255,0" value="165" />
+			<entry class="" argb="255,42,255,0" value="166" />
+			<entry class="" argb="255,46,255,0" value="167" />
+			<entry class="" argb="255,51,255,0" value="168" />
+			<entry class="" argb="255,55,255,0" value="169" />
+			<entry class="" argb="255,63,255,0" value="170" />
+			<entry class="" argb="255,67,255,0" value="171" />
+			<entry class="" argb="255,72,255,0" value="172" />
+			<entry class="" argb="255,76,255,0" value="173" />
+			<entry class="" argb="255,80,255,0" value="174" />
+			<entry class="" argb="255,89,255,0" value="175" />
+			<entry class="" argb="255,93,255,0" value="176" />
+			<entry class="" argb="255,97,255,0" value="177" />
+			<entry class="" argb="255,101,255,0" value="178" />
+			<entry class="" argb="255,110,255,0" value="179" />
+			<entry class="" argb="255,114,255,0" value="180" />
+			<entry class="" argb="255,119,255,0" value="181" />
+			<entry class="" argb="255,123,255,0" value="182" />
+			<entry class="" argb="255,131,255,0" value="183" />
+			<entry class="" argb="255,135,255,0" value="184" />
+			<entry class="" argb="255,140,255,0" value="185" />
+			<entry class="" argb="255,144,255,0" value="186" />
+			<entry class="" argb="255,153,255,0" value="187" />
+			<entry class="" argb="255,157,255,0" value="188" />
+			<entry class="" argb="255,161,255,0" value="189" />
+			<entry class="" argb="255,165,255,0" value="190" />
+			<entry class="" argb="255,169,255,0" value="191" />
+			<entry class="" argb="255,178,255,0" value="192" />
+			<entry class="" argb="255,182,255,0" value="193" />
+			<entry class="" argb="255,187,255,0" value="194" />
+			<entry class="" argb="255,191,255,0" value="195" />
+			<entry class="" argb="255,199,255,0" value="196" />
+			<entry class="" argb="255,203,255,0" value="197" />
+			<entry class="" argb="255,208,255,0" value="198" />
+			<entry class="" argb="255,212,255,0" value="199" />
+			<entry class="" argb="255,221,255,0" value="200" />
+			<entry class="" argb="255,225,255,0" value="201" />
+			<entry class="" argb="255,229,255,0" value="202" />
+			<entry class="" argb="255,233,255,0" value="203" />
+			<entry class="" argb="255,242,255,0" value="204" />
+			<entry class="" argb="255,246,255,0" value="205" />
+			<entry class="" argb="255,250,255,0" value="206" />
+			<entry class="" argb="255,255,255,0" value="207" />
+			<entry class="" argb="255,255,250,0" value="208" />
+			<entry class="" argb="255,255,242,0" value="209" />
+			<entry class="" argb="255,255,238,0" value="210" />
+			<entry class="" argb="255,255,233,0" value="211" />
+			<entry class="" argb="255,255,229,0" value="212" />
+			<entry class="" argb="255,255,221,0" value="213" />
+			<entry class="" argb="255,255,216,0" value="214" />
+			<entry class="" argb="255,255,212,0" value="215" />
+			<entry class="" argb="255,255,208,0" value="216" />
+			<entry class="" argb="255,255,199,0" value="217" />
+			<entry class="" argb="255,255,195,0" value="218" />
+			<entry class="" argb="255,255,191,0" value="219" />
+			<entry class="" argb="255,255,187,0" value="220" />
+			<entry class="" argb="255,255,178,0" value="221" />
+			<entry class="" argb="255,255,174,0" value="222" />
+			<entry class="" argb="255,255,170,0" value="223" />
+			<entry class="" argb="255,255,165,0" value="224" />
+			<entry class="" argb="255,255,161,0" value="225" />
+			<entry class="" argb="255,255,153,0" value="226" />
+			<entry class="" argb="255,255,148,0" value="227" />
+			<entry class="" argb="255,255,144,0" value="228" />
+			<entry class="" argb="255,255,140,0" value="229" />
+			<entry class="" argb="255,255,131,0" value="230" />
+			<entry class="" argb="255,255,127,0" value="231" />
+			<entry class="" argb="255,255,123,0" value="232" />
+			<entry class="" argb="255,255,119,0" value="233" />
+			<entry class="" argb="255,255,110,0" value="234" />
+			<entry class="" argb="255,255,106,0" value="235" />
+			<entry class="" argb="255,255,102,0" value="236" />
+			<entry class="" argb="255,255,97,0" value="237" />
+			<entry class="" argb="255,255,89,0" value="238" />
+			<entry class="" argb="255,255,85,0" value="239" />
+			<entry class="" argb="255,255,80,0" value="240" />
+			<entry class="" argb="255,255,76,0" value="241" />
+			<entry class="" argb="255,255,72,0" value="242" />
+			<entry class="" argb="255,255,63,0" value="243" />
+			<entry class="" argb="255,255,59,0" value="244" />
+			<entry class="" argb="255,255,55,0" value="245" />
+			<entry class="" argb="255,255,51,0" value="246" />
+			<entry class="" argb="255,255,42,0" value="247" />
+			<entry class="" argb="255,255,38,0" value="248" />
+			<entry class="" argb="255,255,34,0" value="249" />
+			<entry class="" argb="255,255,29,0" value="250" />
+			<entry class="" argb="255,255,21,0" value="251" />
+			<entry class="" argb="255,255,17,0" value="252" />
+			<entry class="" argb="255,255,12,0" value="253" />
+			<entry class="" argb="255,255,8,0" value="254" />
+			<entry class="" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="red-purple" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,0" value="1" />
+			<entry class="" argb="255,3,0,0" value="2" />
+			<entry class="" argb="255,6,0,0" value="3" />
+			<entry class="" argb="255,10,0,0" value="4" />
+			<entry class="" argb="255,13,0,0" value="5" />
+			<entry class="" argb="255,17,0,0" value="6" />
+			<entry class="" argb="255,20,0,0" value="7" />
+			<entry class="" argb="255,24,0,1" value="8" />
+			<entry class="" argb="255,27,0,1" value="9" />
+			<entry class="" argb="255,30,0,1" value="10" />
+			<entry class="" argb="255,33,0,1" value="11" />
+			<entry class="" argb="255,36,0,2" value="12" />
+			<entry class="" argb="255,39,0,2" value="13" />
+			<entry class="" argb="255,42,0,2" value="14" />
+			<entry class="" argb="255,45,0,2" value="15" />
+			<entry class="" argb="255,48,0,2" value="16" />
+			<entry class="" argb="255,51,0,2" value="17" />
+			<entry class="" argb="255,54,0,2" value="18" />
+			<entry class="" argb="255,57,0,2" value="19" />
+			<entry class="" argb="255,60,0,3" value="20" />
+			<entry class="" argb="255,63,0,3" value="21" />
+			<entry class="" argb="255,66,0,3" value="22" />
+			<entry class="" argb="255,69,0,3" value="23" />
+			<entry class="" argb="255,72,0,4" value="24" />
+			<entry class="" argb="255,75,0,4" value="25" />
+			<entry class="" argb="255,78,0,4" value="26" />
+			<entry class="" argb="255,81,0,4" value="27" />
+			<entry class="" argb="255,84,0,4" value="28" />
+			<entry class="" argb="255,85,0,5" value="29" />
+			<entry class="" argb="255,86,0,6" value="30" />
+			<entry class="" argb="255,87,0,7" value="31" />
+			<entry class="" argb="255,88,0,9" value="32" />
+			<entry class="" argb="255,90,0,9" value="33" />
+			<entry class="" argb="255,92,0,10" value="34" />
+			<entry class="" argb="255,94,0,11" value="35" />
+			<entry class="" argb="255,96,0,12" value="36" />
+			<entry class="" argb="255,97,0,13" value="37" />
+			<entry class="" argb="255,98,0,14" value="38" />
+			<entry class="" argb="255,99,0,15" value="39" />
+			<entry class="" argb="255,100,0,17" value="40" />
+			<entry class="" argb="255,102,0,17" value="41" />
+			<entry class="" argb="255,104,0,18" value="42" />
+			<entry class="" argb="255,106,0,18" value="43" />
+			<entry class="" argb="255,108,0,19" value="44" />
+			<entry class="" argb="255,109,0,20" value="45" />
+			<entry class="" argb="255,110,0,22" value="46" />
+			<entry class="" argb="255,111,0,23" value="47" />
+			<entry class="" argb="255,112,0,25" value="48" />
+			<entry class="" argb="255,114,0,25" value="49" />
+			<entry class="" argb="255,116,0,26" value="50" />
+			<entry class="" argb="255,118,0,26" value="51" />
+			<entry class="" argb="255,120,0,27" value="52" />
+			<entry class="" argb="255,121,0,28" value="53" />
+			<entry class="" argb="255,122,0,29" value="54" />
+			<entry class="" argb="255,123,0,30" value="55" />
+			<entry class="" argb="255,124,0,32" value="56" />
+			<entry class="" argb="255,126,0,32" value="57" />
+			<entry class="" argb="255,128,0,33" value="58" />
+			<entry class="" argb="255,130,0,33" value="59" />
+			<entry class="" argb="255,132,0,34" value="60" />
+			<entry class="" argb="255,133,0,35" value="61" />
+			<entry class="" argb="255,134,0,36" value="62" />
+			<entry class="" argb="255,135,0,37" value="63" />
+			<entry class="" argb="255,136,0,39" value="64" />
+			<entry class="" argb="255,138,1,39" value="65" />
+			<entry class="" argb="255,140,2,40" value="66" />
+			<entry class="" argb="255,142,3,40" value="67" />
+			<entry class="" argb="255,144,4,41" value="68" />
+			<entry class="" argb="255,145,4,42" value="69" />
+			<entry class="" argb="255,146,4,43" value="70" />
+			<entry class="" argb="255,147,4,44" value="71" />
+			<entry class="" argb="255,148,4,46" value="72" />
+			<entry class="" argb="255,150,4,46" value="73" />
+			<entry class="" argb="255,152,4,47" value="74" />
+			<entry class="" argb="255,154,4,48" value="75" />
+			<entry class="" argb="255,156,4,49" value="76" />
+			<entry class="" argb="255,157,4,50" value="77" />
+			<entry class="" argb="255,158,4,51" value="78" />
+			<entry class="" argb="255,159,4,52" value="79" />
+			<entry class="" argb="255,160,4,54" value="80" />
+			<entry class="" argb="255,162,5,54" value="81" />
+			<entry class="" argb="255,164,6,53" value="82" />
+			<entry class="" argb="255,166,7,53" value="83" />
+			<entry class="" argb="255,168,8,52" value="84" />
+			<entry class="" argb="255,169,8,54" value="85" />
+			<entry class="" argb="255,170,8,56" value="86" />
+			<entry class="" argb="255,171,8,58" value="87" />
+			<entry class="" argb="255,172,8,60" value="88" />
+			<entry class="" argb="255,174,8,60" value="89" />
+			<entry class="" argb="255,176,8,61" value="90" />
+			<entry class="" argb="255,178,8,62" value="91" />
+			<entry class="" argb="255,180,8,63" value="92" />
+			<entry class="" argb="255,181,8,64" value="93" />
+			<entry class="" argb="255,182,8,65" value="94" />
+			<entry class="" argb="255,183,8,66" value="95" />
+			<entry class="" argb="255,184,8,68" value="96" />
+			<entry class="" argb="255,185,8,69" value="97" />
+			<entry class="" argb="255,186,8,70" value="98" />
+			<entry class="" argb="255,187,8,71" value="99" />
+			<entry class="" argb="255,188,8,73" value="100" />
+			<entry class="" argb="255,189,8,74" value="101" />
+			<entry class="" argb="255,190,8,75" value="102" />
+			<entry class="" argb="255,191,8,76" value="103" />
+			<entry class="" argb="255,192,8,77" value="104" />
+			<entry class="" argb="255,193,8,78" value="105" />
+			<entry class="" argb="255,194,8,79" value="106" />
+			<entry class="" argb="255,195,8,80" value="107" />
+			<entry class="" argb="255,196,8,82" value="108" />
+			<entry class="" argb="255,198,9,82" value="109" />
+			<entry class="" argb="255,200,10,83" value="110" />
+			<entry class="" argb="255,202,11,83" value="111" />
+			<entry class="" argb="255,204,12,84" value="112" />
+			<entry class="" argb="255,205,12,85" value="113" />
+			<entry class="" argb="255,206,12,86" value="114" />
+			<entry class="" argb="255,207,12,87" value="115" />
+			<entry class="" argb="255,208,12,89" value="116" />
+			<entry class="" argb="255,209,12,90" value="117" />
+			<entry class="" argb="255,210,12,91" value="118" />
+			<entry class="" argb="255,211,12,92" value="119" />
+			<entry class="" argb="255,212,12,94" value="120" />
+			<entry class="" argb="255,213,12,95" value="121" />
+			<entry class="" argb="255,214,12,96" value="122" />
+			<entry class="" argb="255,215,12,97" value="123" />
+			<entry class="" argb="255,216,12,98" value="124" />
+			<entry class="" argb="255,217,12,99" value="125" />
+			<entry class="" argb="255,218,12,100" value="126" />
+			<entry class="" argb="255,219,12,101" value="127" />
+			<entry class="" argb="255,220,12,103" value="128" />
+			<entry class="" argb="255,222,12,103" value="129" />
+			<entry class="" argb="255,224,12,104" value="130" />
+			<entry class="" argb="255,226,12,105" value="131" />
+			<entry class="" argb="255,228,12,106" value="132" />
+			<entry class="" argb="255,229,13,107" value="133" />
+			<entry class="" argb="255,230,14,108" value="134" />
+			<entry class="" argb="255,231,15,109" value="135" />
+			<entry class="" argb="255,232,16,110" value="136" />
+			<entry class="" argb="255,233,16,111" value="137" />
+			<entry class="" argb="255,234,16,112" value="138" />
+			<entry class="" argb="255,235,16,113" value="139" />
+			<entry class="" argb="255,236,16,115" value="140" />
+			<entry class="" argb="255,237,16,116" value="141" />
+			<entry class="" argb="255,238,16,117" value="142" />
+			<entry class="" argb="255,239,16,118" value="143" />
+			<entry class="" argb="255,240,16,119" value="144" />
+			<entry class="" argb="255,241,16,120" value="145" />
+			<entry class="" argb="255,242,16,121" value="146" />
+			<entry class="" argb="255,243,16,122" value="147" />
+			<entry class="" argb="255,244,16,124" value="148" />
+			<entry class="" argb="255,246,16,124" value="149" />
+			<entry class="" argb="255,248,16,125" value="150" />
+			<entry class="" argb="255,250,16,125" value="151" />
+			<entry class="" argb="255,252,16,126" value="152" />
+			<entry class="" argb="255,252,17,127" value="153" />
+			<entry class="" argb="255,252,18,129" value="154" />
+			<entry class="" argb="255,252,19,131" value="155" />
+			<entry class="" argb="255,252,20,133" value="156" />
+			<entry class="" argb="255,252,20,134" value="157" />
+			<entry class="" argb="255,252,20,136" value="158" />
+			<entry class="" argb="255,252,20,138" value="159" />
+			<entry class="" argb="255,252,20,140" value="160" />
+			<entry class="" argb="255,252,21,141" value="161" />
+			<entry class="" argb="255,252,22,143" value="162" />
+			<entry class="" argb="255,252,23,144" value="163" />
+			<entry class="" argb="255,252,24,146" value="164" />
+			<entry class="" argb="255,252,24,147" value="165" />
+			<entry class="" argb="255,252,24,149" value="166" />
+			<entry class="" argb="255,252,24,151" value="167" />
+			<entry class="" argb="255,252,24,153" value="168" />
+			<entry class="" argb="255,252,25,154" value="169" />
+			<entry class="" argb="255,252,26,156" value="170" />
+			<entry class="" argb="255,252,27,157" value="171" />
+			<entry class="" argb="255,252,28,159" value="172" />
+			<entry class="" argb="255,252,30,160" value="173" />
+			<entry class="" argb="255,252,32,161" value="174" />
+			<entry class="" argb="255,252,34,162" value="175" />
+			<entry class="" argb="255,252,36,164" value="176" />
+			<entry class="" argb="255,252,38,165" value="177" />
+			<entry class="" argb="255,252,40,166" value="178" />
+			<entry class="" argb="255,252,42,167" value="179" />
+			<entry class="" argb="255,252,44,169" value="180" />
+			<entry class="" argb="255,252,46,170" value="181" />
+			<entry class="" argb="255,252,48,172" value="182" />
+			<entry class="" argb="255,252,50,173" value="183" />
+			<entry class="" argb="255,252,52,175" value="184" />
+			<entry class="" argb="255,252,54,176" value="185" />
+			<entry class="" argb="255,252,56,177" value="186" />
+			<entry class="" argb="255,252,58,178" value="187" />
+			<entry class="" argb="255,252,60,180" value="188" />
+			<entry class="" argb="255,252,61,181" value="189" />
+			<entry class="" argb="255,252,62,183" value="190" />
+			<entry class="" argb="255,252,63,184" value="191" />
+			<entry class="" argb="255,252,64,186" value="192" />
+			<entry class="" argb="255,252,66,187" value="193" />
+			<entry class="" argb="255,252,68,188" value="194" />
+			<entry class="" argb="255,252,70,189" value="195" />
+			<entry class="" argb="255,252,72,191" value="196" />
+			<entry class="" argb="255,252,74,192" value="197" />
+			<entry class="" argb="255,252,76,193" value="198" />
+			<entry class="" argb="255,252,78,194" value="199" />
+			<entry class="" argb="255,252,80,196" value="200" />
+			<entry class="" argb="255,252,82,197" value="201" />
+			<entry class="" argb="255,252,84,199" value="202" />
+			<entry class="" argb="255,252,86,200" value="203" />
+			<entry class="" argb="255,252,88,202" value="204" />
+			<entry class="" argb="255,252,90,203" value="205" />
+			<entry class="" argb="255,252,92,204" value="206" />
+			<entry class="" argb="255,252,94,205" value="207" />
+			<entry class="" argb="255,252,96,207" value="208" />
+			<entry class="" argb="255,252,98,208" value="209" />
+			<entry class="" argb="255,252,100,209" value="210" />
+			<entry class="" argb="255,252,102,210" value="211" />
+			<entry class="" argb="255,252,104,212" value="212" />
+			<entry class="" argb="255,252,107,213" value="213" />
+			<entry class="" argb="255,252,110,214" value="214" />
+			<entry class="" argb="255,252,113,215" value="215" />
+			<entry class="" argb="255,252,116,217" value="216" />
+			<entry class="" argb="255,252,119,218" value="217" />
+			<entry class="" argb="255,252,122,219" value="218" />
+			<entry class="" argb="255,252,125,220" value="219" />
+			<entry class="" argb="255,252,128,221" value="220" />
+			<entry class="" argb="255,252,131,222" value="221" />
+			<entry class="" argb="255,252,134,223" value="222" />
+			<entry class="" argb="255,252,137,224" value="223" />
+			<entry class="" argb="255,252,140,226" value="224" />
+			<entry class="" argb="255,252,143,227" value="225" />
+			<entry class="" argb="255,252,146,228" value="226" />
+			<entry class="" argb="255,252,149,229" value="227" />
+			<entry class="" argb="255,252,152,230" value="228" />
+			<entry class="" argb="255,252,155,231" value="229" />
+			<entry class="" argb="255,252,158,232" value="230" />
+			<entry class="" argb="255,252,161,233" value="231" />
+			<entry class="" argb="255,252,164,235" value="232" />
+			<entry class="" argb="255,252,167,236" value="233" />
+			<entry class="" argb="255,252,170,237" value="234" />
+			<entry class="" argb="255,252,173,238" value="235" />
+			<entry class="" argb="255,252,176,239" value="236" />
+			<entry class="" argb="255,252,180,240" value="237" />
+			<entry class="" argb="255,252,184,241" value="238" />
+			<entry class="" argb="255,252,188,242" value="239" />
+			<entry class="" argb="255,252,192,243" value="240" />
+			<entry class="" argb="255,252,197,243" value="241" />
+			<entry class="" argb="255,252,202,244" value="242" />
+			<entry class="" argb="255,252,207,245" value="243" />
+			<entry class="" argb="255,252,212,246" value="244" />
+			<entry class="" argb="255,252,217,246" value="245" />
+			<entry class="" argb="255,252,222,247" value="246" />
+			<entry class="" argb="255,252,227,248" value="247" />
+			<entry class="" argb="255,252,232,249" value="248" />
+			<entry class="" argb="255,252,237,249" value="249" />
+			<entry class="" argb="255,252,242,250" value="250" />
+			<entry class="" argb="255,252,247,251" value="251" />
+			<entry class="" argb="255,252,252,252" value="252" />
+			<entry class="" argb="255,252,252,252" value="253" />
+			<entry class="" argb="255,253,253,253" value="254" />
+			<entry class="" argb="255,254,254,254" value="255" />
+		</table>
+	</palette>
+
+	<palette name="std-gamma-II" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,5" value="1" />
+			<entry class="" argb="255,0,0,10" value="2" />
+			<entry class="" argb="255,0,0,15" value="3" />
+			<entry class="" argb="255,0,0,20" value="4" />
+			<entry class="" argb="255,0,0,26" value="5" />
+			<entry class="" argb="255,0,0,31" value="6" />
+			<entry class="" argb="255,0,0,36" value="7" />
+			<entry class="" argb="255,0,0,41" value="8" />
+			<entry class="" argb="255,0,0,46" value="9" />
+			<entry class="" argb="255,0,0,52" value="10" />
+			<entry class="" argb="255,0,0,57" value="11" />
+			<entry class="" argb="255,0,0,62" value="12" />
+			<entry class="" argb="255,0,0,67" value="13" />
+			<entry class="" argb="255,0,0,72" value="14" />
+			<entry class="" argb="255,0,0,78" value="15" />
+			<entry class="" argb="255,0,0,83" value="16" />
+			<entry class="" argb="255,0,0,88" value="17" />
+			<entry class="" argb="255,0,0,93" value="18" />
+			<entry class="" argb="255,0,0,98" value="19" />
+			<entry class="" argb="255,0,0,104" value="20" />
+			<entry class="" argb="255,0,0,109" value="21" />
+			<entry class="" argb="255,0,0,114" value="22" />
+			<entry class="" argb="255,0,0,119" value="23" />
+			<entry class="" argb="255,0,0,124" value="24" />
+			<entry class="" argb="255,0,0,130" value="25" />
+			<entry class="" argb="255,0,0,135" value="26" />
+			<entry class="" argb="255,0,0,140" value="27" />
+			<entry class="" argb="255,0,0,145" value="28" />
+			<entry class="" argb="255,0,0,150" value="29" />
+			<entry class="" argb="255,0,0,156" value="30" />
+			<entry class="" argb="255,0,0,161" value="31" />
+			<entry class="" argb="255,0,0,166" value="32" />
+			<entry class="" argb="255,0,0,171" value="33" />
+			<entry class="" argb="255,0,0,176" value="34" />
+			<entry class="" argb="255,0,0,182" value="35" />
+			<entry class="" argb="255,0,0,187" value="36" />
+			<entry class="" argb="255,0,0,192" value="37" />
+			<entry class="" argb="255,0,0,197" value="38" />
+			<entry class="" argb="255,0,0,202" value="39" />
+			<entry class="" argb="255,0,0,208" value="40" />
+			<entry class="" argb="255,0,0,213" value="41" />
+			<entry class="" argb="255,0,0,218" value="42" />
+			<entry class="" argb="255,0,0,223" value="43" />
+			<entry class="" argb="255,0,0,228" value="44" />
+			<entry class="" argb="255,0,0,234" value="45" />
+			<entry class="" argb="255,0,0,239" value="46" />
+			<entry class="" argb="255,0,0,244" value="47" />
+			<entry class="" argb="255,4,0,249" value="48" />
+			<entry class="" argb="255,9,0,255" value="49" />
+			<entry class="" argb="255,14,0,250" value="50" />
+			<entry class="" argb="255,19,0,245" value="51" />
+			<entry class="" argb="255,23,0,239" value="52" />
+			<entry class="" argb="255,28,0,234" value="53" />
+			<entry class="" argb="255,33,0,228" value="54" />
+			<entry class="" argb="255,38,0,223" value="55" />
+			<entry class="" argb="255,42,0,218" value="56" />
+			<entry class="" argb="255,47,0,212" value="57" />
+			<entry class="" argb="255,52,0,207" value="58" />
+			<entry class="" argb="255,57,0,201" value="59" />
+			<entry class="" argb="255,61,0,196" value="60" />
+			<entry class="" argb="255,66,0,190" value="61" />
+			<entry class="" argb="255,71,0,185" value="62" />
+			<entry class="" argb="255,76,0,180" value="63" />
+			<entry class="" argb="255,81,0,174" value="64" />
+			<entry class="" argb="255,81,0,169" value="65" />
+			<entry class="" argb="255,81,0,163" value="66" />
+			<entry class="" argb="255,81,0,158" value="67" />
+			<entry class="" argb="255,81,0,152" value="68" />
+			<entry class="" argb="255,81,0,147" value="69" />
+			<entry class="" argb="255,81,0,142" value="70" />
+			<entry class="" argb="255,81,0,136" value="71" />
+			<entry class="" argb="255,80,0,131" value="72" />
+			<entry class="" argb="255,80,0,125" value="73" />
+			<entry class="" argb="255,80,0,120" value="74" />
+			<entry class="" argb="255,80,0,114" value="75" />
+			<entry class="" argb="255,80,0,109" value="76" />
+			<entry class="" argb="255,80,0,104" value="77" />
+			<entry class="" argb="255,80,0,98" value="78" />
+			<entry class="" argb="255,79,0,93" value="79" />
+			<entry class="" argb="255,84,0,87" value="80" />
+			<entry class="" argb="255,89,0,82" value="81" />
+			<entry class="" argb="255,94,0,76" value="82" />
+			<entry class="" argb="255,99,0,71" value="83" />
+			<entry class="" argb="255,104,0,66" value="84" />
+			<entry class="" argb="255,109,0,60" value="85" />
+			<entry class="" argb="255,114,0,55" value="86" />
+			<entry class="" argb="255,119,0,49" value="87" />
+			<entry class="" argb="255,124,0,44" value="88" />
+			<entry class="" argb="255,129,0,38" value="89" />
+			<entry class="" argb="255,134,0,33" value="90" />
+			<entry class="" argb="255,139,0,28" value="91" />
+			<entry class="" argb="255,144,0,22" value="92" />
+			<entry class="" argb="255,149,0,17" value="93" />
+			<entry class="" argb="255,154,0,11" value="94" />
+			<entry class="" argb="255,159,0,6" value="95" />
+			<entry class="" argb="255,164,0,0" value="96" />
+			<entry class="" argb="255,169,0,0" value="97" />
+			<entry class="" argb="255,174,0,0" value="98" />
+			<entry class="" argb="255,180,0,0" value="99" />
+			<entry class="" argb="255,185,0,0" value="100" />
+			<entry class="" argb="255,190,0,0" value="101" />
+			<entry class="" argb="255,196,0,0" value="102" />
+			<entry class="" argb="255,201,0,0" value="103" />
+			<entry class="" argb="255,206,0,0" value="104" />
+			<entry class="" argb="255,212,0,0" value="105" />
+			<entry class="" argb="255,217,0,0" value="106" />
+			<entry class="" argb="255,222,0,0" value="107" />
+			<entry class="" argb="255,228,0,0" value="108" />
+			<entry class="" argb="255,233,0,0" value="109" />
+			<entry class="" argb="255,255,0,0" value="110" />
+			<entry class="" argb="255,255,0,0" value="111" />
+			<entry class="" argb="255,255,0,0" value="112" />
+			<entry class="" argb="255,255,0,0" value="113" />
+			<entry class="" argb="255,255,5,0" value="114" />
+			<entry class="" argb="255,255,10,0" value="115" />
+			<entry class="" argb="255,255,16,0" value="116" />
+			<entry class="" argb="255,255,21,0" value="117" />
+			<entry class="" argb="255,255,27,0" value="118" />
+			<entry class="" argb="255,255,32,0" value="119" />
+			<entry class="" argb="255,255,37,0" value="120" />
+			<entry class="" argb="255,255,43,0" value="121" />
+			<entry class="" argb="255,255,48,0" value="122" />
+			<entry class="" argb="255,255,54,0" value="123" />
+			<entry class="" argb="255,255,59,0" value="124" />
+			<entry class="" argb="255,255,64,0" value="125" />
+			<entry class="" argb="255,255,70,0" value="126" />
+			<entry class="" argb="255,255,75,0" value="127" />
+			<entry class="" argb="255,255,81,0" value="128" />
+			<entry class="" argb="255,255,85,4" value="129" />
+			<entry class="" argb="255,255,90,9" value="130" />
+			<entry class="" argb="255,255,95,14" value="131" />
+			<entry class="" argb="255,255,100,19" value="132" />
+			<entry class="" argb="255,255,105,24" value="133" />
+			<entry class="" argb="255,255,109,28" value="134" />
+			<entry class="" argb="255,255,114,33" value="135" />
+			<entry class="" argb="255,255,119,38" value="136" />
+			<entry class="" argb="255,255,124,43" value="137" />
+			<entry class="" argb="255,255,129,48" value="138" />
+			<entry class="" argb="255,255,134,53" value="139" />
+			<entry class="" argb="255,255,138,57" value="140" />
+			<entry class="" argb="255,255,143,62" value="141" />
+			<entry class="" argb="255,255,148,67" value="142" />
+			<entry class="" argb="255,255,153,72" value="143" />
+			<entry class="" argb="255,255,158,77" value="144" />
+			<entry class="" argb="255,255,163,82" value="145" />
+			<entry class="" argb="255,255,163,77" value="146" />
+			<entry class="" argb="255,255,163,71" value="147" />
+			<entry class="" argb="255,255,163,65" value="148" />
+			<entry class="" argb="255,255,163,59" value="149" />
+			<entry class="" argb="255,255,163,53" value="150" />
+			<entry class="" argb="255,255,163,47" value="151" />
+			<entry class="" argb="255,255,163,41" value="152" />
+			<entry class="" argb="255,255,163,36" value="153" />
+			<entry class="" argb="255,255,163,30" value="154" />
+			<entry class="" argb="255,255,163,24" value="155" />
+			<entry class="" argb="255,255,163,18" value="156" />
+			<entry class="" argb="255,255,163,12" value="157" />
+			<entry class="" argb="255,255,163,6" value="158" />
+			<entry class="" argb="255,255,163,0" value="159" />
+			<entry class="" argb="255,255,163,0" value="160" />
+			<entry class="" argb="255,255,163,0" value="161" />
+			<entry class="" argb="255,255,163,0" value="162" />
+			<entry class="" argb="255,248,163,0" value="163" />
+			<entry class="" argb="255,240,163,0" value="164" />
+			<entry class="" argb="255,232,163,0" value="165" />
+			<entry class="" argb="255,225,163,0" value="166" />
+			<entry class="" argb="255,217,163,0" value="167" />
+			<entry class="" argb="255,209,163,0" value="168" />
+			<entry class="" argb="255,202,163,0" value="169" />
+			<entry class="" argb="255,194,163,0" value="170" />
+			<entry class="" argb="255,186,163,0" value="171" />
+			<entry class="" argb="255,179,163,0" value="172" />
+			<entry class="" argb="255,171,163,0" value="173" />
+			<entry class="" argb="255,163,163,0" value="174" />
+			<entry class="" argb="255,168,163,0" value="175" />
+			<entry class="" argb="255,173,163,0" value="176" />
+			<entry class="" argb="255,178,169,3" value="177" />
+			<entry class="" argb="255,183,175,6" value="178" />
+			<entry class="" argb="255,188,181,9" value="179" />
+			<entry class="" argb="255,193,187,12" value="180" />
+			<entry class="" argb="255,198,193,16" value="181" />
+			<entry class="" argb="255,203,199,19" value="182" />
+			<entry class="" argb="255,209,205,22" value="183" />
+			<entry class="" argb="255,214,212,25" value="184" />
+			<entry class="" argb="255,219,218,29" value="185" />
+			<entry class="" argb="255,224,224,32" value="186" />
+			<entry class="" argb="255,229,230,35" value="187" />
+			<entry class="" argb="255,234,236,38" value="188" />
+			<entry class="" argb="255,239,242,41" value="189" />
+			<entry class="" argb="255,244,248,45" value="190" />
+			<entry class="" argb="255,249,255,48" value="191" />
+			<entry class="" argb="255,255,255,51" value="192" />
+			<entry class="" argb="255,255,255,54" value="193" />
+			<entry class="" argb="255,255,255,58" value="194" />
+			<entry class="" argb="255,255,255,61" value="195" />
+			<entry class="" argb="255,255,255,64" value="196" />
+			<entry class="" argb="255,255,255,67" value="197" />
+			<entry class="" argb="255,255,255,71" value="198" />
+			<entry class="" argb="255,255,255,74" value="199" />
+			<entry class="" argb="255,255,255,77" value="200" />
+			<entry class="" argb="255,255,255,80" value="201" />
+			<entry class="" argb="255,255,255,83" value="202" />
+			<entry class="" argb="255,255,255,87" value="203" />
+			<entry class="" argb="255,255,255,90" value="204" />
+			<entry class="" argb="255,255,255,93" value="205" />
+			<entry class="" argb="255,255,255,96" value="206" />
+			<entry class="" argb="255,255,255,100" value="207" />
+			<entry class="" argb="255,255,255,103" value="208" />
+			<entry class="" argb="255,255,255,106" value="209" />
+			<entry class="" argb="255,255,255,109" value="210" />
+			<entry class="" argb="255,255,255,112" value="211" />
+			<entry class="" argb="255,255,255,116" value="212" />
+			<entry class="" argb="255,255,255,119" value="213" />
+			<entry class="" argb="255,255,255,122" value="214" />
+			<entry class="" argb="255,255,255,125" value="215" />
+			<entry class="" argb="255,255,255,129" value="216" />
+			<entry class="" argb="255,255,255,132" value="217" />
+			<entry class="" argb="255,255,255,135" value="218" />
+			<entry class="" argb="255,255,255,138" value="219" />
+			<entry class="" argb="255,255,255,142" value="220" />
+			<entry class="" argb="255,255,255,145" value="221" />
+			<entry class="" argb="255,255,255,148" value="222" />
+			<entry class="" argb="255,255,255,151" value="223" />
+			<entry class="" argb="255,255,255,154" value="224" />
+			<entry class="" argb="255,255,255,158" value="225" />
+			<entry class="" argb="255,255,255,161" value="226" />
+			<entry class="" argb="255,255,255,164" value="227" />
+			<entry class="" argb="255,255,255,167" value="228" />
+			<entry class="" argb="255,255,255,171" value="229" />
+			<entry class="" argb="255,255,255,174" value="230" />
+			<entry class="" argb="255,255,255,177" value="231" />
+			<entry class="" argb="255,255,255,180" value="232" />
+			<entry class="" argb="255,255,255,183" value="233" />
+			<entry class="" argb="255,255,255,187" value="234" />
+			<entry class="" argb="255,255,255,190" value="235" />
+			<entry class="" argb="255,255,255,193" value="236" />
+			<entry class="" argb="255,255,255,196" value="237" />
+			<entry class="" argb="255,255,255,200" value="238" />
+			<entry class="" argb="255,255,255,203" value="239" />
+			<entry class="" argb="255,255,255,206" value="240" />
+			<entry class="" argb="255,255,255,209" value="241" />
+			<entry class="" argb="255,255,255,213" value="242" />
+			<entry class="" argb="255,255,255,216" value="243" />
+			<entry class="" argb="255,255,255,219" value="244" />
+			<entry class="" argb="255,255,255,222" value="245" />
+			<entry class="" argb="255,255,255,225" value="246" />
+			<entry class="" argb="255,255,255,229" value="247" />
+			<entry class="" argb="255,255,255,232" value="248" />
+			<entry class="" argb="255,255,255,235" value="249" />
+			<entry class="" argb="255,255,255,238" value="250" />
+			<entry class="" argb="255,255,255,242" value="251" />
+			<entry class="" argb="255,255,255,245" value="252" />
+			<entry class="" argb="255,255,255,248" value="253" />
+			<entry class="" argb="255,255,255,251" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="steps" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,42,0" value="1" />
+			<entry class="" argb="255,0,85,0" value="2" />
+			<entry class="" argb="255,0,127,0" value="3" />
+			<entry class="" argb="255,0,170,0" value="4" />
+			<entry class="" argb="255,0,212,0" value="5" />
+			<entry class="" argb="255,0,255,0" value="6" />
+			<entry class="" argb="255,0,246,0" value="7" />
+			<entry class="" argb="255,0,236,0" value="8" />
+			<entry class="" argb="255,0,226,0" value="9" />
+			<entry class="" argb="255,0,216,0" value="10" />
+			<entry class="" argb="255,0,206,0" value="11" />
+			<entry class="" argb="255,0,197,0" value="12" />
+			<entry class="" argb="255,0,187,0" value="13" />
+			<entry class="" argb="255,0,177,0" value="14" />
+			<entry class="" argb="255,0,167,0" value="15" />
+			<entry class="" argb="255,0,157,0" value="16" />
+			<entry class="" argb="255,0,148,0" value="17" />
+			<entry class="" argb="255,0,138,0" value="18" />
+			<entry class="" argb="255,0,128,0" value="19" />
+			<entry class="" argb="255,0,118,0" value="20" />
+			<entry class="" argb="255,0,108,0" value="21" />
+			<entry class="" argb="255,0,99,0" value="22" />
+			<entry class="" argb="255,0,89,0" value="23" />
+			<entry class="" argb="255,0,79,0" value="24" />
+			<entry class="" argb="255,0,69,0" value="25" />
+			<entry class="" argb="255,0,59,0" value="26" />
+			<entry class="" argb="255,0,50,0" value="27" />
+			<entry class="" argb="255,0,40,0" value="28" />
+			<entry class="" argb="255,0,30,0" value="29" />
+			<entry class="" argb="255,0,20,0" value="30" />
+			<entry class="" argb="255,0,10,0" value="31" />
+			<entry class="" argb="255,0,0,0" value="32" />
+			<entry class="" argb="255,0,0,8" value="33" />
+			<entry class="" argb="255,0,0,16" value="34" />
+			<entry class="" argb="255,0,0,24" value="35" />
+			<entry class="" argb="255,0,0,32" value="36" />
+			<entry class="" argb="255,0,0,41" value="37" />
+			<entry class="" argb="255,0,0,49" value="38" />
+			<entry class="" argb="255,0,0,57" value="39" />
+			<entry class="" argb="255,0,0,65" value="40" />
+			<entry class="" argb="255,0,0,74" value="41" />
+			<entry class="" argb="255,0,0,82" value="42" />
+			<entry class="" argb="255,0,0,90" value="43" />
+			<entry class="" argb="255,0,0,98" value="44" />
+			<entry class="" argb="255,0,0,106" value="45" />
+			<entry class="" argb="255,0,0,115" value="46" />
+			<entry class="" argb="255,0,0,123" value="47" />
+			<entry class="" argb="255,0,0,131" value="48" />
+			<entry class="" argb="255,0,0,139" value="49" />
+			<entry class="" argb="255,0,0,148" value="50" />
+			<entry class="" argb="255,0,0,156" value="51" />
+			<entry class="" argb="255,0,0,164" value="52" />
+			<entry class="" argb="255,0,0,172" value="53" />
+			<entry class="" argb="255,0,0,180" value="54" />
+			<entry class="" argb="255,0,0,189" value="55" />
+			<entry class="" argb="255,0,0,197" value="56" />
+			<entry class="" argb="255,0,0,205" value="57" />
+			<entry class="" argb="255,0,0,213" value="58" />
+			<entry class="" argb="255,0,0,222" value="59" />
+			<entry class="" argb="255,0,0,230" value="60" />
+			<entry class="" argb="255,0,0,238" value="61" />
+			<entry class="" argb="255,0,0,246" value="62" />
+			<entry class="" argb="255,0,0,255" value="63" />
+			<entry class="" argb="255,0,0,0" value="64" />
+			<entry class="" argb="255,7,0,5" value="65" />
+			<entry class="" argb="255,15,0,10" value="66" />
+			<entry class="" argb="255,23,0,15" value="67" />
+			<entry class="" argb="255,31,0,21" value="68" />
+			<entry class="" argb="255,39,0,26" value="69" />
+			<entry class="" argb="255,47,0,31" value="70" />
+			<entry class="" argb="255,55,0,37" value="71" />
+			<entry class="" argb="255,63,0,42" value="72" />
+			<entry class="" argb="255,70,0,47" value="73" />
+			<entry class="" argb="255,78,0,53" value="74" />
+			<entry class="" argb="255,86,0,58" value="75" />
+			<entry class="" argb="255,94,0,63" value="76" />
+			<entry class="" argb="255,102,0,69" value="77" />
+			<entry class="" argb="255,110,0,74" value="78" />
+			<entry class="" argb="255,118,0,79" value="79" />
+			<entry class="" argb="255,126,0,85" value="80" />
+			<entry class="" argb="255,134,0,89" value="81" />
+			<entry class="" argb="255,142,0,94" value="82" />
+			<entry class="" argb="255,151,0,98" value="83" />
+			<entry class="" argb="255,159,0,103" value="84" />
+			<entry class="" argb="255,168,0,108" value="85" />
+			<entry class="" argb="255,176,0,112" value="86" />
+			<entry class="" argb="255,184,0,117" value="87" />
+			<entry class="" argb="255,193,0,121" value="88" />
+			<entry class="" argb="255,201,0,126" value="89" />
+			<entry class="" argb="255,210,0,131" value="90" />
+			<entry class="" argb="255,218,0,135" value="91" />
+			<entry class="" argb="255,226,0,140" value="92" />
+			<entry class="" argb="255,235,0,144" value="93" />
+			<entry class="" argb="255,243,0,149" value="94" />
+			<entry class="" argb="255,252,0,154" value="95" />
+			<entry class="" argb="255,0,0,0" value="96" />
+			<entry class="" argb="255,1,0,0" value="97" />
+			<entry class="" argb="255,2,0,0" value="98" />
+			<entry class="" argb="255,3,0,0" value="99" />
+			<entry class="" argb="255,4,0,0" value="100" />
+			<entry class="" argb="255,5,0,0" value="101" />
+			<entry class="" argb="255,6,0,0" value="102" />
+			<entry class="" argb="255,7,0,0" value="103" />
+			<entry class="" argb="255,8,0,0" value="104" />
+			<entry class="" argb="255,9,0,0" value="105" />
+			<entry class="" argb="255,10,0,0" value="106" />
+			<entry class="" argb="255,11,0,0" value="107" />
+			<entry class="" argb="255,12,0,0" value="108" />
+			<entry class="" argb="255,14,0,0" value="109" />
+			<entry class="" argb="255,16,0,0" value="110" />
+			<entry class="" argb="255,18,0,0" value="111" />
+			<entry class="" argb="255,20,0,0" value="112" />
+			<entry class="" argb="255,23,0,0" value="113" />
+			<entry class="" argb="255,25,0,0" value="114" />
+			<entry class="" argb="255,27,0,0" value="115" />
+			<entry class="" argb="255,29,0,0" value="116" />
+			<entry class="" argb="255,32,0,0" value="117" />
+			<entry class="" argb="255,34,0,0" value="118" />
+			<entry class="" argb="255,36,0,0" value="119" />
+			<entry class="" argb="255,38,0,0" value="120" />
+			<entry class="" argb="255,41,0,0" value="121" />
+			<entry class="" argb="255,44,0,0" value="122" />
+			<entry class="" argb="255,47,0,0" value="123" />
+			<entry class="" argb="255,50,0,0" value="124" />
+			<entry class="" argb="255,53,0,0" value="125" />
+			<entry class="" argb="255,56,0,0" value="126" />
+			<entry class="" argb="255,59,0,0" value="127" />
+			<entry class="" argb="255,63,0,0" value="128" />
+			<entry class="" argb="255,66,0,0" value="129" />
+			<entry class="" argb="255,69,0,0" value="130" />
+			<entry class="" argb="255,72,0,0" value="131" />
+			<entry class="" argb="255,75,0,0" value="132" />
+			<entry class="" argb="255,78,0,0" value="133" />
+			<entry class="" argb="255,82,0,1" value="134" />
+			<entry class="" argb="255,85,0,1" value="135" />
+			<entry class="" argb="255,89,0,1" value="136" />
+			<entry class="" argb="255,93,0,1" value="137" />
+			<entry class="" argb="255,97,0,1" value="138" />
+			<entry class="" argb="255,101,0,1" value="139" />
+			<entry class="" argb="255,105,0,1" value="140" />
+			<entry class="" argb="255,108,0,1" value="141" />
+			<entry class="" argb="255,112,0,1" value="142" />
+			<entry class="" argb="255,116,0,1" value="143" />
+			<entry class="" argb="255,120,0,1" value="144" />
+			<entry class="" argb="255,124,0,1" value="145" />
+			<entry class="" argb="255,128,1,1" value="146" />
+			<entry class="" argb="255,131,1,1" value="147" />
+			<entry class="" argb="255,135,1,1" value="148" />
+			<entry class="" argb="255,139,1,1" value="149" />
+			<entry class="" argb="255,143,1,1" value="150" />
+			<entry class="" argb="255,147,1,1" value="151" />
+			<entry class="" argb="255,151,1,1" value="152" />
+			<entry class="" argb="255,155,1,1" value="153" />
+			<entry class="" argb="255,159,1,1" value="154" />
+			<entry class="" argb="255,163,1,1" value="155" />
+			<entry class="" argb="255,167,1,1" value="156" />
+			<entry class="" argb="255,171,1,1" value="157" />
+			<entry class="" argb="255,175,1,1" value="158" />
+			<entry class="" argb="255,178,1,1" value="159" />
+			<entry class="" argb="255,181,1,1" value="160" />
+			<entry class="" argb="255,185,1,1" value="161" />
+			<entry class="" argb="255,188,1,1" value="162" />
+			<entry class="" argb="255,192,1,1" value="163" />
+			<entry class="" argb="255,195,1,1" value="164" />
+			<entry class="" argb="255,198,1,1" value="165" />
+			<entry class="" argb="255,202,1,1" value="166" />
+			<entry class="" argb="255,205,1,1" value="167" />
+			<entry class="" argb="255,209,1,1" value="168" />
+			<entry class="" argb="255,212,1,1" value="169" />
+			<entry class="" argb="255,216,1,2" value="170" />
+			<entry class="" argb="255,218,1,2" value="171" />
+			<entry class="" argb="255,220,1,2" value="172" />
+			<entry class="" argb="255,223,1,2" value="173" />
+			<entry class="" argb="255,225,1,2" value="174" />
+			<entry class="" argb="255,227,1,2" value="175" />
+			<entry class="" argb="255,230,1,2" value="176" />
+			<entry class="" argb="255,232,1,2" value="177" />
+			<entry class="" argb="255,234,1,2" value="178" />
+			<entry class="" argb="255,237,1,2" value="179" />
+			<entry class="" argb="255,239,1,2" value="180" />
+			<entry class="" argb="255,241,1,2" value="181" />
+			<entry class="" argb="255,244,2,2" value="182" />
+			<entry class="" argb="255,244,2,2" value="183" />
+			<entry class="" argb="255,245,2,2" value="184" />
+			<entry class="" argb="255,246,2,2" value="185" />
+			<entry class="" argb="255,247,2,2" value="186" />
+			<entry class="" argb="255,247,2,2" value="187" />
+			<entry class="" argb="255,248,2,2" value="188" />
+			<entry class="" argb="255,249,2,2" value="189" />
+			<entry class="" argb="255,250,2,2" value="190" />
+			<entry class="" argb="255,250,2,2" value="191" />
+			<entry class="" argb="255,251,2,2" value="192" />
+			<entry class="" argb="255,252,2,2" value="193" />
+			<entry class="" argb="255,253,2,2" value="194" />
+			<entry class="" argb="255,254,1,2" value="195" />
+			<entry class="" argb="255,254,1,2" value="196" />
+			<entry class="" argb="255,254,3,2" value="197" />
+			<entry class="" argb="255,254,5,2" value="198" />
+			<entry class="" argb="255,254,8,2" value="199" />
+			<entry class="" argb="255,254,10,2" value="200" />
+			<entry class="" argb="255,254,12,2" value="201" />
+			<entry class="" argb="255,254,15,2" value="202" />
+			<entry class="" argb="255,254,17,2" value="203" />
+			<entry class="" argb="255,254,19,2" value="204" />
+			<entry class="" argb="255,254,22,2" value="205" />
+			<entry class="" argb="255,254,24,2" value="206" />
+			<entry class="" argb="255,254,26,2" value="207" />
+			<entry class="" argb="255,254,29,2" value="208" />
+			<entry class="" argb="255,254,31,2" value="209" />
+			<entry class="" argb="255,254,33,2" value="210" />
+			<entry class="" argb="255,254,36,2" value="211" />
+			<entry class="" argb="255,254,36,2" value="212" />
+			<entry class="" argb="255,254,38,3" value="213" />
+			<entry class="" argb="255,254,40,4" value="214" />
+			<entry class="" argb="255,254,42,5" value="215" />
+			<entry class="" argb="255,255,45,7" value="216" />
+			<entry class="" argb="255,255,48,9" value="217" />
+			<entry class="" argb="255,255,51,12" value="218" />
+			<entry class="" argb="255,255,54,14" value="219" />
+			<entry class="" argb="255,255,58,17" value="220" />
+			<entry class="" argb="255,255,61,20" value="221" />
+			<entry class="" argb="255,255,64,23" value="222" />
+			<entry class="" argb="255,255,67,27" value="223" />
+			<entry class="" argb="255,255,70,30" value="224" />
+			<entry class="" argb="255,255,73,34" value="225" />
+			<entry class="" argb="255,255,77,39" value="226" />
+			<entry class="" argb="255,255,82,44" value="227" />
+			<entry class="" argb="255,255,87,49" value="228" />
+			<entry class="" argb="255,255,92,55" value="229" />
+			<entry class="" argb="255,255,96,60" value="230" />
+			<entry class="" argb="255,255,100,65" value="231" />
+			<entry class="" argb="255,255,104,71" value="232" />
+			<entry class="" argb="255,255,108,76" value="233" />
+			<entry class="" argb="255,255,113,82" value="234" />
+			<entry class="" argb="255,255,119,89" value="235" />
+			<entry class="" argb="255,255,125,97" value="236" />
+			<entry class="" argb="255,255,131,104" value="237" />
+			<entry class="" argb="255,255,138,112" value="238" />
+			<entry class="" argb="255,255,144,120" value="239" />
+			<entry class="" argb="255,255,151,128" value="240" />
+			<entry class="" argb="255,255,157,136" value="241" />
+			<entry class="" argb="255,255,164,145" value="242" />
+			<entry class="" argb="255,255,171,153" value="243" />
+			<entry class="" argb="255,255,178,162" value="244" />
+			<entry class="" argb="255,255,185,171" value="245" />
+			<entry class="" argb="255,255,193,180" value="246" />
+			<entry class="" argb="255,255,200,189" value="247" />
+			<entry class="" argb="255,255,208,198" value="248" />
+			<entry class="" argb="255,255,215,207" value="249" />
+			<entry class="" argb="255,255,223,217" value="250" />
+			<entry class="" argb="255,255,229,224" value="251" />
+			<entry class="" argb="255,255,235,232" value="252" />
+			<entry class="" argb="255,255,242,239" value="253" />
+			<entry class="" argb="255,255,248,247" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="stern-special" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,18,1,1" value="1" />
+			<entry class="" argb="255,36,2,3" value="2" />
+			<entry class="" argb="255,54,3,5" value="3" />
+			<entry class="" argb="255,72,4,7" value="4" />
+			<entry class="" argb="255,90,5,9" value="5" />
+			<entry class="" argb="255,108,6,11" value="6" />
+			<entry class="" argb="255,127,7,13" value="7" />
+			<entry class="" argb="255,145,8,15" value="8" />
+			<entry class="" argb="255,163,9,17" value="9" />
+			<entry class="" argb="255,181,10,19" value="10" />
+			<entry class="" argb="255,199,11,21" value="11" />
+			<entry class="" argb="255,217,12,23" value="12" />
+			<entry class="" argb="255,235,13,25" value="13" />
+			<entry class="" argb="255,254,14,27" value="14" />
+			<entry class="" argb="255,249,15,29" value="15" />
+			<entry class="" argb="255,244,16,31" value="16" />
+			<entry class="" argb="255,239,17,33" value="17" />
+			<entry class="" argb="255,234,18,35" value="18" />
+			<entry class="" argb="255,229,19,37" value="19" />
+			<entry class="" argb="255,223,20,39" value="20" />
+			<entry class="" argb="255,218,21,41" value="21" />
+			<entry class="" argb="255,213,22,43" value="22" />
+			<entry class="" argb="255,208,23,45" value="23" />
+			<entry class="" argb="255,203,24,47" value="24" />
+			<entry class="" argb="255,197,25,49" value="25" />
+			<entry class="" argb="255,192,26,51" value="26" />
+			<entry class="" argb="255,187,27,53" value="27" />
+			<entry class="" argb="255,182,28,55" value="28" />
+			<entry class="" argb="255,177,29,57" value="29" />
+			<entry class="" argb="255,172,30,59" value="30" />
+			<entry class="" argb="255,166,31,61" value="31" />
+			<entry class="" argb="255,161,32,63" value="32" />
+			<entry class="" argb="255,156,33,65" value="33" />
+			<entry class="" argb="255,151,34,67" value="34" />
+			<entry class="" argb="255,146,35,69" value="35" />
+			<entry class="" argb="255,140,36,71" value="36" />
+			<entry class="" argb="255,135,37,73" value="37" />
+			<entry class="" argb="255,130,38,75" value="38" />
+			<entry class="" argb="255,125,39,77" value="39" />
+			<entry class="" argb="255,120,40,79" value="40" />
+			<entry class="" argb="255,115,41,81" value="41" />
+			<entry class="" argb="255,109,42,83" value="42" />
+			<entry class="" argb="255,104,43,85" value="43" />
+			<entry class="" argb="255,99,44,87" value="44" />
+			<entry class="" argb="255,94,45,89" value="45" />
+			<entry class="" argb="255,89,46,91" value="46" />
+			<entry class="" argb="255,83,47,93" value="47" />
+			<entry class="" argb="255,78,48,95" value="48" />
+			<entry class="" argb="255,73,49,97" value="49" />
+			<entry class="" argb="255,68,50,99" value="50" />
+			<entry class="" argb="255,63,51,101" value="51" />
+			<entry class="" argb="255,58,52,103" value="52" />
+			<entry class="" argb="255,52,53,105" value="53" />
+			<entry class="" argb="255,47,54,107" value="54" />
+			<entry class="" argb="255,42,55,109" value="55" />
+			<entry class="" argb="255,37,56,111" value="56" />
+			<entry class="" argb="255,32,57,113" value="57" />
+			<entry class="" argb="255,26,58,115" value="58" />
+			<entry class="" argb="255,21,59,117" value="59" />
+			<entry class="" argb="255,16,60,119" value="60" />
+			<entry class="" argb="255,11,61,121" value="61" />
+			<entry class="" argb="255,6,62,123" value="62" />
+			<entry class="" argb="255,0,63,125" value="63" />
+			<entry class="" argb="255,64,64,127" value="64" />
+			<entry class="" argb="255,65,65,129" value="65" />
+			<entry class="" argb="255,66,66,131" value="66" />
+			<entry class="" argb="255,67,67,133" value="67" />
+			<entry class="" argb="255,68,68,135" value="68" />
+			<entry class="" argb="255,69,69,137" value="69" />
+			<entry class="" argb="255,70,70,139" value="70" />
+			<entry class="" argb="255,71,71,141" value="71" />
+			<entry class="" argb="255,72,72,143" value="72" />
+			<entry class="" argb="255,73,73,145" value="73" />
+			<entry class="" argb="255,74,74,147" value="74" />
+			<entry class="" argb="255,75,75,149" value="75" />
+			<entry class="" argb="255,76,76,151" value="76" />
+			<entry class="" argb="255,77,77,153" value="77" />
+			<entry class="" argb="255,78,78,155" value="78" />
+			<entry class="" argb="255,79,79,157" value="79" />
+			<entry class="" argb="255,80,80,159" value="80" />
+			<entry class="" argb="255,81,81,161" value="81" />
+			<entry class="" argb="255,82,82,163" value="82" />
+			<entry class="" argb="255,83,83,165" value="83" />
+			<entry class="" argb="255,84,84,167" value="84" />
+			<entry class="" argb="255,85,85,169" value="85" />
+			<entry class="" argb="255,86,86,171" value="86" />
+			<entry class="" argb="255,87,87,173" value="87" />
+			<entry class="" argb="255,88,88,175" value="88" />
+			<entry class="" argb="255,89,89,177" value="89" />
+			<entry class="" argb="255,90,90,179" value="90" />
+			<entry class="" argb="255,91,91,181" value="91" />
+			<entry class="" argb="255,92,92,183" value="92" />
+			<entry class="" argb="255,93,93,185" value="93" />
+			<entry class="" argb="255,94,94,187" value="94" />
+			<entry class="" argb="255,95,95,189" value="95" />
+			<entry class="" argb="255,96,96,191" value="96" />
+			<entry class="" argb="255,97,97,193" value="97" />
+			<entry class="" argb="255,98,98,195" value="98" />
+			<entry class="" argb="255,99,99,197" value="99" />
+			<entry class="" argb="255,100,100,199" value="100" />
+			<entry class="" argb="255,101,101,201" value="101" />
+			<entry class="" argb="255,102,102,203" value="102" />
+			<entry class="" argb="255,103,103,205" value="103" />
+			<entry class="" argb="255,104,104,207" value="104" />
+			<entry class="" argb="255,105,105,209" value="105" />
+			<entry class="" argb="255,106,106,211" value="106" />
+			<entry class="" argb="255,107,107,213" value="107" />
+			<entry class="" argb="255,108,108,215" value="108" />
+			<entry class="" argb="255,109,109,217" value="109" />
+			<entry class="" argb="255,110,110,219" value="110" />
+			<entry class="" argb="255,111,111,221" value="111" />
+			<entry class="" argb="255,112,112,223" value="112" />
+			<entry class="" argb="255,113,113,225" value="113" />
+			<entry class="" argb="255,114,114,227" value="114" />
+			<entry class="" argb="255,115,115,229" value="115" />
+			<entry class="" argb="255,116,116,231" value="116" />
+			<entry class="" argb="255,117,117,233" value="117" />
+			<entry class="" argb="255,118,118,235" value="118" />
+			<entry class="" argb="255,119,119,237" value="119" />
+			<entry class="" argb="255,120,120,239" value="120" />
+			<entry class="" argb="255,121,121,241" value="121" />
+			<entry class="" argb="255,122,122,243" value="122" />
+			<entry class="" argb="255,123,123,245" value="123" />
+			<entry class="" argb="255,124,124,247" value="124" />
+			<entry class="" argb="255,125,125,249" value="125" />
+			<entry class="" argb="255,126,126,251" value="126" />
+			<entry class="" argb="255,127,127,253" value="127" />
+			<entry class="" argb="255,128,128,255" value="128" />
+			<entry class="" argb="255,129,129,251" value="129" />
+			<entry class="" argb="255,130,130,247" value="130" />
+			<entry class="" argb="255,131,131,243" value="131" />
+			<entry class="" argb="255,132,132,238" value="132" />
+			<entry class="" argb="255,133,133,234" value="133" />
+			<entry class="" argb="255,134,134,230" value="134" />
+			<entry class="" argb="255,135,135,226" value="135" />
+			<entry class="" argb="255,136,136,221" value="136" />
+			<entry class="" argb="255,137,137,217" value="137" />
+			<entry class="" argb="255,138,138,213" value="138" />
+			<entry class="" argb="255,139,139,209" value="139" />
+			<entry class="" argb="255,140,140,204" value="140" />
+			<entry class="" argb="255,141,141,200" value="141" />
+			<entry class="" argb="255,142,142,196" value="142" />
+			<entry class="" argb="255,143,143,192" value="143" />
+			<entry class="" argb="255,144,144,187" value="144" />
+			<entry class="" argb="255,145,145,183" value="145" />
+			<entry class="" argb="255,146,146,179" value="146" />
+			<entry class="" argb="255,147,147,175" value="147" />
+			<entry class="" argb="255,148,148,170" value="148" />
+			<entry class="" argb="255,149,149,166" value="149" />
+			<entry class="" argb="255,150,150,162" value="150" />
+			<entry class="" argb="255,151,151,158" value="151" />
+			<entry class="" argb="255,152,152,153" value="152" />
+			<entry class="" argb="255,153,153,149" value="153" />
+			<entry class="" argb="255,154,154,145" value="154" />
+			<entry class="" argb="255,155,155,141" value="155" />
+			<entry class="" argb="255,156,156,136" value="156" />
+			<entry class="" argb="255,157,157,132" value="157" />
+			<entry class="" argb="255,158,158,128" value="158" />
+			<entry class="" argb="255,159,159,124" value="159" />
+			<entry class="" argb="255,160,160,119" value="160" />
+			<entry class="" argb="255,161,161,115" value="161" />
+			<entry class="" argb="255,162,162,111" value="162" />
+			<entry class="" argb="255,163,163,107" value="163" />
+			<entry class="" argb="255,164,164,102" value="164" />
+			<entry class="" argb="255,165,165,98" value="165" />
+			<entry class="" argb="255,166,166,94" value="166" />
+			<entry class="" argb="255,167,167,90" value="167" />
+			<entry class="" argb="255,168,168,85" value="168" />
+			<entry class="" argb="255,169,169,81" value="169" />
+			<entry class="" argb="255,170,170,77" value="170" />
+			<entry class="" argb="255,171,171,73" value="171" />
+			<entry class="" argb="255,172,172,68" value="172" />
+			<entry class="" argb="255,173,173,64" value="173" />
+			<entry class="" argb="255,174,174,60" value="174" />
+			<entry class="" argb="255,175,175,56" value="175" />
+			<entry class="" argb="255,176,176,51" value="176" />
+			<entry class="" argb="255,177,177,47" value="177" />
+			<entry class="" argb="255,178,178,43" value="178" />
+			<entry class="" argb="255,179,179,39" value="179" />
+			<entry class="" argb="255,180,180,34" value="180" />
+			<entry class="" argb="255,181,181,30" value="181" />
+			<entry class="" argb="255,182,182,26" value="182" />
+			<entry class="" argb="255,183,183,22" value="183" />
+			<entry class="" argb="255,184,184,17" value="184" />
+			<entry class="" argb="255,185,185,13" value="185" />
+			<entry class="" argb="255,186,186,9" value="186" />
+			<entry class="" argb="255,187,187,5" value="187" />
+			<entry class="" argb="255,188,188,0" value="188" />
+			<entry class="" argb="255,189,189,3" value="189" />
+			<entry class="" argb="255,190,190,7" value="190" />
+			<entry class="" argb="255,191,191,11" value="191" />
+			<entry class="" argb="255,192,192,15" value="192" />
+			<entry class="" argb="255,193,193,19" value="193" />
+			<entry class="" argb="255,194,194,22" value="194" />
+			<entry class="" argb="255,195,195,26" value="195" />
+			<entry class="" argb="255,196,196,30" value="196" />
+			<entry class="" argb="255,197,197,34" value="197" />
+			<entry class="" argb="255,198,198,38" value="198" />
+			<entry class="" argb="255,199,199,41" value="199" />
+			<entry class="" argb="255,200,200,45" value="200" />
+			<entry class="" argb="255,201,201,49" value="201" />
+			<entry class="" argb="255,202,202,53" value="202" />
+			<entry class="" argb="255,203,203,57" value="203" />
+			<entry class="" argb="255,204,204,60" value="204" />
+			<entry class="" argb="255,205,205,64" value="205" />
+			<entry class="" argb="255,206,206,68" value="206" />
+			<entry class="" argb="255,207,207,72" value="207" />
+			<entry class="" argb="255,208,208,76" value="208" />
+			<entry class="" argb="255,209,209,79" value="209" />
+			<entry class="" argb="255,210,210,83" value="210" />
+			<entry class="" argb="255,211,211,87" value="211" />
+			<entry class="" argb="255,212,212,91" value="212" />
+			<entry class="" argb="255,213,213,95" value="213" />
+			<entry class="" argb="255,214,214,98" value="214" />
+			<entry class="" argb="255,215,215,102" value="215" />
+			<entry class="" argb="255,216,216,106" value="216" />
+			<entry class="" argb="255,217,217,110" value="217" />
+			<entry class="" argb="255,218,218,114" value="218" />
+			<entry class="" argb="255,219,219,117" value="219" />
+			<entry class="" argb="255,220,220,121" value="220" />
+			<entry class="" argb="255,221,221,125" value="221" />
+			<entry class="" argb="255,222,222,129" value="222" />
+			<entry class="" argb="255,223,223,133" value="223" />
+			<entry class="" argb="255,224,224,137" value="224" />
+			<entry class="" argb="255,225,225,140" value="225" />
+			<entry class="" argb="255,226,226,144" value="226" />
+			<entry class="" argb="255,227,227,148" value="227" />
+			<entry class="" argb="255,228,228,152" value="228" />
+			<entry class="" argb="255,229,229,156" value="229" />
+			<entry class="" argb="255,230,230,159" value="230" />
+			<entry class="" argb="255,231,231,163" value="231" />
+			<entry class="" argb="255,232,232,167" value="232" />
+			<entry class="" argb="255,233,233,171" value="233" />
+			<entry class="" argb="255,234,234,175" value="234" />
+			<entry class="" argb="255,235,235,178" value="235" />
+			<entry class="" argb="255,236,236,182" value="236" />
+			<entry class="" argb="255,237,237,186" value="237" />
+			<entry class="" argb="255,238,238,190" value="238" />
+			<entry class="" argb="255,239,239,194" value="239" />
+			<entry class="" argb="255,240,240,197" value="240" />
+			<entry class="" argb="255,241,241,201" value="241" />
+			<entry class="" argb="255,242,242,205" value="242" />
+			<entry class="" argb="255,243,243,209" value="243" />
+			<entry class="" argb="255,244,244,213" value="244" />
+			<entry class="" argb="255,245,245,216" value="245" />
+			<entry class="" argb="255,246,246,220" value="246" />
+			<entry class="" argb="255,247,247,224" value="247" />
+			<entry class="" argb="255,248,248,228" value="248" />
+			<entry class="" argb="255,249,249,232" value="249" />
+			<entry class="" argb="255,250,250,235" value="250" />
+			<entry class="" argb="255,251,251,239" value="251" />
+			<entry class="" argb="255,252,252,243" value="252" />
+			<entry class="" argb="255,253,253,247" value="253" />
+			<entry class="" argb="255,254,254,251" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="MDT1" interpolate="false">
+		<table>
+			<entry class="C21" argb="255,255,255,255" value="6000" />
+			<entry class="C20" argb="255,226,246,246" value="5000" />
+			<entry class="C19" argb="255,201,232,232" value="4000" />
+			<entry class="C10" argb="255,179,231,217" value="3500" />
+			<entry class="C9" argb="255,179,227,205" value="3000" />
+			<entry class="C8" argb="255,173,221,193" value="2500" />
+			<entry class="C7" argb="255,96,214,136" value="2000" />
+			<entry class="C6" argb="255,54,198,24" value="1500" />
+			<entry class="C5" argb="255,110,213,37" value="1000" />
+			<entry class="C4" argb="255,138,138,11" value="500" />
+			<entry class="C17" argb="255,163,163,10" value="250" />
+			<entry class="C11" argb="255,0,204,255" value="0" />
+			<entry class="C18" argb="255,0,204,255" value="-250" />
+			<entry class="C3" argb="255,0,153,255" value="-500" />
+			<entry class="C2" argb="255,0,51,255" value="-1000" />
+			<entry class="C1" argb="255,51,0,255" value="-1500" />
+			<entry class="C0" argb="255,0,0,204" value="-2000" />
+			<entry class="C12" argb="255,0,51,153" value="-2500" />
+			<entry class="C13" argb="255,0,0,102" value="-3000" />
+			<entry class="C16" argb="255,6,6,73" value="-3500" />
+			<entry class="C15" argb="255,4,22,40" value="-4000" />
+			<entry class="C14" argb="255,0,0,0" value="-10896" />
+		</table>
+	</palette>
+
+	<palette name="MDT2" interpolate="false">
+		<table>
+			<entry class="C21" argb="255,255,255,255" value="6000" />
+			<entry class="C20" argb="255,226,246,246" value="5000" />
+			<entry class="C19" argb="255,201,232,232" value="4000" />
+			<entry class="C10" argb="255,179,231,217" value="3500" />
+			<entry class="C9" argb="255,179,227,205" value="3000" />
+			<entry class="C8" argb="255,173,221,193" value="2500" />
+			<entry class="C7" argb="255,96,214,136" value="2000" />
+			<entry class="C6" argb="255,32,175,83" value="1500" />
+			<entry class="C5" argb="255,90,199,14" value="1000" />
+			<entry class="C4" argb="255,110,138,11" value="500" />
+			<entry class="C17" argb="255,147,163,10" value="250" />
+			<entry class="C11" argb="255,0,204,255" value="0" />
+			<entry class="C18" argb="255,0,204,255" value="-250" />
+			<entry class="C3" argb="255,0,153,255" value="-500" />
+			<entry class="C2" argb="255,30,74,251" value="-1000" />
+			<entry class="C1" argb="255,51,0,255" value="-1500" />
+			<entry class="C0" argb="255,0,0,219" value="-2000" />
+			<entry class="C12" argb="255,15,15,168" value="-2500" />
+			<entry class="C13" argb="255,15,15,153" value="-3000" />
+			<entry class="C16" argb="255,17,17,128" value="-3500" />
+			<entry class="C15" argb="255,14,16,108" value="-4000" />
+			<entry class="C22" argb="255,4,6,78" value="-5000" />
+			<entry class="C23" argb="255,0,0,68" value="-6000" />
+			<entry class="C24" argb="255,0,0,58" value="-7000" />
+			<entry class="C14" argb="255,0,0,0" value="-8000" />
+		</table>
+	</palette>
+
+	<palette name="CLASIFICACION" interpolate="false">
+		<table>
+			<entry class="C18" argb="255,0,102,255" value="18" />
+			<entry class="C17" argb="255,153,0,255" value="17" />
+			<entry class="C16" argb="255,153,0,153" value="16" />
+			<entry class="C15" argb="255,204,153,255" value="15" />
+			<entry class="C14" argb="255,204,80,17" value="14" />
+			<entry class="C13" argb="255,255,175,0" value="13" />
+			<entry class="C12" argb="255,255,153,102" value="12" />
+			<entry class="C11" argb="255,204,255,51" value="11" />
+			<entry class="C10" argb="255,204,204,0" value="10" />
+			<entry class="C9" argb="255,153,153,0" value="9" />
+			<entry class="C8" argb="255,204,0,102" value="8" />
+			<entry class="C7" argb="255,0,153,51" value="7" />
+			<entry class="C6" argb="255,51,204,0" value="6" />
+			<entry class="C5" argb="255,231,231,12" value="5" />
+			<entry class="C4" argb="255,12,118,119" value="4" />
+			<entry class="C3" argb="255,174,177,7" value="3" />
+			<entry class="C2" argb="255,67,97,69" value="2" />
+			<entry class="C1" argb="255,4,126,4" value="1" />
+		</table>
+	</palette>
+	<!-- Gradient, HSV(120,90,48) to HSV(60,70,100) to HSV(20,84,42) -->
+	<palette name="1  Forest - Soil  (100)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,12,122,12" value="0" />
+			<entry class="2" argb="255,14,124,12" value="1" />
+			<entry class="3" argb="255,17,126,13" value="2" />
+			<entry class="4" argb="255,19,129,14" value="3" />
+			<entry class="5" argb="255,22,131,14" value="4" />
+			<entry class="6" argb="255,25,133,15" value="5" />
+			<entry class="7" argb="255,28,135,16" value="6" />
+			<entry class="8" argb="255,31,137,17" value="7" />
+			<entry class="9" argb="255,34,140,17" value="8" />
+			<entry class="10" argb="255,37,142,18" value="9" />
+			<entry class="11" argb="255,40,144,19" value="10" />
+			<entry class="12" argb="255,43,146,20" value="11" />
+			<entry class="13" argb="255,46,148,20" value="12" />
+			<entry class="14" argb="255,49,151,21" value="13" />
+			<entry class="15" argb="255,53,153,22" value="14" />
+			<entry class="16" argb="255,56,155,23" value="15" />
+			<entry class="17" argb="255,59,157,24" value="16" />
+			<entry class="18" argb="255,63,159,25" value="17" />
+			<entry class="19" argb="255,66,162,25" value="18" />
+			<entry class="20" argb="255,70,164,26" value="19" />
+			<entry class="21" argb="255,74,166,27" value="20" />
+			<entry class="22" argb="255,77,168,28" value="21" />
+			<entry class="23" argb="255,81,171,29" value="22" />
+			<entry class="24" argb="255,85,173,30" value="23" />
+			<entry class="25" argb="255,89,175,31" value="24" />
+			<entry class="26" argb="255,93,177,32" value="25" />
+			<entry class="27" argb="255,96,179,33" value="26" />
+			<entry class="28" argb="255,100,182,34" value="27" />
+			<entry class="29" argb="255,104,184,35" value="28" />
+			<entry class="30" argb="255,109,186,36" value="29" />
+			<entry class="31" argb="255,113,188,37" value="30" />
+			<entry class="32" argb="255,117,190,38" value="31" />
+			<entry class="33" argb="255,121,193,39" value="32" />
+			<entry class="34" argb="255,125,195,41" value="33" />
+			<entry class="35" argb="255,130,197,42" value="34" />
+			<entry class="36" argb="255,134,199,43" value="35" />
+			<entry class="37" argb="255,138,201,44" value="36" />
+			<entry class="38" argb="255,143,204,45" value="37" />
+			<entry class="39" argb="255,147,206,46" value="38" />
+			<entry class="40" argb="255,152,208,47" value="39" />
+			<entry class="41" argb="255,156,210,49" value="40" />
+			<entry class="42" argb="255,161,213,50" value="41" />
+			<entry class="43" argb="255,166,215,51" value="42" />
+			<entry class="44" argb="255,170,217,52" value="43" />
+			<entry class="45" argb="255,175,219,54" value="44" />
+			<entry class="46" argb="255,180,221,55" value="45" />
+			<entry class="47" argb="255,185,224,56" value="46" />
+			<entry class="48" argb="255,189,226,58" value="47" />
+			<entry class="49" argb="255,194,228,59" value="48" />
+			<entry class="50" argb="255,199,230,60" value="49" />
+			<entry class="51" argb="255,204,232,62" value="50" />
+			<entry class="52" argb="255,209,235,63" value="51" />
+			<entry class="53" argb="255,214,237,64" value="52" />
+			<entry class="54" argb="255,219,239,66" value="53" />
+			<entry class="55" argb="255,224,241,67" value="54" />
+			<entry class="56" argb="255,229,243,69" value="55" />
+			<entry class="57" argb="255,234,246,70" value="56" />
+			<entry class="58" argb="255,239,248,72" value="57" />
+			<entry class="59" argb="255,244,250,73" value="58" />
+			<entry class="60" argb="255,249,252,74" value="59" />
+			<entry class="61" argb="255,255,255,76" value="60" />
+			<entry class="62" argb="255,251,248,74" value="61" />
+			<entry class="63" argb="255,247,241,72" value="62" />
+			<entry class="64" argb="255,243,235,70" value="63" />
+			<entry class="65" argb="255,240,228,68" value="64" />
+			<entry class="66" argb="255,236,222,66" value="65" />
+			<entry class="67" argb="255,232,216,64" value="66" />
+			<entry class="68" argb="255,229,209,63" value="67" />
+			<entry class="69" argb="255,225,203,61" value="68" />
+			<entry class="70" argb="255,221,197,59" value="69" />
+			<entry class="71" argb="255,218,191,57" value="70" />
+			<entry class="72" argb="255,214,185,56" value="71" />
+			<entry class="73" argb="255,210,179,54" value="72" />
+			<entry class="74" argb="255,206,173,52" value="73" />
+			<entry class="75" argb="255,203,167,51" value="74" />
+			<entry class="76" argb="255,199,161,49" value="75" />
+			<entry class="77" argb="255,195,156,47" value="76" />
+			<entry class="78" argb="255,192,150,46" value="77" />
+			<entry class="79" argb="255,188,145,44" value="78" />
+			<entry class="80" argb="255,184,139,43" value="79" />
+			<entry class="81" argb="255,181,134,41" value="80" />
+			<entry class="82" argb="255,177,129,40" value="81" />
+			<entry class="83" argb="255,173,124,38" value="82" />
+			<entry class="84" argb="255,169,119,37" value="83" />
+			<entry class="85" argb="255,166,114,35" value="84" />
+			<entry class="86" argb="255,162,109,34" value="85" />
+			<entry class="87" argb="255,158,104,33" value="86" />
+			<entry class="88" argb="255,155,99,31" value="87" />
+			<entry class="89" argb="255,151,95,30" value="88" />
+			<entry class="90" argb="255,147,90,29" value="89" />
+			<entry class="91" argb="255,144,86,28" value="90" />
+			<entry class="92" argb="255,140,81,26" value="91" />
+			<entry class="93" argb="255,136,77,25" value="92" />
+			<entry class="94" argb="255,132,73,24" value="93" />
+			<entry class="95" argb="255,129,69,23" value="94" />
+			<entry class="96" argb="255,125,65,22" value="95" />
+			<entry class="97" argb="255,121,61,21" value="96" />
+			<entry class="98" argb="255,118,57,20" value="97" />
+			<entry class="99" argb="255,114,54,19" value="98" />
+			<entry class="100" argb="255,110,50,18" value="99" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(20,84,42) to HSV(60,70,100) to HSV(120,90,48) -->
+	<palette name="1  Soil - Forest  (100)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,107,47,17" value="0" />
+			<entry class="2" argb="255,110,50,18" value="1" />
+			<entry class="3" argb="255,114,54,19" value="2" />
+			<entry class="4" argb="255,118,57,20" value="3" />
+			<entry class="5" argb="255,121,61,21" value="4" />
+			<entry class="6" argb="255,125,65,22" value="5" />
+			<entry class="7" argb="255,129,69,23" value="6" />
+			<entry class="8" argb="255,132,73,24" value="7" />
+			<entry class="9" argb="255,136,77,25" value="8" />
+			<entry class="10" argb="255,140,81,26" value="9" />
+			<entry class="11" argb="255,144,86,28" value="10" />
+			<entry class="12" argb="255,147,90,29" value="11" />
+			<entry class="13" argb="255,151,95,30" value="12" />
+			<entry class="14" argb="255,155,99,31" value="13" />
+			<entry class="15" argb="255,158,104,33" value="14" />
+			<entry class="16" argb="255,162,109,34" value="15" />
+			<entry class="17" argb="255,166,114,35" value="16" />
+			<entry class="18" argb="255,169,119,37" value="17" />
+			<entry class="19" argb="255,173,124,38" value="18" />
+			<entry class="20" argb="255,177,129,40" value="19" />
+			<entry class="21" argb="255,181,134,41" value="20" />
+			<entry class="22" argb="255,184,139,43" value="21" />
+			<entry class="23" argb="255,188,145,44" value="22" />
+			<entry class="24" argb="255,192,150,46" value="23" />
+			<entry class="25" argb="255,195,156,47" value="24" />
+			<entry class="26" argb="255,199,161,49" value="25" />
+			<entry class="27" argb="255,203,167,51" value="26" />
+			<entry class="28" argb="255,206,173,52" value="27" />
+			<entry class="29" argb="255,210,179,54" value="28" />
+			<entry class="30" argb="255,214,185,56" value="29" />
+			<entry class="31" argb="255,218,191,57" value="30" />
+			<entry class="32" argb="255,221,197,59" value="31" />
+			<entry class="33" argb="255,225,203,61" value="32" />
+			<entry class="34" argb="255,229,209,63" value="33" />
+			<entry class="35" argb="255,232,216,64" value="34" />
+			<entry class="36" argb="255,236,222,66" value="35" />
+			<entry class="37" argb="255,240,228,68" value="36" />
+			<entry class="38" argb="255,243,235,70" value="37" />
+			<entry class="39" argb="255,247,241,72" value="38" />
+			<entry class="40" argb="255,251,248,74" value="39" />
+			<entry class="41" argb="255,255,255,76" value="40" />
+			<entry class="42" argb="255,249,252,74" value="41" />
+			<entry class="43" argb="255,244,250,73" value="42" />
+			<entry class="44" argb="255,239,248,72" value="43" />
+			<entry class="45" argb="255,234,246,70" value="44" />
+			<entry class="46" argb="255,229,243,69" value="45" />
+			<entry class="47" argb="255,224,241,67" value="46" />
+			<entry class="48" argb="255,219,239,66" value="47" />
+			<entry class="49" argb="255,214,237,64" value="48" />
+			<entry class="50" argb="255,209,235,63" value="49" />
+			<entry class="51" argb="255,204,232,62" value="50" />
+			<entry class="52" argb="255,199,230,60" value="51" />
+			<entry class="53" argb="255,194,228,59" value="52" />
+			<entry class="54" argb="255,189,226,58" value="53" />
+			<entry class="55" argb="255,185,224,56" value="54" />
+			<entry class="56" argb="255,180,221,55" value="55" />
+			<entry class="57" argb="255,175,219,54" value="56" />
+			<entry class="58" argb="255,170,217,52" value="57" />
+			<entry class="59" argb="255,166,215,51" value="58" />
+			<entry class="60" argb="255,161,213,50" value="59" />
+			<entry class="61" argb="255,156,210,49" value="60" />
+			<entry class="62" argb="255,152,208,47" value="61" />
+			<entry class="63" argb="255,147,206,46" value="62" />
+			<entry class="64" argb="255,143,204,45" value="63" />
+			<entry class="65" argb="255,138,201,44" value="64" />
+			<entry class="66" argb="255,134,199,43" value="65" />
+			<entry class="67" argb="255,130,197,42" value="66" />
+			<entry class="68" argb="255,125,195,41" value="67" />
+			<entry class="69" argb="255,121,193,39" value="68" />
+			<entry class="70" argb="255,117,190,38" value="69" />
+			<entry class="71" argb="255,113,188,37" value="70" />
+			<entry class="72" argb="255,109,186,36" value="71" />
+			<entry class="73" argb="255,104,184,35" value="72" />
+			<entry class="74" argb="255,100,182,34" value="73" />
+			<entry class="75" argb="255,96,179,33" value="74" />
+			<entry class="76" argb="255,93,177,32" value="75" />
+			<entry class="77" argb="255,89,175,31" value="76" />
+			<entry class="78" argb="255,85,173,30" value="77" />
+			<entry class="79" argb="255,81,171,29" value="78" />
+			<entry class="80" argb="255,77,168,28" value="79" />
+			<entry class="81" argb="255,74,166,27" value="80" />
+			<entry class="82" argb="255,70,164,26" value="81" />
+			<entry class="83" argb="255,66,162,25" value="82" />
+			<entry class="84" argb="255,63,159,25" value="83" />
+			<entry class="85" argb="255,59,157,24" value="84" />
+			<entry class="86" argb="255,56,155,23" value="85" />
+			<entry class="87" argb="255,53,153,22" value="86" />
+			<entry class="88" argb="255,49,151,21" value="87" />
+			<entry class="89" argb="255,46,148,20" value="88" />
+			<entry class="90" argb="255,43,146,20" value="89" />
+			<entry class="91" argb="255,40,144,19" value="90" />
+			<entry class="92" argb="255,37,142,18" value="91" />
+			<entry class="93" argb="255,34,140,17" value="92" />
+			<entry class="94" argb="255,31,137,17" value="93" />
+			<entry class="95" argb="255,28,135,16" value="94" />
+			<entry class="96" argb="255,25,133,15" value="95" />
+			<entry class="97" argb="255,22,131,14" value="96" />
+			<entry class="98" argb="255,19,129,14" value="97" />
+			<entry class="99" argb="255,17,126,13" value="98" />
+			<entry class="100" argb="255,14,124,12" value="99" />
+		</table>
+	</palette>
+	
+	<palette name="2  Blues  (35)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,85" value="0" />
+			<entry class="2" argb="255,0,0,95" value="1" />
+			<entry class="3" argb="255,0,0,105" value="2" />
+			<entry class="4" argb="255,0,0,115" value="3" />
+			<entry class="5" argb="255,0,0,125" value="4" />
+			<entry class="6" argb="255,0,0,135" value="5" />
+			<entry class="7" argb="255,0,0,145" value="6" />
+			<entry class="8" argb="255,0,0,155" value="7" />
+			<entry class="9" argb="255,0,0,165" value="8" />
+			<entry class="10" argb="255,0,0,175" value="9" />
+			<entry class="11" argb="255,0,0,185" value="10" />
+			<entry class="12" argb="255,0,0,195" value="11" />
+			<entry class="13" argb="255,0,0,205" value="12" />
+			<entry class="14" argb="255,0,0,215" value="13" />
+			<entry class="15" argb="255,0,0,225" value="14" />
+			<entry class="16" argb="255,0,0,235" value="15" />
+			<entry class="17" argb="255,0,0,245" value="16" />
+			<entry class="18" argb="255,0,0,255" value="17" />
+			<entry class="19" argb="255,10,10,255" value="18" />
+			<entry class="20" argb="255,20,20,255" value="19" />
+			<entry class="21" argb="255,30,30,255" value="20" />
+			<entry class="22" argb="255,40,40,255" value="21" />
+			<entry class="23" argb="255,50,50,255" value="22" />
+			<entry class="24" argb="255,60,60,255" value="23" />
+			<entry class="25" argb="255,70,70,255" value="24" />
+			<entry class="26" argb="255,80,80,255" value="25" />
+			<entry class="27" argb="255,90,90,255" value="26" />
+			<entry class="28" argb="255,100,100,255" value="27" />
+			<entry class="29" argb="255,110,110,255" value="28" />
+			<entry class="30" argb="255,120,120,255" value="29" />
+			<entry class="31" argb="255,130,130,255" value="30" />
+			<entry class="32" argb="255,140,140,255" value="31" />
+			<entry class="33" argb="255,150,150,255" value="32" />
+			<entry class="34" argb="255,160,160,255" value="33" />
+			<entry class="35" argb="255,170,170,255" value="34" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(242,96,60) to HSV(192,96,96) to HSV(142,96,60) -->
+	<palette name="2  Cool  (100)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,11,6,153" value="0" />
+			<entry class="2" argb="255,8,6,154" value="1" />
+			<entry class="3" argb="255,6,6,156" value="2" />
+			<entry class="4" argb="255,6,8,158" value="3" />
+			<entry class="5" argb="255,6,11,160" value="4" />
+			<entry class="6" argb="255,6,14,162" value="5" />
+			<entry class="7" argb="255,6,17,164" value="6" />
+			<entry class="8" argb="255,6,19,165" value="7" />
+			<entry class="9" argb="255,6,22,167" value="8" />
+			<entry class="10" argb="255,6,25,169" value="9" />
+			<entry class="11" argb="255,6,28,171" value="10" />
+			<entry class="12" argb="255,6,31,173" value="11" />
+			<entry class="13" argb="255,7,35,175" value="12" />
+			<entry class="14" argb="255,7,38,176" value="13" />
+			<entry class="15" argb="255,7,41,178" value="14" />
+			<entry class="16" argb="255,7,44,180" value="15" />
+			<entry class="17" argb="255,7,48,182" value="16" />
+			<entry class="18" argb="255,7,51,184" value="17" />
+			<entry class="19" argb="255,7,55,186" value="18" />
+			<entry class="20" argb="255,7,58,187" value="19" />
+			<entry class="21" argb="255,7,62,189" value="20" />
+			<entry class="22" argb="255,7,65,191" value="21" />
+			<entry class="23" argb="255,7,69,193" value="22" />
+			<entry class="24" argb="255,7,73,195" value="23" />
+			<entry class="25" argb="255,7,77,197" value="24" />
+			<entry class="26" argb="255,7,81,198" value="25" />
+			<entry class="27" argb="255,8,85,200" value="26" />
+			<entry class="28" argb="255,8,89,202" value="27" />
+			<entry class="29" argb="255,8,93,204" value="28" />
+			<entry class="30" argb="255,8,97,206" value="29" />
+			<entry class="31" argb="255,8,101,208" value="30" />
+			<entry class="32" argb="255,8,105,209" value="31" />
+			<entry class="33" argb="255,8,110,211" value="32" />
+			<entry class="34" argb="255,8,114,213" value="33" />
+			<entry class="35" argb="255,8,118,215" value="34" />
+			<entry class="36" argb="255,8,123,217" value="35" />
+			<entry class="37" argb="255,8,127,219" value="36" />
+			<entry class="38" argb="255,8,132,220" value="37" />
+			<entry class="39" argb="255,8,137,222" value="38" />
+			<entry class="40" argb="255,8,141,224" value="39" />
+			<entry class="41" argb="255,9,146,226" value="40" />
+			<entry class="42" argb="255,9,151,228" value="41" />
+			<entry class="43" argb="255,9,156,230" value="42" />
+			<entry class="44" argb="255,9,161,231" value="43" />
+			<entry class="45" argb="255,9,166,233" value="44" />
+			<entry class="46" argb="255,9,171,235" value="45" />
+			<entry class="47" argb="255,9,176,237" value="46" />
+			<entry class="48" argb="255,9,181,239" value="47" />
+			<entry class="49" argb="255,9,187,241" value="48" />
+			<entry class="50" argb="255,9,192,242" value="49" />
+			<entry class="51" argb="255,9,197,244" value="50" />
+			<entry class="52" argb="255,9,200,242" value="51" />
+			<entry class="53" argb="255,9,202,241" value="52" />
+			<entry class="54" argb="255,9,204,239" value="53" />
+			<entry class="55" argb="255,9,207,237" value="54" />
+			<entry class="56" argb="255,9,209,235" value="55" />
+			<entry class="57" argb="255,9,211,233" value="56" />
+			<entry class="58" argb="255,9,213,231" value="57" />
+			<entry class="59" argb="255,9,215,230" value="58" />
+			<entry class="60" argb="255,9,217,228" value="59" />
+			<entry class="61" argb="255,9,219,226" value="60" />
+			<entry class="62" argb="255,8,221,224" value="61" />
+			<entry class="63" argb="255,8,222,222" value="62" />
+			<entry class="64" argb="255,8,220,217" value="63" />
+			<entry class="65" argb="255,8,219,212" value="64" />
+			<entry class="66" argb="255,8,217,206" value="65" />
+			<entry class="67" argb="255,8,215,201" value="66" />
+			<entry class="68" argb="255,8,213,196" value="67" />
+			<entry class="69" argb="255,8,211,191" value="68" />
+			<entry class="70" argb="255,8,209,186" value="69" />
+			<entry class="71" argb="255,8,208,181" value="70" />
+			<entry class="72" argb="255,8,206,176" value="71" />
+			<entry class="73" argb="255,8,204,171" value="72" />
+			<entry class="74" argb="255,8,202,166" value="73" />
+			<entry class="75" argb="255,8,200,162" value="74" />
+			<entry class="76" argb="255,7,198,157" value="75" />
+			<entry class="77" argb="255,7,197,152" value="76" />
+			<entry class="78" argb="255,7,195,148" value="77" />
+			<entry class="79" argb="255,7,193,143" value="78" />
+			<entry class="80" argb="255,7,191,139" value="79" />
+			<entry class="81" argb="255,7,189,135" value="80" />
+			<entry class="82" argb="255,7,187,130" value="81" />
+			<entry class="83" argb="255,7,186,126" value="82" />
+			<entry class="84" argb="255,7,184,122" value="83" />
+			<entry class="85" argb="255,7,182,118" value="84" />
+			<entry class="86" argb="255,7,180,114" value="85" />
+			<entry class="87" argb="255,7,178,110" value="86" />
+			<entry class="88" argb="255,7,176,106" value="87" />
+			<entry class="89" argb="255,7,175,102" value="88" />
+			<entry class="90" argb="255,6,173,98" value="89" />
+			<entry class="91" argb="255,6,171,94" value="90" />
+			<entry class="92" argb="255,6,169,90" value="91" />
+			<entry class="93" argb="255,6,167,87" value="92" />
+			<entry class="94" argb="255,6,165,83" value="93" />
+			<entry class="95" argb="255,6,164,80" value="94" />
+			<entry class="96" argb="255,6,162,76" value="95" />
+			<entry class="97" argb="255,6,160,73" value="96" />
+			<entry class="98" argb="255,6,158,69" value="97" />
+			<entry class="99" argb="255,6,156,66" value="98" />
+			<entry class="100" argb="255,6,154,63" value="99" />
+		</table>
+	</palette>
+	
+	<palette name="2  Greens  (35)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,0,85,0" value="0" />
+			<entry class="2" argb="255,0,95,0" value="1" />
+			<entry class="3" argb="255,0,105,0" value="2" />
+			<entry class="4" argb="255,0,115,0" value="3" />
+			<entry class="5" argb="255,0,125,0" value="4" />
+			<entry class="6" argb="255,0,135,0" value="5" />
+			<entry class="7" argb="255,0,145,0" value="6" />
+			<entry class="8" argb="255,0,155,0" value="7" />
+			<entry class="9" argb="255,0,165,0" value="8" />
+			<entry class="10" argb="255,0,175,0" value="9" />
+			<entry class="11" argb="255,0,185,0" value="10" />
+			<entry class="12" argb="255,0,195,0" value="11" />
+			<entry class="13" argb="255,0,205,0" value="12" />
+			<entry class="14" argb="255,0,215,0" value="13" />
+			<entry class="15" argb="255,0,225,0" value="14" />
+			<entry class="16" argb="255,0,235,0" value="15" />
+			<entry class="17" argb="255,0,245,0" value="16" />
+			<entry class="18" argb="255,0,255,0" value="17" />
+			<entry class="19" argb="255,10,255,10" value="18" />
+			<entry class="20" argb="255,20,255,20" value="19" />
+			<entry class="21" argb="255,30,255,30" value="20" />
+			<entry class="22" argb="255,40,255,40" value="21" />
+			<entry class="23" argb="255,50,255,50" value="22" />
+			<entry class="24" argb="255,60,255,60" value="23" />
+			<entry class="25" argb="255,70,255,70" value="24" />
+			<entry class="26" argb="255,80,255,80" value="25" />
+			<entry class="27" argb="255,90,255,90" value="26" />
+			<entry class="28" argb="255,100,255,100" value="27" />
+			<entry class="29" argb="255,110,255,110" value="28" />
+			<entry class="30" argb="255,120,255,120" value="29" />
+			<entry class="31" argb="255,130,255,130" value="30" />
+			<entry class="32" argb="255,140,255,140" value="31" />
+			<entry class="33" argb="255,150,255,150" value="32" />
+			<entry class="34" argb="255,160,255,160" value="33" />
+			<entry class="35" argb="255,170,255,170" value="34" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(165,95,36) to HSV(165,36,100) -->
+	<palette name="2  Marine  (24)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,4,91,69" value="0" />
+			<entry class="2" argb="255,7,98,75" value="1" />
+			<entry class="3" argb="255,10,105,81" value="2" />
+			<entry class="4" argb="255,13,112,87" value="3" />
+			<entry class="5" argb="255,17,119,93" value="4" />
+			<entry class="6" argb="255,21,125,99" value="5" />
+			<entry class="7" argb="255,26,132,105" value="6" />
+			<entry class="8" argb="255,30,139,112" value="7" />
+			<entry class="9" argb="255,36,146,118" value="8" />
+			<entry class="10" argb="255,41,152,125" value="9" />
+			<entry class="11" argb="255,47,159,131" value="10" />
+			<entry class="12" argb="255,53,166,138" value="11" />
+			<entry class="13" argb="255,59,173,145" value="12" />
+			<entry class="14" argb="255,66,180,151" value="13" />
+			<entry class="15" argb="255,73,186,158" value="14" />
+			<entry class="16" argb="255,81,193,165" value="15" />
+			<entry class="17" argb="255,88,200,172" value="16" />
+			<entry class="18" argb="255,97,207,179" value="17" />
+			<entry class="19" argb="255,105,214,187" value="18" />
+			<entry class="20" argb="255,114,220,194" value="19" />
+			<entry class="21" argb="255,123,227,201" value="20" />
+			<entry class="22" argb="255,132,234,209" value="21" />
+			<entry class="23" argb="255,142,241,216" value="22" />
+			<entry class="24" argb="255,152,248,224" value="23" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(30,100,100) to HSV(30,100,30) -->
+	<palette name="2  Pumpkin  (24)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,127,0" value="0" />
+			<entry class="2" argb="255,247,123,0" value="1" />
+			<entry class="3" argb="255,240,120,0" value="2" />
+			<entry class="4" argb="255,232,116,0" value="3" />
+			<entry class="5" argb="255,225,112,0" value="4" />
+			<entry class="6" argb="255,217,108,0" value="5" />
+			<entry class="7" argb="255,210,105,0" value="6" />
+			<entry class="8" argb="255,202,101,0" value="7" />
+			<entry class="9" argb="255,195,97,0" value="8" />
+			<entry class="10" argb="255,188,94,0" value="9" />
+			<entry class="11" argb="255,180,90,0" value="10" />
+			<entry class="12" argb="255,173,86,0" value="11" />
+			<entry class="13" argb="255,165,82,0" value="12" />
+			<entry class="14" argb="255,158,79,0" value="13" />
+			<entry class="15" argb="255,150,75,0" value="14" />
+			<entry class="16" argb="255,143,71,0" value="15" />
+			<entry class="17" argb="255,135,67,0" value="16" />
+			<entry class="18" argb="255,128,64,0" value="17" />
+			<entry class="19" argb="255,121,60,0" value="18" />
+			<entry class="20" argb="255,113,56,0" value="19" />
+			<entry class="21" argb="255,106,53,0" value="20" />
+			<entry class="22" argb="255,98,49,0" value="21" />
+			<entry class="23" argb="255,91,45,0" value="22" />
+			<entry class="24" argb="255,83,41,0" value="23" />
+		</table>
+	</palette>
+
+	<palette name="2  Reds  (35)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,85,0,0" value="0" />
+			<entry class="2" argb="255,95,0,0" value="1" />
+			<entry class="3" argb="255,105,0,0" value="2" />
+			<entry class="4" argb="255,115,0,0" value="3" />
+			<entry class="5" argb="255,125,0,0" value="4" />
+			<entry class="6" argb="255,135,0,0" value="5" />
+			<entry class="7" argb="255,145,0,0" value="6" />
+			<entry class="8" argb="255,155,0,0" value="7" />
+			<entry class="9" argb="255,165,0,0" value="8" />
+			<entry class="10" argb="255,175,0,0" value="9" />
+			<entry class="11" argb="255,185,0,0" value="10" />
+			<entry class="12" argb="255,195,0,0" value="11" />
+			<entry class="13" argb="255,205,0,0" value="12" />
+			<entry class="14" argb="255,215,0,0" value="13" />
+			<entry class="15" argb="255,225,0,0" value="14" />
+			<entry class="16" argb="255,235,0,0" value="15" />
+			<entry class="17" argb="255,245,0,0" value="16" />
+			<entry class="18" argb="255,255,0,0" value="17" />
+			<entry class="19" argb="255,255,10,10" value="18" />
+			<entry class="20" argb="255,255,20,20" value="19" />
+			<entry class="21" argb="255,255,30,30" value="20" />
+			<entry class="22" argb="255,255,40,40" value="21" />
+			<entry class="23" argb="255,255,50,50" value="22" />
+			<entry class="24" argb="255,255,60,60" value="23" />
+			<entry class="25" argb="255,255,70,70" value="24" />
+			<entry class="26" argb="255,255,80,80" value="25" />
+			<entry class="27" argb="255,255,90,90" value="26" />
+			<entry class="28" argb="255,255,100,100" value="27" />
+			<entry class="29" argb="255,255,110,110" value="28" />
+			<entry class="30" argb="255,255,120,120" value="29" />
+			<entry class="31" argb="255,255,130,130" value="30" />
+			<entry class="32" argb="255,255,140,140" value="31" />
+			<entry class="33" argb="255,255,150,150" value="32" />
+			<entry class="34" argb="255,255,160,160" value="33" />
+			<entry class="35" argb="255,255,170,170" value="34" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(50,38,98) to HSV(50,100,98) -->
+	<palette name="2  Sand  (24)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,249,234,154" value="0" />
+			<entry class="2" argb="255,249,232,148" value="1" />
+			<entry class="3" argb="255,249,231,142" value="2" />
+			<entry class="4" argb="255,249,230,135" value="3" />
+			<entry class="5" argb="255,249,229,129" value="4" />
+			<entry class="6" argb="255,249,228,122" value="5" />
+			<entry class="7" argb="255,249,227,116" value="6" />
+			<entry class="8" argb="255,249,226,109" value="7" />
+			<entry class="9" argb="255,249,225,103" value="8" />
+			<entry class="10" argb="255,249,224,96" value="9" />
+			<entry class="11" argb="255,249,223,90" value="10" />
+			<entry class="12" argb="255,249,222,83" value="11" />
+			<entry class="13" argb="255,249,221,77" value="12" />
+			<entry class="14" argb="255,249,220,71" value="13" />
+			<entry class="15" argb="255,249,219,64" value="14" />
+			<entry class="16" argb="255,249,217,58" value="15" />
+			<entry class="17" argb="255,249,216,51" value="16" />
+			<entry class="18" argb="255,249,215,45" value="17" />
+			<entry class="19" argb="255,249,214,38" value="18" />
+			<entry class="20" argb="255,249,213,32" value="19" />
+			<entry class="21" argb="255,249,212,25" value="20" />
+			<entry class="22" argb="255,249,211,19" value="21" />
+			<entry class="23" argb="255,249,210,12" value="22" />
+			<entry class="24" argb="255,249,209,6" value="23" />
+		</table>
+	</palette>	
+
+	<!-- Gradient, HSV(0,96,96) to HSV(32,96,96) to HSV(64,70,100) -->
+	<palette name="2  Warm  (64)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,244,9,9" value="0" />
+			<entry class="2" argb="255,244,13,9" value="1" />
+			<entry class="3" argb="255,244,17,9" value="2" />
+			<entry class="4" argb="255,244,21,9" value="3" />
+			<entry class="5" argb="255,244,25,9" value="4" />
+			<entry class="6" argb="255,244,29,9" value="5" />
+			<entry class="7" argb="255,244,33,9" value="6" />
+			<entry class="8" argb="255,244,37,9" value="7" />
+			<entry class="9" argb="255,244,41,9" value="8" />
+			<entry class="10" argb="255,244,45,9" value="9" />
+			<entry class="11" argb="255,244,48,9" value="10" />
+			<entry class="12" argb="255,244,52,9" value="11" />
+			<entry class="13" argb="255,244,56,9" value="12" />
+			<entry class="14" argb="255,244,60,9" value="13" />
+			<entry class="15" argb="255,244,64,9" value="14" />
+			<entry class="16" argb="255,244,68,9" value="15" />
+			<entry class="17" argb="255,244,72,9" value="16" />
+			<entry class="18" argb="255,244,76,9" value="17" />
+			<entry class="19" argb="255,244,80,9" value="18" />
+			<entry class="20" argb="255,244,84,9" value="19" />
+			<entry class="21" argb="255,244,88,9" value="20" />
+			<entry class="22" argb="255,244,92,9" value="21" />
+			<entry class="23" argb="255,244,95,9" value="22" />
+			<entry class="24" argb="255,244,99,9" value="23" />
+			<entry class="25" argb="255,244,103,9" value="24" />
+			<entry class="26" argb="255,244,107,9" value="25" />
+			<entry class="27" argb="255,244,111,9" value="26" />
+			<entry class="28" argb="255,244,115,9" value="27" />
+			<entry class="29" argb="255,244,119,9" value="28" />
+			<entry class="30" argb="255,244,123,9" value="29" />
+			<entry class="31" argb="255,244,127,9" value="30" />
+			<entry class="32" argb="255,244,131,9" value="31" />
+			<entry class="33" argb="255,244,135,9" value="32" />
+			<entry class="34" argb="255,245,140,11" value="33" />
+			<entry class="35" argb="255,245,145,13" value="34" />
+			<entry class="36" argb="255,245,149,15" value="35" />
+			<entry class="37" argb="255,246,154,17" value="36" />
+			<entry class="38" argb="255,246,159,19" value="37" />
+			<entry class="39" argb="255,246,164,21" value="38" />
+			<entry class="40" argb="255,247,168,23" value="39" />
+			<entry class="41" argb="255,247,173,25" value="40" />
+			<entry class="42" argb="255,247,178,28" value="41" />
+			<entry class="43" argb="255,247,182,30" value="42" />
+			<entry class="44" argb="255,248,187,32" value="43" />
+			<entry class="45" argb="255,248,191,34" value="44" />
+			<entry class="46" argb="255,248,195,36" value="45" />
+			<entry class="47" argb="255,249,200,38" value="46" />
+			<entry class="48" argb="255,249,204,40" value="47" />
+			<entry class="49" argb="255,249,208,42" value="48" />
+			<entry class="50" argb="255,250,212,44" value="49" />
+			<entry class="51" argb="255,250,216,46" value="50" />
+			<entry class="52" argb="255,250,220,48" value="51" />
+			<entry class="53" argb="255,251,224,50" value="52" />
+			<entry class="54" argb="255,251,228,52" value="53" />
+			<entry class="55" argb="255,251,232,55" value="54" />
+			<entry class="56" argb="255,252,235,57" value="55" />
+			<entry class="57" argb="255,252,239,59" value="56" />
+			<entry class="58" argb="255,252,243,61" value="57" />
+			<entry class="59" argb="255,253,246,63" value="58" />
+			<entry class="60" argb="255,253,250,65" value="59" />
+			<entry class="61" argb="255,253,253,67" value="60" />
+			<entry class="62" argb="255,250,254,70" value="61" />
+			<entry class="63" argb="255,248,254,72" value="62" />
+			<entry class="64" argb="255,245,254,74" value="63" />
+		</table>
+	</palette>
+
+<!-- Agave Split complements, 1st color then on second color again and again.  Then ordered by color wheel -->
+	<palette name="Candy  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,51,173" value="0" />
+			<entry class="2" argb="255,255,92,51" value="1" />
+			<entry class="3" argb="255,255,255,51" value="2" />
+			<entry class="4" argb="255,214,255,51" value="3" />
+			<entry class="5" argb="255,51,255,51" value="4" />
+			<entry class="6" argb="255,51,255,214" value="5" />
+			<entry class="7" argb="255,51,133,255" value="6" />
+			<entry class="8" argb="255,133,51,255" value="7" />
+			<entry class="9" argb="255,173,51,255" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 4, 95%, 95%) Degrees between hues 10-->
+	<palette name="Color Wheel Long  (36)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,27,12" value="0" />
+			<entry class="2" argb="255,242,65,12" value="1" />
+			<entry class="3" argb="255,242,104,12" value="2" />
+			<entry class="4" argb="255,242,142,12" value="3" />
+			<entry class="5" argb="255,242,180,12" value="4" />
+			<entry class="6" argb="255,242,219,12" value="5" />
+			<entry class="7" argb="255,226,242,12" value="6" />
+			<entry class="8" argb="255,188,242,12" value="7" />
+			<entry class="9" argb="255,150,242,12" value="8" />
+			<entry class="10" argb="255,111,242,12" value="9" />
+			<entry class="11" argb="255,73,242,12" value="10" />
+			<entry class="12" argb="255,35,242,12" value="11" />
+			<entry class="13" argb="255,12,242,27" value="12" />
+			<entry class="14" argb="255,12,242,65" value="13" />
+			<entry class="15" argb="255,12,242,104" value="14" />
+			<entry class="16" argb="255,12,242,142" value="15" />
+			<entry class="17" argb="255,12,242,180" value="16" />
+			<entry class="18" argb="255,12,242,219" value="17" />
+			<entry class="19" argb="255,12,226,242" value="18" />
+			<entry class="20" argb="255,12,188,242" value="19" />
+			<entry class="21" argb="255,12,150,242" value="20" />
+			<entry class="22" argb="255,12,111,242" value="21" />
+			<entry class="23" argb="255,12,73,242" value="22" />
+			<entry class="24" argb="255,12,35,242" value="23" />
+			<entry class="25" argb="255,27,12,242" value="24" />
+			<entry class="26" argb="255,65,12,242" value="25" />
+			<entry class="27" argb="255,104,12,242" value="26" />
+			<entry class="28" argb="255,142,12,242" value="27" />
+			<entry class="29" argb="255,180,12,242" value="28" />
+			<entry class="30" argb="255,219,12,242" value="29" />
+			<entry class="31" argb="255,242,12,226" value="30" />
+			<entry class="32" argb="255,242,12,188" value="31" />
+			<entry class="33" argb="255,242,12,150" value="32" />
+			<entry class="34" argb="255,242,12,111" value="33" />
+			<entry class="35" argb="255,242,12,73" value="34" />
+			<entry class="36" argb="255,242,12,35" value="35" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 4, 95%, 95%) Degrees between hues 40-->
+	<palette name="Color Wheel Short  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,27,12" value="0" />
+			<entry class="2" argb="255,242,180,12" value="1" />
+			<entry class="3" argb="255,150,242,12" value="2" />
+			<entry class="4" argb="255,12,242,27" value="3" />
+			<entry class="5" argb="255,12,242,180" value="4" />
+			<entry class="6" argb="255,12,150,242" value="5" />
+			<entry class="7" argb="255,27,12,242" value="6" />
+			<entry class="8" argb="255,180,12,242" value="7" />
+			<entry class="9" argb="255,242,12,150" value="8" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(210,100,100) to HSV(210,100,0) -->
+	<palette name="Deep Azure  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,127,255" value="0" />
+			<entry class="2" argb="255,0,127,254" value="1" />
+			<entry class="3" argb="255,0,126,253" value="2" />
+			<entry class="4" argb="255,0,126,252" value="3" />
+			<entry class="5" argb="255,0,125,251" value="4" />
+			<entry class="6" argb="255,0,125,250" value="5" />
+			<entry class="7" argb="255,0,124,249" value="6" />
+			<entry class="8" argb="255,0,124,248" value="7" />
+			<entry class="9" argb="255,0,123,247" value="8" />
+			<entry class="10" argb="255,0,123,246" value="9" />
+			<entry class="11" argb="255,0,122,245" value="10" />
+			<entry class="12" argb="255,0,122,244" value="11" />
+			<entry class="13" argb="255,0,121,243" value="12" />
+			<entry class="14" argb="255,0,121,242" value="13" />
+			<entry class="15" argb="255,0,120,241" value="14" />
+			<entry class="16" argb="255,0,120,240" value="15" />
+			<entry class="17" argb="255,0,119,239" value="16" />
+			<entry class="18" argb="255,0,119,238" value="17" />
+			<entry class="19" argb="255,0,118,237" value="18" />
+			<entry class="20" argb="255,0,118,236" value="19" />
+			<entry class="21" argb="255,0,117,235" value="20" />
+			<entry class="22" argb="255,0,117,234" value="21" />
+			<entry class="23" argb="255,0,116,233" value="22" />
+			<entry class="24" argb="255,0,116,232" value="23" />
+			<entry class="25" argb="255,0,115,231" value="24" />
+			<entry class="26" argb="255,0,115,230" value="25" />
+			<entry class="27" argb="255,0,114,229" value="26" />
+			<entry class="28" argb="255,0,114,228" value="27" />
+			<entry class="29" argb="255,0,113,227" value="28" />
+			<entry class="30" argb="255,0,113,226" value="29" />
+			<entry class="31" argb="255,0,112,225" value="30" />
+			<entry class="32" argb="255,0,112,224" value="31" />
+			<entry class="33" argb="255,0,111,223" value="32" />
+			<entry class="34" argb="255,0,111,222" value="33" />
+			<entry class="35" argb="255,0,110,221" value="34" />
+			<entry class="36" argb="255,0,110,220" value="35" />
+			<entry class="37" argb="255,0,109,219" value="36" />
+			<entry class="38" argb="255,0,109,218" value="37" />
+			<entry class="39" argb="255,0,108,217" value="38" />
+			<entry class="40" argb="255,0,108,216" value="39" />
+			<entry class="41" argb="255,0,107,215" value="40" />
+			<entry class="42" argb="255,0,107,214" value="41" />
+			<entry class="43" argb="255,0,106,213" value="42" />
+			<entry class="44" argb="255,0,106,212" value="43" />
+			<entry class="45" argb="255,0,105,211" value="44" />
+			<entry class="46" argb="255,0,105,210" value="45" />
+			<entry class="47" argb="255,0,104,209" value="46" />
+			<entry class="48" argb="255,0,104,208" value="47" />
+			<entry class="49" argb="255,0,103,207" value="48" />
+			<entry class="50" argb="255,0,103,206" value="49" />
+			<entry class="51" argb="255,0,102,205" value="50" />
+			<entry class="52" argb="255,0,102,204" value="51" />
+			<entry class="53" argb="255,0,101,203" value="52" />
+			<entry class="54" argb="255,0,101,202" value="53" />
+			<entry class="55" argb="255,0,100,201" value="54" />
+			<entry class="56" argb="255,0,100,200" value="55" />
+			<entry class="57" argb="255,0,99,199" value="56" />
+			<entry class="58" argb="255,0,99,198" value="57" />
+			<entry class="59" argb="255,0,98,197" value="58" />
+			<entry class="60" argb="255,0,98,196" value="59" />
+			<entry class="61" argb="255,0,97,195" value="60" />
+			<entry class="62" argb="255,0,97,194" value="61" />
+			<entry class="63" argb="255,0,96,193" value="62" />
+			<entry class="64" argb="255,0,96,192" value="63" />
+			<entry class="65" argb="255,0,95,191" value="64" />
+			<entry class="66" argb="255,0,95,190" value="65" />
+			<entry class="67" argb="255,0,94,189" value="66" />
+			<entry class="68" argb="255,0,94,188" value="67" />
+			<entry class="69" argb="255,0,93,187" value="68" />
+			<entry class="70" argb="255,0,93,186" value="69" />
+			<entry class="71" argb="255,0,92,185" value="70" />
+			<entry class="72" argb="255,0,92,184" value="71" />
+			<entry class="73" argb="255,0,91,183" value="72" />
+			<entry class="74" argb="255,0,91,182" value="73" />
+			<entry class="75" argb="255,0,90,181" value="74" />
+			<entry class="76" argb="255,0,90,180" value="75" />
+			<entry class="77" argb="255,0,89,179" value="76" />
+			<entry class="78" argb="255,0,89,178" value="77" />
+			<entry class="79" argb="255,0,88,177" value="78" />
+			<entry class="80" argb="255,0,88,176" value="79" />
+			<entry class="81" argb="255,0,87,175" value="80" />
+			<entry class="82" argb="255,0,87,174" value="81" />
+			<entry class="83" argb="255,0,86,173" value="82" />
+			<entry class="84" argb="255,0,86,172" value="83" />
+			<entry class="85" argb="255,0,85,171" value="84" />
+			<entry class="86" argb="255,0,85,170" value="85" />
+			<entry class="87" argb="255,0,84,169" value="86" />
+			<entry class="88" argb="255,0,84,168" value="87" />
+			<entry class="89" argb="255,0,83,167" value="88" />
+			<entry class="90" argb="255,0,83,166" value="89" />
+			<entry class="91" argb="255,0,82,165" value="90" />
+			<entry class="92" argb="255,0,82,164" value="91" />
+			<entry class="93" argb="255,0,81,163" value="92" />
+			<entry class="94" argb="255,0,81,162" value="93" />
+			<entry class="95" argb="255,0,80,161" value="94" />
+			<entry class="96" argb="255,0,80,160" value="95" />
+			<entry class="97" argb="255,0,79,159" value="96" />
+			<entry class="98" argb="255,0,79,158" value="97" />
+			<entry class="99" argb="255,0,78,157" value="98" />
+			<entry class="100" argb="255,0,78,156" value="99" />
+			<entry class="101" argb="255,0,77,155" value="100" />
+			<entry class="102" argb="255,0,77,154" value="101" />
+			<entry class="103" argb="255,0,76,153" value="102" />
+			<entry class="104" argb="255,0,76,152" value="103" />
+			<entry class="105" argb="255,0,75,151" value="104" />
+			<entry class="106" argb="255,0,75,150" value="105" />
+			<entry class="107" argb="255,0,74,149" value="106" />
+			<entry class="108" argb="255,0,74,148" value="107" />
+			<entry class="109" argb="255,0,73,147" value="108" />
+			<entry class="110" argb="255,0,73,146" value="109" />
+			<entry class="111" argb="255,0,72,145" value="110" />
+			<entry class="112" argb="255,0,72,144" value="111" />
+			<entry class="113" argb="255,0,71,143" value="112" />
+			<entry class="114" argb="255,0,71,142" value="113" />
+			<entry class="115" argb="255,0,70,141" value="114" />
+			<entry class="116" argb="255,0,70,140" value="115" />
+			<entry class="117" argb="255,0,69,139" value="116" />
+			<entry class="118" argb="255,0,69,138" value="117" />
+			<entry class="119" argb="255,0,68,137" value="118" />
+			<entry class="120" argb="255,0,68,136" value="119" />
+			<entry class="121" argb="255,0,67,135" value="120" />
+			<entry class="122" argb="255,0,67,134" value="121" />
+			<entry class="123" argb="255,0,66,133" value="122" />
+			<entry class="124" argb="255,0,66,132" value="123" />
+			<entry class="125" argb="255,0,65,131" value="124" />
+			<entry class="126" argb="255,0,65,130" value="125" />
+			<entry class="127" argb="255,0,64,129" value="126" />
+			<entry class="128" argb="255,0,64,128" value="127" />
+			<entry class="129" argb="255,0,63,127" value="128" />
+			<entry class="130" argb="255,0,63,126" value="129" />
+			<entry class="131" argb="255,0,62,125" value="130" />
+			<entry class="132" argb="255,0,62,124" value="131" />
+			<entry class="133" argb="255,0,61,123" value="132" />
+			<entry class="134" argb="255,0,61,122" value="133" />
+			<entry class="135" argb="255,0,60,121" value="134" />
+			<entry class="136" argb="255,0,60,120" value="135" />
+			<entry class="137" argb="255,0,59,119" value="136" />
+			<entry class="138" argb="255,0,59,118" value="137" />
+			<entry class="139" argb="255,0,58,117" value="138" />
+			<entry class="140" argb="255,0,58,116" value="139" />
+			<entry class="141" argb="255,0,57,115" value="140" />
+			<entry class="142" argb="255,0,57,114" value="141" />
+			<entry class="143" argb="255,0,56,113" value="142" />
+			<entry class="144" argb="255,0,56,112" value="143" />
+			<entry class="145" argb="255,0,55,111" value="144" />
+			<entry class="146" argb="255,0,55,110" value="145" />
+			<entry class="147" argb="255,0,54,109" value="146" />
+			<entry class="148" argb="255,0,54,108" value="147" />
+			<entry class="149" argb="255,0,53,107" value="148" />
+			<entry class="150" argb="255,0,53,106" value="149" />
+			<entry class="151" argb="255,0,52,105" value="150" />
+			<entry class="152" argb="255,0,52,104" value="151" />
+			<entry class="153" argb="255,0,51,103" value="152" />
+			<entry class="154" argb="255,0,51,102" value="153" />
+			<entry class="155" argb="255,0,50,101" value="154" />
+			<entry class="156" argb="255,0,50,100" value="155" />
+			<entry class="157" argb="255,0,49,99" value="156" />
+			<entry class="158" argb="255,0,49,98" value="157" />
+			<entry class="159" argb="255,0,48,97" value="158" />
+			<entry class="160" argb="255,0,48,96" value="159" />
+			<entry class="161" argb="255,0,47,95" value="160" />
+			<entry class="162" argb="255,0,47,94" value="161" />
+			<entry class="163" argb="255,0,46,93" value="162" />
+			<entry class="164" argb="255,0,46,92" value="163" />
+			<entry class="165" argb="255,0,45,91" value="164" />
+			<entry class="166" argb="255,0,45,90" value="165" />
+			<entry class="167" argb="255,0,44,89" value="166" />
+			<entry class="168" argb="255,0,44,88" value="167" />
+			<entry class="169" argb="255,0,43,87" value="168" />
+			<entry class="170" argb="255,0,43,86" value="169" />
+			<entry class="171" argb="255,0,42,85" value="170" />
+			<entry class="172" argb="255,0,42,84" value="171" />
+			<entry class="173" argb="255,0,41,83" value="172" />
+			<entry class="174" argb="255,0,41,82" value="173" />
+			<entry class="175" argb="255,0,40,81" value="174" />
+			<entry class="176" argb="255,0,40,80" value="175" />
+			<entry class="177" argb="255,0,39,79" value="176" />
+			<entry class="178" argb="255,0,39,78" value="177" />
+			<entry class="179" argb="255,0,38,77" value="178" />
+			<entry class="180" argb="255,0,38,76" value="179" />
+			<entry class="181" argb="255,0,37,75" value="180" />
+			<entry class="182" argb="255,0,37,74" value="181" />
+			<entry class="183" argb="255,0,36,73" value="182" />
+			<entry class="184" argb="255,0,36,72" value="183" />
+			<entry class="185" argb="255,0,35,71" value="184" />
+			<entry class="186" argb="255,0,35,70" value="185" />
+			<entry class="187" argb="255,0,34,69" value="186" />
+			<entry class="188" argb="255,0,34,68" value="187" />
+			<entry class="189" argb="255,0,33,67" value="188" />
+			<entry class="190" argb="255,0,33,66" value="189" />
+			<entry class="191" argb="255,0,32,65" value="190" />
+			<entry class="192" argb="255,0,32,64" value="191" />
+			<entry class="193" argb="255,0,31,63" value="192" />
+			<entry class="194" argb="255,0,31,62" value="193" />
+			<entry class="195" argb="255,0,30,61" value="194" />
+			<entry class="196" argb="255,0,30,60" value="195" />
+			<entry class="197" argb="255,0,29,59" value="196" />
+			<entry class="198" argb="255,0,29,58" value="197" />
+			<entry class="199" argb="255,0,28,57" value="198" />
+			<entry class="200" argb="255,0,28,56" value="199" />
+			<entry class="201" argb="255,0,27,55" value="200" />
+			<entry class="202" argb="255,0,27,54" value="201" />
+			<entry class="203" argb="255,0,26,53" value="202" />
+			<entry class="204" argb="255,0,26,52" value="203" />
+			<entry class="205" argb="255,0,25,51" value="204" />
+			<entry class="206" argb="255,0,25,50" value="205" />
+			<entry class="207" argb="255,0,24,49" value="206" />
+			<entry class="208" argb="255,0,24,48" value="207" />
+			<entry class="209" argb="255,0,23,47" value="208" />
+			<entry class="210" argb="255,0,23,46" value="209" />
+			<entry class="211" argb="255,0,22,45" value="210" />
+			<entry class="212" argb="255,0,22,44" value="211" />
+			<entry class="213" argb="255,0,21,43" value="212" />
+			<entry class="214" argb="255,0,21,42" value="213" />
+			<entry class="215" argb="255,0,20,41" value="214" />
+			<entry class="216" argb="255,0,20,40" value="215" />
+			<entry class="217" argb="255,0,19,39" value="216" />
+			<entry class="218" argb="255,0,19,38" value="217" />
+			<entry class="219" argb="255,0,18,37" value="218" />
+			<entry class="220" argb="255,0,18,36" value="219" />
+			<entry class="221" argb="255,0,17,35" value="220" />
+			<entry class="222" argb="255,0,17,34" value="221" />
+			<entry class="223" argb="255,0,16,33" value="222" />
+			<entry class="224" argb="255,0,16,32" value="223" />
+			<entry class="225" argb="255,0,15,31" value="224" />
+			<entry class="226" argb="255,0,15,30" value="225" />
+			<entry class="227" argb="255,0,14,29" value="226" />
+			<entry class="228" argb="255,0,14,28" value="227" />
+			<entry class="229" argb="255,0,13,27" value="228" />
+			<entry class="230" argb="255,0,13,26" value="229" />
+			<entry class="231" argb="255,0,12,25" value="230" />
+			<entry class="232" argb="255,0,12,24" value="231" />
+			<entry class="233" argb="255,0,11,23" value="232" />
+			<entry class="234" argb="255,0,11,22" value="233" />
+			<entry class="235" argb="255,0,10,21" value="234" />
+			<entry class="236" argb="255,0,10,20" value="235" />
+			<entry class="237" argb="255,0,9,19" value="236" />
+			<entry class="238" argb="255,0,9,18" value="237" />
+			<entry class="239" argb="255,0,8,17" value="238" />
+			<entry class="240" argb="255,0,8,16" value="239" />
+			<entry class="241" argb="255,0,7,15" value="240" />
+			<entry class="242" argb="255,0,7,14" value="241" />
+			<entry class="243" argb="255,0,6,13" value="242" />
+			<entry class="244" argb="255,0,6,12" value="243" />
+			<entry class="245" argb="255,0,5,11" value="244" />
+			<entry class="246" argb="255,0,5,10" value="245" />
+			<entry class="247" argb="255,0,4,9" value="246" />
+			<entry class="248" argb="255,0,4,8" value="247" />
+			<entry class="249" argb="255,0,3,7" value="248" />
+			<entry class="250" argb="255,0,3,6" value="249" />
+			<entry class="251" argb="255,0,2,5" value="250" />
+			<entry class="252" argb="255,0,2,4" value="251" />
+			<entry class="253" argb="255,0,1,3" value="252" />
+			<entry class="254" argb="255,0,1,2" value="253" />
+			<entry class="255" argb="255,0,0,1" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+	
+	<!-- Gradient, HSV(240,100,0) to HSV(240,100,100) -->
+	<palette name="Deep Blue  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,0,1" value="1" />
+			<entry class="3" argb="255,0,0,2" value="2" />
+			<entry class="4" argb="255,0,0,3" value="3" />
+			<entry class="5" argb="255,0,0,4" value="4" />
+			<entry class="6" argb="255,0,0,5" value="5" />
+			<entry class="7" argb="255,0,0,6" value="6" />
+			<entry class="8" argb="255,0,0,7" value="7" />
+			<entry class="9" argb="255,0,0,8" value="8" />
+			<entry class="10" argb="255,0,0,9" value="9" />
+			<entry class="11" argb="255,0,0,10" value="10" />
+			<entry class="12" argb="255,0,0,11" value="11" />
+			<entry class="13" argb="255,0,0,12" value="12" />
+			<entry class="14" argb="255,0,0,13" value="13" />
+			<entry class="15" argb="255,0,0,14" value="14" />
+			<entry class="16" argb="255,0,0,15" value="15" />
+			<entry class="17" argb="255,0,0,16" value="16" />
+			<entry class="18" argb="255,0,0,17" value="17" />
+			<entry class="19" argb="255,0,0,18" value="18" />
+			<entry class="20" argb="255,0,0,19" value="19" />
+			<entry class="21" argb="255,0,0,20" value="20" />
+			<entry class="22" argb="255,0,0,21" value="21" />
+			<entry class="23" argb="255,0,0,22" value="22" />
+			<entry class="24" argb="255,0,0,23" value="23" />
+			<entry class="25" argb="255,0,0,24" value="24" />
+			<entry class="26" argb="255,0,0,25" value="25" />
+			<entry class="27" argb="255,0,0,26" value="26" />
+			<entry class="28" argb="255,0,0,27" value="27" />
+			<entry class="29" argb="255,0,0,28" value="28" />
+			<entry class="30" argb="255,0,0,29" value="29" />
+			<entry class="31" argb="255,0,0,30" value="30" />
+			<entry class="32" argb="255,0,0,31" value="31" />
+			<entry class="33" argb="255,0,0,32" value="32" />
+			<entry class="34" argb="255,0,0,33" value="33" />
+			<entry class="35" argb="255,0,0,34" value="34" />
+			<entry class="36" argb="255,0,0,35" value="35" />
+			<entry class="37" argb="255,0,0,36" value="36" />
+			<entry class="38" argb="255,0,0,37" value="37" />
+			<entry class="39" argb="255,0,0,38" value="38" />
+			<entry class="40" argb="255,0,0,39" value="39" />
+			<entry class="41" argb="255,0,0,40" value="40" />
+			<entry class="42" argb="255,0,0,41" value="41" />
+			<entry class="43" argb="255,0,0,42" value="42" />
+			<entry class="44" argb="255,0,0,43" value="43" />
+			<entry class="45" argb="255,0,0,44" value="44" />
+			<entry class="46" argb="255,0,0,45" value="45" />
+			<entry class="47" argb="255,0,0,46" value="46" />
+			<entry class="48" argb="255,0,0,47" value="47" />
+			<entry class="49" argb="255,0,0,48" value="48" />
+			<entry class="50" argb="255,0,0,49" value="49" />
+			<entry class="51" argb="255,0,0,50" value="50" />
+			<entry class="52" argb="255,0,0,51" value="51" />
+			<entry class="53" argb="255,0,0,52" value="52" />
+			<entry class="54" argb="255,0,0,53" value="53" />
+			<entry class="55" argb="255,0,0,54" value="54" />
+			<entry class="56" argb="255,0,0,55" value="55" />
+			<entry class="57" argb="255,0,0,56" value="56" />
+			<entry class="58" argb="255,0,0,57" value="57" />
+			<entry class="59" argb="255,0,0,58" value="58" />
+			<entry class="60" argb="255,0,0,59" value="59" />
+			<entry class="61" argb="255,0,0,60" value="60" />
+			<entry class="62" argb="255,0,0,61" value="61" />
+			<entry class="63" argb="255,0,0,62" value="62" />
+			<entry class="64" argb="255,0,0,63" value="63" />
+			<entry class="65" argb="255,0,0,64" value="64" />
+			<entry class="66" argb="255,0,0,65" value="65" />
+			<entry class="67" argb="255,0,0,66" value="66" />
+			<entry class="68" argb="255,0,0,67" value="67" />
+			<entry class="69" argb="255,0,0,68" value="68" />
+			<entry class="70" argb="255,0,0,69" value="69" />
+			<entry class="71" argb="255,0,0,70" value="70" />
+			<entry class="72" argb="255,0,0,71" value="71" />
+			<entry class="73" argb="255,0,0,72" value="72" />
+			<entry class="74" argb="255,0,0,73" value="73" />
+			<entry class="75" argb="255,0,0,74" value="74" />
+			<entry class="76" argb="255,0,0,75" value="75" />
+			<entry class="77" argb="255,0,0,76" value="76" />
+			<entry class="78" argb="255,0,0,77" value="77" />
+			<entry class="79" argb="255,0,0,78" value="78" />
+			<entry class="80" argb="255,0,0,79" value="79" />
+			<entry class="81" argb="255,0,0,80" value="80" />
+			<entry class="82" argb="255,0,0,81" value="81" />
+			<entry class="83" argb="255,0,0,82" value="82" />
+			<entry class="84" argb="255,0,0,83" value="83" />
+			<entry class="85" argb="255,0,0,84" value="84" />
+			<entry class="86" argb="255,0,0,85" value="85" />
+			<entry class="87" argb="255,0,0,86" value="86" />
+			<entry class="88" argb="255,0,0,87" value="87" />
+			<entry class="89" argb="255,0,0,88" value="88" />
+			<entry class="90" argb="255,0,0,89" value="89" />
+			<entry class="91" argb="255,0,0,90" value="90" />
+			<entry class="92" argb="255,0,0,91" value="91" />
+			<entry class="93" argb="255,0,0,92" value="92" />
+			<entry class="94" argb="255,0,0,93" value="93" />
+			<entry class="95" argb="255,0,0,94" value="94" />
+			<entry class="96" argb="255,0,0,95" value="95" />
+			<entry class="97" argb="255,0,0,96" value="96" />
+			<entry class="98" argb="255,0,0,97" value="97" />
+			<entry class="99" argb="255,0,0,98" value="98" />
+			<entry class="100" argb="255,0,0,99" value="99" />
+			<entry class="101" argb="255,0,0,100" value="100" />
+			<entry class="102" argb="255,0,0,101" value="101" />
+			<entry class="103" argb="255,0,0,102" value="102" />
+			<entry class="104" argb="255,0,0,103" value="103" />
+			<entry class="105" argb="255,0,0,104" value="104" />
+			<entry class="106" argb="255,0,0,105" value="105" />
+			<entry class="107" argb="255,0,0,106" value="106" />
+			<entry class="108" argb="255,0,0,107" value="107" />
+			<entry class="109" argb="255,0,0,108" value="108" />
+			<entry class="110" argb="255,0,0,109" value="109" />
+			<entry class="111" argb="255,0,0,110" value="110" />
+			<entry class="112" argb="255,0,0,111" value="111" />
+			<entry class="113" argb="255,0,0,112" value="112" />
+			<entry class="114" argb="255,0,0,113" value="113" />
+			<entry class="115" argb="255,0,0,114" value="114" />
+			<entry class="116" argb="255,0,0,115" value="115" />
+			<entry class="117" argb="255,0,0,116" value="116" />
+			<entry class="118" argb="255,0,0,117" value="117" />
+			<entry class="119" argb="255,0,0,118" value="118" />
+			<entry class="120" argb="255,0,0,119" value="119" />
+			<entry class="121" argb="255,0,0,120" value="120" />
+			<entry class="122" argb="255,0,0,121" value="121" />
+			<entry class="123" argb="255,0,0,122" value="122" />
+			<entry class="124" argb="255,0,0,123" value="123" />
+			<entry class="125" argb="255,0,0,124" value="124" />
+			<entry class="126" argb="255,0,0,125" value="125" />
+			<entry class="127" argb="255,0,0,126" value="126" />
+			<entry class="128" argb="255,0,0,127" value="127" />
+			<entry class="129" argb="255,0,0,128" value="128" />
+			<entry class="130" argb="255,0,0,129" value="129" />
+			<entry class="131" argb="255,0,0,130" value="130" />
+			<entry class="132" argb="255,0,0,131" value="131" />
+			<entry class="133" argb="255,0,0,132" value="132" />
+			<entry class="134" argb="255,0,0,133" value="133" />
+			<entry class="135" argb="255,0,0,134" value="134" />
+			<entry class="136" argb="255,0,0,135" value="135" />
+			<entry class="137" argb="255,0,0,136" value="136" />
+			<entry class="138" argb="255,0,0,137" value="137" />
+			<entry class="139" argb="255,0,0,138" value="138" />
+			<entry class="140" argb="255,0,0,139" value="139" />
+			<entry class="141" argb="255,0,0,140" value="140" />
+			<entry class="142" argb="255,0,0,141" value="141" />
+			<entry class="143" argb="255,0,0,142" value="142" />
+			<entry class="144" argb="255,0,0,143" value="143" />
+			<entry class="145" argb="255,0,0,144" value="144" />
+			<entry class="146" argb="255,0,0,145" value="145" />
+			<entry class="147" argb="255,0,0,146" value="146" />
+			<entry class="148" argb="255,0,0,147" value="147" />
+			<entry class="149" argb="255,0,0,148" value="148" />
+			<entry class="150" argb="255,0,0,149" value="149" />
+			<entry class="151" argb="255,0,0,150" value="150" />
+			<entry class="152" argb="255,0,0,151" value="151" />
+			<entry class="153" argb="255,0,0,152" value="152" />
+			<entry class="154" argb="255,0,0,153" value="153" />
+			<entry class="155" argb="255,0,0,154" value="154" />
+			<entry class="156" argb="255,0,0,155" value="155" />
+			<entry class="157" argb="255,0,0,156" value="156" />
+			<entry class="158" argb="255,0,0,157" value="157" />
+			<entry class="159" argb="255,0,0,158" value="158" />
+			<entry class="160" argb="255,0,0,159" value="159" />
+			<entry class="161" argb="255,0,0,160" value="160" />
+			<entry class="162" argb="255,0,0,161" value="161" />
+			<entry class="163" argb="255,0,0,162" value="162" />
+			<entry class="164" argb="255,0,0,163" value="163" />
+			<entry class="165" argb="255,0,0,164" value="164" />
+			<entry class="166" argb="255,0,0,165" value="165" />
+			<entry class="167" argb="255,0,0,166" value="166" />
+			<entry class="168" argb="255,0,0,167" value="167" />
+			<entry class="169" argb="255,0,0,168" value="168" />
+			<entry class="170" argb="255,0,0,169" value="169" />
+			<entry class="171" argb="255,0,0,170" value="170" />
+			<entry class="172" argb="255,0,0,171" value="171" />
+			<entry class="173" argb="255,0,0,172" value="172" />
+			<entry class="174" argb="255,0,0,173" value="173" />
+			<entry class="175" argb="255,0,0,174" value="174" />
+			<entry class="176" argb="255,0,0,175" value="175" />
+			<entry class="177" argb="255,0,0,176" value="176" />
+			<entry class="178" argb="255,0,0,177" value="177" />
+			<entry class="179" argb="255,0,0,178" value="178" />
+			<entry class="180" argb="255,0,0,179" value="179" />
+			<entry class="181" argb="255,0,0,180" value="180" />
+			<entry class="182" argb="255,0,0,181" value="181" />
+			<entry class="183" argb="255,0,0,182" value="182" />
+			<entry class="184" argb="255,0,0,183" value="183" />
+			<entry class="185" argb="255,0,0,184" value="184" />
+			<entry class="186" argb="255,0,0,185" value="185" />
+			<entry class="187" argb="255,0,0,186" value="186" />
+			<entry class="188" argb="255,0,0,187" value="187" />
+			<entry class="189" argb="255,0,0,188" value="188" />
+			<entry class="190" argb="255,0,0,189" value="189" />
+			<entry class="191" argb="255,0,0,190" value="190" />
+			<entry class="192" argb="255,0,0,191" value="191" />
+			<entry class="193" argb="255,0,0,192" value="192" />
+			<entry class="194" argb="255,0,0,193" value="193" />
+			<entry class="195" argb="255,0,0,194" value="194" />
+			<entry class="196" argb="255,0,0,195" value="195" />
+			<entry class="197" argb="255,0,0,196" value="196" />
+			<entry class="198" argb="255,0,0,197" value="197" />
+			<entry class="199" argb="255,0,0,198" value="198" />
+			<entry class="200" argb="255,0,0,199" value="199" />
+			<entry class="201" argb="255,0,0,200" value="200" />
+			<entry class="202" argb="255,0,0,201" value="201" />
+			<entry class="203" argb="255,0,0,202" value="202" />
+			<entry class="204" argb="255,0,0,203" value="203" />
+			<entry class="205" argb="255,0,0,204" value="204" />
+			<entry class="206" argb="255,0,0,205" value="205" />
+			<entry class="207" argb="255,0,0,206" value="206" />
+			<entry class="208" argb="255,0,0,207" value="207" />
+			<entry class="209" argb="255,0,0,208" value="208" />
+			<entry class="210" argb="255,0,0,209" value="209" />
+			<entry class="211" argb="255,0,0,210" value="210" />
+			<entry class="212" argb="255,0,0,211" value="211" />
+			<entry class="213" argb="255,0,0,212" value="212" />
+			<entry class="214" argb="255,0,0,213" value="213" />
+			<entry class="215" argb="255,0,0,214" value="214" />
+			<entry class="216" argb="255,0,0,215" value="215" />
+			<entry class="217" argb="255,0,0,216" value="216" />
+			<entry class="218" argb="255,0,0,217" value="217" />
+			<entry class="219" argb="255,0,0,218" value="218" />
+			<entry class="220" argb="255,0,0,219" value="219" />
+			<entry class="221" argb="255,0,0,220" value="220" />
+			<entry class="222" argb="255,0,0,221" value="221" />
+			<entry class="223" argb="255,0,0,222" value="222" />
+			<entry class="224" argb="255,0,0,223" value="223" />
+			<entry class="225" argb="255,0,0,224" value="224" />
+			<entry class="226" argb="255,0,0,225" value="225" />
+			<entry class="227" argb="255,0,0,226" value="226" />
+			<entry class="228" argb="255,0,0,227" value="227" />
+			<entry class="229" argb="255,0,0,228" value="228" />
+			<entry class="230" argb="255,0,0,229" value="229" />
+			<entry class="231" argb="255,0,0,230" value="230" />
+			<entry class="232" argb="255,0,0,231" value="231" />
+			<entry class="233" argb="255,0,0,232" value="232" />
+			<entry class="234" argb="255,0,0,233" value="233" />
+			<entry class="235" argb="255,0,0,234" value="234" />
+			<entry class="236" argb="255,0,0,235" value="235" />
+			<entry class="237" argb="255,0,0,236" value="236" />
+			<entry class="238" argb="255,0,0,237" value="237" />
+			<entry class="239" argb="255,0,0,238" value="238" />
+			<entry class="240" argb="255,0,0,239" value="239" />
+			<entry class="241" argb="255,0,0,240" value="240" />
+			<entry class="242" argb="255,0,0,241" value="241" />
+			<entry class="243" argb="255,0,0,242" value="242" />
+			<entry class="244" argb="255,0,0,243" value="243" />
+			<entry class="245" argb="255,0,0,244" value="244" />
+			<entry class="246" argb="255,0,0,245" value="245" />
+			<entry class="247" argb="255,0,0,246" value="246" />
+			<entry class="248" argb="255,0,0,247" value="247" />
+			<entry class="249" argb="255,0,0,248" value="248" />
+			<entry class="250" argb="255,0,0,249" value="249" />
+			<entry class="251" argb="255,0,0,250" value="250" />
+			<entry class="252" argb="255,0,0,251" value="251" />
+			<entry class="253" argb="255,0,0,252" value="252" />
+			<entry class="254" argb="255,0,0,253" value="253" />
+			<entry class="255" argb="255,0,0,254" value="254" />
+			<entry class="256" argb="255,0,0,255" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(90,100,100) to HSV(90,100,0) -->
+	<palette name="Deep Chartreuse  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,127,255,0" value="0" />
+			<entry class="2" argb="255,127,254,0" value="1" />
+			<entry class="3" argb="255,126,253,0" value="2" />
+			<entry class="4" argb="255,126,252,0" value="3" />
+			<entry class="5" argb="255,125,251,0" value="4" />
+			<entry class="6" argb="255,125,250,0" value="5" />
+			<entry class="7" argb="255,124,249,0" value="6" />
+			<entry class="8" argb="255,124,248,0" value="7" />
+			<entry class="9" argb="255,123,247,0" value="8" />
+			<entry class="10" argb="255,123,246,0" value="9" />
+			<entry class="11" argb="255,122,245,0" value="10" />
+			<entry class="12" argb="255,122,244,0" value="11" />
+			<entry class="13" argb="255,121,243,0" value="12" />
+			<entry class="14" argb="255,121,242,0" value="13" />
+			<entry class="15" argb="255,120,241,0" value="14" />
+			<entry class="16" argb="255,120,240,0" value="15" />
+			<entry class="17" argb="255,119,239,0" value="16" />
+			<entry class="18" argb="255,119,238,0" value="17" />
+			<entry class="19" argb="255,118,237,0" value="18" />
+			<entry class="20" argb="255,118,236,0" value="19" />
+			<entry class="21" argb="255,117,235,0" value="20" />
+			<entry class="22" argb="255,117,234,0" value="21" />
+			<entry class="23" argb="255,116,233,0" value="22" />
+			<entry class="24" argb="255,116,232,0" value="23" />
+			<entry class="25" argb="255,115,231,0" value="24" />
+			<entry class="26" argb="255,115,230,0" value="25" />
+			<entry class="27" argb="255,114,229,0" value="26" />
+			<entry class="28" argb="255,114,228,0" value="27" />
+			<entry class="29" argb="255,113,227,0" value="28" />
+			<entry class="30" argb="255,113,226,0" value="29" />
+			<entry class="31" argb="255,112,225,0" value="30" />
+			<entry class="32" argb="255,112,224,0" value="31" />
+			<entry class="33" argb="255,111,223,0" value="32" />
+			<entry class="34" argb="255,111,222,0" value="33" />
+			<entry class="35" argb="255,110,221,0" value="34" />
+			<entry class="36" argb="255,110,220,0" value="35" />
+			<entry class="37" argb="255,109,219,0" value="36" />
+			<entry class="38" argb="255,109,218,0" value="37" />
+			<entry class="39" argb="255,108,217,0" value="38" />
+			<entry class="40" argb="255,108,216,0" value="39" />
+			<entry class="41" argb="255,107,215,0" value="40" />
+			<entry class="42" argb="255,107,214,0" value="41" />
+			<entry class="43" argb="255,106,213,0" value="42" />
+			<entry class="44" argb="255,106,212,0" value="43" />
+			<entry class="45" argb="255,105,211,0" value="44" />
+			<entry class="46" argb="255,105,210,0" value="45" />
+			<entry class="47" argb="255,104,209,0" value="46" />
+			<entry class="48" argb="255,104,208,0" value="47" />
+			<entry class="49" argb="255,103,207,0" value="48" />
+			<entry class="50" argb="255,103,206,0" value="49" />
+			<entry class="51" argb="255,102,205,0" value="50" />
+			<entry class="52" argb="255,102,204,0" value="51" />
+			<entry class="53" argb="255,101,203,0" value="52" />
+			<entry class="54" argb="255,101,202,0" value="53" />
+			<entry class="55" argb="255,100,201,0" value="54" />
+			<entry class="56" argb="255,100,200,0" value="55" />
+			<entry class="57" argb="255,99,199,0" value="56" />
+			<entry class="58" argb="255,99,198,0" value="57" />
+			<entry class="59" argb="255,98,197,0" value="58" />
+			<entry class="60" argb="255,98,196,0" value="59" />
+			<entry class="61" argb="255,97,195,0" value="60" />
+			<entry class="62" argb="255,97,194,0" value="61" />
+			<entry class="63" argb="255,96,193,0" value="62" />
+			<entry class="64" argb="255,96,192,0" value="63" />
+			<entry class="65" argb="255,95,191,0" value="64" />
+			<entry class="66" argb="255,95,190,0" value="65" />
+			<entry class="67" argb="255,94,189,0" value="66" />
+			<entry class="68" argb="255,94,188,0" value="67" />
+			<entry class="69" argb="255,93,187,0" value="68" />
+			<entry class="70" argb="255,93,186,0" value="69" />
+			<entry class="71" argb="255,92,185,0" value="70" />
+			<entry class="72" argb="255,92,184,0" value="71" />
+			<entry class="73" argb="255,91,183,0" value="72" />
+			<entry class="74" argb="255,91,182,0" value="73" />
+			<entry class="75" argb="255,90,181,0" value="74" />
+			<entry class="76" argb="255,90,180,0" value="75" />
+			<entry class="77" argb="255,89,179,0" value="76" />
+			<entry class="78" argb="255,89,178,0" value="77" />
+			<entry class="79" argb="255,88,177,0" value="78" />
+			<entry class="80" argb="255,88,176,0" value="79" />
+			<entry class="81" argb="255,87,175,0" value="80" />
+			<entry class="82" argb="255,87,174,0" value="81" />
+			<entry class="83" argb="255,86,173,0" value="82" />
+			<entry class="84" argb="255,86,172,0" value="83" />
+			<entry class="85" argb="255,85,171,0" value="84" />
+			<entry class="86" argb="255,85,170,0" value="85" />
+			<entry class="87" argb="255,84,169,0" value="86" />
+			<entry class="88" argb="255,84,168,0" value="87" />
+			<entry class="89" argb="255,83,167,0" value="88" />
+			<entry class="90" argb="255,83,166,0" value="89" />
+			<entry class="91" argb="255,82,165,0" value="90" />
+			<entry class="92" argb="255,82,164,0" value="91" />
+			<entry class="93" argb="255,81,163,0" value="92" />
+			<entry class="94" argb="255,81,162,0" value="93" />
+			<entry class="95" argb="255,80,161,0" value="94" />
+			<entry class="96" argb="255,80,160,0" value="95" />
+			<entry class="97" argb="255,79,159,0" value="96" />
+			<entry class="98" argb="255,79,158,0" value="97" />
+			<entry class="99" argb="255,78,157,0" value="98" />
+			<entry class="100" argb="255,78,156,0" value="99" />
+			<entry class="101" argb="255,77,155,0" value="100" />
+			<entry class="102" argb="255,77,154,0" value="101" />
+			<entry class="103" argb="255,76,153,0" value="102" />
+			<entry class="104" argb="255,76,152,0" value="103" />
+			<entry class="105" argb="255,75,151,0" value="104" />
+			<entry class="106" argb="255,75,150,0" value="105" />
+			<entry class="107" argb="255,74,149,0" value="106" />
+			<entry class="108" argb="255,74,148,0" value="107" />
+			<entry class="109" argb="255,73,147,0" value="108" />
+			<entry class="110" argb="255,73,146,0" value="109" />
+			<entry class="111" argb="255,72,145,0" value="110" />
+			<entry class="112" argb="255,72,144,0" value="111" />
+			<entry class="113" argb="255,71,143,0" value="112" />
+			<entry class="114" argb="255,71,142,0" value="113" />
+			<entry class="115" argb="255,70,141,0" value="114" />
+			<entry class="116" argb="255,70,140,0" value="115" />
+			<entry class="117" argb="255,69,139,0" value="116" />
+			<entry class="118" argb="255,69,138,0" value="117" />
+			<entry class="119" argb="255,68,137,0" value="118" />
+			<entry class="120" argb="255,68,136,0" value="119" />
+			<entry class="121" argb="255,67,135,0" value="120" />
+			<entry class="122" argb="255,67,134,0" value="121" />
+			<entry class="123" argb="255,66,133,0" value="122" />
+			<entry class="124" argb="255,66,132,0" value="123" />
+			<entry class="125" argb="255,65,131,0" value="124" />
+			<entry class="126" argb="255,65,130,0" value="125" />
+			<entry class="127" argb="255,64,129,0" value="126" />
+			<entry class="128" argb="255,64,128,0" value="127" />
+			<entry class="129" argb="255,63,127,0" value="128" />
+			<entry class="130" argb="255,63,126,0" value="129" />
+			<entry class="131" argb="255,62,125,0" value="130" />
+			<entry class="132" argb="255,62,124,0" value="131" />
+			<entry class="133" argb="255,61,123,0" value="132" />
+			<entry class="134" argb="255,61,122,0" value="133" />
+			<entry class="135" argb="255,60,121,0" value="134" />
+			<entry class="136" argb="255,60,120,0" value="135" />
+			<entry class="137" argb="255,59,119,0" value="136" />
+			<entry class="138" argb="255,59,118,0" value="137" />
+			<entry class="139" argb="255,58,117,0" value="138" />
+			<entry class="140" argb="255,58,116,0" value="139" />
+			<entry class="141" argb="255,57,115,0" value="140" />
+			<entry class="142" argb="255,57,114,0" value="141" />
+			<entry class="143" argb="255,56,113,0" value="142" />
+			<entry class="144" argb="255,56,112,0" value="143" />
+			<entry class="145" argb="255,55,111,0" value="144" />
+			<entry class="146" argb="255,55,110,0" value="145" />
+			<entry class="147" argb="255,54,109,0" value="146" />
+			<entry class="148" argb="255,54,108,0" value="147" />
+			<entry class="149" argb="255,53,107,0" value="148" />
+			<entry class="150" argb="255,53,106,0" value="149" />
+			<entry class="151" argb="255,52,105,0" value="150" />
+			<entry class="152" argb="255,52,104,0" value="151" />
+			<entry class="153" argb="255,51,103,0" value="152" />
+			<entry class="154" argb="255,51,102,0" value="153" />
+			<entry class="155" argb="255,50,101,0" value="154" />
+			<entry class="156" argb="255,50,100,0" value="155" />
+			<entry class="157" argb="255,49,99,0" value="156" />
+			<entry class="158" argb="255,49,98,0" value="157" />
+			<entry class="159" argb="255,48,97,0" value="158" />
+			<entry class="160" argb="255,48,96,0" value="159" />
+			<entry class="161" argb="255,47,95,0" value="160" />
+			<entry class="162" argb="255,47,94,0" value="161" />
+			<entry class="163" argb="255,46,93,0" value="162" />
+			<entry class="164" argb="255,46,92,0" value="163" />
+			<entry class="165" argb="255,45,91,0" value="164" />
+			<entry class="166" argb="255,45,90,0" value="165" />
+			<entry class="167" argb="255,44,89,0" value="166" />
+			<entry class="168" argb="255,44,88,0" value="167" />
+			<entry class="169" argb="255,43,87,0" value="168" />
+			<entry class="170" argb="255,43,86,0" value="169" />
+			<entry class="171" argb="255,42,85,0" value="170" />
+			<entry class="172" argb="255,42,84,0" value="171" />
+			<entry class="173" argb="255,41,83,0" value="172" />
+			<entry class="174" argb="255,41,82,0" value="173" />
+			<entry class="175" argb="255,40,81,0" value="174" />
+			<entry class="176" argb="255,40,80,0" value="175" />
+			<entry class="177" argb="255,39,79,0" value="176" />
+			<entry class="178" argb="255,39,78,0" value="177" />
+			<entry class="179" argb="255,38,77,0" value="178" />
+			<entry class="180" argb="255,38,76,0" value="179" />
+			<entry class="181" argb="255,37,75,0" value="180" />
+			<entry class="182" argb="255,37,74,0" value="181" />
+			<entry class="183" argb="255,36,73,0" value="182" />
+			<entry class="184" argb="255,36,72,0" value="183" />
+			<entry class="185" argb="255,35,71,0" value="184" />
+			<entry class="186" argb="255,35,70,0" value="185" />
+			<entry class="187" argb="255,34,69,0" value="186" />
+			<entry class="188" argb="255,34,68,0" value="187" />
+			<entry class="189" argb="255,33,67,0" value="188" />
+			<entry class="190" argb="255,33,66,0" value="189" />
+			<entry class="191" argb="255,32,65,0" value="190" />
+			<entry class="192" argb="255,32,64,0" value="191" />
+			<entry class="193" argb="255,31,63,0" value="192" />
+			<entry class="194" argb="255,31,62,0" value="193" />
+			<entry class="195" argb="255,30,61,0" value="194" />
+			<entry class="196" argb="255,30,60,0" value="195" />
+			<entry class="197" argb="255,29,59,0" value="196" />
+			<entry class="198" argb="255,29,58,0" value="197" />
+			<entry class="199" argb="255,28,57,0" value="198" />
+			<entry class="200" argb="255,28,56,0" value="199" />
+			<entry class="201" argb="255,27,55,0" value="200" />
+			<entry class="202" argb="255,27,54,0" value="201" />
+			<entry class="203" argb="255,26,53,0" value="202" />
+			<entry class="204" argb="255,26,52,0" value="203" />
+			<entry class="205" argb="255,25,51,0" value="204" />
+			<entry class="206" argb="255,25,50,0" value="205" />
+			<entry class="207" argb="255,24,49,0" value="206" />
+			<entry class="208" argb="255,24,48,0" value="207" />
+			<entry class="209" argb="255,23,47,0" value="208" />
+			<entry class="210" argb="255,23,46,0" value="209" />
+			<entry class="211" argb="255,22,45,0" value="210" />
+			<entry class="212" argb="255,22,44,0" value="211" />
+			<entry class="213" argb="255,21,43,0" value="212" />
+			<entry class="214" argb="255,21,42,0" value="213" />
+			<entry class="215" argb="255,20,41,0" value="214" />
+			<entry class="216" argb="255,20,40,0" value="215" />
+			<entry class="217" argb="255,19,39,0" value="216" />
+			<entry class="218" argb="255,19,38,0" value="217" />
+			<entry class="219" argb="255,18,37,0" value="218" />
+			<entry class="220" argb="255,18,36,0" value="219" />
+			<entry class="221" argb="255,17,35,0" value="220" />
+			<entry class="222" argb="255,17,34,0" value="221" />
+			<entry class="223" argb="255,16,33,0" value="222" />
+			<entry class="224" argb="255,16,32,0" value="223" />
+			<entry class="225" argb="255,15,31,0" value="224" />
+			<entry class="226" argb="255,15,30,0" value="225" />
+			<entry class="227" argb="255,14,29,0" value="226" />
+			<entry class="228" argb="255,14,28,0" value="227" />
+			<entry class="229" argb="255,13,27,0" value="228" />
+			<entry class="230" argb="255,13,26,0" value="229" />
+			<entry class="231" argb="255,12,25,0" value="230" />
+			<entry class="232" argb="255,12,24,0" value="231" />
+			<entry class="233" argb="255,11,23,0" value="232" />
+			<entry class="234" argb="255,11,22,0" value="233" />
+			<entry class="235" argb="255,10,21,0" value="234" />
+			<entry class="236" argb="255,10,20,0" value="235" />
+			<entry class="237" argb="255,9,19,0" value="236" />
+			<entry class="238" argb="255,9,18,0" value="237" />
+			<entry class="239" argb="255,8,17,0" value="238" />
+			<entry class="240" argb="255,8,16,0" value="239" />
+			<entry class="241" argb="255,7,15,0" value="240" />
+			<entry class="242" argb="255,7,14,0" value="241" />
+			<entry class="243" argb="255,6,13,0" value="242" />
+			<entry class="244" argb="255,6,12,0" value="243" />
+			<entry class="245" argb="255,5,11,0" value="244" />
+			<entry class="246" argb="255,5,10,0" value="245" />
+			<entry class="247" argb="255,4,9,0" value="246" />
+			<entry class="248" argb="255,4,8,0" value="247" />
+			<entry class="249" argb="255,3,7,0" value="248" />
+			<entry class="250" argb="255,3,6,0" value="249" />
+			<entry class="251" argb="255,2,5,0" value="250" />
+			<entry class="252" argb="255,2,4,0" value="251" />
+			<entry class="253" argb="255,1,3,0" value="252" />
+			<entry class="254" argb="255,1,2,0" value="253" />
+			<entry class="255" argb="255,0,1,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(180,100,0) to HSV(180,100,100) -->
+	<palette name="Deep Cyan  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,1,1" value="1" />
+			<entry class="3" argb="255,0,2,2" value="2" />
+			<entry class="4" argb="255,0,3,3" value="3" />
+			<entry class="5" argb="255,0,4,4" value="4" />
+			<entry class="6" argb="255,0,5,5" value="5" />
+			<entry class="7" argb="255,0,6,6" value="6" />
+			<entry class="8" argb="255,0,7,7" value="7" />
+			<entry class="9" argb="255,0,8,8" value="8" />
+			<entry class="10" argb="255,0,9,9" value="9" />
+			<entry class="11" argb="255,0,10,10" value="10" />
+			<entry class="12" argb="255,0,11,11" value="11" />
+			<entry class="13" argb="255,0,12,12" value="12" />
+			<entry class="14" argb="255,0,13,13" value="13" />
+			<entry class="15" argb="255,0,14,14" value="14" />
+			<entry class="16" argb="255,0,15,15" value="15" />
+			<entry class="17" argb="255,0,16,16" value="16" />
+			<entry class="18" argb="255,0,17,17" value="17" />
+			<entry class="19" argb="255,0,18,18" value="18" />
+			<entry class="20" argb="255,0,19,19" value="19" />
+			<entry class="21" argb="255,0,20,20" value="20" />
+			<entry class="22" argb="255,0,21,21" value="21" />
+			<entry class="23" argb="255,0,22,22" value="22" />
+			<entry class="24" argb="255,0,23,23" value="23" />
+			<entry class="25" argb="255,0,24,24" value="24" />
+			<entry class="26" argb="255,0,25,25" value="25" />
+			<entry class="27" argb="255,0,26,26" value="26" />
+			<entry class="28" argb="255,0,27,27" value="27" />
+			<entry class="29" argb="255,0,28,28" value="28" />
+			<entry class="30" argb="255,0,29,29" value="29" />
+			<entry class="31" argb="255,0,30,30" value="30" />
+			<entry class="32" argb="255,0,31,31" value="31" />
+			<entry class="33" argb="255,0,32,32" value="32" />
+			<entry class="34" argb="255,0,33,33" value="33" />
+			<entry class="35" argb="255,0,34,34" value="34" />
+			<entry class="36" argb="255,0,35,35" value="35" />
+			<entry class="37" argb="255,0,36,36" value="36" />
+			<entry class="38" argb="255,0,37,37" value="37" />
+			<entry class="39" argb="255,0,38,38" value="38" />
+			<entry class="40" argb="255,0,39,39" value="39" />
+			<entry class="41" argb="255,0,40,40" value="40" />
+			<entry class="42" argb="255,0,41,41" value="41" />
+			<entry class="43" argb="255,0,42,42" value="42" />
+			<entry class="44" argb="255,0,43,43" value="43" />
+			<entry class="45" argb="255,0,44,44" value="44" />
+			<entry class="46" argb="255,0,45,45" value="45" />
+			<entry class="47" argb="255,0,46,46" value="46" />
+			<entry class="48" argb="255,0,47,47" value="47" />
+			<entry class="49" argb="255,0,48,48" value="48" />
+			<entry class="50" argb="255,0,49,49" value="49" />
+			<entry class="51" argb="255,0,50,50" value="50" />
+			<entry class="52" argb="255,0,51,51" value="51" />
+			<entry class="53" argb="255,0,52,52" value="52" />
+			<entry class="54" argb="255,0,53,53" value="53" />
+			<entry class="55" argb="255,0,54,54" value="54" />
+			<entry class="56" argb="255,0,55,55" value="55" />
+			<entry class="57" argb="255,0,56,56" value="56" />
+			<entry class="58" argb="255,0,57,57" value="57" />
+			<entry class="59" argb="255,0,58,58" value="58" />
+			<entry class="60" argb="255,0,59,59" value="59" />
+			<entry class="61" argb="255,0,60,60" value="60" />
+			<entry class="62" argb="255,0,61,61" value="61" />
+			<entry class="63" argb="255,0,62,62" value="62" />
+			<entry class="64" argb="255,0,63,63" value="63" />
+			<entry class="65" argb="255,0,64,64" value="64" />
+			<entry class="66" argb="255,0,65,65" value="65" />
+			<entry class="67" argb="255,0,66,66" value="66" />
+			<entry class="68" argb="255,0,67,67" value="67" />
+			<entry class="69" argb="255,0,68,68" value="68" />
+			<entry class="70" argb="255,0,69,69" value="69" />
+			<entry class="71" argb="255,0,70,70" value="70" />
+			<entry class="72" argb="255,0,71,71" value="71" />
+			<entry class="73" argb="255,0,72,72" value="72" />
+			<entry class="74" argb="255,0,73,73" value="73" />
+			<entry class="75" argb="255,0,74,74" value="74" />
+			<entry class="76" argb="255,0,75,75" value="75" />
+			<entry class="77" argb="255,0,76,76" value="76" />
+			<entry class="78" argb="255,0,77,77" value="77" />
+			<entry class="79" argb="255,0,78,78" value="78" />
+			<entry class="80" argb="255,0,79,79" value="79" />
+			<entry class="81" argb="255,0,80,80" value="80" />
+			<entry class="82" argb="255,0,81,81" value="81" />
+			<entry class="83" argb="255,0,82,82" value="82" />
+			<entry class="84" argb="255,0,83,83" value="83" />
+			<entry class="85" argb="255,0,84,84" value="84" />
+			<entry class="86" argb="255,0,85,85" value="85" />
+			<entry class="87" argb="255,0,86,86" value="86" />
+			<entry class="88" argb="255,0,87,87" value="87" />
+			<entry class="89" argb="255,0,88,88" value="88" />
+			<entry class="90" argb="255,0,89,89" value="89" />
+			<entry class="91" argb="255,0,90,90" value="90" />
+			<entry class="92" argb="255,0,91,91" value="91" />
+			<entry class="93" argb="255,0,92,92" value="92" />
+			<entry class="94" argb="255,0,93,93" value="93" />
+			<entry class="95" argb="255,0,94,94" value="94" />
+			<entry class="96" argb="255,0,95,95" value="95" />
+			<entry class="97" argb="255,0,96,96" value="96" />
+			<entry class="98" argb="255,0,97,97" value="97" />
+			<entry class="99" argb="255,0,98,98" value="98" />
+			<entry class="100" argb="255,0,99,99" value="99" />
+			<entry class="101" argb="255,0,100,100" value="100" />
+			<entry class="102" argb="255,0,101,101" value="101" />
+			<entry class="103" argb="255,0,102,102" value="102" />
+			<entry class="104" argb="255,0,103,103" value="103" />
+			<entry class="105" argb="255,0,104,104" value="104" />
+			<entry class="106" argb="255,0,105,105" value="105" />
+			<entry class="107" argb="255,0,106,106" value="106" />
+			<entry class="108" argb="255,0,107,107" value="107" />
+			<entry class="109" argb="255,0,108,108" value="108" />
+			<entry class="110" argb="255,0,109,109" value="109" />
+			<entry class="111" argb="255,0,110,110" value="110" />
+			<entry class="112" argb="255,0,111,111" value="111" />
+			<entry class="113" argb="255,0,112,112" value="112" />
+			<entry class="114" argb="255,0,113,113" value="113" />
+			<entry class="115" argb="255,0,114,114" value="114" />
+			<entry class="116" argb="255,0,115,115" value="115" />
+			<entry class="117" argb="255,0,116,116" value="116" />
+			<entry class="118" argb="255,0,117,117" value="117" />
+			<entry class="119" argb="255,0,118,118" value="118" />
+			<entry class="120" argb="255,0,119,119" value="119" />
+			<entry class="121" argb="255,0,120,120" value="120" />
+			<entry class="122" argb="255,0,121,121" value="121" />
+			<entry class="123" argb="255,0,122,122" value="122" />
+			<entry class="124" argb="255,0,123,123" value="123" />
+			<entry class="125" argb="255,0,124,124" value="124" />
+			<entry class="126" argb="255,0,125,125" value="125" />
+			<entry class="127" argb="255,0,126,126" value="126" />
+			<entry class="128" argb="255,0,127,127" value="127" />
+			<entry class="129" argb="255,0,128,128" value="128" />
+			<entry class="130" argb="255,0,129,129" value="129" />
+			<entry class="131" argb="255,0,130,130" value="130" />
+			<entry class="132" argb="255,0,131,131" value="131" />
+			<entry class="133" argb="255,0,132,132" value="132" />
+			<entry class="134" argb="255,0,133,133" value="133" />
+			<entry class="135" argb="255,0,134,134" value="134" />
+			<entry class="136" argb="255,0,135,135" value="135" />
+			<entry class="137" argb="255,0,136,136" value="136" />
+			<entry class="138" argb="255,0,137,137" value="137" />
+			<entry class="139" argb="255,0,138,138" value="138" />
+			<entry class="140" argb="255,0,139,139" value="139" />
+			<entry class="141" argb="255,0,140,140" value="140" />
+			<entry class="142" argb="255,0,141,141" value="141" />
+			<entry class="143" argb="255,0,142,142" value="142" />
+			<entry class="144" argb="255,0,143,143" value="143" />
+			<entry class="145" argb="255,0,144,144" value="144" />
+			<entry class="146" argb="255,0,145,145" value="145" />
+			<entry class="147" argb="255,0,146,146" value="146" />
+			<entry class="148" argb="255,0,147,147" value="147" />
+			<entry class="149" argb="255,0,148,148" value="148" />
+			<entry class="150" argb="255,0,149,149" value="149" />
+			<entry class="151" argb="255,0,150,150" value="150" />
+			<entry class="152" argb="255,0,151,151" value="151" />
+			<entry class="153" argb="255,0,152,152" value="152" />
+			<entry class="154" argb="255,0,153,153" value="153" />
+			<entry class="155" argb="255,0,154,154" value="154" />
+			<entry class="156" argb="255,0,155,155" value="155" />
+			<entry class="157" argb="255,0,156,156" value="156" />
+			<entry class="158" argb="255,0,157,157" value="157" />
+			<entry class="159" argb="255,0,158,158" value="158" />
+			<entry class="160" argb="255,0,159,159" value="159" />
+			<entry class="161" argb="255,0,160,160" value="160" />
+			<entry class="162" argb="255,0,161,161" value="161" />
+			<entry class="163" argb="255,0,162,162" value="162" />
+			<entry class="164" argb="255,0,163,163" value="163" />
+			<entry class="165" argb="255,0,164,164" value="164" />
+			<entry class="166" argb="255,0,165,165" value="165" />
+			<entry class="167" argb="255,0,166,166" value="166" />
+			<entry class="168" argb="255,0,167,167" value="167" />
+			<entry class="169" argb="255,0,168,168" value="168" />
+			<entry class="170" argb="255,0,169,169" value="169" />
+			<entry class="171" argb="255,0,170,170" value="170" />
+			<entry class="172" argb="255,0,171,171" value="171" />
+			<entry class="173" argb="255,0,172,172" value="172" />
+			<entry class="174" argb="255,0,173,173" value="173" />
+			<entry class="175" argb="255,0,174,174" value="174" />
+			<entry class="176" argb="255,0,175,175" value="175" />
+			<entry class="177" argb="255,0,176,176" value="176" />
+			<entry class="178" argb="255,0,177,177" value="177" />
+			<entry class="179" argb="255,0,178,178" value="178" />
+			<entry class="180" argb="255,0,179,179" value="179" />
+			<entry class="181" argb="255,0,180,180" value="180" />
+			<entry class="182" argb="255,0,181,181" value="181" />
+			<entry class="183" argb="255,0,182,182" value="182" />
+			<entry class="184" argb="255,0,183,183" value="183" />
+			<entry class="185" argb="255,0,184,184" value="184" />
+			<entry class="186" argb="255,0,185,185" value="185" />
+			<entry class="187" argb="255,0,186,186" value="186" />
+			<entry class="188" argb="255,0,187,187" value="187" />
+			<entry class="189" argb="255,0,188,188" value="188" />
+			<entry class="190" argb="255,0,189,189" value="189" />
+			<entry class="191" argb="255,0,190,190" value="190" />
+			<entry class="192" argb="255,0,191,191" value="191" />
+			<entry class="193" argb="255,0,192,192" value="192" />
+			<entry class="194" argb="255,0,193,193" value="193" />
+			<entry class="195" argb="255,0,194,194" value="194" />
+			<entry class="196" argb="255,0,195,195" value="195" />
+			<entry class="197" argb="255,0,196,196" value="196" />
+			<entry class="198" argb="255,0,197,197" value="197" />
+			<entry class="199" argb="255,0,198,198" value="198" />
+			<entry class="200" argb="255,0,199,199" value="199" />
+			<entry class="201" argb="255,0,200,200" value="200" />
+			<entry class="202" argb="255,0,201,201" value="201" />
+			<entry class="203" argb="255,0,202,202" value="202" />
+			<entry class="204" argb="255,0,203,203" value="203" />
+			<entry class="205" argb="255,0,204,204" value="204" />
+			<entry class="206" argb="255,0,205,205" value="205" />
+			<entry class="207" argb="255,0,206,206" value="206" />
+			<entry class="208" argb="255,0,207,207" value="207" />
+			<entry class="209" argb="255,0,208,208" value="208" />
+			<entry class="210" argb="255,0,209,209" value="209" />
+			<entry class="211" argb="255,0,210,210" value="210" />
+			<entry class="212" argb="255,0,211,211" value="211" />
+			<entry class="213" argb="255,0,212,212" value="212" />
+			<entry class="214" argb="255,0,213,213" value="213" />
+			<entry class="215" argb="255,0,214,214" value="214" />
+			<entry class="216" argb="255,0,215,215" value="215" />
+			<entry class="217" argb="255,0,216,216" value="216" />
+			<entry class="218" argb="255,0,217,217" value="217" />
+			<entry class="219" argb="255,0,218,218" value="218" />
+			<entry class="220" argb="255,0,219,219" value="219" />
+			<entry class="221" argb="255,0,220,220" value="220" />
+			<entry class="222" argb="255,0,221,221" value="221" />
+			<entry class="223" argb="255,0,222,222" value="222" />
+			<entry class="224" argb="255,0,223,223" value="223" />
+			<entry class="225" argb="255,0,224,224" value="224" />
+			<entry class="226" argb="255,0,225,225" value="225" />
+			<entry class="227" argb="255,0,226,226" value="226" />
+			<entry class="228" argb="255,0,227,227" value="227" />
+			<entry class="229" argb="255,0,228,228" value="228" />
+			<entry class="230" argb="255,0,229,229" value="229" />
+			<entry class="231" argb="255,0,230,230" value="230" />
+			<entry class="232" argb="255,0,231,231" value="231" />
+			<entry class="233" argb="255,0,232,232" value="232" />
+			<entry class="234" argb="255,0,233,233" value="233" />
+			<entry class="235" argb="255,0,234,234" value="234" />
+			<entry class="236" argb="255,0,235,235" value="235" />
+			<entry class="237" argb="255,0,236,236" value="236" />
+			<entry class="238" argb="255,0,237,237" value="237" />
+			<entry class="239" argb="255,0,238,238" value="238" />
+			<entry class="240" argb="255,0,239,239" value="239" />
+			<entry class="241" argb="255,0,240,240" value="240" />
+			<entry class="242" argb="255,0,241,241" value="241" />
+			<entry class="243" argb="255,0,242,242" value="242" />
+			<entry class="244" argb="255,0,243,243" value="243" />
+			<entry class="245" argb="255,0,244,244" value="244" />
+			<entry class="246" argb="255,0,245,245" value="245" />
+			<entry class="247" argb="255,0,246,246" value="246" />
+			<entry class="248" argb="255,0,247,247" value="247" />
+			<entry class="249" argb="255,0,248,248" value="248" />
+			<entry class="250" argb="255,0,249,249" value="249" />
+			<entry class="251" argb="255,0,250,250" value="250" />
+			<entry class="252" argb="255,0,251,251" value="251" />
+			<entry class="253" argb="255,0,252,252" value="252" />
+			<entry class="254" argb="255,0,253,253" value="253" />
+			<entry class="255" argb="255,0,254,254" value="254" />
+			<entry class="256" argb="255,0,255,255" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(120,100,0) to HSV(120,100,100) -->
+	<palette name="Deep Green  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,1,0" value="1" />
+			<entry class="3" argb="255,0,2,0" value="2" />
+			<entry class="4" argb="255,0,3,0" value="3" />
+			<entry class="5" argb="255,0,4,0" value="4" />
+			<entry class="6" argb="255,0,5,0" value="5" />
+			<entry class="7" argb="255,0,6,0" value="6" />
+			<entry class="8" argb="255,0,7,0" value="7" />
+			<entry class="9" argb="255,0,8,0" value="8" />
+			<entry class="10" argb="255,0,9,0" value="9" />
+			<entry class="11" argb="255,0,10,0" value="10" />
+			<entry class="12" argb="255,0,11,0" value="11" />
+			<entry class="13" argb="255,0,12,0" value="12" />
+			<entry class="14" argb="255,0,13,0" value="13" />
+			<entry class="15" argb="255,0,14,0" value="14" />
+			<entry class="16" argb="255,0,15,0" value="15" />
+			<entry class="17" argb="255,0,16,0" value="16" />
+			<entry class="18" argb="255,0,17,0" value="17" />
+			<entry class="19" argb="255,0,18,0" value="18" />
+			<entry class="20" argb="255,0,19,0" value="19" />
+			<entry class="21" argb="255,0,20,0" value="20" />
+			<entry class="22" argb="255,0,21,0" value="21" />
+			<entry class="23" argb="255,0,22,0" value="22" />
+			<entry class="24" argb="255,0,23,0" value="23" />
+			<entry class="25" argb="255,0,24,0" value="24" />
+			<entry class="26" argb="255,0,25,0" value="25" />
+			<entry class="27" argb="255,0,26,0" value="26" />
+			<entry class="28" argb="255,0,27,0" value="27" />
+			<entry class="29" argb="255,0,28,0" value="28" />
+			<entry class="30" argb="255,0,29,0" value="29" />
+			<entry class="31" argb="255,0,30,0" value="30" />
+			<entry class="32" argb="255,0,31,0" value="31" />
+			<entry class="33" argb="255,0,32,0" value="32" />
+			<entry class="34" argb="255,0,33,0" value="33" />
+			<entry class="35" argb="255,0,34,0" value="34" />
+			<entry class="36" argb="255,0,35,0" value="35" />
+			<entry class="37" argb="255,0,36,0" value="36" />
+			<entry class="38" argb="255,0,37,0" value="37" />
+			<entry class="39" argb="255,0,38,0" value="38" />
+			<entry class="40" argb="255,0,39,0" value="39" />
+			<entry class="41" argb="255,0,40,0" value="40" />
+			<entry class="42" argb="255,0,41,0" value="41" />
+			<entry class="43" argb="255,0,42,0" value="42" />
+			<entry class="44" argb="255,0,43,0" value="43" />
+			<entry class="45" argb="255,0,44,0" value="44" />
+			<entry class="46" argb="255,0,45,0" value="45" />
+			<entry class="47" argb="255,0,46,0" value="46" />
+			<entry class="48" argb="255,0,47,0" value="47" />
+			<entry class="49" argb="255,0,48,0" value="48" />
+			<entry class="50" argb="255,0,49,0" value="49" />
+			<entry class="51" argb="255,0,50,0" value="50" />
+			<entry class="52" argb="255,0,51,0" value="51" />
+			<entry class="53" argb="255,0,52,0" value="52" />
+			<entry class="54" argb="255,0,53,0" value="53" />
+			<entry class="55" argb="255,0,54,0" value="54" />
+			<entry class="56" argb="255,0,55,0" value="55" />
+			<entry class="57" argb="255,0,56,0" value="56" />
+			<entry class="58" argb="255,0,57,0" value="57" />
+			<entry class="59" argb="255,0,58,0" value="58" />
+			<entry class="60" argb="255,0,59,0" value="59" />
+			<entry class="61" argb="255,0,60,0" value="60" />
+			<entry class="62" argb="255,0,61,0" value="61" />
+			<entry class="63" argb="255,0,62,0" value="62" />
+			<entry class="64" argb="255,0,63,0" value="63" />
+			<entry class="65" argb="255,0,64,0" value="64" />
+			<entry class="66" argb="255,0,65,0" value="65" />
+			<entry class="67" argb="255,0,66,0" value="66" />
+			<entry class="68" argb="255,0,67,0" value="67" />
+			<entry class="69" argb="255,0,68,0" value="68" />
+			<entry class="70" argb="255,0,69,0" value="69" />
+			<entry class="71" argb="255,0,70,0" value="70" />
+			<entry class="72" argb="255,0,71,0" value="71" />
+			<entry class="73" argb="255,0,72,0" value="72" />
+			<entry class="74" argb="255,0,73,0" value="73" />
+			<entry class="75" argb="255,0,74,0" value="74" />
+			<entry class="76" argb="255,0,75,0" value="75" />
+			<entry class="77" argb="255,0,76,0" value="76" />
+			<entry class="78" argb="255,0,77,0" value="77" />
+			<entry class="79" argb="255,0,78,0" value="78" />
+			<entry class="80" argb="255,0,79,0" value="79" />
+			<entry class="81" argb="255,0,80,0" value="80" />
+			<entry class="82" argb="255,0,81,0" value="81" />
+			<entry class="83" argb="255,0,82,0" value="82" />
+			<entry class="84" argb="255,0,83,0" value="83" />
+			<entry class="85" argb="255,0,84,0" value="84" />
+			<entry class="86" argb="255,0,85,0" value="85" />
+			<entry class="87" argb="255,0,86,0" value="86" />
+			<entry class="88" argb="255,0,87,0" value="87" />
+			<entry class="89" argb="255,0,88,0" value="88" />
+			<entry class="90" argb="255,0,89,0" value="89" />
+			<entry class="91" argb="255,0,90,0" value="90" />
+			<entry class="92" argb="255,0,91,0" value="91" />
+			<entry class="93" argb="255,0,92,0" value="92" />
+			<entry class="94" argb="255,0,93,0" value="93" />
+			<entry class="95" argb="255,0,94,0" value="94" />
+			<entry class="96" argb="255,0,95,0" value="95" />
+			<entry class="97" argb="255,0,96,0" value="96" />
+			<entry class="98" argb="255,0,97,0" value="97" />
+			<entry class="99" argb="255,0,98,0" value="98" />
+			<entry class="100" argb="255,0,99,0" value="99" />
+			<entry class="101" argb="255,0,100,0" value="100" />
+			<entry class="102" argb="255,0,101,0" value="101" />
+			<entry class="103" argb="255,0,102,0" value="102" />
+			<entry class="104" argb="255,0,103,0" value="103" />
+			<entry class="105" argb="255,0,104,0" value="104" />
+			<entry class="106" argb="255,0,105,0" value="105" />
+			<entry class="107" argb="255,0,106,0" value="106" />
+			<entry class="108" argb="255,0,107,0" value="107" />
+			<entry class="109" argb="255,0,108,0" value="108" />
+			<entry class="110" argb="255,0,109,0" value="109" />
+			<entry class="111" argb="255,0,110,0" value="110" />
+			<entry class="112" argb="255,0,111,0" value="111" />
+			<entry class="113" argb="255,0,112,0" value="112" />
+			<entry class="114" argb="255,0,113,0" value="113" />
+			<entry class="115" argb="255,0,114,0" value="114" />
+			<entry class="116" argb="255,0,115,0" value="115" />
+			<entry class="117" argb="255,0,116,0" value="116" />
+			<entry class="118" argb="255,0,117,0" value="117" />
+			<entry class="119" argb="255,0,118,0" value="118" />
+			<entry class="120" argb="255,0,119,0" value="119" />
+			<entry class="121" argb="255,0,120,0" value="120" />
+			<entry class="122" argb="255,0,121,0" value="121" />
+			<entry class="123" argb="255,0,122,0" value="122" />
+			<entry class="124" argb="255,0,123,0" value="123" />
+			<entry class="125" argb="255,0,124,0" value="124" />
+			<entry class="126" argb="255,0,125,0" value="125" />
+			<entry class="127" argb="255,0,126,0" value="126" />
+			<entry class="128" argb="255,0,127,0" value="127" />
+			<entry class="129" argb="255,0,128,0" value="128" />
+			<entry class="130" argb="255,0,129,0" value="129" />
+			<entry class="131" argb="255,0,130,0" value="130" />
+			<entry class="132" argb="255,0,131,0" value="131" />
+			<entry class="133" argb="255,0,132,0" value="132" />
+			<entry class="134" argb="255,0,133,0" value="133" />
+			<entry class="135" argb="255,0,134,0" value="134" />
+			<entry class="136" argb="255,0,135,0" value="135" />
+			<entry class="137" argb="255,0,136,0" value="136" />
+			<entry class="138" argb="255,0,137,0" value="137" />
+			<entry class="139" argb="255,0,138,0" value="138" />
+			<entry class="140" argb="255,0,139,0" value="139" />
+			<entry class="141" argb="255,0,140,0" value="140" />
+			<entry class="142" argb="255,0,141,0" value="141" />
+			<entry class="143" argb="255,0,142,0" value="142" />
+			<entry class="144" argb="255,0,143,0" value="143" />
+			<entry class="145" argb="255,0,144,0" value="144" />
+			<entry class="146" argb="255,0,145,0" value="145" />
+			<entry class="147" argb="255,0,146,0" value="146" />
+			<entry class="148" argb="255,0,147,0" value="147" />
+			<entry class="149" argb="255,0,148,0" value="148" />
+			<entry class="150" argb="255,0,149,0" value="149" />
+			<entry class="151" argb="255,0,150,0" value="150" />
+			<entry class="152" argb="255,0,151,0" value="151" />
+			<entry class="153" argb="255,0,152,0" value="152" />
+			<entry class="154" argb="255,0,153,0" value="153" />
+			<entry class="155" argb="255,0,154,0" value="154" />
+			<entry class="156" argb="255,0,155,0" value="155" />
+			<entry class="157" argb="255,0,156,0" value="156" />
+			<entry class="158" argb="255,0,157,0" value="157" />
+			<entry class="159" argb="255,0,158,0" value="158" />
+			<entry class="160" argb="255,0,159,0" value="159" />
+			<entry class="161" argb="255,0,160,0" value="160" />
+			<entry class="162" argb="255,0,161,0" value="161" />
+			<entry class="163" argb="255,0,162,0" value="162" />
+			<entry class="164" argb="255,0,163,0" value="163" />
+			<entry class="165" argb="255,0,164,0" value="164" />
+			<entry class="166" argb="255,0,165,0" value="165" />
+			<entry class="167" argb="255,0,166,0" value="166" />
+			<entry class="168" argb="255,0,167,0" value="167" />
+			<entry class="169" argb="255,0,168,0" value="168" />
+			<entry class="170" argb="255,0,169,0" value="169" />
+			<entry class="171" argb="255,0,170,0" value="170" />
+			<entry class="172" argb="255,0,171,0" value="171" />
+			<entry class="173" argb="255,0,172,0" value="172" />
+			<entry class="174" argb="255,0,173,0" value="173" />
+			<entry class="175" argb="255,0,174,0" value="174" />
+			<entry class="176" argb="255,0,175,0" value="175" />
+			<entry class="177" argb="255,0,176,0" value="176" />
+			<entry class="178" argb="255,0,177,0" value="177" />
+			<entry class="179" argb="255,0,178,0" value="178" />
+			<entry class="180" argb="255,0,179,0" value="179" />
+			<entry class="181" argb="255,0,180,0" value="180" />
+			<entry class="182" argb="255,0,181,0" value="181" />
+			<entry class="183" argb="255,0,182,0" value="182" />
+			<entry class="184" argb="255,0,183,0" value="183" />
+			<entry class="185" argb="255,0,184,0" value="184" />
+			<entry class="186" argb="255,0,185,0" value="185" />
+			<entry class="187" argb="255,0,186,0" value="186" />
+			<entry class="188" argb="255,0,187,0" value="187" />
+			<entry class="189" argb="255,0,188,0" value="188" />
+			<entry class="190" argb="255,0,189,0" value="189" />
+			<entry class="191" argb="255,0,190,0" value="190" />
+			<entry class="192" argb="255,0,191,0" value="191" />
+			<entry class="193" argb="255,0,192,0" value="192" />
+			<entry class="194" argb="255,0,193,0" value="193" />
+			<entry class="195" argb="255,0,194,0" value="194" />
+			<entry class="196" argb="255,0,195,0" value="195" />
+			<entry class="197" argb="255,0,196,0" value="196" />
+			<entry class="198" argb="255,0,197,0" value="197" />
+			<entry class="199" argb="255,0,198,0" value="198" />
+			<entry class="200" argb="255,0,199,0" value="199" />
+			<entry class="201" argb="255,0,200,0" value="200" />
+			<entry class="202" argb="255,0,201,0" value="201" />
+			<entry class="203" argb="255,0,202,0" value="202" />
+			<entry class="204" argb="255,0,203,0" value="203" />
+			<entry class="205" argb="255,0,204,0" value="204" />
+			<entry class="206" argb="255,0,205,0" value="205" />
+			<entry class="207" argb="255,0,206,0" value="206" />
+			<entry class="208" argb="255,0,207,0" value="207" />
+			<entry class="209" argb="255,0,208,0" value="208" />
+			<entry class="210" argb="255,0,209,0" value="209" />
+			<entry class="211" argb="255,0,210,0" value="210" />
+			<entry class="212" argb="255,0,211,0" value="211" />
+			<entry class="213" argb="255,0,212,0" value="212" />
+			<entry class="214" argb="255,0,213,0" value="213" />
+			<entry class="215" argb="255,0,214,0" value="214" />
+			<entry class="216" argb="255,0,215,0" value="215" />
+			<entry class="217" argb="255,0,216,0" value="216" />
+			<entry class="218" argb="255,0,217,0" value="217" />
+			<entry class="219" argb="255,0,218,0" value="218" />
+			<entry class="220" argb="255,0,219,0" value="219" />
+			<entry class="221" argb="255,0,220,0" value="220" />
+			<entry class="222" argb="255,0,221,0" value="221" />
+			<entry class="223" argb="255,0,222,0" value="222" />
+			<entry class="224" argb="255,0,223,0" value="223" />
+			<entry class="225" argb="255,0,224,0" value="224" />
+			<entry class="226" argb="255,0,225,0" value="225" />
+			<entry class="227" argb="255,0,226,0" value="226" />
+			<entry class="228" argb="255,0,227,0" value="227" />
+			<entry class="229" argb="255,0,228,0" value="228" />
+			<entry class="230" argb="255,0,229,0" value="229" />
+			<entry class="231" argb="255,0,230,0" value="230" />
+			<entry class="232" argb="255,0,231,0" value="231" />
+			<entry class="233" argb="255,0,232,0" value="232" />
+			<entry class="234" argb="255,0,233,0" value="233" />
+			<entry class="235" argb="255,0,234,0" value="234" />
+			<entry class="236" argb="255,0,235,0" value="235" />
+			<entry class="237" argb="255,0,236,0" value="236" />
+			<entry class="238" argb="255,0,237,0" value="237" />
+			<entry class="239" argb="255,0,238,0" value="238" />
+			<entry class="240" argb="255,0,239,0" value="239" />
+			<entry class="241" argb="255,0,240,0" value="240" />
+			<entry class="242" argb="255,0,241,0" value="241" />
+			<entry class="243" argb="255,0,242,0" value="242" />
+			<entry class="244" argb="255,0,243,0" value="243" />
+			<entry class="245" argb="255,0,244,0" value="244" />
+			<entry class="246" argb="255,0,245,0" value="245" />
+			<entry class="247" argb="255,0,246,0" value="246" />
+			<entry class="248" argb="255,0,247,0" value="247" />
+			<entry class="249" argb="255,0,248,0" value="248" />
+			<entry class="250" argb="255,0,249,0" value="249" />
+			<entry class="251" argb="255,0,250,0" value="250" />
+			<entry class="252" argb="255,0,251,0" value="251" />
+			<entry class="253" argb="255,0,252,0" value="252" />
+			<entry class="254" argb="255,0,253,0" value="253" />
+			<entry class="255" argb="255,0,254,0" value="254" />
+			<entry class="256" argb="255,0,255,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(300,100,0) to HSV(300,100,100) -->
+	<palette name="Deep Magenta  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,1,0,1" value="1" />
+			<entry class="3" argb="255,2,0,2" value="2" />
+			<entry class="4" argb="255,3,0,3" value="3" />
+			<entry class="5" argb="255,4,0,4" value="4" />
+			<entry class="6" argb="255,5,0,5" value="5" />
+			<entry class="7" argb="255,6,0,6" value="6" />
+			<entry class="8" argb="255,7,0,7" value="7" />
+			<entry class="9" argb="255,8,0,8" value="8" />
+			<entry class="10" argb="255,9,0,9" value="9" />
+			<entry class="11" argb="255,10,0,10" value="10" />
+			<entry class="12" argb="255,11,0,11" value="11" />
+			<entry class="13" argb="255,12,0,12" value="12" />
+			<entry class="14" argb="255,13,0,13" value="13" />
+			<entry class="15" argb="255,14,0,14" value="14" />
+			<entry class="16" argb="255,15,0,15" value="15" />
+			<entry class="17" argb="255,16,0,16" value="16" />
+			<entry class="18" argb="255,17,0,17" value="17" />
+			<entry class="19" argb="255,18,0,18" value="18" />
+			<entry class="20" argb="255,19,0,19" value="19" />
+			<entry class="21" argb="255,20,0,20" value="20" />
+			<entry class="22" argb="255,21,0,21" value="21" />
+			<entry class="23" argb="255,22,0,22" value="22" />
+			<entry class="24" argb="255,23,0,23" value="23" />
+			<entry class="25" argb="255,24,0,24" value="24" />
+			<entry class="26" argb="255,25,0,25" value="25" />
+			<entry class="27" argb="255,26,0,26" value="26" />
+			<entry class="28" argb="255,27,0,27" value="27" />
+			<entry class="29" argb="255,28,0,28" value="28" />
+			<entry class="30" argb="255,29,0,29" value="29" />
+			<entry class="31" argb="255,30,0,30" value="30" />
+			<entry class="32" argb="255,31,0,31" value="31" />
+			<entry class="33" argb="255,32,0,32" value="32" />
+			<entry class="34" argb="255,33,0,33" value="33" />
+			<entry class="35" argb="255,34,0,34" value="34" />
+			<entry class="36" argb="255,35,0,35" value="35" />
+			<entry class="37" argb="255,36,0,36" value="36" />
+			<entry class="38" argb="255,37,0,37" value="37" />
+			<entry class="39" argb="255,38,0,38" value="38" />
+			<entry class="40" argb="255,39,0,39" value="39" />
+			<entry class="41" argb="255,40,0,40" value="40" />
+			<entry class="42" argb="255,41,0,41" value="41" />
+			<entry class="43" argb="255,42,0,42" value="42" />
+			<entry class="44" argb="255,43,0,43" value="43" />
+			<entry class="45" argb="255,44,0,44" value="44" />
+			<entry class="46" argb="255,45,0,45" value="45" />
+			<entry class="47" argb="255,46,0,46" value="46" />
+			<entry class="48" argb="255,47,0,47" value="47" />
+			<entry class="49" argb="255,48,0,48" value="48" />
+			<entry class="50" argb="255,49,0,49" value="49" />
+			<entry class="51" argb="255,50,0,50" value="50" />
+			<entry class="52" argb="255,51,0,51" value="51" />
+			<entry class="53" argb="255,52,0,52" value="52" />
+			<entry class="54" argb="255,53,0,53" value="53" />
+			<entry class="55" argb="255,54,0,54" value="54" />
+			<entry class="56" argb="255,55,0,55" value="55" />
+			<entry class="57" argb="255,56,0,56" value="56" />
+			<entry class="58" argb="255,57,0,57" value="57" />
+			<entry class="59" argb="255,58,0,58" value="58" />
+			<entry class="60" argb="255,59,0,59" value="59" />
+			<entry class="61" argb="255,60,0,60" value="60" />
+			<entry class="62" argb="255,61,0,61" value="61" />
+			<entry class="63" argb="255,62,0,62" value="62" />
+			<entry class="64" argb="255,63,0,63" value="63" />
+			<entry class="65" argb="255,64,0,64" value="64" />
+			<entry class="66" argb="255,65,0,65" value="65" />
+			<entry class="67" argb="255,66,0,66" value="66" />
+			<entry class="68" argb="255,67,0,67" value="67" />
+			<entry class="69" argb="255,68,0,68" value="68" />
+			<entry class="70" argb="255,69,0,69" value="69" />
+			<entry class="71" argb="255,70,0,70" value="70" />
+			<entry class="72" argb="255,71,0,71" value="71" />
+			<entry class="73" argb="255,72,0,72" value="72" />
+			<entry class="74" argb="255,73,0,73" value="73" />
+			<entry class="75" argb="255,74,0,74" value="74" />
+			<entry class="76" argb="255,75,0,75" value="75" />
+			<entry class="77" argb="255,76,0,76" value="76" />
+			<entry class="78" argb="255,77,0,77" value="77" />
+			<entry class="79" argb="255,78,0,78" value="78" />
+			<entry class="80" argb="255,79,0,79" value="79" />
+			<entry class="81" argb="255,80,0,80" value="80" />
+			<entry class="82" argb="255,81,0,81" value="81" />
+			<entry class="83" argb="255,82,0,82" value="82" />
+			<entry class="84" argb="255,83,0,83" value="83" />
+			<entry class="85" argb="255,84,0,84" value="84" />
+			<entry class="86" argb="255,85,0,85" value="85" />
+			<entry class="87" argb="255,86,0,86" value="86" />
+			<entry class="88" argb="255,87,0,87" value="87" />
+			<entry class="89" argb="255,88,0,88" value="88" />
+			<entry class="90" argb="255,89,0,89" value="89" />
+			<entry class="91" argb="255,90,0,90" value="90" />
+			<entry class="92" argb="255,91,0,91" value="91" />
+			<entry class="93" argb="255,92,0,92" value="92" />
+			<entry class="94" argb="255,93,0,93" value="93" />
+			<entry class="95" argb="255,94,0,94" value="94" />
+			<entry class="96" argb="255,95,0,95" value="95" />
+			<entry class="97" argb="255,96,0,96" value="96" />
+			<entry class="98" argb="255,97,0,97" value="97" />
+			<entry class="99" argb="255,98,0,98" value="98" />
+			<entry class="100" argb="255,99,0,99" value="99" />
+			<entry class="101" argb="255,100,0,100" value="100" />
+			<entry class="102" argb="255,101,0,101" value="101" />
+			<entry class="103" argb="255,102,0,102" value="102" />
+			<entry class="104" argb="255,103,0,103" value="103" />
+			<entry class="105" argb="255,104,0,104" value="104" />
+			<entry class="106" argb="255,105,0,105" value="105" />
+			<entry class="107" argb="255,106,0,106" value="106" />
+			<entry class="108" argb="255,107,0,107" value="107" />
+			<entry class="109" argb="255,108,0,108" value="108" />
+			<entry class="110" argb="255,109,0,109" value="109" />
+			<entry class="111" argb="255,110,0,110" value="110" />
+			<entry class="112" argb="255,111,0,111" value="111" />
+			<entry class="113" argb="255,112,0,112" value="112" />
+			<entry class="114" argb="255,113,0,113" value="113" />
+			<entry class="115" argb="255,114,0,114" value="114" />
+			<entry class="116" argb="255,115,0,115" value="115" />
+			<entry class="117" argb="255,116,0,116" value="116" />
+			<entry class="118" argb="255,117,0,117" value="117" />
+			<entry class="119" argb="255,118,0,118" value="118" />
+			<entry class="120" argb="255,119,0,119" value="119" />
+			<entry class="121" argb="255,120,0,120" value="120" />
+			<entry class="122" argb="255,121,0,121" value="121" />
+			<entry class="123" argb="255,122,0,122" value="122" />
+			<entry class="124" argb="255,123,0,123" value="123" />
+			<entry class="125" argb="255,124,0,124" value="124" />
+			<entry class="126" argb="255,125,0,125" value="125" />
+			<entry class="127" argb="255,126,0,126" value="126" />
+			<entry class="128" argb="255,127,0,127" value="127" />
+			<entry class="129" argb="255,128,0,128" value="128" />
+			<entry class="130" argb="255,129,0,129" value="129" />
+			<entry class="131" argb="255,130,0,130" value="130" />
+			<entry class="132" argb="255,131,0,131" value="131" />
+			<entry class="133" argb="255,132,0,132" value="132" />
+			<entry class="134" argb="255,133,0,133" value="133" />
+			<entry class="135" argb="255,134,0,134" value="134" />
+			<entry class="136" argb="255,135,0,135" value="135" />
+			<entry class="137" argb="255,136,0,136" value="136" />
+			<entry class="138" argb="255,137,0,137" value="137" />
+			<entry class="139" argb="255,138,0,138" value="138" />
+			<entry class="140" argb="255,139,0,139" value="139" />
+			<entry class="141" argb="255,140,0,140" value="140" />
+			<entry class="142" argb="255,141,0,141" value="141" />
+			<entry class="143" argb="255,142,0,142" value="142" />
+			<entry class="144" argb="255,143,0,143" value="143" />
+			<entry class="145" argb="255,144,0,144" value="144" />
+			<entry class="146" argb="255,145,0,145" value="145" />
+			<entry class="147" argb="255,146,0,146" value="146" />
+			<entry class="148" argb="255,147,0,147" value="147" />
+			<entry class="149" argb="255,148,0,148" value="148" />
+			<entry class="150" argb="255,149,0,149" value="149" />
+			<entry class="151" argb="255,150,0,150" value="150" />
+			<entry class="152" argb="255,151,0,151" value="151" />
+			<entry class="153" argb="255,152,0,152" value="152" />
+			<entry class="154" argb="255,153,0,153" value="153" />
+			<entry class="155" argb="255,154,0,154" value="154" />
+			<entry class="156" argb="255,155,0,155" value="155" />
+			<entry class="157" argb="255,156,0,156" value="156" />
+			<entry class="158" argb="255,157,0,157" value="157" />
+			<entry class="159" argb="255,158,0,158" value="158" />
+			<entry class="160" argb="255,159,0,159" value="159" />
+			<entry class="161" argb="255,160,0,160" value="160" />
+			<entry class="162" argb="255,161,0,161" value="161" />
+			<entry class="163" argb="255,162,0,162" value="162" />
+			<entry class="164" argb="255,163,0,163" value="163" />
+			<entry class="165" argb="255,164,0,164" value="164" />
+			<entry class="166" argb="255,165,0,165" value="165" />
+			<entry class="167" argb="255,166,0,166" value="166" />
+			<entry class="168" argb="255,167,0,167" value="167" />
+			<entry class="169" argb="255,168,0,168" value="168" />
+			<entry class="170" argb="255,169,0,169" value="169" />
+			<entry class="171" argb="255,170,0,170" value="170" />
+			<entry class="172" argb="255,171,0,171" value="171" />
+			<entry class="173" argb="255,172,0,172" value="172" />
+			<entry class="174" argb="255,173,0,173" value="173" />
+			<entry class="175" argb="255,174,0,174" value="174" />
+			<entry class="176" argb="255,175,0,175" value="175" />
+			<entry class="177" argb="255,176,0,176" value="176" />
+			<entry class="178" argb="255,177,0,177" value="177" />
+			<entry class="179" argb="255,178,0,178" value="178" />
+			<entry class="180" argb="255,179,0,179" value="179" />
+			<entry class="181" argb="255,180,0,180" value="180" />
+			<entry class="182" argb="255,181,0,181" value="181" />
+			<entry class="183" argb="255,182,0,182" value="182" />
+			<entry class="184" argb="255,183,0,183" value="183" />
+			<entry class="185" argb="255,184,0,184" value="184" />
+			<entry class="186" argb="255,185,0,185" value="185" />
+			<entry class="187" argb="255,186,0,186" value="186" />
+			<entry class="188" argb="255,187,0,187" value="187" />
+			<entry class="189" argb="255,188,0,188" value="188" />
+			<entry class="190" argb="255,189,0,189" value="189" />
+			<entry class="191" argb="255,190,0,190" value="190" />
+			<entry class="192" argb="255,191,0,191" value="191" />
+			<entry class="193" argb="255,192,0,192" value="192" />
+			<entry class="194" argb="255,193,0,193" value="193" />
+			<entry class="195" argb="255,194,0,194" value="194" />
+			<entry class="196" argb="255,195,0,195" value="195" />
+			<entry class="197" argb="255,196,0,196" value="196" />
+			<entry class="198" argb="255,197,0,197" value="197" />
+			<entry class="199" argb="255,198,0,198" value="198" />
+			<entry class="200" argb="255,199,0,199" value="199" />
+			<entry class="201" argb="255,200,0,200" value="200" />
+			<entry class="202" argb="255,201,0,201" value="201" />
+			<entry class="203" argb="255,202,0,202" value="202" />
+			<entry class="204" argb="255,203,0,203" value="203" />
+			<entry class="205" argb="255,204,0,204" value="204" />
+			<entry class="206" argb="255,205,0,205" value="205" />
+			<entry class="207" argb="255,206,0,206" value="206" />
+			<entry class="208" argb="255,207,0,207" value="207" />
+			<entry class="209" argb="255,208,0,208" value="208" />
+			<entry class="210" argb="255,209,0,209" value="209" />
+			<entry class="211" argb="255,210,0,210" value="210" />
+			<entry class="212" argb="255,211,0,211" value="211" />
+			<entry class="213" argb="255,212,0,212" value="212" />
+			<entry class="214" argb="255,213,0,213" value="213" />
+			<entry class="215" argb="255,214,0,214" value="214" />
+			<entry class="216" argb="255,215,0,215" value="215" />
+			<entry class="217" argb="255,216,0,216" value="216" />
+			<entry class="218" argb="255,217,0,217" value="217" />
+			<entry class="219" argb="255,218,0,218" value="218" />
+			<entry class="220" argb="255,219,0,219" value="219" />
+			<entry class="221" argb="255,220,0,220" value="220" />
+			<entry class="222" argb="255,221,0,221" value="221" />
+			<entry class="223" argb="255,222,0,222" value="222" />
+			<entry class="224" argb="255,223,0,223" value="223" />
+			<entry class="225" argb="255,224,0,224" value="224" />
+			<entry class="226" argb="255,225,0,225" value="225" />
+			<entry class="227" argb="255,226,0,226" value="226" />
+			<entry class="228" argb="255,227,0,227" value="227" />
+			<entry class="229" argb="255,228,0,228" value="228" />
+			<entry class="230" argb="255,229,0,229" value="229" />
+			<entry class="231" argb="255,230,0,230" value="230" />
+			<entry class="232" argb="255,231,0,231" value="231" />
+			<entry class="233" argb="255,232,0,232" value="232" />
+			<entry class="234" argb="255,233,0,233" value="233" />
+			<entry class="235" argb="255,234,0,234" value="234" />
+			<entry class="236" argb="255,235,0,235" value="235" />
+			<entry class="237" argb="255,236,0,236" value="236" />
+			<entry class="238" argb="255,237,0,237" value="237" />
+			<entry class="239" argb="255,238,0,238" value="238" />
+			<entry class="240" argb="255,239,0,239" value="239" />
+			<entry class="241" argb="255,240,0,240" value="240" />
+			<entry class="242" argb="255,241,0,241" value="241" />
+			<entry class="243" argb="255,242,0,242" value="242" />
+			<entry class="244" argb="255,243,0,243" value="243" />
+			<entry class="245" argb="255,244,0,244" value="244" />
+			<entry class="246" argb="255,245,0,245" value="245" />
+			<entry class="247" argb="255,246,0,246" value="246" />
+			<entry class="248" argb="255,247,0,247" value="247" />
+			<entry class="249" argb="255,248,0,248" value="248" />
+			<entry class="250" argb="255,249,0,249" value="249" />
+			<entry class="251" argb="255,250,0,250" value="250" />
+			<entry class="252" argb="255,251,0,251" value="251" />
+			<entry class="253" argb="255,252,0,252" value="252" />
+			<entry class="254" argb="255,253,0,253" value="253" />
+			<entry class="255" argb="255,254,0,254" value="254" />
+			<entry class="256" argb="255,255,0,255" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(30,100,100) to HSV(30,100,0) -->
+	<palette name="Deep Orange  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,127,0" value="0" />
+			<entry class="2" argb="255,254,127,0" value="1" />
+			<entry class="3" argb="255,253,126,0" value="2" />
+			<entry class="4" argb="255,252,126,0" value="3" />
+			<entry class="5" argb="255,251,125,0" value="4" />
+			<entry class="6" argb="255,250,125,0" value="5" />
+			<entry class="7" argb="255,249,124,0" value="6" />
+			<entry class="8" argb="255,248,124,0" value="7" />
+			<entry class="9" argb="255,247,123,0" value="8" />
+			<entry class="10" argb="255,246,123,0" value="9" />
+			<entry class="11" argb="255,245,122,0" value="10" />
+			<entry class="12" argb="255,244,122,0" value="11" />
+			<entry class="13" argb="255,243,121,0" value="12" />
+			<entry class="14" argb="255,242,121,0" value="13" />
+			<entry class="15" argb="255,241,120,0" value="14" />
+			<entry class="16" argb="255,240,120,0" value="15" />
+			<entry class="17" argb="255,239,119,0" value="16" />
+			<entry class="18" argb="255,238,119,0" value="17" />
+			<entry class="19" argb="255,237,118,0" value="18" />
+			<entry class="20" argb="255,236,118,0" value="19" />
+			<entry class="21" argb="255,235,117,0" value="20" />
+			<entry class="22" argb="255,234,117,0" value="21" />
+			<entry class="23" argb="255,233,116,0" value="22" />
+			<entry class="24" argb="255,232,116,0" value="23" />
+			<entry class="25" argb="255,231,115,0" value="24" />
+			<entry class="26" argb="255,230,115,0" value="25" />
+			<entry class="27" argb="255,229,114,0" value="26" />
+			<entry class="28" argb="255,228,114,0" value="27" />
+			<entry class="29" argb="255,227,113,0" value="28" />
+			<entry class="30" argb="255,226,113,0" value="29" />
+			<entry class="31" argb="255,225,112,0" value="30" />
+			<entry class="32" argb="255,224,112,0" value="31" />
+			<entry class="33" argb="255,223,111,0" value="32" />
+			<entry class="34" argb="255,222,111,0" value="33" />
+			<entry class="35" argb="255,221,110,0" value="34" />
+			<entry class="36" argb="255,220,110,0" value="35" />
+			<entry class="37" argb="255,219,109,0" value="36" />
+			<entry class="38" argb="255,218,109,0" value="37" />
+			<entry class="39" argb="255,217,108,0" value="38" />
+			<entry class="40" argb="255,216,108,0" value="39" />
+			<entry class="41" argb="255,215,107,0" value="40" />
+			<entry class="42" argb="255,214,107,0" value="41" />
+			<entry class="43" argb="255,213,106,0" value="42" />
+			<entry class="44" argb="255,212,106,0" value="43" />
+			<entry class="45" argb="255,211,105,0" value="44" />
+			<entry class="46" argb="255,210,105,0" value="45" />
+			<entry class="47" argb="255,209,104,0" value="46" />
+			<entry class="48" argb="255,208,104,0" value="47" />
+			<entry class="49" argb="255,207,103,0" value="48" />
+			<entry class="50" argb="255,206,103,0" value="49" />
+			<entry class="51" argb="255,205,102,0" value="50" />
+			<entry class="52" argb="255,204,102,0" value="51" />
+			<entry class="53" argb="255,203,101,0" value="52" />
+			<entry class="54" argb="255,202,101,0" value="53" />
+			<entry class="55" argb="255,201,100,0" value="54" />
+			<entry class="56" argb="255,200,100,0" value="55" />
+			<entry class="57" argb="255,199,99,0" value="56" />
+			<entry class="58" argb="255,198,99,0" value="57" />
+			<entry class="59" argb="255,197,98,0" value="58" />
+			<entry class="60" argb="255,196,98,0" value="59" />
+			<entry class="61" argb="255,195,97,0" value="60" />
+			<entry class="62" argb="255,194,97,0" value="61" />
+			<entry class="63" argb="255,193,96,0" value="62" />
+			<entry class="64" argb="255,192,96,0" value="63" />
+			<entry class="65" argb="255,191,95,0" value="64" />
+			<entry class="66" argb="255,190,95,0" value="65" />
+			<entry class="67" argb="255,189,94,0" value="66" />
+			<entry class="68" argb="255,188,94,0" value="67" />
+			<entry class="69" argb="255,187,93,0" value="68" />
+			<entry class="70" argb="255,186,93,0" value="69" />
+			<entry class="71" argb="255,185,92,0" value="70" />
+			<entry class="72" argb="255,184,92,0" value="71" />
+			<entry class="73" argb="255,183,91,0" value="72" />
+			<entry class="74" argb="255,182,91,0" value="73" />
+			<entry class="75" argb="255,181,90,0" value="74" />
+			<entry class="76" argb="255,180,90,0" value="75" />
+			<entry class="77" argb="255,179,89,0" value="76" />
+			<entry class="78" argb="255,178,89,0" value="77" />
+			<entry class="79" argb="255,177,88,0" value="78" />
+			<entry class="80" argb="255,176,88,0" value="79" />
+			<entry class="81" argb="255,175,87,0" value="80" />
+			<entry class="82" argb="255,174,87,0" value="81" />
+			<entry class="83" argb="255,173,86,0" value="82" />
+			<entry class="84" argb="255,172,86,0" value="83" />
+			<entry class="85" argb="255,171,85,0" value="84" />
+			<entry class="86" argb="255,170,85,0" value="85" />
+			<entry class="87" argb="255,169,84,0" value="86" />
+			<entry class="88" argb="255,168,84,0" value="87" />
+			<entry class="89" argb="255,167,83,0" value="88" />
+			<entry class="90" argb="255,166,83,0" value="89" />
+			<entry class="91" argb="255,165,82,0" value="90" />
+			<entry class="92" argb="255,164,82,0" value="91" />
+			<entry class="93" argb="255,163,81,0" value="92" />
+			<entry class="94" argb="255,162,81,0" value="93" />
+			<entry class="95" argb="255,161,80,0" value="94" />
+			<entry class="96" argb="255,160,80,0" value="95" />
+			<entry class="97" argb="255,159,79,0" value="96" />
+			<entry class="98" argb="255,158,79,0" value="97" />
+			<entry class="99" argb="255,157,78,0" value="98" />
+			<entry class="100" argb="255,156,78,0" value="99" />
+			<entry class="101" argb="255,155,77,0" value="100" />
+			<entry class="102" argb="255,154,77,0" value="101" />
+			<entry class="103" argb="255,153,76,0" value="102" />
+			<entry class="104" argb="255,152,76,0" value="103" />
+			<entry class="105" argb="255,151,75,0" value="104" />
+			<entry class="106" argb="255,150,75,0" value="105" />
+			<entry class="107" argb="255,149,74,0" value="106" />
+			<entry class="108" argb="255,148,74,0" value="107" />
+			<entry class="109" argb="255,147,73,0" value="108" />
+			<entry class="110" argb="255,146,73,0" value="109" />
+			<entry class="111" argb="255,145,72,0" value="110" />
+			<entry class="112" argb="255,144,72,0" value="111" />
+			<entry class="113" argb="255,143,71,0" value="112" />
+			<entry class="114" argb="255,142,71,0" value="113" />
+			<entry class="115" argb="255,141,70,0" value="114" />
+			<entry class="116" argb="255,140,70,0" value="115" />
+			<entry class="117" argb="255,139,69,0" value="116" />
+			<entry class="118" argb="255,138,69,0" value="117" />
+			<entry class="119" argb="255,137,68,0" value="118" />
+			<entry class="120" argb="255,136,68,0" value="119" />
+			<entry class="121" argb="255,135,67,0" value="120" />
+			<entry class="122" argb="255,134,67,0" value="121" />
+			<entry class="123" argb="255,133,66,0" value="122" />
+			<entry class="124" argb="255,132,66,0" value="123" />
+			<entry class="125" argb="255,131,65,0" value="124" />
+			<entry class="126" argb="255,130,65,0" value="125" />
+			<entry class="127" argb="255,129,64,0" value="126" />
+			<entry class="128" argb="255,128,64,0" value="127" />
+			<entry class="129" argb="255,127,63,0" value="128" />
+			<entry class="130" argb="255,126,63,0" value="129" />
+			<entry class="131" argb="255,125,62,0" value="130" />
+			<entry class="132" argb="255,124,62,0" value="131" />
+			<entry class="133" argb="255,123,61,0" value="132" />
+			<entry class="134" argb="255,122,61,0" value="133" />
+			<entry class="135" argb="255,121,60,0" value="134" />
+			<entry class="136" argb="255,120,60,0" value="135" />
+			<entry class="137" argb="255,119,59,0" value="136" />
+			<entry class="138" argb="255,118,59,0" value="137" />
+			<entry class="139" argb="255,117,58,0" value="138" />
+			<entry class="140" argb="255,116,58,0" value="139" />
+			<entry class="141" argb="255,115,57,0" value="140" />
+			<entry class="142" argb="255,114,57,0" value="141" />
+			<entry class="143" argb="255,113,56,0" value="142" />
+			<entry class="144" argb="255,112,56,0" value="143" />
+			<entry class="145" argb="255,111,55,0" value="144" />
+			<entry class="146" argb="255,110,55,0" value="145" />
+			<entry class="147" argb="255,109,54,0" value="146" />
+			<entry class="148" argb="255,108,54,0" value="147" />
+			<entry class="149" argb="255,107,53,0" value="148" />
+			<entry class="150" argb="255,106,53,0" value="149" />
+			<entry class="151" argb="255,105,52,0" value="150" />
+			<entry class="152" argb="255,104,52,0" value="151" />
+			<entry class="153" argb="255,103,51,0" value="152" />
+			<entry class="154" argb="255,102,51,0" value="153" />
+			<entry class="155" argb="255,101,50,0" value="154" />
+			<entry class="156" argb="255,100,50,0" value="155" />
+			<entry class="157" argb="255,99,49,0" value="156" />
+			<entry class="158" argb="255,98,49,0" value="157" />
+			<entry class="159" argb="255,97,48,0" value="158" />
+			<entry class="160" argb="255,96,48,0" value="159" />
+			<entry class="161" argb="255,95,47,0" value="160" />
+			<entry class="162" argb="255,94,47,0" value="161" />
+			<entry class="163" argb="255,93,46,0" value="162" />
+			<entry class="164" argb="255,92,46,0" value="163" />
+			<entry class="165" argb="255,91,45,0" value="164" />
+			<entry class="166" argb="255,90,45,0" value="165" />
+			<entry class="167" argb="255,89,44,0" value="166" />
+			<entry class="168" argb="255,88,44,0" value="167" />
+			<entry class="169" argb="255,87,43,0" value="168" />
+			<entry class="170" argb="255,86,43,0" value="169" />
+			<entry class="171" argb="255,85,42,0" value="170" />
+			<entry class="172" argb="255,84,42,0" value="171" />
+			<entry class="173" argb="255,83,41,0" value="172" />
+			<entry class="174" argb="255,82,41,0" value="173" />
+			<entry class="175" argb="255,81,40,0" value="174" />
+			<entry class="176" argb="255,80,40,0" value="175" />
+			<entry class="177" argb="255,79,39,0" value="176" />
+			<entry class="178" argb="255,78,39,0" value="177" />
+			<entry class="179" argb="255,77,38,0" value="178" />
+			<entry class="180" argb="255,76,38,0" value="179" />
+			<entry class="181" argb="255,75,37,0" value="180" />
+			<entry class="182" argb="255,74,37,0" value="181" />
+			<entry class="183" argb="255,73,36,0" value="182" />
+			<entry class="184" argb="255,72,36,0" value="183" />
+			<entry class="185" argb="255,71,35,0" value="184" />
+			<entry class="186" argb="255,70,35,0" value="185" />
+			<entry class="187" argb="255,69,34,0" value="186" />
+			<entry class="188" argb="255,68,34,0" value="187" />
+			<entry class="189" argb="255,67,33,0" value="188" />
+			<entry class="190" argb="255,66,33,0" value="189" />
+			<entry class="191" argb="255,65,32,0" value="190" />
+			<entry class="192" argb="255,64,32,0" value="191" />
+			<entry class="193" argb="255,63,31,0" value="192" />
+			<entry class="194" argb="255,62,31,0" value="193" />
+			<entry class="195" argb="255,61,30,0" value="194" />
+			<entry class="196" argb="255,60,30,0" value="195" />
+			<entry class="197" argb="255,59,29,0" value="196" />
+			<entry class="198" argb="255,58,29,0" value="197" />
+			<entry class="199" argb="255,57,28,0" value="198" />
+			<entry class="200" argb="255,56,28,0" value="199" />
+			<entry class="201" argb="255,55,27,0" value="200" />
+			<entry class="202" argb="255,54,27,0" value="201" />
+			<entry class="203" argb="255,53,26,0" value="202" />
+			<entry class="204" argb="255,52,26,0" value="203" />
+			<entry class="205" argb="255,51,25,0" value="204" />
+			<entry class="206" argb="255,50,25,0" value="205" />
+			<entry class="207" argb="255,49,24,0" value="206" />
+			<entry class="208" argb="255,48,24,0" value="207" />
+			<entry class="209" argb="255,47,23,0" value="208" />
+			<entry class="210" argb="255,46,23,0" value="209" />
+			<entry class="211" argb="255,45,22,0" value="210" />
+			<entry class="212" argb="255,44,22,0" value="211" />
+			<entry class="213" argb="255,43,21,0" value="212" />
+			<entry class="214" argb="255,42,21,0" value="213" />
+			<entry class="215" argb="255,41,20,0" value="214" />
+			<entry class="216" argb="255,40,20,0" value="215" />
+			<entry class="217" argb="255,39,19,0" value="216" />
+			<entry class="218" argb="255,38,19,0" value="217" />
+			<entry class="219" argb="255,37,18,0" value="218" />
+			<entry class="220" argb="255,36,18,0" value="219" />
+			<entry class="221" argb="255,35,17,0" value="220" />
+			<entry class="222" argb="255,34,17,0" value="221" />
+			<entry class="223" argb="255,33,16,0" value="222" />
+			<entry class="224" argb="255,32,16,0" value="223" />
+			<entry class="225" argb="255,31,15,0" value="224" />
+			<entry class="226" argb="255,30,15,0" value="225" />
+			<entry class="227" argb="255,29,14,0" value="226" />
+			<entry class="228" argb="255,28,14,0" value="227" />
+			<entry class="229" argb="255,27,13,0" value="228" />
+			<entry class="230" argb="255,26,13,0" value="229" />
+			<entry class="231" argb="255,25,12,0" value="230" />
+			<entry class="232" argb="255,24,12,0" value="231" />
+			<entry class="233" argb="255,23,11,0" value="232" />
+			<entry class="234" argb="255,22,11,0" value="233" />
+			<entry class="235" argb="255,21,10,0" value="234" />
+			<entry class="236" argb="255,20,10,0" value="235" />
+			<entry class="237" argb="255,19,9,0" value="236" />
+			<entry class="238" argb="255,18,9,0" value="237" />
+			<entry class="239" argb="255,17,8,0" value="238" />
+			<entry class="240" argb="255,16,8,0" value="239" />
+			<entry class="241" argb="255,15,7,0" value="240" />
+			<entry class="242" argb="255,14,7,0" value="241" />
+			<entry class="243" argb="255,13,6,0" value="242" />
+			<entry class="244" argb="255,12,6,0" value="243" />
+			<entry class="245" argb="255,11,5,0" value="244" />
+			<entry class="246" argb="255,10,5,0" value="245" />
+			<entry class="247" argb="255,9,4,0" value="246" />
+			<entry class="248" argb="255,8,4,0" value="247" />
+			<entry class="249" argb="255,7,3,0" value="248" />
+			<entry class="250" argb="255,6,3,0" value="249" />
+			<entry class="251" argb="255,5,2,0" value="250" />
+			<entry class="252" argb="255,4,2,0" value="251" />
+			<entry class="253" argb="255,3,1,0" value="252" />
+			<entry class="254" argb="255,2,1,0" value="253" />
+			<entry class="255" argb="255,1,0,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(0,100,0) to HSV(0,100,100) -->
+	<palette name="Deep Red  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,1,0,0" value="1" />
+			<entry class="3" argb="255,2,0,0" value="2" />
+			<entry class="4" argb="255,3,0,0" value="3" />
+			<entry class="5" argb="255,4,0,0" value="4" />
+			<entry class="6" argb="255,5,0,0" value="5" />
+			<entry class="7" argb="255,6,0,0" value="6" />
+			<entry class="8" argb="255,7,0,0" value="7" />
+			<entry class="9" argb="255,8,0,0" value="8" />
+			<entry class="10" argb="255,9,0,0" value="9" />
+			<entry class="11" argb="255,10,0,0" value="10" />
+			<entry class="12" argb="255,11,0,0" value="11" />
+			<entry class="13" argb="255,12,0,0" value="12" />
+			<entry class="14" argb="255,13,0,0" value="13" />
+			<entry class="15" argb="255,14,0,0" value="14" />
+			<entry class="16" argb="255,15,0,0" value="15" />
+			<entry class="17" argb="255,16,0,0" value="16" />
+			<entry class="18" argb="255,17,0,0" value="17" />
+			<entry class="19" argb="255,18,0,0" value="18" />
+			<entry class="20" argb="255,19,0,0" value="19" />
+			<entry class="21" argb="255,20,0,0" value="20" />
+			<entry class="22" argb="255,21,0,0" value="21" />
+			<entry class="23" argb="255,22,0,0" value="22" />
+			<entry class="24" argb="255,23,0,0" value="23" />
+			<entry class="25" argb="255,24,0,0" value="24" />
+			<entry class="26" argb="255,25,0,0" value="25" />
+			<entry class="27" argb="255,26,0,0" value="26" />
+			<entry class="28" argb="255,27,0,0" value="27" />
+			<entry class="29" argb="255,28,0,0" value="28" />
+			<entry class="30" argb="255,29,0,0" value="29" />
+			<entry class="31" argb="255,30,0,0" value="30" />
+			<entry class="32" argb="255,31,0,0" value="31" />
+			<entry class="33" argb="255,32,0,0" value="32" />
+			<entry class="34" argb="255,33,0,0" value="33" />
+			<entry class="35" argb="255,34,0,0" value="34" />
+			<entry class="36" argb="255,35,0,0" value="35" />
+			<entry class="37" argb="255,36,0,0" value="36" />
+			<entry class="38" argb="255,37,0,0" value="37" />
+			<entry class="39" argb="255,38,0,0" value="38" />
+			<entry class="40" argb="255,39,0,0" value="39" />
+			<entry class="41" argb="255,40,0,0" value="40" />
+			<entry class="42" argb="255,41,0,0" value="41" />
+			<entry class="43" argb="255,42,0,0" value="42" />
+			<entry class="44" argb="255,43,0,0" value="43" />
+			<entry class="45" argb="255,44,0,0" value="44" />
+			<entry class="46" argb="255,45,0,0" value="45" />
+			<entry class="47" argb="255,46,0,0" value="46" />
+			<entry class="48" argb="255,47,0,0" value="47" />
+			<entry class="49" argb="255,48,0,0" value="48" />
+			<entry class="50" argb="255,49,0,0" value="49" />
+			<entry class="51" argb="255,50,0,0" value="50" />
+			<entry class="52" argb="255,51,0,0" value="51" />
+			<entry class="53" argb="255,52,0,0" value="52" />
+			<entry class="54" argb="255,53,0,0" value="53" />
+			<entry class="55" argb="255,54,0,0" value="54" />
+			<entry class="56" argb="255,55,0,0" value="55" />
+			<entry class="57" argb="255,56,0,0" value="56" />
+			<entry class="58" argb="255,57,0,0" value="57" />
+			<entry class="59" argb="255,58,0,0" value="58" />
+			<entry class="60" argb="255,59,0,0" value="59" />
+			<entry class="61" argb="255,60,0,0" value="60" />
+			<entry class="62" argb="255,61,0,0" value="61" />
+			<entry class="63" argb="255,62,0,0" value="62" />
+			<entry class="64" argb="255,63,0,0" value="63" />
+			<entry class="65" argb="255,64,0,0" value="64" />
+			<entry class="66" argb="255,65,0,0" value="65" />
+			<entry class="67" argb="255,66,0,0" value="66" />
+			<entry class="68" argb="255,67,0,0" value="67" />
+			<entry class="69" argb="255,68,0,0" value="68" />
+			<entry class="70" argb="255,69,0,0" value="69" />
+			<entry class="71" argb="255,70,0,0" value="70" />
+			<entry class="72" argb="255,71,0,0" value="71" />
+			<entry class="73" argb="255,72,0,0" value="72" />
+			<entry class="74" argb="255,73,0,0" value="73" />
+			<entry class="75" argb="255,74,0,0" value="74" />
+			<entry class="76" argb="255,75,0,0" value="75" />
+			<entry class="77" argb="255,76,0,0" value="76" />
+			<entry class="78" argb="255,77,0,0" value="77" />
+			<entry class="79" argb="255,78,0,0" value="78" />
+			<entry class="80" argb="255,79,0,0" value="79" />
+			<entry class="81" argb="255,80,0,0" value="80" />
+			<entry class="82" argb="255,81,0,0" value="81" />
+			<entry class="83" argb="255,82,0,0" value="82" />
+			<entry class="84" argb="255,83,0,0" value="83" />
+			<entry class="85" argb="255,84,0,0" value="84" />
+			<entry class="86" argb="255,85,0,0" value="85" />
+			<entry class="87" argb="255,86,0,0" value="86" />
+			<entry class="88" argb="255,87,0,0" value="87" />
+			<entry class="89" argb="255,88,0,0" value="88" />
+			<entry class="90" argb="255,89,0,0" value="89" />
+			<entry class="91" argb="255,90,0,0" value="90" />
+			<entry class="92" argb="255,91,0,0" value="91" />
+			<entry class="93" argb="255,92,0,0" value="92" />
+			<entry class="94" argb="255,93,0,0" value="93" />
+			<entry class="95" argb="255,94,0,0" value="94" />
+			<entry class="96" argb="255,95,0,0" value="95" />
+			<entry class="97" argb="255,96,0,0" value="96" />
+			<entry class="98" argb="255,97,0,0" value="97" />
+			<entry class="99" argb="255,98,0,0" value="98" />
+			<entry class="100" argb="255,99,0,0" value="99" />
+			<entry class="101" argb="255,100,0,0" value="100" />
+			<entry class="102" argb="255,101,0,0" value="101" />
+			<entry class="103" argb="255,102,0,0" value="102" />
+			<entry class="104" argb="255,103,0,0" value="103" />
+			<entry class="105" argb="255,104,0,0" value="104" />
+			<entry class="106" argb="255,105,0,0" value="105" />
+			<entry class="107" argb="255,106,0,0" value="106" />
+			<entry class="108" argb="255,107,0,0" value="107" />
+			<entry class="109" argb="255,108,0,0" value="108" />
+			<entry class="110" argb="255,109,0,0" value="109" />
+			<entry class="111" argb="255,110,0,0" value="110" />
+			<entry class="112" argb="255,111,0,0" value="111" />
+			<entry class="113" argb="255,112,0,0" value="112" />
+			<entry class="114" argb="255,113,0,0" value="113" />
+			<entry class="115" argb="255,114,0,0" value="114" />
+			<entry class="116" argb="255,115,0,0" value="115" />
+			<entry class="117" argb="255,116,0,0" value="116" />
+			<entry class="118" argb="255,117,0,0" value="117" />
+			<entry class="119" argb="255,118,0,0" value="118" />
+			<entry class="120" argb="255,119,0,0" value="119" />
+			<entry class="121" argb="255,120,0,0" value="120" />
+			<entry class="122" argb="255,121,0,0" value="121" />
+			<entry class="123" argb="255,122,0,0" value="122" />
+			<entry class="124" argb="255,123,0,0" value="123" />
+			<entry class="125" argb="255,124,0,0" value="124" />
+			<entry class="126" argb="255,125,0,0" value="125" />
+			<entry class="127" argb="255,126,0,0" value="126" />
+			<entry class="128" argb="255,127,0,0" value="127" />
+			<entry class="129" argb="255,128,0,0" value="128" />
+			<entry class="130" argb="255,129,0,0" value="129" />
+			<entry class="131" argb="255,130,0,0" value="130" />
+			<entry class="132" argb="255,131,0,0" value="131" />
+			<entry class="133" argb="255,132,0,0" value="132" />
+			<entry class="134" argb="255,133,0,0" value="133" />
+			<entry class="135" argb="255,134,0,0" value="134" />
+			<entry class="136" argb="255,135,0,0" value="135" />
+			<entry class="137" argb="255,136,0,0" value="136" />
+			<entry class="138" argb="255,137,0,0" value="137" />
+			<entry class="139" argb="255,138,0,0" value="138" />
+			<entry class="140" argb="255,139,0,0" value="139" />
+			<entry class="141" argb="255,140,0,0" value="140" />
+			<entry class="142" argb="255,141,0,0" value="141" />
+			<entry class="143" argb="255,142,0,0" value="142" />
+			<entry class="144" argb="255,143,0,0" value="143" />
+			<entry class="145" argb="255,144,0,0" value="144" />
+			<entry class="146" argb="255,145,0,0" value="145" />
+			<entry class="147" argb="255,146,0,0" value="146" />
+			<entry class="148" argb="255,147,0,0" value="147" />
+			<entry class="149" argb="255,148,0,0" value="148" />
+			<entry class="150" argb="255,149,0,0" value="149" />
+			<entry class="151" argb="255,150,0,0" value="150" />
+			<entry class="152" argb="255,151,0,0" value="151" />
+			<entry class="153" argb="255,152,0,0" value="152" />
+			<entry class="154" argb="255,153,0,0" value="153" />
+			<entry class="155" argb="255,154,0,0" value="154" />
+			<entry class="156" argb="255,155,0,0" value="155" />
+			<entry class="157" argb="255,156,0,0" value="156" />
+			<entry class="158" argb="255,157,0,0" value="157" />
+			<entry class="159" argb="255,158,0,0" value="158" />
+			<entry class="160" argb="255,159,0,0" value="159" />
+			<entry class="161" argb="255,160,0,0" value="160" />
+			<entry class="162" argb="255,161,0,0" value="161" />
+			<entry class="163" argb="255,162,0,0" value="162" />
+			<entry class="164" argb="255,163,0,0" value="163" />
+			<entry class="165" argb="255,164,0,0" value="164" />
+			<entry class="166" argb="255,165,0,0" value="165" />
+			<entry class="167" argb="255,166,0,0" value="166" />
+			<entry class="168" argb="255,167,0,0" value="167" />
+			<entry class="169" argb="255,168,0,0" value="168" />
+			<entry class="170" argb="255,169,0,0" value="169" />
+			<entry class="171" argb="255,170,0,0" value="170" />
+			<entry class="172" argb="255,171,0,0" value="171" />
+			<entry class="173" argb="255,172,0,0" value="172" />
+			<entry class="174" argb="255,173,0,0" value="173" />
+			<entry class="175" argb="255,174,0,0" value="174" />
+			<entry class="176" argb="255,175,0,0" value="175" />
+			<entry class="177" argb="255,176,0,0" value="176" />
+			<entry class="178" argb="255,177,0,0" value="177" />
+			<entry class="179" argb="255,178,0,0" value="178" />
+			<entry class="180" argb="255,179,0,0" value="179" />
+			<entry class="181" argb="255,180,0,0" value="180" />
+			<entry class="182" argb="255,181,0,0" value="181" />
+			<entry class="183" argb="255,182,0,0" value="182" />
+			<entry class="184" argb="255,183,0,0" value="183" />
+			<entry class="185" argb="255,184,0,0" value="184" />
+			<entry class="186" argb="255,185,0,0" value="185" />
+			<entry class="187" argb="255,186,0,0" value="186" />
+			<entry class="188" argb="255,187,0,0" value="187" />
+			<entry class="189" argb="255,188,0,0" value="188" />
+			<entry class="190" argb="255,189,0,0" value="189" />
+			<entry class="191" argb="255,190,0,0" value="190" />
+			<entry class="192" argb="255,191,0,0" value="191" />
+			<entry class="193" argb="255,192,0,0" value="192" />
+			<entry class="194" argb="255,193,0,0" value="193" />
+			<entry class="195" argb="255,194,0,0" value="194" />
+			<entry class="196" argb="255,195,0,0" value="195" />
+			<entry class="197" argb="255,196,0,0" value="196" />
+			<entry class="198" argb="255,197,0,0" value="197" />
+			<entry class="199" argb="255,198,0,0" value="198" />
+			<entry class="200" argb="255,199,0,0" value="199" />
+			<entry class="201" argb="255,200,0,0" value="200" />
+			<entry class="202" argb="255,201,0,0" value="201" />
+			<entry class="203" argb="255,202,0,0" value="202" />
+			<entry class="204" argb="255,203,0,0" value="203" />
+			<entry class="205" argb="255,204,0,0" value="204" />
+			<entry class="206" argb="255,205,0,0" value="205" />
+			<entry class="207" argb="255,206,0,0" value="206" />
+			<entry class="208" argb="255,207,0,0" value="207" />
+			<entry class="209" argb="255,208,0,0" value="208" />
+			<entry class="210" argb="255,209,0,0" value="209" />
+			<entry class="211" argb="255,210,0,0" value="210" />
+			<entry class="212" argb="255,211,0,0" value="211" />
+			<entry class="213" argb="255,212,0,0" value="212" />
+			<entry class="214" argb="255,213,0,0" value="213" />
+			<entry class="215" argb="255,214,0,0" value="214" />
+			<entry class="216" argb="255,215,0,0" value="215" />
+			<entry class="217" argb="255,216,0,0" value="216" />
+			<entry class="218" argb="255,217,0,0" value="217" />
+			<entry class="219" argb="255,218,0,0" value="218" />
+			<entry class="220" argb="255,219,0,0" value="219" />
+			<entry class="221" argb="255,220,0,0" value="220" />
+			<entry class="222" argb="255,221,0,0" value="221" />
+			<entry class="223" argb="255,222,0,0" value="222" />
+			<entry class="224" argb="255,223,0,0" value="223" />
+			<entry class="225" argb="255,224,0,0" value="224" />
+			<entry class="226" argb="255,225,0,0" value="225" />
+			<entry class="227" argb="255,226,0,0" value="226" />
+			<entry class="228" argb="255,227,0,0" value="227" />
+			<entry class="229" argb="255,228,0,0" value="228" />
+			<entry class="230" argb="255,229,0,0" value="229" />
+			<entry class="231" argb="255,230,0,0" value="230" />
+			<entry class="232" argb="255,231,0,0" value="231" />
+			<entry class="233" argb="255,232,0,0" value="232" />
+			<entry class="234" argb="255,233,0,0" value="233" />
+			<entry class="235" argb="255,234,0,0" value="234" />
+			<entry class="236" argb="255,235,0,0" value="235" />
+			<entry class="237" argb="255,236,0,0" value="236" />
+			<entry class="238" argb="255,237,0,0" value="237" />
+			<entry class="239" argb="255,238,0,0" value="238" />
+			<entry class="240" argb="255,239,0,0" value="239" />
+			<entry class="241" argb="255,240,0,0" value="240" />
+			<entry class="242" argb="255,241,0,0" value="241" />
+			<entry class="243" argb="255,242,0,0" value="242" />
+			<entry class="244" argb="255,243,0,0" value="243" />
+			<entry class="245" argb="255,244,0,0" value="244" />
+			<entry class="246" argb="255,245,0,0" value="245" />
+			<entry class="247" argb="255,246,0,0" value="246" />
+			<entry class="248" argb="255,247,0,0" value="247" />
+			<entry class="249" argb="255,248,0,0" value="248" />
+			<entry class="250" argb="255,249,0,0" value="249" />
+			<entry class="251" argb="255,250,0,0" value="250" />
+			<entry class="252" argb="255,251,0,0" value="251" />
+			<entry class="253" argb="255,252,0,0" value="252" />
+			<entry class="254" argb="255,253,0,0" value="253" />
+			<entry class="255" argb="255,254,0,0" value="254" />
+			<entry class="256" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(330,100,100) to HSV(330,100,0) -->
+	<palette name="Deep Rose  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,0,127" value="0" />
+			<entry class="2" argb="255,254,0,127" value="1" />
+			<entry class="3" argb="255,253,0,126" value="2" />
+			<entry class="4" argb="255,252,0,126" value="3" />
+			<entry class="5" argb="255,251,0,125" value="4" />
+			<entry class="6" argb="255,250,0,125" value="5" />
+			<entry class="7" argb="255,249,0,124" value="6" />
+			<entry class="8" argb="255,248,0,124" value="7" />
+			<entry class="9" argb="255,247,0,123" value="8" />
+			<entry class="10" argb="255,246,0,123" value="9" />
+			<entry class="11" argb="255,245,0,122" value="10" />
+			<entry class="12" argb="255,244,0,122" value="11" />
+			<entry class="13" argb="255,243,0,121" value="12" />
+			<entry class="14" argb="255,242,0,121" value="13" />
+			<entry class="15" argb="255,241,0,120" value="14" />
+			<entry class="16" argb="255,240,0,120" value="15" />
+			<entry class="17" argb="255,239,0,119" value="16" />
+			<entry class="18" argb="255,238,0,119" value="17" />
+			<entry class="19" argb="255,237,0,118" value="18" />
+			<entry class="20" argb="255,236,0,118" value="19" />
+			<entry class="21" argb="255,235,0,117" value="20" />
+			<entry class="22" argb="255,234,0,117" value="21" />
+			<entry class="23" argb="255,233,0,116" value="22" />
+			<entry class="24" argb="255,232,0,116" value="23" />
+			<entry class="25" argb="255,231,0,115" value="24" />
+			<entry class="26" argb="255,230,0,115" value="25" />
+			<entry class="27" argb="255,229,0,114" value="26" />
+			<entry class="28" argb="255,228,0,114" value="27" />
+			<entry class="29" argb="255,227,0,113" value="28" />
+			<entry class="30" argb="255,226,0,113" value="29" />
+			<entry class="31" argb="255,225,0,112" value="30" />
+			<entry class="32" argb="255,224,0,112" value="31" />
+			<entry class="33" argb="255,223,0,111" value="32" />
+			<entry class="34" argb="255,222,0,111" value="33" />
+			<entry class="35" argb="255,221,0,110" value="34" />
+			<entry class="36" argb="255,220,0,110" value="35" />
+			<entry class="37" argb="255,219,0,109" value="36" />
+			<entry class="38" argb="255,218,0,109" value="37" />
+			<entry class="39" argb="255,217,0,108" value="38" />
+			<entry class="40" argb="255,216,0,108" value="39" />
+			<entry class="41" argb="255,215,0,107" value="40" />
+			<entry class="42" argb="255,214,0,107" value="41" />
+			<entry class="43" argb="255,213,0,106" value="42" />
+			<entry class="44" argb="255,212,0,106" value="43" />
+			<entry class="45" argb="255,211,0,105" value="44" />
+			<entry class="46" argb="255,210,0,105" value="45" />
+			<entry class="47" argb="255,209,0,104" value="46" />
+			<entry class="48" argb="255,208,0,104" value="47" />
+			<entry class="49" argb="255,207,0,103" value="48" />
+			<entry class="50" argb="255,206,0,103" value="49" />
+			<entry class="51" argb="255,205,0,102" value="50" />
+			<entry class="52" argb="255,204,0,102" value="51" />
+			<entry class="53" argb="255,203,0,101" value="52" />
+			<entry class="54" argb="255,202,0,101" value="53" />
+			<entry class="55" argb="255,201,0,100" value="54" />
+			<entry class="56" argb="255,200,0,100" value="55" />
+			<entry class="57" argb="255,199,0,99" value="56" />
+			<entry class="58" argb="255,198,0,99" value="57" />
+			<entry class="59" argb="255,197,0,98" value="58" />
+			<entry class="60" argb="255,196,0,98" value="59" />
+			<entry class="61" argb="255,195,0,97" value="60" />
+			<entry class="62" argb="255,194,0,97" value="61" />
+			<entry class="63" argb="255,193,0,96" value="62" />
+			<entry class="64" argb="255,192,0,96" value="63" />
+			<entry class="65" argb="255,191,0,95" value="64" />
+			<entry class="66" argb="255,190,0,95" value="65" />
+			<entry class="67" argb="255,189,0,94" value="66" />
+			<entry class="68" argb="255,188,0,94" value="67" />
+			<entry class="69" argb="255,187,0,93" value="68" />
+			<entry class="70" argb="255,186,0,93" value="69" />
+			<entry class="71" argb="255,185,0,92" value="70" />
+			<entry class="72" argb="255,184,0,92" value="71" />
+			<entry class="73" argb="255,183,0,91" value="72" />
+			<entry class="74" argb="255,182,0,91" value="73" />
+			<entry class="75" argb="255,181,0,90" value="74" />
+			<entry class="76" argb="255,180,0,90" value="75" />
+			<entry class="77" argb="255,179,0,89" value="76" />
+			<entry class="78" argb="255,178,0,89" value="77" />
+			<entry class="79" argb="255,177,0,88" value="78" />
+			<entry class="80" argb="255,176,0,88" value="79" />
+			<entry class="81" argb="255,175,0,87" value="80" />
+			<entry class="82" argb="255,174,0,87" value="81" />
+			<entry class="83" argb="255,173,0,86" value="82" />
+			<entry class="84" argb="255,172,0,86" value="83" />
+			<entry class="85" argb="255,171,0,85" value="84" />
+			<entry class="86" argb="255,170,0,85" value="85" />
+			<entry class="87" argb="255,169,0,84" value="86" />
+			<entry class="88" argb="255,168,0,84" value="87" />
+			<entry class="89" argb="255,167,0,83" value="88" />
+			<entry class="90" argb="255,166,0,83" value="89" />
+			<entry class="91" argb="255,165,0,82" value="90" />
+			<entry class="92" argb="255,164,0,82" value="91" />
+			<entry class="93" argb="255,163,0,81" value="92" />
+			<entry class="94" argb="255,162,0,81" value="93" />
+			<entry class="95" argb="255,161,0,80" value="94" />
+			<entry class="96" argb="255,160,0,80" value="95" />
+			<entry class="97" argb="255,159,0,79" value="96" />
+			<entry class="98" argb="255,158,0,79" value="97" />
+			<entry class="99" argb="255,157,0,78" value="98" />
+			<entry class="100" argb="255,156,0,78" value="99" />
+			<entry class="101" argb="255,155,0,77" value="100" />
+			<entry class="102" argb="255,154,0,77" value="101" />
+			<entry class="103" argb="255,153,0,76" value="102" />
+			<entry class="104" argb="255,152,0,76" value="103" />
+			<entry class="105" argb="255,151,0,75" value="104" />
+			<entry class="106" argb="255,150,0,75" value="105" />
+			<entry class="107" argb="255,149,0,74" value="106" />
+			<entry class="108" argb="255,148,0,74" value="107" />
+			<entry class="109" argb="255,147,0,73" value="108" />
+			<entry class="110" argb="255,146,0,73" value="109" />
+			<entry class="111" argb="255,145,0,72" value="110" />
+			<entry class="112" argb="255,144,0,72" value="111" />
+			<entry class="113" argb="255,143,0,71" value="112" />
+			<entry class="114" argb="255,142,0,71" value="113" />
+			<entry class="115" argb="255,141,0,70" value="114" />
+			<entry class="116" argb="255,140,0,70" value="115" />
+			<entry class="117" argb="255,139,0,69" value="116" />
+			<entry class="118" argb="255,138,0,69" value="117" />
+			<entry class="119" argb="255,137,0,68" value="118" />
+			<entry class="120" argb="255,136,0,68" value="119" />
+			<entry class="121" argb="255,135,0,67" value="120" />
+			<entry class="122" argb="255,134,0,67" value="121" />
+			<entry class="123" argb="255,133,0,66" value="122" />
+			<entry class="124" argb="255,132,0,66" value="123" />
+			<entry class="125" argb="255,131,0,65" value="124" />
+			<entry class="126" argb="255,130,0,65" value="125" />
+			<entry class="127" argb="255,129,0,64" value="126" />
+			<entry class="128" argb="255,128,0,64" value="127" />
+			<entry class="129" argb="255,127,0,63" value="128" />
+			<entry class="130" argb="255,126,0,63" value="129" />
+			<entry class="131" argb="255,125,0,62" value="130" />
+			<entry class="132" argb="255,124,0,62" value="131" />
+			<entry class="133" argb="255,123,0,61" value="132" />
+			<entry class="134" argb="255,122,0,61" value="133" />
+			<entry class="135" argb="255,121,0,60" value="134" />
+			<entry class="136" argb="255,120,0,60" value="135" />
+			<entry class="137" argb="255,119,0,59" value="136" />
+			<entry class="138" argb="255,118,0,59" value="137" />
+			<entry class="139" argb="255,117,0,58" value="138" />
+			<entry class="140" argb="255,116,0,58" value="139" />
+			<entry class="141" argb="255,115,0,57" value="140" />
+			<entry class="142" argb="255,114,0,57" value="141" />
+			<entry class="143" argb="255,113,0,56" value="142" />
+			<entry class="144" argb="255,112,0,56" value="143" />
+			<entry class="145" argb="255,111,0,55" value="144" />
+			<entry class="146" argb="255,110,0,55" value="145" />
+			<entry class="147" argb="255,109,0,54" value="146" />
+			<entry class="148" argb="255,108,0,54" value="147" />
+			<entry class="149" argb="255,107,0,53" value="148" />
+			<entry class="150" argb="255,106,0,53" value="149" />
+			<entry class="151" argb="255,105,0,52" value="150" />
+			<entry class="152" argb="255,104,0,52" value="151" />
+			<entry class="153" argb="255,103,0,51" value="152" />
+			<entry class="154" argb="255,102,0,51" value="153" />
+			<entry class="155" argb="255,101,0,50" value="154" />
+			<entry class="156" argb="255,100,0,50" value="155" />
+			<entry class="157" argb="255,99,0,49" value="156" />
+			<entry class="158" argb="255,98,0,49" value="157" />
+			<entry class="159" argb="255,97,0,48" value="158" />
+			<entry class="160" argb="255,96,0,48" value="159" />
+			<entry class="161" argb="255,95,0,47" value="160" />
+			<entry class="162" argb="255,94,0,47" value="161" />
+			<entry class="163" argb="255,93,0,46" value="162" />
+			<entry class="164" argb="255,92,0,46" value="163" />
+			<entry class="165" argb="255,91,0,45" value="164" />
+			<entry class="166" argb="255,90,0,45" value="165" />
+			<entry class="167" argb="255,89,0,44" value="166" />
+			<entry class="168" argb="255,88,0,44" value="167" />
+			<entry class="169" argb="255,87,0,43" value="168" />
+			<entry class="170" argb="255,86,0,43" value="169" />
+			<entry class="171" argb="255,85,0,42" value="170" />
+			<entry class="172" argb="255,84,0,42" value="171" />
+			<entry class="173" argb="255,83,0,41" value="172" />
+			<entry class="174" argb="255,82,0,41" value="173" />
+			<entry class="175" argb="255,81,0,40" value="174" />
+			<entry class="176" argb="255,80,0,40" value="175" />
+			<entry class="177" argb="255,79,0,39" value="176" />
+			<entry class="178" argb="255,78,0,39" value="177" />
+			<entry class="179" argb="255,77,0,38" value="178" />
+			<entry class="180" argb="255,76,0,38" value="179" />
+			<entry class="181" argb="255,75,0,37" value="180" />
+			<entry class="182" argb="255,74,0,37" value="181" />
+			<entry class="183" argb="255,73,0,36" value="182" />
+			<entry class="184" argb="255,72,0,36" value="183" />
+			<entry class="185" argb="255,71,0,35" value="184" />
+			<entry class="186" argb="255,70,0,35" value="185" />
+			<entry class="187" argb="255,69,0,34" value="186" />
+			<entry class="188" argb="255,68,0,34" value="187" />
+			<entry class="189" argb="255,67,0,33" value="188" />
+			<entry class="190" argb="255,66,0,33" value="189" />
+			<entry class="191" argb="255,65,0,32" value="190" />
+			<entry class="192" argb="255,64,0,32" value="191" />
+			<entry class="193" argb="255,63,0,31" value="192" />
+			<entry class="194" argb="255,62,0,31" value="193" />
+			<entry class="195" argb="255,61,0,30" value="194" />
+			<entry class="196" argb="255,60,0,30" value="195" />
+			<entry class="197" argb="255,59,0,29" value="196" />
+			<entry class="198" argb="255,58,0,29" value="197" />
+			<entry class="199" argb="255,57,0,28" value="198" />
+			<entry class="200" argb="255,56,0,28" value="199" />
+			<entry class="201" argb="255,55,0,27" value="200" />
+			<entry class="202" argb="255,54,0,27" value="201" />
+			<entry class="203" argb="255,53,0,26" value="202" />
+			<entry class="204" argb="255,52,0,26" value="203" />
+			<entry class="205" argb="255,51,0,25" value="204" />
+			<entry class="206" argb="255,50,0,25" value="205" />
+			<entry class="207" argb="255,49,0,24" value="206" />
+			<entry class="208" argb="255,48,0,24" value="207" />
+			<entry class="209" argb="255,47,0,23" value="208" />
+			<entry class="210" argb="255,46,0,23" value="209" />
+			<entry class="211" argb="255,45,0,22" value="210" />
+			<entry class="212" argb="255,44,0,22" value="211" />
+			<entry class="213" argb="255,43,0,21" value="212" />
+			<entry class="214" argb="255,42,0,21" value="213" />
+			<entry class="215" argb="255,41,0,20" value="214" />
+			<entry class="216" argb="255,40,0,20" value="215" />
+			<entry class="217" argb="255,39,0,19" value="216" />
+			<entry class="218" argb="255,38,0,19" value="217" />
+			<entry class="219" argb="255,37,0,18" value="218" />
+			<entry class="220" argb="255,36,0,18" value="219" />
+			<entry class="221" argb="255,35,0,17" value="220" />
+			<entry class="222" argb="255,34,0,17" value="221" />
+			<entry class="223" argb="255,33,0,16" value="222" />
+			<entry class="224" argb="255,32,0,16" value="223" />
+			<entry class="225" argb="255,31,0,15" value="224" />
+			<entry class="226" argb="255,30,0,15" value="225" />
+			<entry class="227" argb="255,29,0,14" value="226" />
+			<entry class="228" argb="255,28,0,14" value="227" />
+			<entry class="229" argb="255,27,0,13" value="228" />
+			<entry class="230" argb="255,26,0,13" value="229" />
+			<entry class="231" argb="255,25,0,12" value="230" />
+			<entry class="232" argb="255,24,0,12" value="231" />
+			<entry class="233" argb="255,23,0,11" value="232" />
+			<entry class="234" argb="255,22,0,11" value="233" />
+			<entry class="235" argb="255,21,0,10" value="234" />
+			<entry class="236" argb="255,20,0,10" value="235" />
+			<entry class="237" argb="255,19,0,9" value="236" />
+			<entry class="238" argb="255,18,0,9" value="237" />
+			<entry class="239" argb="255,17,0,8" value="238" />
+			<entry class="240" argb="255,16,0,8" value="239" />
+			<entry class="241" argb="255,15,0,7" value="240" />
+			<entry class="242" argb="255,14,0,7" value="241" />
+			<entry class="243" argb="255,13,0,6" value="242" />
+			<entry class="244" argb="255,12,0,6" value="243" />
+			<entry class="245" argb="255,11,0,5" value="244" />
+			<entry class="246" argb="255,10,0,5" value="245" />
+			<entry class="247" argb="255,9,0,4" value="246" />
+			<entry class="248" argb="255,8,0,4" value="247" />
+			<entry class="249" argb="255,7,0,3" value="248" />
+			<entry class="250" argb="255,6,0,3" value="249" />
+			<entry class="251" argb="255,5,0,2" value="250" />
+			<entry class="252" argb="255,4,0,2" value="251" />
+			<entry class="253" argb="255,3,0,1" value="252" />
+			<entry class="254" argb="255,2,0,1" value="253" />
+			<entry class="255" argb="255,1,0,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(150,100,100) to HSV(150,100,0) -->
+	<palette name="Deep Spring Green  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,255,127" value="0" />
+			<entry class="2" argb="255,0,254,127" value="1" />
+			<entry class="3" argb="255,0,253,126" value="2" />
+			<entry class="4" argb="255,0,252,126" value="3" />
+			<entry class="5" argb="255,0,251,125" value="4" />
+			<entry class="6" argb="255,0,250,125" value="5" />
+			<entry class="7" argb="255,0,249,124" value="6" />
+			<entry class="8" argb="255,0,248,124" value="7" />
+			<entry class="9" argb="255,0,247,123" value="8" />
+			<entry class="10" argb="255,0,246,123" value="9" />
+			<entry class="11" argb="255,0,245,122" value="10" />
+			<entry class="12" argb="255,0,244,122" value="11" />
+			<entry class="13" argb="255,0,243,121" value="12" />
+			<entry class="14" argb="255,0,242,121" value="13" />
+			<entry class="15" argb="255,0,241,120" value="14" />
+			<entry class="16" argb="255,0,240,120" value="15" />
+			<entry class="17" argb="255,0,239,119" value="16" />
+			<entry class="18" argb="255,0,238,119" value="17" />
+			<entry class="19" argb="255,0,237,118" value="18" />
+			<entry class="20" argb="255,0,236,118" value="19" />
+			<entry class="21" argb="255,0,235,117" value="20" />
+			<entry class="22" argb="255,0,234,117" value="21" />
+			<entry class="23" argb="255,0,233,116" value="22" />
+			<entry class="24" argb="255,0,232,116" value="23" />
+			<entry class="25" argb="255,0,231,115" value="24" />
+			<entry class="26" argb="255,0,230,115" value="25" />
+			<entry class="27" argb="255,0,229,114" value="26" />
+			<entry class="28" argb="255,0,228,114" value="27" />
+			<entry class="29" argb="255,0,227,113" value="28" />
+			<entry class="30" argb="255,0,226,113" value="29" />
+			<entry class="31" argb="255,0,225,112" value="30" />
+			<entry class="32" argb="255,0,224,112" value="31" />
+			<entry class="33" argb="255,0,223,111" value="32" />
+			<entry class="34" argb="255,0,222,111" value="33" />
+			<entry class="35" argb="255,0,221,110" value="34" />
+			<entry class="36" argb="255,0,220,110" value="35" />
+			<entry class="37" argb="255,0,219,109" value="36" />
+			<entry class="38" argb="255,0,218,109" value="37" />
+			<entry class="39" argb="255,0,217,108" value="38" />
+			<entry class="40" argb="255,0,216,108" value="39" />
+			<entry class="41" argb="255,0,215,107" value="40" />
+			<entry class="42" argb="255,0,214,107" value="41" />
+			<entry class="43" argb="255,0,213,106" value="42" />
+			<entry class="44" argb="255,0,212,106" value="43" />
+			<entry class="45" argb="255,0,211,105" value="44" />
+			<entry class="46" argb="255,0,210,105" value="45" />
+			<entry class="47" argb="255,0,209,104" value="46" />
+			<entry class="48" argb="255,0,208,104" value="47" />
+			<entry class="49" argb="255,0,207,103" value="48" />
+			<entry class="50" argb="255,0,206,103" value="49" />
+			<entry class="51" argb="255,0,205,102" value="50" />
+			<entry class="52" argb="255,0,204,102" value="51" />
+			<entry class="53" argb="255,0,203,101" value="52" />
+			<entry class="54" argb="255,0,202,101" value="53" />
+			<entry class="55" argb="255,0,201,100" value="54" />
+			<entry class="56" argb="255,0,200,100" value="55" />
+			<entry class="57" argb="255,0,199,99" value="56" />
+			<entry class="58" argb="255,0,198,99" value="57" />
+			<entry class="59" argb="255,0,197,98" value="58" />
+			<entry class="60" argb="255,0,196,98" value="59" />
+			<entry class="61" argb="255,0,195,97" value="60" />
+			<entry class="62" argb="255,0,194,97" value="61" />
+			<entry class="63" argb="255,0,193,96" value="62" />
+			<entry class="64" argb="255,0,192,96" value="63" />
+			<entry class="65" argb="255,0,191,95" value="64" />
+			<entry class="66" argb="255,0,190,95" value="65" />
+			<entry class="67" argb="255,0,189,94" value="66" />
+			<entry class="68" argb="255,0,188,94" value="67" />
+			<entry class="69" argb="255,0,187,93" value="68" />
+			<entry class="70" argb="255,0,186,93" value="69" />
+			<entry class="71" argb="255,0,185,92" value="70" />
+			<entry class="72" argb="255,0,184,92" value="71" />
+			<entry class="73" argb="255,0,183,91" value="72" />
+			<entry class="74" argb="255,0,182,91" value="73" />
+			<entry class="75" argb="255,0,181,90" value="74" />
+			<entry class="76" argb="255,0,180,90" value="75" />
+			<entry class="77" argb="255,0,179,89" value="76" />
+			<entry class="78" argb="255,0,178,89" value="77" />
+			<entry class="79" argb="255,0,177,88" value="78" />
+			<entry class="80" argb="255,0,176,88" value="79" />
+			<entry class="81" argb="255,0,175,87" value="80" />
+			<entry class="82" argb="255,0,174,87" value="81" />
+			<entry class="83" argb="255,0,173,86" value="82" />
+			<entry class="84" argb="255,0,172,86" value="83" />
+			<entry class="85" argb="255,0,171,85" value="84" />
+			<entry class="86" argb="255,0,170,85" value="85" />
+			<entry class="87" argb="255,0,169,84" value="86" />
+			<entry class="88" argb="255,0,168,84" value="87" />
+			<entry class="89" argb="255,0,167,83" value="88" />
+			<entry class="90" argb="255,0,166,83" value="89" />
+			<entry class="91" argb="255,0,165,82" value="90" />
+			<entry class="92" argb="255,0,164,82" value="91" />
+			<entry class="93" argb="255,0,163,81" value="92" />
+			<entry class="94" argb="255,0,162,81" value="93" />
+			<entry class="95" argb="255,0,161,80" value="94" />
+			<entry class="96" argb="255,0,160,80" value="95" />
+			<entry class="97" argb="255,0,159,79" value="96" />
+			<entry class="98" argb="255,0,158,79" value="97" />
+			<entry class="99" argb="255,0,157,78" value="98" />
+			<entry class="100" argb="255,0,156,78" value="99" />
+			<entry class="101" argb="255,0,155,77" value="100" />
+			<entry class="102" argb="255,0,154,77" value="101" />
+			<entry class="103" argb="255,0,153,76" value="102" />
+			<entry class="104" argb="255,0,152,76" value="103" />
+			<entry class="105" argb="255,0,151,75" value="104" />
+			<entry class="106" argb="255,0,150,75" value="105" />
+			<entry class="107" argb="255,0,149,74" value="106" />
+			<entry class="108" argb="255,0,148,74" value="107" />
+			<entry class="109" argb="255,0,147,73" value="108" />
+			<entry class="110" argb="255,0,146,73" value="109" />
+			<entry class="111" argb="255,0,145,72" value="110" />
+			<entry class="112" argb="255,0,144,72" value="111" />
+			<entry class="113" argb="255,0,143,71" value="112" />
+			<entry class="114" argb="255,0,142,71" value="113" />
+			<entry class="115" argb="255,0,141,70" value="114" />
+			<entry class="116" argb="255,0,140,70" value="115" />
+			<entry class="117" argb="255,0,139,69" value="116" />
+			<entry class="118" argb="255,0,138,69" value="117" />
+			<entry class="119" argb="255,0,137,68" value="118" />
+			<entry class="120" argb="255,0,136,68" value="119" />
+			<entry class="121" argb="255,0,135,67" value="120" />
+			<entry class="122" argb="255,0,134,67" value="121" />
+			<entry class="123" argb="255,0,133,66" value="122" />
+			<entry class="124" argb="255,0,132,66" value="123" />
+			<entry class="125" argb="255,0,131,65" value="124" />
+			<entry class="126" argb="255,0,130,65" value="125" />
+			<entry class="127" argb="255,0,129,64" value="126" />
+			<entry class="128" argb="255,0,128,64" value="127" />
+			<entry class="129" argb="255,0,127,63" value="128" />
+			<entry class="130" argb="255,0,126,63" value="129" />
+			<entry class="131" argb="255,0,125,62" value="130" />
+			<entry class="132" argb="255,0,124,62" value="131" />
+			<entry class="133" argb="255,0,123,61" value="132" />
+			<entry class="134" argb="255,0,122,61" value="133" />
+			<entry class="135" argb="255,0,121,60" value="134" />
+			<entry class="136" argb="255,0,120,60" value="135" />
+			<entry class="137" argb="255,0,119,59" value="136" />
+			<entry class="138" argb="255,0,118,59" value="137" />
+			<entry class="139" argb="255,0,117,58" value="138" />
+			<entry class="140" argb="255,0,116,58" value="139" />
+			<entry class="141" argb="255,0,115,57" value="140" />
+			<entry class="142" argb="255,0,114,57" value="141" />
+			<entry class="143" argb="255,0,113,56" value="142" />
+			<entry class="144" argb="255,0,112,56" value="143" />
+			<entry class="145" argb="255,0,111,55" value="144" />
+			<entry class="146" argb="255,0,110,55" value="145" />
+			<entry class="147" argb="255,0,109,54" value="146" />
+			<entry class="148" argb="255,0,108,54" value="147" />
+			<entry class="149" argb="255,0,107,53" value="148" />
+			<entry class="150" argb="255,0,106,53" value="149" />
+			<entry class="151" argb="255,0,105,52" value="150" />
+			<entry class="152" argb="255,0,104,52" value="151" />
+			<entry class="153" argb="255,0,103,51" value="152" />
+			<entry class="154" argb="255,0,102,51" value="153" />
+			<entry class="155" argb="255,0,101,50" value="154" />
+			<entry class="156" argb="255,0,100,50" value="155" />
+			<entry class="157" argb="255,0,99,49" value="156" />
+			<entry class="158" argb="255,0,98,49" value="157" />
+			<entry class="159" argb="255,0,97,48" value="158" />
+			<entry class="160" argb="255,0,96,48" value="159" />
+			<entry class="161" argb="255,0,95,47" value="160" />
+			<entry class="162" argb="255,0,94,47" value="161" />
+			<entry class="163" argb="255,0,93,46" value="162" />
+			<entry class="164" argb="255,0,92,46" value="163" />
+			<entry class="165" argb="255,0,91,45" value="164" />
+			<entry class="166" argb="255,0,90,45" value="165" />
+			<entry class="167" argb="255,0,89,44" value="166" />
+			<entry class="168" argb="255,0,88,44" value="167" />
+			<entry class="169" argb="255,0,87,43" value="168" />
+			<entry class="170" argb="255,0,86,43" value="169" />
+			<entry class="171" argb="255,0,85,42" value="170" />
+			<entry class="172" argb="255,0,84,42" value="171" />
+			<entry class="173" argb="255,0,83,41" value="172" />
+			<entry class="174" argb="255,0,82,41" value="173" />
+			<entry class="175" argb="255,0,81,40" value="174" />
+			<entry class="176" argb="255,0,80,40" value="175" />
+			<entry class="177" argb="255,0,79,39" value="176" />
+			<entry class="178" argb="255,0,78,39" value="177" />
+			<entry class="179" argb="255,0,77,38" value="178" />
+			<entry class="180" argb="255,0,76,38" value="179" />
+			<entry class="181" argb="255,0,75,37" value="180" />
+			<entry class="182" argb="255,0,74,37" value="181" />
+			<entry class="183" argb="255,0,73,36" value="182" />
+			<entry class="184" argb="255,0,72,36" value="183" />
+			<entry class="185" argb="255,0,71,35" value="184" />
+			<entry class="186" argb="255,0,70,35" value="185" />
+			<entry class="187" argb="255,0,69,34" value="186" />
+			<entry class="188" argb="255,0,68,34" value="187" />
+			<entry class="189" argb="255,0,67,33" value="188" />
+			<entry class="190" argb="255,0,66,33" value="189" />
+			<entry class="191" argb="255,0,65,32" value="190" />
+			<entry class="192" argb="255,0,64,32" value="191" />
+			<entry class="193" argb="255,0,63,31" value="192" />
+			<entry class="194" argb="255,0,62,31" value="193" />
+			<entry class="195" argb="255,0,61,30" value="194" />
+			<entry class="196" argb="255,0,60,30" value="195" />
+			<entry class="197" argb="255,0,59,29" value="196" />
+			<entry class="198" argb="255,0,58,29" value="197" />
+			<entry class="199" argb="255,0,57,28" value="198" />
+			<entry class="200" argb="255,0,56,28" value="199" />
+			<entry class="201" argb="255,0,55,27" value="200" />
+			<entry class="202" argb="255,0,54,27" value="201" />
+			<entry class="203" argb="255,0,53,26" value="202" />
+			<entry class="204" argb="255,0,52,26" value="203" />
+			<entry class="205" argb="255,0,51,25" value="204" />
+			<entry class="206" argb="255,0,50,25" value="205" />
+			<entry class="207" argb="255,0,49,24" value="206" />
+			<entry class="208" argb="255,0,48,24" value="207" />
+			<entry class="209" argb="255,0,47,23" value="208" />
+			<entry class="210" argb="255,0,46,23" value="209" />
+			<entry class="211" argb="255,0,45,22" value="210" />
+			<entry class="212" argb="255,0,44,22" value="211" />
+			<entry class="213" argb="255,0,43,21" value="212" />
+			<entry class="214" argb="255,0,42,21" value="213" />
+			<entry class="215" argb="255,0,41,20" value="214" />
+			<entry class="216" argb="255,0,40,20" value="215" />
+			<entry class="217" argb="255,0,39,19" value="216" />
+			<entry class="218" argb="255,0,38,19" value="217" />
+			<entry class="219" argb="255,0,37,18" value="218" />
+			<entry class="220" argb="255,0,36,18" value="219" />
+			<entry class="221" argb="255,0,35,17" value="220" />
+			<entry class="222" argb="255,0,34,17" value="221" />
+			<entry class="223" argb="255,0,33,16" value="222" />
+			<entry class="224" argb="255,0,32,16" value="223" />
+			<entry class="225" argb="255,0,31,15" value="224" />
+			<entry class="226" argb="255,0,30,15" value="225" />
+			<entry class="227" argb="255,0,29,14" value="226" />
+			<entry class="228" argb="255,0,28,14" value="227" />
+			<entry class="229" argb="255,0,27,13" value="228" />
+			<entry class="230" argb="255,0,26,13" value="229" />
+			<entry class="231" argb="255,0,25,12" value="230" />
+			<entry class="232" argb="255,0,24,12" value="231" />
+			<entry class="233" argb="255,0,23,11" value="232" />
+			<entry class="234" argb="255,0,22,11" value="233" />
+			<entry class="235" argb="255,0,21,10" value="234" />
+			<entry class="236" argb="255,0,20,10" value="235" />
+			<entry class="237" argb="255,0,19,9" value="236" />
+			<entry class="238" argb="255,0,18,9" value="237" />
+			<entry class="239" argb="255,0,17,8" value="238" />
+			<entry class="240" argb="255,0,16,8" value="239" />
+			<entry class="241" argb="255,0,15,7" value="240" />
+			<entry class="242" argb="255,0,14,7" value="241" />
+			<entry class="243" argb="255,0,13,6" value="242" />
+			<entry class="244" argb="255,0,12,6" value="243" />
+			<entry class="245" argb="255,0,11,5" value="244" />
+			<entry class="246" argb="255,0,10,5" value="245" />
+			<entry class="247" argb="255,0,9,4" value="246" />
+			<entry class="248" argb="255,0,8,4" value="247" />
+			<entry class="249" argb="255,0,7,3" value="248" />
+			<entry class="250" argb="255,0,6,3" value="249" />
+			<entry class="251" argb="255,0,5,2" value="250" />
+			<entry class="252" argb="255,0,4,2" value="251" />
+			<entry class="253" argb="255,0,3,1" value="252" />
+			<entry class="254" argb="255,0,2,1" value="253" />
+			<entry class="255" argb="255,0,1,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+	
+	<!-- Gradient, HSV(270,100,100) to HSV(270,100,0) -->
+	<palette name="Deep Violet  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,127,0,255" value="0" />
+			<entry class="2" argb="255,127,0,254" value="1" />
+			<entry class="3" argb="255,126,0,253" value="2" />
+			<entry class="4" argb="255,126,0,252" value="3" />
+			<entry class="5" argb="255,125,0,251" value="4" />
+			<entry class="6" argb="255,125,0,250" value="5" />
+			<entry class="7" argb="255,124,0,249" value="6" />
+			<entry class="8" argb="255,124,0,248" value="7" />
+			<entry class="9" argb="255,123,0,247" value="8" />
+			<entry class="10" argb="255,123,0,246" value="9" />
+			<entry class="11" argb="255,122,0,245" value="10" />
+			<entry class="12" argb="255,122,0,244" value="11" />
+			<entry class="13" argb="255,121,0,243" value="12" />
+			<entry class="14" argb="255,121,0,242" value="13" />
+			<entry class="15" argb="255,120,0,241" value="14" />
+			<entry class="16" argb="255,120,0,240" value="15" />
+			<entry class="17" argb="255,119,0,239" value="16" />
+			<entry class="18" argb="255,119,0,238" value="17" />
+			<entry class="19" argb="255,118,0,237" value="18" />
+			<entry class="20" argb="255,118,0,236" value="19" />
+			<entry class="21" argb="255,117,0,235" value="20" />
+			<entry class="22" argb="255,117,0,234" value="21" />
+			<entry class="23" argb="255,116,0,233" value="22" />
+			<entry class="24" argb="255,116,0,232" value="23" />
+			<entry class="25" argb="255,115,0,231" value="24" />
+			<entry class="26" argb="255,115,0,230" value="25" />
+			<entry class="27" argb="255,114,0,229" value="26" />
+			<entry class="28" argb="255,114,0,228" value="27" />
+			<entry class="29" argb="255,113,0,227" value="28" />
+			<entry class="30" argb="255,113,0,226" value="29" />
+			<entry class="31" argb="255,112,0,225" value="30" />
+			<entry class="32" argb="255,112,0,224" value="31" />
+			<entry class="33" argb="255,111,0,223" value="32" />
+			<entry class="34" argb="255,111,0,222" value="33" />
+			<entry class="35" argb="255,110,0,221" value="34" />
+			<entry class="36" argb="255,110,0,220" value="35" />
+			<entry class="37" argb="255,109,0,219" value="36" />
+			<entry class="38" argb="255,109,0,218" value="37" />
+			<entry class="39" argb="255,108,0,217" value="38" />
+			<entry class="40" argb="255,108,0,216" value="39" />
+			<entry class="41" argb="255,107,0,215" value="40" />
+			<entry class="42" argb="255,107,0,214" value="41" />
+			<entry class="43" argb="255,106,0,213" value="42" />
+			<entry class="44" argb="255,106,0,212" value="43" />
+			<entry class="45" argb="255,105,0,211" value="44" />
+			<entry class="46" argb="255,105,0,210" value="45" />
+			<entry class="47" argb="255,104,0,209" value="46" />
+			<entry class="48" argb="255,104,0,208" value="47" />
+			<entry class="49" argb="255,103,0,207" value="48" />
+			<entry class="50" argb="255,103,0,206" value="49" />
+			<entry class="51" argb="255,102,0,205" value="50" />
+			<entry class="52" argb="255,102,0,204" value="51" />
+			<entry class="53" argb="255,101,0,203" value="52" />
+			<entry class="54" argb="255,101,0,202" value="53" />
+			<entry class="55" argb="255,100,0,201" value="54" />
+			<entry class="56" argb="255,100,0,200" value="55" />
+			<entry class="57" argb="255,99,0,199" value="56" />
+			<entry class="58" argb="255,99,0,198" value="57" />
+			<entry class="59" argb="255,98,0,197" value="58" />
+			<entry class="60" argb="255,98,0,196" value="59" />
+			<entry class="61" argb="255,97,0,195" value="60" />
+			<entry class="62" argb="255,97,0,194" value="61" />
+			<entry class="63" argb="255,96,0,193" value="62" />
+			<entry class="64" argb="255,96,0,192" value="63" />
+			<entry class="65" argb="255,95,0,191" value="64" />
+			<entry class="66" argb="255,95,0,190" value="65" />
+			<entry class="67" argb="255,94,0,189" value="66" />
+			<entry class="68" argb="255,94,0,188" value="67" />
+			<entry class="69" argb="255,93,0,187" value="68" />
+			<entry class="70" argb="255,93,0,186" value="69" />
+			<entry class="71" argb="255,92,0,185" value="70" />
+			<entry class="72" argb="255,92,0,184" value="71" />
+			<entry class="73" argb="255,91,0,183" value="72" />
+			<entry class="74" argb="255,91,0,182" value="73" />
+			<entry class="75" argb="255,90,0,181" value="74" />
+			<entry class="76" argb="255,90,0,180" value="75" />
+			<entry class="77" argb="255,89,0,179" value="76" />
+			<entry class="78" argb="255,89,0,178" value="77" />
+			<entry class="79" argb="255,88,0,177" value="78" />
+			<entry class="80" argb="255,88,0,176" value="79" />
+			<entry class="81" argb="255,87,0,175" value="80" />
+			<entry class="82" argb="255,87,0,174" value="81" />
+			<entry class="83" argb="255,86,0,173" value="82" />
+			<entry class="84" argb="255,86,0,172" value="83" />
+			<entry class="85" argb="255,85,0,171" value="84" />
+			<entry class="86" argb="255,85,0,170" value="85" />
+			<entry class="87" argb="255,84,0,169" value="86" />
+			<entry class="88" argb="255,84,0,168" value="87" />
+			<entry class="89" argb="255,83,0,167" value="88" />
+			<entry class="90" argb="255,83,0,166" value="89" />
+			<entry class="91" argb="255,82,0,165" value="90" />
+			<entry class="92" argb="255,82,0,164" value="91" />
+			<entry class="93" argb="255,81,0,163" value="92" />
+			<entry class="94" argb="255,81,0,162" value="93" />
+			<entry class="95" argb="255,80,0,161" value="94" />
+			<entry class="96" argb="255,80,0,160" value="95" />
+			<entry class="97" argb="255,79,0,159" value="96" />
+			<entry class="98" argb="255,79,0,158" value="97" />
+			<entry class="99" argb="255,78,0,157" value="98" />
+			<entry class="100" argb="255,78,0,156" value="99" />
+			<entry class="101" argb="255,77,0,155" value="100" />
+			<entry class="102" argb="255,77,0,154" value="101" />
+			<entry class="103" argb="255,76,0,153" value="102" />
+			<entry class="104" argb="255,76,0,152" value="103" />
+			<entry class="105" argb="255,75,0,151" value="104" />
+			<entry class="106" argb="255,75,0,150" value="105" />
+			<entry class="107" argb="255,74,0,149" value="106" />
+			<entry class="108" argb="255,74,0,148" value="107" />
+			<entry class="109" argb="255,73,0,147" value="108" />
+			<entry class="110" argb="255,73,0,146" value="109" />
+			<entry class="111" argb="255,72,0,145" value="110" />
+			<entry class="112" argb="255,72,0,144" value="111" />
+			<entry class="113" argb="255,71,0,143" value="112" />
+			<entry class="114" argb="255,71,0,142" value="113" />
+			<entry class="115" argb="255,70,0,141" value="114" />
+			<entry class="116" argb="255,70,0,140" value="115" />
+			<entry class="117" argb="255,69,0,139" value="116" />
+			<entry class="118" argb="255,69,0,138" value="117" />
+			<entry class="119" argb="255,68,0,137" value="118" />
+			<entry class="120" argb="255,68,0,136" value="119" />
+			<entry class="121" argb="255,67,0,135" value="120" />
+			<entry class="122" argb="255,67,0,134" value="121" />
+			<entry class="123" argb="255,66,0,133" value="122" />
+			<entry class="124" argb="255,66,0,132" value="123" />
+			<entry class="125" argb="255,65,0,131" value="124" />
+			<entry class="126" argb="255,65,0,130" value="125" />
+			<entry class="127" argb="255,64,0,129" value="126" />
+			<entry class="128" argb="255,64,0,128" value="127" />
+			<entry class="129" argb="255,63,0,127" value="128" />
+			<entry class="130" argb="255,63,0,126" value="129" />
+			<entry class="131" argb="255,62,0,125" value="130" />
+			<entry class="132" argb="255,62,0,124" value="131" />
+			<entry class="133" argb="255,61,0,123" value="132" />
+			<entry class="134" argb="255,61,0,122" value="133" />
+			<entry class="135" argb="255,60,0,121" value="134" />
+			<entry class="136" argb="255,60,0,120" value="135" />
+			<entry class="137" argb="255,59,0,119" value="136" />
+			<entry class="138" argb="255,59,0,118" value="137" />
+			<entry class="139" argb="255,58,0,117" value="138" />
+			<entry class="140" argb="255,58,0,116" value="139" />
+			<entry class="141" argb="255,57,0,115" value="140" />
+			<entry class="142" argb="255,57,0,114" value="141" />
+			<entry class="143" argb="255,56,0,113" value="142" />
+			<entry class="144" argb="255,56,0,112" value="143" />
+			<entry class="145" argb="255,55,0,111" value="144" />
+			<entry class="146" argb="255,55,0,110" value="145" />
+			<entry class="147" argb="255,54,0,109" value="146" />
+			<entry class="148" argb="255,54,0,108" value="147" />
+			<entry class="149" argb="255,53,0,107" value="148" />
+			<entry class="150" argb="255,53,0,106" value="149" />
+			<entry class="151" argb="255,52,0,105" value="150" />
+			<entry class="152" argb="255,52,0,104" value="151" />
+			<entry class="153" argb="255,51,0,103" value="152" />
+			<entry class="154" argb="255,51,0,102" value="153" />
+			<entry class="155" argb="255,50,0,101" value="154" />
+			<entry class="156" argb="255,50,0,100" value="155" />
+			<entry class="157" argb="255,49,0,99" value="156" />
+			<entry class="158" argb="255,49,0,98" value="157" />
+			<entry class="159" argb="255,48,0,97" value="158" />
+			<entry class="160" argb="255,48,0,96" value="159" />
+			<entry class="161" argb="255,47,0,95" value="160" />
+			<entry class="162" argb="255,47,0,94" value="161" />
+			<entry class="163" argb="255,46,0,93" value="162" />
+			<entry class="164" argb="255,46,0,92" value="163" />
+			<entry class="165" argb="255,45,0,91" value="164" />
+			<entry class="166" argb="255,45,0,90" value="165" />
+			<entry class="167" argb="255,44,0,89" value="166" />
+			<entry class="168" argb="255,44,0,88" value="167" />
+			<entry class="169" argb="255,43,0,87" value="168" />
+			<entry class="170" argb="255,43,0,86" value="169" />
+			<entry class="171" argb="255,42,0,85" value="170" />
+			<entry class="172" argb="255,42,0,84" value="171" />
+			<entry class="173" argb="255,41,0,83" value="172" />
+			<entry class="174" argb="255,41,0,82" value="173" />
+			<entry class="175" argb="255,40,0,81" value="174" />
+			<entry class="176" argb="255,40,0,80" value="175" />
+			<entry class="177" argb="255,39,0,79" value="176" />
+			<entry class="178" argb="255,39,0,78" value="177" />
+			<entry class="179" argb="255,38,0,77" value="178" />
+			<entry class="180" argb="255,38,0,76" value="179" />
+			<entry class="181" argb="255,37,0,75" value="180" />
+			<entry class="182" argb="255,37,0,74" value="181" />
+			<entry class="183" argb="255,36,0,73" value="182" />
+			<entry class="184" argb="255,36,0,72" value="183" />
+			<entry class="185" argb="255,35,0,71" value="184" />
+			<entry class="186" argb="255,35,0,70" value="185" />
+			<entry class="187" argb="255,34,0,69" value="186" />
+			<entry class="188" argb="255,34,0,68" value="187" />
+			<entry class="189" argb="255,33,0,67" value="188" />
+			<entry class="190" argb="255,33,0,66" value="189" />
+			<entry class="191" argb="255,32,0,65" value="190" />
+			<entry class="192" argb="255,32,0,64" value="191" />
+			<entry class="193" argb="255,31,0,63" value="192" />
+			<entry class="194" argb="255,31,0,62" value="193" />
+			<entry class="195" argb="255,30,0,61" value="194" />
+			<entry class="196" argb="255,30,0,60" value="195" />
+			<entry class="197" argb="255,29,0,59" value="196" />
+			<entry class="198" argb="255,29,0,58" value="197" />
+			<entry class="199" argb="255,28,0,57" value="198" />
+			<entry class="200" argb="255,28,0,56" value="199" />
+			<entry class="201" argb="255,27,0,55" value="200" />
+			<entry class="202" argb="255,27,0,54" value="201" />
+			<entry class="203" argb="255,26,0,53" value="202" />
+			<entry class="204" argb="255,26,0,52" value="203" />
+			<entry class="205" argb="255,25,0,51" value="204" />
+			<entry class="206" argb="255,25,0,50" value="205" />
+			<entry class="207" argb="255,24,0,49" value="206" />
+			<entry class="208" argb="255,24,0,48" value="207" />
+			<entry class="209" argb="255,23,0,47" value="208" />
+			<entry class="210" argb="255,23,0,46" value="209" />
+			<entry class="211" argb="255,22,0,45" value="210" />
+			<entry class="212" argb="255,22,0,44" value="211" />
+			<entry class="213" argb="255,21,0,43" value="212" />
+			<entry class="214" argb="255,21,0,42" value="213" />
+			<entry class="215" argb="255,20,0,41" value="214" />
+			<entry class="216" argb="255,20,0,40" value="215" />
+			<entry class="217" argb="255,19,0,39" value="216" />
+			<entry class="218" argb="255,19,0,38" value="217" />
+			<entry class="219" argb="255,18,0,37" value="218" />
+			<entry class="220" argb="255,18,0,36" value="219" />
+			<entry class="221" argb="255,17,0,35" value="220" />
+			<entry class="222" argb="255,17,0,34" value="221" />
+			<entry class="223" argb="255,16,0,33" value="222" />
+			<entry class="224" argb="255,16,0,32" value="223" />
+			<entry class="225" argb="255,15,0,31" value="224" />
+			<entry class="226" argb="255,15,0,30" value="225" />
+			<entry class="227" argb="255,14,0,29" value="226" />
+			<entry class="228" argb="255,14,0,28" value="227" />
+			<entry class="229" argb="255,13,0,27" value="228" />
+			<entry class="230" argb="255,13,0,26" value="229" />
+			<entry class="231" argb="255,12,0,25" value="230" />
+			<entry class="232" argb="255,12,0,24" value="231" />
+			<entry class="233" argb="255,11,0,23" value="232" />
+			<entry class="234" argb="255,11,0,22" value="233" />
+			<entry class="235" argb="255,10,0,21" value="234" />
+			<entry class="236" argb="255,10,0,20" value="235" />
+			<entry class="237" argb="255,9,0,19" value="236" />
+			<entry class="238" argb="255,9,0,18" value="237" />
+			<entry class="239" argb="255,8,0,17" value="238" />
+			<entry class="240" argb="255,8,0,16" value="239" />
+			<entry class="241" argb="255,7,0,15" value="240" />
+			<entry class="242" argb="255,7,0,14" value="241" />
+			<entry class="243" argb="255,6,0,13" value="242" />
+			<entry class="244" argb="255,6,0,12" value="243" />
+			<entry class="245" argb="255,5,0,11" value="244" />
+			<entry class="246" argb="255,5,0,10" value="245" />
+			<entry class="247" argb="255,4,0,9" value="246" />
+			<entry class="248" argb="255,4,0,8" value="247" />
+			<entry class="249" argb="255,3,0,7" value="248" />
+			<entry class="250" argb="255,3,0,6" value="249" />
+			<entry class="251" argb="255,2,0,5" value="250" />
+			<entry class="252" argb="255,2,0,4" value="251" />
+			<entry class="253" argb="255,1,0,3" value="252" />
+			<entry class="254" argb="255,1,0,2" value="253" />
+			<entry class="255" argb="255,0,0,1" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(60,100,0) to HSV(60,100,100) -->
+	<palette name="Deep Yellow  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,1,1,0" value="1" />
+			<entry class="3" argb="255,2,2,0" value="2" />
+			<entry class="4" argb="255,3,3,0" value="3" />
+			<entry class="5" argb="255,4,4,0" value="4" />
+			<entry class="6" argb="255,5,5,0" value="5" />
+			<entry class="7" argb="255,6,6,0" value="6" />
+			<entry class="8" argb="255,7,7,0" value="7" />
+			<entry class="9" argb="255,8,8,0" value="8" />
+			<entry class="10" argb="255,9,9,0" value="9" />
+			<entry class="11" argb="255,10,10,0" value="10" />
+			<entry class="12" argb="255,11,11,0" value="11" />
+			<entry class="13" argb="255,12,12,0" value="12" />
+			<entry class="14" argb="255,13,13,0" value="13" />
+			<entry class="15" argb="255,14,14,0" value="14" />
+			<entry class="16" argb="255,15,15,0" value="15" />
+			<entry class="17" argb="255,16,16,0" value="16" />
+			<entry class="18" argb="255,17,17,0" value="17" />
+			<entry class="19" argb="255,18,18,0" value="18" />
+			<entry class="20" argb="255,19,19,0" value="19" />
+			<entry class="21" argb="255,20,20,0" value="20" />
+			<entry class="22" argb="255,21,21,0" value="21" />
+			<entry class="23" argb="255,22,22,0" value="22" />
+			<entry class="24" argb="255,23,23,0" value="23" />
+			<entry class="25" argb="255,24,24,0" value="24" />
+			<entry class="26" argb="255,25,25,0" value="25" />
+			<entry class="27" argb="255,26,26,0" value="26" />
+			<entry class="28" argb="255,27,27,0" value="27" />
+			<entry class="29" argb="255,28,28,0" value="28" />
+			<entry class="30" argb="255,29,29,0" value="29" />
+			<entry class="31" argb="255,30,30,0" value="30" />
+			<entry class="32" argb="255,31,31,0" value="31" />
+			<entry class="33" argb="255,32,32,0" value="32" />
+			<entry class="34" argb="255,33,33,0" value="33" />
+			<entry class="35" argb="255,34,34,0" value="34" />
+			<entry class="36" argb="255,35,35,0" value="35" />
+			<entry class="37" argb="255,36,36,0" value="36" />
+			<entry class="38" argb="255,37,37,0" value="37" />
+			<entry class="39" argb="255,38,38,0" value="38" />
+			<entry class="40" argb="255,39,39,0" value="39" />
+			<entry class="41" argb="255,40,40,0" value="40" />
+			<entry class="42" argb="255,41,41,0" value="41" />
+			<entry class="43" argb="255,42,42,0" value="42" />
+			<entry class="44" argb="255,43,43,0" value="43" />
+			<entry class="45" argb="255,44,44,0" value="44" />
+			<entry class="46" argb="255,45,45,0" value="45" />
+			<entry class="47" argb="255,46,46,0" value="46" />
+			<entry class="48" argb="255,47,47,0" value="47" />
+			<entry class="49" argb="255,48,48,0" value="48" />
+			<entry class="50" argb="255,49,49,0" value="49" />
+			<entry class="51" argb="255,50,50,0" value="50" />
+			<entry class="52" argb="255,51,51,0" value="51" />
+			<entry class="53" argb="255,52,52,0" value="52" />
+			<entry class="54" argb="255,53,53,0" value="53" />
+			<entry class="55" argb="255,54,54,0" value="54" />
+			<entry class="56" argb="255,55,55,0" value="55" />
+			<entry class="57" argb="255,56,56,0" value="56" />
+			<entry class="58" argb="255,57,57,0" value="57" />
+			<entry class="59" argb="255,58,58,0" value="58" />
+			<entry class="60" argb="255,59,59,0" value="59" />
+			<entry class="61" argb="255,60,60,0" value="60" />
+			<entry class="62" argb="255,61,61,0" value="61" />
+			<entry class="63" argb="255,62,62,0" value="62" />
+			<entry class="64" argb="255,63,63,0" value="63" />
+			<entry class="65" argb="255,64,64,0" value="64" />
+			<entry class="66" argb="255,65,65,0" value="65" />
+			<entry class="67" argb="255,66,66,0" value="66" />
+			<entry class="68" argb="255,67,67,0" value="67" />
+			<entry class="69" argb="255,68,68,0" value="68" />
+			<entry class="70" argb="255,69,69,0" value="69" />
+			<entry class="71" argb="255,70,70,0" value="70" />
+			<entry class="72" argb="255,71,71,0" value="71" />
+			<entry class="73" argb="255,72,72,0" value="72" />
+			<entry class="74" argb="255,73,73,0" value="73" />
+			<entry class="75" argb="255,74,74,0" value="74" />
+			<entry class="76" argb="255,75,75,0" value="75" />
+			<entry class="77" argb="255,76,76,0" value="76" />
+			<entry class="78" argb="255,77,77,0" value="77" />
+			<entry class="79" argb="255,78,78,0" value="78" />
+			<entry class="80" argb="255,79,79,0" value="79" />
+			<entry class="81" argb="255,80,80,0" value="80" />
+			<entry class="82" argb="255,81,81,0" value="81" />
+			<entry class="83" argb="255,82,82,0" value="82" />
+			<entry class="84" argb="255,83,83,0" value="83" />
+			<entry class="85" argb="255,84,84,0" value="84" />
+			<entry class="86" argb="255,85,85,0" value="85" />
+			<entry class="87" argb="255,86,86,0" value="86" />
+			<entry class="88" argb="255,87,87,0" value="87" />
+			<entry class="89" argb="255,88,88,0" value="88" />
+			<entry class="90" argb="255,89,89,0" value="89" />
+			<entry class="91" argb="255,90,90,0" value="90" />
+			<entry class="92" argb="255,91,91,0" value="91" />
+			<entry class="93" argb="255,92,92,0" value="92" />
+			<entry class="94" argb="255,93,93,0" value="93" />
+			<entry class="95" argb="255,94,94,0" value="94" />
+			<entry class="96" argb="255,95,95,0" value="95" />
+			<entry class="97" argb="255,96,96,0" value="96" />
+			<entry class="98" argb="255,97,97,0" value="97" />
+			<entry class="99" argb="255,98,98,0" value="98" />
+			<entry class="100" argb="255,99,99,0" value="99" />
+			<entry class="101" argb="255,100,100,0" value="100" />
+			<entry class="102" argb="255,101,101,0" value="101" />
+			<entry class="103" argb="255,102,102,0" value="102" />
+			<entry class="104" argb="255,103,103,0" value="103" />
+			<entry class="105" argb="255,104,104,0" value="104" />
+			<entry class="106" argb="255,105,105,0" value="105" />
+			<entry class="107" argb="255,106,106,0" value="106" />
+			<entry class="108" argb="255,107,107,0" value="107" />
+			<entry class="109" argb="255,108,108,0" value="108" />
+			<entry class="110" argb="255,109,109,0" value="109" />
+			<entry class="111" argb="255,110,110,0" value="110" />
+			<entry class="112" argb="255,111,111,0" value="111" />
+			<entry class="113" argb="255,112,112,0" value="112" />
+			<entry class="114" argb="255,113,113,0" value="113" />
+			<entry class="115" argb="255,114,114,0" value="114" />
+			<entry class="116" argb="255,115,115,0" value="115" />
+			<entry class="117" argb="255,116,116,0" value="116" />
+			<entry class="118" argb="255,117,117,0" value="117" />
+			<entry class="119" argb="255,118,118,0" value="118" />
+			<entry class="120" argb="255,119,119,0" value="119" />
+			<entry class="121" argb="255,120,120,0" value="120" />
+			<entry class="122" argb="255,121,121,0" value="121" />
+			<entry class="123" argb="255,122,122,0" value="122" />
+			<entry class="124" argb="255,123,123,0" value="123" />
+			<entry class="125" argb="255,124,124,0" value="124" />
+			<entry class="126" argb="255,125,125,0" value="125" />
+			<entry class="127" argb="255,126,126,0" value="126" />
+			<entry class="128" argb="255,127,127,0" value="127" />
+			<entry class="129" argb="255,128,128,0" value="128" />
+			<entry class="130" argb="255,129,129,0" value="129" />
+			<entry class="131" argb="255,130,130,0" value="130" />
+			<entry class="132" argb="255,131,131,0" value="131" />
+			<entry class="133" argb="255,132,132,0" value="132" />
+			<entry class="134" argb="255,133,133,0" value="133" />
+			<entry class="135" argb="255,134,134,0" value="134" />
+			<entry class="136" argb="255,135,135,0" value="135" />
+			<entry class="137" argb="255,136,136,0" value="136" />
+			<entry class="138" argb="255,137,137,0" value="137" />
+			<entry class="139" argb="255,138,138,0" value="138" />
+			<entry class="140" argb="255,139,139,0" value="139" />
+			<entry class="141" argb="255,140,140,0" value="140" />
+			<entry class="142" argb="255,141,141,0" value="141" />
+			<entry class="143" argb="255,142,142,0" value="142" />
+			<entry class="144" argb="255,143,143,0" value="143" />
+			<entry class="145" argb="255,144,144,0" value="144" />
+			<entry class="146" argb="255,145,145,0" value="145" />
+			<entry class="147" argb="255,146,146,0" value="146" />
+			<entry class="148" argb="255,147,147,0" value="147" />
+			<entry class="149" argb="255,148,148,0" value="148" />
+			<entry class="150" argb="255,149,149,0" value="149" />
+			<entry class="151" argb="255,150,150,0" value="150" />
+			<entry class="152" argb="255,151,151,0" value="151" />
+			<entry class="153" argb="255,152,152,0" value="152" />
+			<entry class="154" argb="255,153,153,0" value="153" />
+			<entry class="155" argb="255,154,154,0" value="154" />
+			<entry class="156" argb="255,155,155,0" value="155" />
+			<entry class="157" argb="255,156,156,0" value="156" />
+			<entry class="158" argb="255,157,157,0" value="157" />
+			<entry class="159" argb="255,158,158,0" value="158" />
+			<entry class="160" argb="255,159,159,0" value="159" />
+			<entry class="161" argb="255,160,160,0" value="160" />
+			<entry class="162" argb="255,161,161,0" value="161" />
+			<entry class="163" argb="255,162,162,0" value="162" />
+			<entry class="164" argb="255,163,163,0" value="163" />
+			<entry class="165" argb="255,164,164,0" value="164" />
+			<entry class="166" argb="255,165,165,0" value="165" />
+			<entry class="167" argb="255,166,166,0" value="166" />
+			<entry class="168" argb="255,167,167,0" value="167" />
+			<entry class="169" argb="255,168,168,0" value="168" />
+			<entry class="170" argb="255,169,169,0" value="169" />
+			<entry class="171" argb="255,170,170,0" value="170" />
+			<entry class="172" argb="255,171,171,0" value="171" />
+			<entry class="173" argb="255,172,172,0" value="172" />
+			<entry class="174" argb="255,173,173,0" value="173" />
+			<entry class="175" argb="255,174,174,0" value="174" />
+			<entry class="176" argb="255,175,175,0" value="175" />
+			<entry class="177" argb="255,176,176,0" value="176" />
+			<entry class="178" argb="255,177,177,0" value="177" />
+			<entry class="179" argb="255,178,178,0" value="178" />
+			<entry class="180" argb="255,179,179,0" value="179" />
+			<entry class="181" argb="255,180,180,0" value="180" />
+			<entry class="182" argb="255,181,181,0" value="181" />
+			<entry class="183" argb="255,182,182,0" value="182" />
+			<entry class="184" argb="255,183,183,0" value="183" />
+			<entry class="185" argb="255,184,184,0" value="184" />
+			<entry class="186" argb="255,185,185,0" value="185" />
+			<entry class="187" argb="255,186,186,0" value="186" />
+			<entry class="188" argb="255,187,187,0" value="187" />
+			<entry class="189" argb="255,188,188,0" value="188" />
+			<entry class="190" argb="255,189,189,0" value="189" />
+			<entry class="191" argb="255,190,190,0" value="190" />
+			<entry class="192" argb="255,191,191,0" value="191" />
+			<entry class="193" argb="255,192,192,0" value="192" />
+			<entry class="194" argb="255,193,193,0" value="193" />
+			<entry class="195" argb="255,194,194,0" value="194" />
+			<entry class="196" argb="255,195,195,0" value="195" />
+			<entry class="197" argb="255,196,196,0" value="196" />
+			<entry class="198" argb="255,197,197,0" value="197" />
+			<entry class="199" argb="255,198,198,0" value="198" />
+			<entry class="200" argb="255,199,199,0" value="199" />
+			<entry class="201" argb="255,200,200,0" value="200" />
+			<entry class="202" argb="255,201,201,0" value="201" />
+			<entry class="203" argb="255,202,202,0" value="202" />
+			<entry class="204" argb="255,203,203,0" value="203" />
+			<entry class="205" argb="255,204,204,0" value="204" />
+			<entry class="206" argb="255,205,205,0" value="205" />
+			<entry class="207" argb="255,206,206,0" value="206" />
+			<entry class="208" argb="255,207,207,0" value="207" />
+			<entry class="209" argb="255,208,208,0" value="208" />
+			<entry class="210" argb="255,209,209,0" value="209" />
+			<entry class="211" argb="255,210,210,0" value="210" />
+			<entry class="212" argb="255,211,211,0" value="211" />
+			<entry class="213" argb="255,212,212,0" value="212" />
+			<entry class="214" argb="255,213,213,0" value="213" />
+			<entry class="215" argb="255,214,214,0" value="214" />
+			<entry class="216" argb="255,215,215,0" value="215" />
+			<entry class="217" argb="255,216,216,0" value="216" />
+			<entry class="218" argb="255,217,217,0" value="217" />
+			<entry class="219" argb="255,218,218,0" value="218" />
+			<entry class="220" argb="255,219,219,0" value="219" />
+			<entry class="221" argb="255,220,220,0" value="220" />
+			<entry class="222" argb="255,221,221,0" value="221" />
+			<entry class="223" argb="255,222,222,0" value="222" />
+			<entry class="224" argb="255,223,223,0" value="223" />
+			<entry class="225" argb="255,224,224,0" value="224" />
+			<entry class="226" argb="255,225,225,0" value="225" />
+			<entry class="227" argb="255,226,226,0" value="226" />
+			<entry class="228" argb="255,227,227,0" value="227" />
+			<entry class="229" argb="255,228,228,0" value="228" />
+			<entry class="230" argb="255,229,229,0" value="229" />
+			<entry class="231" argb="255,230,230,0" value="230" />
+			<entry class="232" argb="255,231,231,0" value="231" />
+			<entry class="233" argb="255,232,232,0" value="232" />
+			<entry class="234" argb="255,233,233,0" value="233" />
+			<entry class="235" argb="255,234,234,0" value="234" />
+			<entry class="236" argb="255,235,235,0" value="235" />
+			<entry class="237" argb="255,236,236,0" value="236" />
+			<entry class="238" argb="255,237,237,0" value="237" />
+			<entry class="239" argb="255,238,238,0" value="238" />
+			<entry class="240" argb="255,239,239,0" value="239" />
+			<entry class="241" argb="255,240,240,0" value="240" />
+			<entry class="242" argb="255,241,241,0" value="241" />
+			<entry class="243" argb="255,242,242,0" value="242" />
+			<entry class="244" argb="255,243,243,0" value="243" />
+			<entry class="245" argb="255,244,244,0" value="244" />
+			<entry class="246" argb="255,245,245,0" value="245" />
+			<entry class="247" argb="255,246,246,0" value="246" />
+			<entry class="248" argb="255,247,247,0" value="247" />
+			<entry class="249" argb="255,248,248,0" value="248" />
+			<entry class="250" argb="255,249,249,0" value="249" />
+			<entry class="251" argb="255,250,250,0" value="250" />
+			<entry class="252" argb="255,251,251,0" value="251" />
+			<entry class="253" argb="255,252,252,0" value="252" />
+			<entry class="254" argb="255,253,253,0" value="253" />
+			<entry class="255" argb="255,254,254,0" value="254" />
+			<entry class="256" argb="255,255,255,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(0,0,0) to HSV(0,0,100) -->
+	<!-- Rename "z  Black - White  (256)" if not used as default -->
+	<palette name="Default" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,0,0" value="1" />
+			<entry class="3" argb="255,1,1,1" value="2" />
+			<entry class="4" argb="255,2,2,2" value="3" />
+			<entry class="5" argb="255,3,3,3" value="4" />
+			<entry class="6" argb="255,4,4,4" value="5" />
+			<entry class="7" argb="255,5,5,5" value="6" />
+			<entry class="8" argb="255,6,6,6" value="7" />
+			<entry class="9" argb="255,7,7,7" value="8" />
+			<entry class="10" argb="255,8,8,8" value="9" />
+			<entry class="11" argb="255,9,9,9" value="10" />
+			<entry class="12" argb="255,10,10,10" value="11" />
+			<entry class="13" argb="255,11,11,11" value="12" />
+			<entry class="14" argb="255,12,12,12" value="13" />
+			<entry class="15" argb="255,13,13,13" value="14" />
+			<entry class="16" argb="255,14,14,14" value="15" />
+			<entry class="17" argb="255,15,15,15" value="16" />
+			<entry class="18" argb="255,16,16,16" value="17" />
+			<entry class="19" argb="255,17,17,17" value="18" />
+			<entry class="20" argb="255,18,18,18" value="19" />
+			<entry class="21" argb="255,19,19,19" value="20" />
+			<entry class="22" argb="255,20,20,20" value="21" />
+			<entry class="23" argb="255,21,21,21" value="22" />
+			<entry class="24" argb="255,22,22,22" value="23" />
+			<entry class="25" argb="255,23,23,23" value="24" />
+			<entry class="26" argb="255,24,24,24" value="25" />
+			<entry class="27" argb="255,25,25,25" value="26" />
+			<entry class="28" argb="255,26,26,26" value="27" />
+			<entry class="29" argb="255,27,27,27" value="28" />
+			<entry class="30" argb="255,28,28,28" value="29" />
+			<entry class="31" argb="255,29,29,29" value="30" />
+			<entry class="32" argb="255,30,30,30" value="31" />
+			<entry class="33" argb="255,31,31,31" value="32" />
+			<entry class="34" argb="255,32,32,32" value="33" />
+			<entry class="35" argb="255,33,33,33" value="34" />
+			<entry class="36" argb="255,34,34,34" value="35" />
+			<entry class="37" argb="255,35,35,35" value="36" />
+			<entry class="38" argb="255,36,36,36" value="37" />
+			<entry class="39" argb="255,37,37,37" value="38" />
+			<entry class="40" argb="255,38,38,38" value="39" />
+			<entry class="41" argb="255,39,39,39" value="40" />
+			<entry class="42" argb="255,40,40,40" value="41" />
+			<entry class="43" argb="255,41,41,41" value="42" />
+			<entry class="44" argb="255,42,42,42" value="43" />
+			<entry class="45" argb="255,43,43,43" value="44" />
+			<entry class="46" argb="255,44,44,44" value="45" />
+			<entry class="47" argb="255,45,45,45" value="46" />
+			<entry class="48" argb="255,46,46,46" value="47" />
+			<entry class="49" argb="255,47,47,47" value="48" />
+			<entry class="50" argb="255,48,48,48" value="49" />
+			<entry class="51" argb="255,49,49,49" value="50" />
+			<entry class="52" argb="255,50,50,50" value="51" />
+			<entry class="53" argb="255,51,51,51" value="52" />
+			<entry class="54" argb="255,52,52,52" value="53" />
+			<entry class="55" argb="255,53,53,53" value="54" />
+			<entry class="56" argb="255,54,54,54" value="55" />
+			<entry class="57" argb="255,55,55,55" value="56" />
+			<entry class="58" argb="255,56,56,56" value="57" />
+			<entry class="59" argb="255,57,57,57" value="58" />
+			<entry class="60" argb="255,58,58,58" value="59" />
+			<entry class="61" argb="255,59,59,59" value="60" />
+			<entry class="62" argb="255,60,60,60" value="61" />
+			<entry class="63" argb="255,61,61,61" value="62" />
+			<entry class="64" argb="255,62,62,62" value="63" />
+			<entry class="65" argb="255,63,63,63" value="64" />
+			<entry class="66" argb="255,64,64,64" value="65" />
+			<entry class="67" argb="255,65,65,65" value="66" />
+			<entry class="68" argb="255,66,66,66" value="67" />
+			<entry class="69" argb="255,67,67,67" value="68" />
+			<entry class="70" argb="255,68,68,68" value="69" />
+			<entry class="71" argb="255,69,69,69" value="70" />
+			<entry class="72" argb="255,70,70,70" value="71" />
+			<entry class="73" argb="255,71,71,71" value="72" />
+			<entry class="74" argb="255,72,72,72" value="73" />
+			<entry class="75" argb="255,73,73,73" value="74" />
+			<entry class="76" argb="255,74,74,74" value="75" />
+			<entry class="77" argb="255,75,75,75" value="76" />
+			<entry class="78" argb="255,76,76,76" value="77" />
+			<entry class="79" argb="255,77,77,77" value="78" />
+			<entry class="80" argb="255,78,78,78" value="79" />
+			<entry class="81" argb="255,79,79,79" value="80" />
+			<entry class="82" argb="255,80,80,80" value="81" />
+			<entry class="83" argb="255,81,81,81" value="82" />
+			<entry class="84" argb="255,82,82,82" value="83" />
+			<entry class="85" argb="255,83,83,83" value="84" />
+			<entry class="86" argb="255,84,84,84" value="85" />
+			<entry class="87" argb="255,85,85,85" value="86" />
+			<entry class="88" argb="255,86,86,86" value="87" />
+			<entry class="89" argb="255,87,87,87" value="88" />
+			<entry class="90" argb="255,88,88,88" value="89" />
+			<entry class="91" argb="255,89,89,89" value="90" />
+			<entry class="92" argb="255,90,90,90" value="91" />
+			<entry class="93" argb="255,91,91,91" value="92" />
+			<entry class="94" argb="255,92,92,92" value="93" />
+			<entry class="95" argb="255,93,93,93" value="94" />
+			<entry class="96" argb="255,94,94,94" value="95" />
+			<entry class="97" argb="255,95,95,95" value="96" />
+			<entry class="98" argb="255,96,96,96" value="97" />
+			<entry class="99" argb="255,97,97,97" value="98" />
+			<entry class="100" argb="255,98,98,98" value="99" />
+			<entry class="101" argb="255,99,99,99" value="100" />
+			<entry class="102" argb="255,100,100,100" value="101" />
+			<entry class="103" argb="255,101,101,101" value="102" />
+			<entry class="104" argb="255,102,102,102" value="103" />
+			<entry class="105" argb="255,103,103,103" value="104" />
+			<entry class="106" argb="255,104,104,104" value="105" />
+			<entry class="107" argb="255,105,105,105" value="106" />
+			<entry class="108" argb="255,106,106,106" value="107" />
+			<entry class="109" argb="255,107,107,107" value="108" />
+			<entry class="110" argb="255,108,108,108" value="109" />
+			<entry class="111" argb="255,109,109,109" value="110" />
+			<entry class="112" argb="255,110,110,110" value="111" />
+			<entry class="113" argb="255,111,111,111" value="112" />
+			<entry class="114" argb="255,112,112,112" value="113" />
+			<entry class="115" argb="255,113,113,113" value="114" />
+			<entry class="116" argb="255,114,114,114" value="115" />
+			<entry class="117" argb="255,115,115,115" value="116" />
+			<entry class="118" argb="255,116,116,116" value="117" />
+			<entry class="119" argb="255,117,117,117" value="118" />
+			<entry class="120" argb="255,118,118,118" value="119" />
+			<entry class="121" argb="255,119,119,119" value="120" />
+			<entry class="122" argb="255,120,120,120" value="121" />
+			<entry class="123" argb="255,121,121,121" value="122" />
+			<entry class="124" argb="255,122,122,122" value="123" />
+			<entry class="125" argb="255,123,123,123" value="124" />
+			<entry class="126" argb="255,124,124,124" value="125" />
+			<entry class="127" argb="255,125,125,125" value="126" />
+			<entry class="128" argb="255,126,126,126" value="127" />
+			<entry class="129" argb="255,127,127,127" value="128" />
+			<entry class="130" argb="255,128,128,128" value="129" />
+			<entry class="131" argb="255,129,129,129" value="130" />
+			<entry class="132" argb="255,130,130,130" value="131" />
+			<entry class="133" argb="255,131,131,131" value="132" />
+			<entry class="134" argb="255,132,132,132" value="133" />
+			<entry class="135" argb="255,133,133,133" value="134" />
+			<entry class="136" argb="255,134,134,134" value="135" />
+			<entry class="137" argb="255,135,135,135" value="136" />
+			<entry class="138" argb="255,136,136,136" value="137" />
+			<entry class="139" argb="255,137,137,137" value="138" />
+			<entry class="140" argb="255,138,138,138" value="139" />
+			<entry class="141" argb="255,139,139,139" value="140" />
+			<entry class="142" argb="255,140,140,140" value="141" />
+			<entry class="143" argb="255,141,141,141" value="142" />
+			<entry class="144" argb="255,142,142,142" value="143" />
+			<entry class="145" argb="255,143,143,143" value="144" />
+			<entry class="146" argb="255,144,144,144" value="145" />
+			<entry class="147" argb="255,145,145,145" value="146" />
+			<entry class="148" argb="255,146,146,146" value="147" />
+			<entry class="149" argb="255,147,147,147" value="148" />
+			<entry class="150" argb="255,148,148,148" value="149" />
+			<entry class="151" argb="255,149,149,149" value="150" />
+			<entry class="152" argb="255,150,150,150" value="151" />
+			<entry class="153" argb="255,151,151,151" value="152" />
+			<entry class="154" argb="255,152,152,152" value="153" />
+			<entry class="155" argb="255,153,153,153" value="154" />
+			<entry class="156" argb="255,154,154,154" value="155" />
+			<entry class="157" argb="255,155,155,155" value="156" />
+			<entry class="158" argb="255,156,156,156" value="157" />
+			<entry class="159" argb="255,157,157,157" value="158" />
+			<entry class="160" argb="255,158,158,158" value="159" />
+			<entry class="161" argb="255,159,159,159" value="160" />
+			<entry class="162" argb="255,160,160,160" value="161" />
+			<entry class="163" argb="255,161,161,161" value="162" />
+			<entry class="164" argb="255,162,162,162" value="163" />
+			<entry class="165" argb="255,163,163,163" value="164" />
+			<entry class="166" argb="255,164,164,164" value="165" />
+			<entry class="167" argb="255,165,165,165" value="166" />
+			<entry class="168" argb="255,166,166,166" value="167" />
+			<entry class="169" argb="255,167,167,167" value="168" />
+			<entry class="170" argb="255,168,168,168" value="169" />
+			<entry class="171" argb="255,169,169,169" value="170" />
+			<entry class="172" argb="255,170,170,170" value="171" />
+			<entry class="173" argb="255,171,171,171" value="172" />
+			<entry class="174" argb="255,172,172,172" value="173" />
+			<entry class="175" argb="255,173,173,173" value="174" />
+			<entry class="176" argb="255,174,174,174" value="175" />
+			<entry class="177" argb="255,175,175,175" value="176" />
+			<entry class="178" argb="255,176,176,176" value="177" />
+			<entry class="179" argb="255,177,177,177" value="178" />
+			<entry class="180" argb="255,178,178,178" value="179" />
+			<entry class="181" argb="255,179,179,179" value="180" />
+			<entry class="182" argb="255,180,180,180" value="181" />
+			<entry class="183" argb="255,181,181,181" value="182" />
+			<entry class="184" argb="255,182,182,182" value="183" />
+			<entry class="185" argb="255,183,183,183" value="184" />
+			<entry class="186" argb="255,184,184,184" value="185" />
+			<entry class="187" argb="255,185,185,185" value="186" />
+			<entry class="188" argb="255,186,186,186" value="187" />
+			<entry class="189" argb="255,187,187,187" value="188" />
+			<entry class="190" argb="255,188,188,188" value="189" />
+			<entry class="191" argb="255,189,189,189" value="190" />
+			<entry class="192" argb="255,190,190,190" value="191" />
+			<entry class="193" argb="255,191,191,191" value="192" />
+			<entry class="194" argb="255,192,192,192" value="193" />
+			<entry class="195" argb="255,193,193,193" value="194" />
+			<entry class="196" argb="255,194,194,194" value="195" />
+			<entry class="197" argb="255,195,195,195" value="196" />
+			<entry class="198" argb="255,196,196,196" value="197" />
+			<entry class="199" argb="255,197,197,197" value="198" />
+			<entry class="200" argb="255,198,198,198" value="199" />
+			<entry class="201" argb="255,199,199,199" value="200" />
+			<entry class="202" argb="255,200,200,200" value="201" />
+			<entry class="203" argb="255,201,201,201" value="202" />
+			<entry class="204" argb="255,202,202,202" value="203" />
+			<entry class="205" argb="255,203,203,203" value="204" />
+			<entry class="206" argb="255,204,204,204" value="205" />
+			<entry class="207" argb="255,205,205,205" value="206" />
+			<entry class="208" argb="255,206,206,206" value="207" />
+			<entry class="209" argb="255,207,207,207" value="208" />
+			<entry class="210" argb="255,208,208,208" value="209" />
+			<entry class="211" argb="255,209,209,209" value="210" />
+			<entry class="212" argb="255,210,210,210" value="211" />
+			<entry class="213" argb="255,211,211,211" value="212" />
+			<entry class="214" argb="255,212,212,212" value="213" />
+			<entry class="215" argb="255,213,213,213" value="214" />
+			<entry class="216" argb="255,214,214,214" value="215" />
+			<entry class="217" argb="255,215,215,215" value="216" />
+			<entry class="218" argb="255,216,216,216" value="217" />
+			<entry class="219" argb="255,217,217,217" value="218" />
+			<entry class="220" argb="255,218,218,218" value="219" />
+			<entry class="221" argb="255,219,219,219" value="220" />
+			<entry class="222" argb="255,220,220,220" value="221" />
+			<entry class="223" argb="255,221,221,221" value="222" />
+			<entry class="224" argb="255,222,222,222" value="223" />
+			<entry class="225" argb="255,223,223,223" value="224" />
+			<entry class="226" argb="255,224,224,224" value="225" />
+			<entry class="227" argb="255,225,225,225" value="226" />
+			<entry class="228" argb="255,226,226,226" value="227" />
+			<entry class="229" argb="255,227,227,227" value="228" />
+			<entry class="230" argb="255,228,228,228" value="229" />
+			<entry class="231" argb="255,229,229,229" value="230" />
+			<entry class="232" argb="255,230,230,230" value="231" />
+			<entry class="233" argb="255,231,231,231" value="232" />
+			<entry class="234" argb="255,232,232,232" value="233" />
+			<entry class="235" argb="255,233,233,233" value="234" />
+			<entry class="236" argb="255,234,234,234" value="235" />
+			<entry class="237" argb="255,235,235,235" value="236" />
+			<entry class="238" argb="255,236,236,236" value="237" />
+			<entry class="239" argb="255,237,237,237" value="238" />
+			<entry class="240" argb="255,238,238,238" value="239" />
+			<entry class="241" argb="255,239,239,239" value="240" />
+			<entry class="242" argb="255,240,240,240" value="241" />
+			<entry class="243" argb="255,241,241,241" value="242" />
+			<entry class="244" argb="255,242,242,242" value="243" />
+			<entry class="245" argb="255,243,243,243" value="244" />
+			<entry class="246" argb="255,244,244,244" value="245" />
+			<entry class="247" argb="255,245,245,245" value="246" />
+			<entry class="248" argb="255,246,246,246" value="247" />
+			<entry class="249" argb="255,247,247,247" value="248" />
+			<entry class="250" argb="255,248,248,248" value="249" />
+			<entry class="251" argb="255,249,249,249" value="250" />
+			<entry class="252" argb="255,250,250,250" value="251" />
+			<entry class="253" argb="255,251,251,251" value="252" />
+			<entry class="254" argb="255,252,252,252" value="253" />
+			<entry class="255" argb="255,253,253,253" value="254" />
+			<entry class="256" argb="255,254,254,254" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(350,90,50) to HSV(300,100,98) to HSV(225,90,50) -->
+	<palette name="Lava Lamp 1  (125)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,127,12,31" value="0" />
+			<entry class="2" argb="255,129,12,34" value="1" />
+			<entry class="3" argb="255,132,12,36" value="2" />
+			<entry class="4" argb="255,134,12,39" value="3" />
+			<entry class="5" argb="255,137,12,41" value="4" />
+			<entry class="6" argb="255,139,12,44" value="5" />
+			<entry class="7" argb="255,142,12,47" value="6" />
+			<entry class="8" argb="255,144,12,49" value="7" />
+			<entry class="9" argb="255,147,12,52" value="8" />
+			<entry class="10" argb="255,149,12,55" value="9" />
+			<entry class="11" argb="255,151,12,58" value="10" />
+			<entry class="12" argb="255,154,12,61" value="11" />
+			<entry class="13" argb="255,156,11,65" value="12" />
+			<entry class="14" argb="255,159,11,68" value="13" />
+			<entry class="15" argb="255,161,11,71" value="14" />
+			<entry class="16" argb="255,164,11,75" value="15" />
+			<entry class="17" argb="255,166,11,78" value="16" />
+			<entry class="18" argb="255,169,11,82" value="17" />
+			<entry class="19" argb="255,171,10,85" value="18" />
+			<entry class="20" argb="255,174,10,89" value="19" />
+			<entry class="21" argb="255,176,10,93" value="20" />
+			<entry class="22" argb="255,178,10,97" value="21" />
+			<entry class="23" argb="255,181,10,101" value="22" />
+			<entry class="24" argb="255,183,9,105" value="23" />
+			<entry class="25" argb="255,186,9,109" value="24" />
+			<entry class="26" argb="255,188,9,114" value="25" />
+			<entry class="27" argb="255,191,9,118" value="26" />
+			<entry class="28" argb="255,193,8,122" value="27" />
+			<entry class="29" argb="255,196,8,127" value="28" />
+			<entry class="30" argb="255,198,8,131" value="29" />
+			<entry class="31" argb="255,200,8,136" value="30" />
+			<entry class="32" argb="255,203,7,141" value="31" />
+			<entry class="33" argb="255,205,7,146" value="32" />
+			<entry class="34" argb="255,208,7,151" value="33" />
+			<entry class="35" argb="255,210,6,156" value="34" />
+			<entry class="36" argb="255,213,6,161" value="35" />
+			<entry class="37" argb="255,215,6,166" value="36" />
+			<entry class="38" argb="255,218,5,172" value="37" />
+			<entry class="39" argb="255,220,5,177" value="38" />
+			<entry class="40" argb="255,222,4,182" value="39" />
+			<entry class="41" argb="255,225,4,188" value="40" />
+			<entry class="42" argb="255,227,4,194" value="41" />
+			<entry class="43" argb="255,230,3,200" value="42" />
+			<entry class="44" argb="255,232,3,205" value="43" />
+			<entry class="45" argb="255,235,2,211" value="44" />
+			<entry class="46" argb="255,237,2,218" value="45" />
+			<entry class="47" argb="255,240,1,224" value="46" />
+			<entry class="48" argb="255,242,1,230" value="47" />
+			<entry class="49" argb="255,245,0,236" value="48" />
+			<entry class="50" argb="255,247,0,243" value="49" />
+			<entry class="51" argb="255,249,0,249" value="50" />
+			<entry class="52" argb="255,244,0,248" value="51" />
+			<entry class="53" argb="255,238,0,246" value="52" />
+			<entry class="54" argb="255,232,0,245" value="53" />
+			<entry class="55" argb="255,227,1,243" value="54" />
+			<entry class="56" argb="255,221,1,241" value="55" />
+			<entry class="57" argb="255,216,1,240" value="56" />
+			<entry class="58" argb="255,210,2,238" value="57" />
+			<entry class="59" argb="255,205,2,236" value="58" />
+			<entry class="60" argb="255,200,2,235" value="59" />
+			<entry class="61" argb="255,195,3,233" value="60" />
+			<entry class="62" argb="255,190,3,231" value="61" />
+			<entry class="63" argb="255,184,3,230" value="62" />
+			<entry class="64" argb="255,179,3,228" value="63" />
+			<entry class="65" argb="255,175,4,227" value="64" />
+			<entry class="66" argb="255,170,4,225" value="65" />
+			<entry class="67" argb="255,165,4,223" value="66" />
+			<entry class="68" argb="255,160,5,222" value="67" />
+			<entry class="69" argb="255,155,5,220" value="68" />
+			<entry class="70" argb="255,151,5,218" value="69" />
+			<entry class="71" argb="255,146,5,217" value="70" />
+			<entry class="72" argb="255,142,6,215" value="71" />
+			<entry class="73" argb="255,137,6,213" value="72" />
+			<entry class="74" argb="255,133,6,212" value="73" />
+			<entry class="75" argb="255,129,6,210" value="74" />
+			<entry class="76" argb="255,124,6,209" value="75" />
+			<entry class="77" argb="255,120,7,207" value="76" />
+			<entry class="78" argb="255,116,7,205" value="77" />
+			<entry class="79" argb="255,112,7,204" value="78" />
+			<entry class="80" argb="255,108,7,202" value="79" />
+			<entry class="81" argb="255,104,8,200" value="80" />
+			<entry class="82" argb="255,100,8,199" value="81" />
+			<entry class="83" argb="255,96,8,197" value="82" />
+			<entry class="84" argb="255,92,8,196" value="83" />
+			<entry class="85" argb="255,89,8,194" value="84" />
+			<entry class="86" argb="255,85,8,192" value="85" />
+			<entry class="87" argb="255,81,9,191" value="86" />
+			<entry class="88" argb="255,78,9,189" value="87" />
+			<entry class="89" argb="255,74,9,187" value="88" />
+			<entry class="90" argb="255,71,9,186" value="89" />
+			<entry class="91" argb="255,68,9,184" value="90" />
+			<entry class="92" argb="255,64,10,182" value="91" />
+			<entry class="93" argb="255,61,10,181" value="92" />
+			<entry class="94" argb="255,58,10,179" value="93" />
+			<entry class="95" argb="255,55,10,178" value="94" />
+			<entry class="96" argb="255,52,10,176" value="95" />
+			<entry class="97" argb="255,49,10,174" value="96" />
+			<entry class="98" argb="255,46,10,173" value="97" />
+			<entry class="99" argb="255,43,10,171" value="98" />
+			<entry class="100" argb="255,40,11,169" value="99" />
+			<entry class="101" argb="255,37,11,168" value="100" />
+			<entry class="102" argb="255,34,11,166" value="101" />
+			<entry class="103" argb="255,31,11,165" value="102" />
+			<entry class="104" argb="255,29,11,163" value="103" />
+			<entry class="105" argb="255,26,11,161" value="104" />
+			<entry class="106" argb="255,24,11,160" value="105" />
+			<entry class="107" argb="255,21,11,158" value="106" />
+			<entry class="108" argb="255,19,11,156" value="107" />
+			<entry class="109" argb="255,16,12,155" value="108" />
+			<entry class="110" argb="255,14,12,153" value="109" />
+			<entry class="111" argb="255,12,12,151" value="110" />
+			<entry class="112" argb="255,12,14,150" value="111" />
+			<entry class="113" argb="255,12,16,148" value="112" />
+			<entry class="114" argb="255,12,19,147" value="113" />
+			<entry class="115" argb="255,12,21,145" value="114" />
+			<entry class="116" argb="255,12,23,143" value="115" />
+			<entry class="117" argb="255,12,25,142" value="116" />
+			<entry class="118" argb="255,12,27,140" value="117" />
+			<entry class="119" argb="255,12,29,138" value="118" />
+			<entry class="120" argb="255,12,31,137" value="119" />
+			<entry class="121" argb="255,12,33,135" value="120" />
+			<entry class="122" argb="255,12,34,134" value="121" />
+			<entry class="123" argb="255,12,36,132" value="122" />
+			<entry class="124" argb="255,12,38,130" value="123" />
+			<entry class="125" argb="255,12,39,129" value="124" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(190,90,50) to HSV(140,100,98) to HSV(65,90,50) -->
+	<palette name="Lava Lamp 2  (125)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,12,108,127" value="0" />
+			<entry class="2" argb="255,12,112,129" value="1" />
+			<entry class="3" argb="255,12,116,132" value="2" />
+			<entry class="4" argb="255,12,120,134" value="3" />
+			<entry class="5" argb="255,12,124,137" value="4" />
+			<entry class="6" argb="255,12,129,139" value="5" />
+			<entry class="7" argb="255,12,133,142" value="6" />
+			<entry class="8" argb="255,12,138,144" value="7" />
+			<entry class="9" argb="255,12,142,147" value="8" />
+			<entry class="10" argb="255,12,147,149" value="9" />
+			<entry class="11" argb="255,12,151,151" value="10" />
+			<entry class="12" argb="255,12,154,152" value="11" />
+			<entry class="13" argb="255,11,156,152" value="12" />
+			<entry class="14" argb="255,11,159,151" value="13" />
+			<entry class="15" argb="255,11,161,151" value="14" />
+			<entry class="16" argb="255,11,164,151" value="15" />
+			<entry class="17" argb="255,11,166,151" value="16" />
+			<entry class="18" argb="255,11,169,150" value="17" />
+			<entry class="19" argb="255,10,171,150" value="18" />
+			<entry class="20" argb="255,10,174,149" value="19" />
+			<entry class="21" argb="255,10,176,148" value="20" />
+			<entry class="22" argb="255,10,178,148" value="21" />
+			<entry class="23" argb="255,10,181,147" value="22" />
+			<entry class="24" argb="255,9,183,146" value="23" />
+			<entry class="25" argb="255,9,186,145" value="24" />
+			<entry class="26" argb="255,9,188,143" value="25" />
+			<entry class="27" argb="255,9,191,142" value="26" />
+			<entry class="28" argb="255,8,193,141" value="27" />
+			<entry class="29" argb="255,8,196,139" value="28" />
+			<entry class="30" argb="255,8,198,138" value="29" />
+			<entry class="31" argb="255,8,200,136" value="30" />
+			<entry class="32" argb="255,7,203,134" value="31" />
+			<entry class="33" argb="255,7,205,133" value="32" />
+			<entry class="34" argb="255,7,208,131" value="33" />
+			<entry class="35" argb="255,6,210,129" value="34" />
+			<entry class="36" argb="255,6,213,127" value="35" />
+			<entry class="37" argb="255,6,215,124" value="36" />
+			<entry class="38" argb="255,5,218,122" value="37" />
+			<entry class="39" argb="255,5,220,120" value="38" />
+			<entry class="40" argb="255,4,222,117" value="39" />
+			<entry class="41" argb="255,4,225,114" value="40" />
+			<entry class="42" argb="255,4,227,112" value="41" />
+			<entry class="43" argb="255,3,230,109" value="42" />
+			<entry class="44" argb="255,3,232,106" value="43" />
+			<entry class="45" argb="255,2,235,103" value="44" />
+			<entry class="46" argb="255,2,237,100" value="45" />
+			<entry class="47" argb="255,1,240,97" value="46" />
+			<entry class="48" argb="255,1,242,93" value="47" />
+			<entry class="49" argb="255,0,245,90" value="48" />
+			<entry class="50" argb="255,0,247,86" value="49" />
+			<entry class="51" argb="255,0,249,83" value="50" />
+			<entry class="52" argb="255,0,248,78" value="51" />
+			<entry class="53" argb="255,0,246,74" value="52" />
+			<entry class="54" argb="255,0,245,70" value="53" />
+			<entry class="55" argb="255,1,243,65" value="54" />
+			<entry class="56" argb="255,1,241,61" value="55" />
+			<entry class="57" argb="255,1,240,57" value="56" />
+			<entry class="58" argb="255,2,238,53" value="57" />
+			<entry class="59" argb="255,2,236,49" value="58" />
+			<entry class="60" argb="255,2,235,45" value="59" />
+			<entry class="61" argb="255,3,233,41" value="60" />
+			<entry class="62" argb="255,3,231,37" value="61" />
+			<entry class="63" argb="255,3,230,33" value="62" />
+			<entry class="64" argb="255,3,228,30" value="63" />
+			<entry class="65" argb="255,4,227,26" value="64" />
+			<entry class="66" argb="255,4,225,22" value="65" />
+			<entry class="67" argb="255,4,223,19" value="66" />
+			<entry class="68" argb="255,5,222,15" value="67" />
+			<entry class="69" argb="255,5,220,12" value="68" />
+			<entry class="70" argb="255,5,218,9" value="69" />
+			<entry class="71" argb="255,5,217,5" value="70" />
+			<entry class="72" argb="255,9,215,6" value="71" />
+			<entry class="73" argb="255,13,213,6" value="72" />
+			<entry class="74" argb="255,16,212,6" value="73" />
+			<entry class="75" argb="255,20,210,6" value="74" />
+			<entry class="76" argb="255,23,209,6" value="75" />
+			<entry class="77" argb="255,27,207,7" value="76" />
+			<entry class="78" argb="255,30,205,7" value="77" />
+			<entry class="79" argb="255,33,204,7" value="78" />
+			<entry class="80" argb="255,37,202,7" value="79" />
+			<entry class="81" argb="255,40,200,8" value="80" />
+			<entry class="82" argb="255,43,199,8" value="81" />
+			<entry class="83" argb="255,46,197,8" value="82" />
+			<entry class="84" argb="255,49,196,8" value="83" />
+			<entry class="85" argb="255,52,194,8" value="84" />
+			<entry class="86" argb="255,54,192,8" value="85" />
+			<entry class="87" argb="255,57,191,9" value="86" />
+			<entry class="88" argb="255,60,189,9" value="87" />
+			<entry class="89" argb="255,63,187,9" value="88" />
+			<entry class="90" argb="255,65,186,9" value="89" />
+			<entry class="91" argb="255,68,184,9" value="90" />
+			<entry class="92" argb="255,70,182,10" value="91" />
+			<entry class="93" argb="255,72,181,10" value="92" />
+			<entry class="94" argb="255,75,179,10" value="93" />
+			<entry class="95" argb="255,77,178,10" value="94" />
+			<entry class="96" argb="255,79,176,10" value="95" />
+			<entry class="97" argb="255,81,174,10" value="96" />
+			<entry class="98" argb="255,83,173,10" value="97" />
+			<entry class="99" argb="255,85,171,10" value="98" />
+			<entry class="100" argb="255,87,169,11" value="99" />
+			<entry class="101" argb="255,89,168,11" value="100" />
+			<entry class="102" argb="255,91,166,11" value="101" />
+			<entry class="103" argb="255,93,165,11" value="102" />
+			<entry class="104" argb="255,95,163,11" value="103" />
+			<entry class="105" argb="255,96,161,11" value="104" />
+			<entry class="106" argb="255,98,160,11" value="105" />
+			<entry class="107" argb="255,99,158,11" value="106" />
+			<entry class="108" argb="255,101,156,11" value="107" />
+			<entry class="109" argb="255,102,155,12" value="108" />
+			<entry class="110" argb="255,104,153,12" value="109" />
+			<entry class="111" argb="255,105,151,12" value="110" />
+			<entry class="112" argb="255,106,150,12" value="111" />
+			<entry class="113" argb="255,107,148,12" value="112" />
+			<entry class="114" argb="255,108,147,12" value="113" />
+			<entry class="115" argb="255,109,145,12" value="114" />
+			<entry class="116" argb="255,110,143,12" value="115" />
+			<entry class="117" argb="255,111,142,12" value="116" />
+			<entry class="118" argb="255,112,140,12" value="117" />
+			<entry class="119" argb="255,113,138,12" value="118" />
+			<entry class="120" argb="255,114,137,12" value="119" />
+			<entry class="121" argb="255,115,135,12" value="120" />
+			<entry class="122" argb="255,115,134,12" value="121" />
+			<entry class="123" argb="255,116,132,12" value="122" />
+			<entry class="124" argb="255,116,130,12" value="123" />
+			<entry class="125" argb="255,117,129,12" value="124" />
+		</table>
+	</palette>
+	
+	<!-- Color Scheme Designer 3, Hue: 30, Tetrad Angle: 20, Scheme: High Contrast -->
+	<palette name="Mosaic 1  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,230,117,23" value="0" />
+			<entry class="2" argb="255,143,99,63" value="1" />
+			<entry class="3" argb="255,109,51,3" value="2" />
+			<entry class="4" argb="255,249,172,109" value="3" />
+			<entry class="5" argb="255,249,209,176" value="4" />
+			<entry class="6" argb="255,230,161,23" value="5" />
+			<entry class="7" argb="255,143,117,63" value="6" />
+			<entry class="8" argb="255,109,74,3" value="7" />
+			<entry class="9" argb="255,249,202,109" value="8" />
+			<entry class="10" argb="255,249,224,176" value="9" />
+			<entry class="11" argb="255,30,67,154" value="10" />
+			<entry class="12" argb="255,48,62,96" value="11" />
+			<entry class="13" argb="255,4,25,73" value="12" />
+			<entry class="14" argb="255,114,149,230" value="13" />
+			<entry class="15" argb="255,170,188,230" value="14" />
+			<entry class="16" argb="255,14,138,138" value="15" />
+			<entry class="17" argb="255,38,86,86" value="16" />
+			<entry class="18" argb="255,2,65,65" value="17" />
+			<entry class="19" argb="255,99,226,226" value="18" />
+			<entry class="20" argb="255,160,226,226" value="19" />
+		</table>
+	</palette>	
+
+	<!-- Color Scheme Designer 3, Hue: 150, Tetrad Angle: 20, Scheme: High Contrast -->
+	<palette name="Mosaic 2  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,150,214,21" value="0" />
+			<entry class="2" argb="255,109,134,59" value="1" />
+			<entry class="3" argb="255,69,102,3" value="2" />
+			<entry class="4" argb="255,199,245,107" value="3" />
+			<entry class="5" argb="255,221,245,173" value="4" />
+			<entry class="6" argb="255,18,184,18" value="5" />
+			<entry class="7" argb="255,50,115,50" value="6" />
+			<entry class="8" argb="255,2,87,2" value="7" />
+			<entry class="9" argb="255,104,237,104" value="8" />
+			<entry class="10" argb="255,168,237,168" value="9" />
+			<entry class="11" argb="255,230,23,23" value="10" />
+			<entry class="12" argb="255,143,63,63" value="11" />
+			<entry class="13" argb="255,109,3,3" value="12" />
+			<entry class="14" argb="255,249,109,109" value="13" />
+			<entry class="15" argb="255,249,176,176" value="14" />
+			<entry class="16" argb="255,184,18,112" value="15" />
+			<entry class="17" argb="255,115,50,87" value="16" />
+			<entry class="18" argb="255,87,2,50" value="17" />
+			<entry class="19" argb="255,237,104,179" value="18" />
+			<entry class="20" argb="255,237,168,207" value="19" />
+		</table>
+	</palette>
+
+	<!-- Color Scheme Designer 3, Hue: 270, Tetrad Angle: 20, Scheme: High Contrast -->	
+	<palette name="Mosaic 3  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,62,32,158" value="0" />
+			<entry class="2" argb="255,61,50,99" value="1" />
+			<entry class="3" argb="255,21,4,75" value="2" />
+			<entry class="4" argb="255,143,116,231" value="3" />
+			<entry class="5" argb="255,185,171,231" value="4" />
+			<entry class="6" argb="255,107,23,153" value="5" />
+			<entry class="7" argb="255,78,45,96" value="6" />
+			<entry class="8" argb="255,48,3,73" value="7" />
+			<entry class="9" argb="255,186,107,230" value="8" />
+			<entry class="10" argb="255,207,166,230" value="9" />
+			<entry class="11" argb="255,230,230,23" value="10" />
+			<entry class="12" argb="255,143,143,63" value="11" />
+			<entry class="13" argb="255,109,109,3" value="12" />
+			<entry class="14" argb="255,249,249,109" value="13" />
+			<entry class="15" argb="255,249,249,176" value="14" />
+			<entry class="16" argb="255,230,194,23" value="15" />
+			<entry class="17" argb="255,143,130,63" value="16" />
+			<entry class="18" argb="255,109,91,3" value="17" />
+			<entry class="19" argb="255,249,225,109" value="18" />
+			<entry class="20" argb="255,249,236,176" value="19" />
+		</table>
+	</palette>
+	
+	<!-- Color Scheme Designer 3, Hue: 90, Tetrad Angle: 20
+           Scheme: Pastels, with lights and shadows upper right (75%) -->
+	<palette name="Mosaic 4  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,223,202,98" value="0" />
+			<entry class="2" argb="255,136,128,90" value="1" />
+			<entry class="3" argb="255,102,86,10" value="2" />
+			<entry class="4" argb="255,249,234,165" value="3" />
+			<entry class="5" argb="255,249,242,209" value="4" />
+			<entry class="6" argb="255,223,215,98" value="5" />
+			<entry class="7" argb="255,136,133,90" value="6" />
+			<entry class="8" argb="255,102,96,10" value="7" />
+			<entry class="9" argb="255,249,243,165" value="8" />
+			<entry class="10" argb="255,249,246,209" value="9" />
+			<entry class="11" argb="255,111,73,151" value="10" />
+			<entry class="12" argb="255,77,63,92" value="11" />
+			<entry class="13" argb="255,38,7,69" value="12" />
+			<entry class="14" argb="255,197,161,234" value="13" />
+			<entry class="15" argb="255,216,199,234" value="14" />
+			<entry class="16" argb="255,95,77,154" value="15" />
+			<entry class="17" argb="255,72,65,94" value="16" />
+			<entry class="18" argb="255,23,8,70" value="17" />
+			<entry class="19" argb="255,181,164,234" value="18" />
+			<entry class="20" argb="255,209,201,234" value="19" />
+		</table>
+	</palette>
+	
+	<!-- Color Scheme Designer 3, Hue: 210, Tetrad Angle: 20
+           Scheme: Pastels, with lights and shadows upper right (75%) -->
+	<palette name="Mosaic 5  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,59,134,134" value="0" />
+			<entry class="2" argb="255,54,82,82" value="1" />
+			<entry class="3" argb="255,6,61,61" value="2" />
+			<entry class="4" argb="255,153,230,230" value="3" />
+			<entry class="5" argb="255,194,230,230" value="4" />
+			<entry class="6" argb="255,71,106,146" value="5" />
+			<entry class="7" argb="255,61,74,89" value="6" />
+			<entry class="8" argb="255,7,35,66" value="7" />
+			<entry class="9" argb="255,161,195,233" value="8" />
+			<entry class="10" argb="255,199,215,233" value="9" />
+			<entry class="11" argb="255,223,174,98" value="10" />
+			<entry class="12" argb="255,136,118,90" value="11" />
+			<entry class="13" argb="255,102,65,10" value="12" />
+			<entry class="14" argb="255,249,215,165" value="13" />
+			<entry class="15" argb="255,249,233,209" value="14" />
+			<entry class="16" argb="255,223,155,98" value="15" />
+			<entry class="17" argb="255,136,111,90" value="16" />
+			<entry class="18" argb="255,102,51,10" value="17" />
+			<entry class="19" argb="255,249,203,165" value="18" />
+			<entry class="20" argb="255,249,227,209" value="19" />
+		</table>
+	</palette>
+
+	<!-- Color Scheme Designer 3, Hue: 330, Tetrad Angle: 20
+           Scheme: Pastels, with lights and shadows upper right (75%) -->
+	<palette name="Mosaic 6  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,179,79,135" value="0" />
+			<entry class="2" argb="255,109,72,93" value="1" />
+			<entry class="3" argb="255,81,8,50" value="2" />
+			<entry class="4" argb="255,240,159,204" value="3" />
+			<entry class="5" argb="255,240,202,223" value="4" />
+			<entry class="6" argb="255,206,91,116" value="5" />
+			<entry class="7" argb="255,126,83,92" value="6" />
+			<entry class="8" argb="255,94,9,27" value="7" />
+			<entry class="9" argb="255,245,162,180" value="8" />
+			<entry class="10" argb="255,245,206,215" value="9" />
+			<entry class="11" argb="255,123,194,85" value="10" />
+			<entry class="12" argb="255,92,119,78" value="11" />
+			<entry class="13" argb="255,36,88,9" value="12" />
+			<entry class="14" argb="255,189,243,161" value="13" />
+			<entry class="15" argb="255,218,243,204" value="14" />
+			<entry class="16" argb="255,169,208,92" value="15" />
+			<entry class="17" argb="255,113,127,84" value="16" />
+			<entry class="18" argb="255,66,95,9" value="17" />
+			<entry class="19" argb="255,218,245,163" value="18" />
+			<entry class="20" argb="255,233,245,207" value="19" />
+		</table>
+	</palette>
+
+	<!-- (HSV 0, 50%, 95%) Degrees between hues 10-->
+	<palette name="Pastels Long  (36)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,121,121" value="0" />
+			<entry class="2" argb="255,242,141,121" value="1" />
+			<entry class="3" argb="255,242,161,121" value="2" />
+			<entry class="4" argb="255,242,181,121" value="3" />
+			<entry class="5" argb="255,242,201,121" value="4" />
+			<entry class="6" argb="255,242,222,121" value="5" />
+			<entry class="7" argb="255,242,242,121" value="6" />
+			<entry class="8" argb="255,222,242,121" value="7" />
+			<entry class="9" argb="255,201,242,121" value="8" />
+			<entry class="10" argb="255,181,242,121" value="9" />
+			<entry class="11" argb="255,161,242,121" value="10" />
+			<entry class="12" argb="255,141,242,121" value="11" />
+			<entry class="13" argb="255,121,242,121" value="12" />
+			<entry class="14" argb="255,121,242,141" value="13" />
+			<entry class="15" argb="255,121,242,161" value="14" />
+			<entry class="16" argb="255,121,242,181" value="15" />
+			<entry class="17" argb="255,121,242,201" value="16" />
+			<entry class="18" argb="255,121,242,222" value="17" />
+			<entry class="19" argb="255,121,242,242" value="18" />
+			<entry class="20" argb="255,121,222,242" value="19" />
+			<entry class="21" argb="255,121,201,242" value="20" />
+			<entry class="22" argb="255,121,181,242" value="21" />
+			<entry class="23" argb="255,121,161,242" value="22" />
+			<entry class="24" argb="255,121,141,242" value="23" />
+			<entry class="25" argb="255,121,121,242" value="24" />
+			<entry class="26" argb="255,141,121,242" value="25" />
+			<entry class="27" argb="255,161,121,242" value="26" />
+			<entry class="28" argb="255,181,121,242" value="27" />
+			<entry class="29" argb="255,201,121,242" value="28" />
+			<entry class="30" argb="255,222,121,242" value="29" />
+			<entry class="31" argb="255,242,121,242" value="30" />
+			<entry class="32" argb="255,242,121,222" value="31" />
+			<entry class="33" argb="255,242,121,201" value="32" />
+			<entry class="34" argb="255,242,121,181" value="33" />
+			<entry class="35" argb="255,242,121,161" value="34" />
+			<entry class="36" argb="255,242,121,141" value="35" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 50%, 95%) Degrees between hues 40-->
+	<palette name="Pastels Short  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,121,121" value="0" />
+			<entry class="2" argb="255,242,201,121" value="1" />
+			<entry class="3" argb="255,201,242,121" value="2" />
+			<entry class="4" argb="255,121,242,121" value="3" />
+			<entry class="5" argb="255,121,242,201" value="4" />
+			<entry class="6" argb="255,121,201,242" value="5" />
+			<entry class="7" argb="255,121,121,242" value="6" />
+			<entry class="8" argb="255,201,121,242" value="7" />
+			<entry class="9" argb="255,242,121,201" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 50%, 75%) Degrees between hues 10-->
+	<palette name="Pastels Dark Long  (36)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,191,95,95" value="0" />
+			<entry class="2" argb="255,191,111,95" value="1" />
+			<entry class="3" argb="255,191,127,95" value="2" />
+			<entry class="4" argb="255,191,143,95" value="3" />
+			<entry class="5" argb="255,191,159,95" value="4" />
+			<entry class="6" argb="255,191,175,95" value="5" />
+			<entry class="7" argb="255,191,191,95" value="6" />
+			<entry class="8" argb="255,175,191,95" value="7" />
+			<entry class="9" argb="255,159,191,95" value="8" />
+			<entry class="10" argb="255,143,191,95" value="9" />
+			<entry class="11" argb="255,127,191,95" value="10" />
+			<entry class="12" argb="255,111,191,95" value="11" />
+			<entry class="13" argb="255,95,191,95" value="12" />
+			<entry class="14" argb="255,95,191,111" value="13" />
+			<entry class="15" argb="255,95,191,127" value="14" />
+			<entry class="16" argb="255,95,191,143" value="15" />
+			<entry class="17" argb="255,95,191,159" value="16" />
+			<entry class="18" argb="255,95,191,175" value="17" />
+			<entry class="19" argb="255,95,191,191" value="18" />
+			<entry class="20" argb="255,95,175,191" value="19" />
+			<entry class="21" argb="255,95,159,191" value="20" />
+			<entry class="22" argb="255,95,143,191" value="21" />
+			<entry class="23" argb="255,95,127,191" value="22" />
+			<entry class="24" argb="255,95,111,191" value="23" />
+			<entry class="25" argb="255,95,95,191" value="24" />
+			<entry class="26" argb="255,111,95,191" value="25" />
+			<entry class="27" argb="255,127,95,191" value="26" />
+			<entry class="28" argb="255,143,95,191" value="27" />
+			<entry class="29" argb="255,159,95,191" value="28" />
+			<entry class="30" argb="255,175,95,191" value="29" />
+			<entry class="31" argb="255,191,95,191" value="30" />
+			<entry class="32" argb="255,191,95,175" value="31" />
+			<entry class="33" argb="255,191,95,159" value="32" />
+			<entry class="34" argb="255,191,95,143" value="33" />
+			<entry class="35" argb="255,191,95,127" value="34" />
+			<entry class="36" argb="255,191,95,111" value="35" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 50%, 75%) Degrees between hues 40-->
+	<palette name="Pastels Dark Short  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,191,95,95" value="0" />
+			<entry class="2" argb="255,191,159,95" value="1" />
+			<entry class="3" argb="255,159,191,95" value="2" />
+			<entry class="4" argb="255,95,191,95" value="3" />
+			<entry class="5" argb="255,95,191,159" value="4" />
+			<entry class="6" argb="255,95,159,191" value="5" />
+			<entry class="7" argb="255,95,95,191" value="6" />
+			<entry class="8" argb="255,159,95,191" value="7" />
+			<entry class="9" argb="255,191,95,159" value="8" />
+		</table>
+	</palette>
+
+	<!-- (HSV 243, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Blue  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,127,112,216" value="0" />
+			<entry class="2" argb="255,94,75,216" value="1" />
+			<entry class="3" argb="255,22,7,115" value="2" />
+			<entry class="4" argb="255,58,46,133" value="3" />
+			<entry class="5" argb="255,44,23,177" value="4" />
+			<entry class="6" argb="255,109,135,214" value="5" />
+			<entry class="7" argb="255,71,107,214" value="6" />
+			<entry class="8" argb="255,6,33,112" value="7" />
+			<entry class="9" argb="255,43,65,129" value="8" />
+			<entry class="10" argb="255,19,58,172" value="9" />
+			<entry class="11" argb="255,101,166,209" value="10" />
+			<entry class="12" argb="255,62,151,209" value="11" />
+			<entry class="13" argb="255,3,66,106" value="12" />
+			<entry class="14" argb="255,36,88,122" value="13" />
+			<entry class="15" argb="255,10,103,163" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 171, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Green  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,98,218,154" value="0" />
+			<entry class="2" argb="255,54,218,130" value="1" />
+			<entry class="3" argb="255,0,117,54" value="2" />
+			<entry class="4" argb="255,34,135,81" value="3" />
+			<entry class="5" argb="255,0,180,84" value="4" />
+			<entry class="6" argb="255,149,238,107" value="5" />
+			<entry class="7" argb="255,117,238,59" value="6" />
+			<entry class="8" argb="255,47,143,0" value="7" />
+			<entry class="9" argb="255,82,165,41" value="8" />
+			<entry class="10" argb="255,72,221,0" value="9" />
+			<entry class="11" argb="255,199,246,111" value="10" />
+			<entry class="12" argb="255,182,246,62" value="11" />
+			<entry class="13" argb="255,101,154,0" value="12" />
+			<entry class="14" argb="255,132,178,45" value="13" />
+			<entry class="15" argb="255,155,237,0" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 27, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Orange  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,255,197,115" value="0" />
+			<entry class="2" argb="255,255,176,64" value="1" />
+			<entry class="3" argb="255,166,97,0" value="2" />
+			<entry class="4" argb="255,191,132,48" value="3" />
+			<entry class="5" argb="255,255,149,0" value="4" />
+			<entry class="6" argb="255,255,174,115" value="5" />
+			<entry class="7" argb="255,255,145,64" value="6" />
+			<entry class="8" argb="255,166,70,0" value="7" />
+			<entry class="9" argb="255,191,109,48" value="8" />
+			<entry class="10" argb="255,255,108,0" value="9" />
+			<entry class="11" argb="255,255,137,115" value="10" />
+			<entry class="12" argb="255,255,93,64" value="11" />
+			<entry class="13" argb="255,166,26,0" value="12" />
+			<entry class="14" argb="255,191,70,48" value="13" />
+			<entry class="15" argb="255,255,40,0" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 315, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Purple  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,234,105,166" value="0" />
+			<entry class="2" argb="255,234,58,141" value="1" />
+			<entry class="3" argb="255,138,0,65" value="2" />
+			<entry class="4" argb="255,160,40,96" value="3" />
+			<entry class="5" argb="255,213,0,101" value="4" />
+			<entry class="6" argb="255,210,95,210" value="5" />
+			<entry class="7" argb="255,210,53,210" value="6" />
+			<entry class="8" argb="255,108,0,108" value="7" />
+			<entry class="9" argb="255,124,31,124" value="8" />
+			<entry class="10" argb="255,166,0,166" value="9" />
+			<entry class="11" argb="255,166,104,213" value="10" />
+			<entry class="12" argb="255,148,64,213" value="11" />
+			<entry class="13" argb="255,65,4,111" value="12" />
+			<entry class="14" argb="255,89,38,128" value="13" />
+			<entry class="15" argb="255,102,11,171" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 99, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Yellow  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,255,254,115" value="0" />
+			<entry class="2" argb="255,255,254,64" value="1" />
+			<entry class="3" argb="255,166,165,0" value="2" />
+			<entry class="4" argb="255,191,190,48" value="3" />
+			<entry class="5" argb="255,255,253,0" value="4" />
+			<entry class="6" argb="255,255,238,115" value="5" />
+			<entry class="7" argb="255,255,231,64" value="6" />
+			<entry class="8" argb="255,166,145,0" value="7" />
+			<entry class="9" argb="255,191,174,48" value="8" />
+			<entry class="10" argb="255,255,223,0" value="9" />
+			<entry class="11" argb="255,255,223,115" value="10" />
+			<entry class="12" argb="255,255,211,64" value="11" />
+			<entry class="13" argb="255,166,128,0" value="12" />
+			<entry class="14" argb="255,191,158,48" value="13" />
+			<entry class="15" argb="255,255,197,0" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 240, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 240, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Down Blue  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,101" value="0" />
+			<entry class="2" argb="255,0,0,140" value="1" />
+			<entry class="3" argb="255,0,0,178" value="2" />
+			<entry class="4" argb="255,0,0,216" value="3" />
+			<entry class="5" argb="255,0,0,255" value="4" />
+			<entry class="6" argb="255,38,38,255" value="5" />
+			<entry class="7" argb="255,76,76,255" value="6" />
+			<entry class="8" argb="255,114,114,255" value="7" />
+			<entry class="9" argb="255,153,153,255" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 120, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 120, 100%, 100%) Five with Value step -0.15 -->	
+	<palette name="Step Down Green  (9)" interpolate="false">
+		<table>
+			<entry class="0" argb="255,0,101,0" value="0" />
+			<entry class="1" argb="255,0,140,0" value="1" />
+			<entry class="2" argb="255,0,178,0" value="2" />
+			<entry class="3" argb="255,0,216,0" value="3" />
+			<entry class="4" argb="255,0,255,0" value="4" />
+			<entry class="5" argb="255,38,255,38" value="5" />
+			<entry class="6" argb="255,76,255,76" value="6" />
+			<entry class="7" argb="255,114,255,114" value="7" />
+			<entry class="8" argb="255,153,255,153" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 0, 100%, 100%) Five with Value step -0.15 -->
+	<palette name="Step Down Red  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,101,0,0" value="0" />
+			<entry class="2" argb="255,140,0,0" value="1" />
+			<entry class="3" argb="255,178,0,0" value="2" />
+			<entry class="4" argb="255,216,0,0" value="3" />
+			<entry class="5" argb="255,255,0,0" value="4" />
+			<entry class="6" argb="255,255,38,38" value="5" />
+			<entry class="7" argb="255,255,76,76" value="6" />
+			<entry class="8" argb="255,255,114,114" value="7" />
+			<entry class="9" argb="255,255,153,153" value="8" />
+		</table>
+	</palette>
+
+	<!-- (HSV 180, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 180, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Up Cyan  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,153,255,255" value="0" />
+			<entry class="2" argb="255,114,255,255" value="1" />
+			<entry class="3" argb="255,76,255,255" value="2" />
+			<entry class="4" argb="255,38,255,255" value="3" />
+			<entry class="5" argb="255,0,255,255" value="4" />
+			<entry class="6" argb="255,0,216,216" value="5" />
+			<entry class="7" argb="255,0,178,178" value="6" />
+			<entry class="8" argb="255,0,140,140" value="7" />
+			<entry class="9" argb="255,0,101,101" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 300, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 300, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Up Magenta  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,153,255" value="0" />
+			<entry class="2" argb="255,255,114,255" value="1" />
+			<entry class="3" argb="255,255,76,255" value="2" />
+			<entry class="4" argb="255,255,38,255" value="3" />
+			<entry class="5" argb="255,255,0,255" value="4" />
+			<entry class="6" argb="255,216,0,216" value="5" />
+			<entry class="7" argb="255,178,0,178" value="6" />
+			<entry class="8" argb="255,140,0,140" value="7" />
+			<entry class="9" argb="255,101,0,101" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 60, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 60, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Up Yellow  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,255,153" value="0" />
+			<entry class="2" argb="255,255,255,114" value="1" />
+			<entry class="3" argb="255,255,255,76" value="2" />
+			<entry class="4" argb="255,255,255,38" value="3" />
+			<entry class="5" argb="255,255,255,0" value="4" />
+			<entry class="6" argb="255,216,216,0" value="5" />
+			<entry class="7" argb="255,178,178,0" value="6" />
+			<entry class="8" argb="255,140,140,0" value="7" />
+			<entry class="9" argb="255,101,101,0" value="8" />
+		</table>
+	</palette>
+	
+	<!-- Gradient, HSV(0,0,100) to HSV(0,0,0) -->	
+	<palette name="White-Black  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,255,255" value="0" />
+			<entry class="2" argb="255,254,254,254" value="1" />
+			<entry class="3" argb="255,253,253,253" value="2" />
+			<entry class="4" argb="255,252,252,252" value="3" />
+			<entry class="5" argb="255,251,251,251" value="4" />
+			<entry class="6" argb="255,250,250,250" value="5" />
+			<entry class="7" argb="255,249,249,249" value="6" />
+			<entry class="8" argb="255,248,248,248" value="7" />
+			<entry class="9" argb="255,247,247,247" value="8" />
+			<entry class="10" argb="255,246,246,246" value="9" />
+			<entry class="11" argb="255,245,245,245" value="10" />
+			<entry class="12" argb="255,244,244,244" value="11" />
+			<entry class="13" argb="255,243,243,243" value="12" />
+			<entry class="14" argb="255,242,242,242" value="13" />
+			<entry class="15" argb="255,241,241,241" value="14" />
+			<entry class="16" argb="255,240,240,240" value="15" />
+			<entry class="17" argb="255,239,239,239" value="16" />
+			<entry class="18" argb="255,238,238,238" value="17" />
+			<entry class="19" argb="255,237,237,237" value="18" />
+			<entry class="20" argb="255,236,236,236" value="19" />
+			<entry class="21" argb="255,235,235,235" value="20" />
+			<entry class="22" argb="255,234,234,234" value="21" />
+			<entry class="23" argb="255,233,233,233" value="22" />
+			<entry class="24" argb="255,232,232,232" value="23" />
+			<entry class="25" argb="255,231,231,231" value="24" />
+			<entry class="26" argb="255,230,230,230" value="25" />
+			<entry class="27" argb="255,229,229,229" value="26" />
+			<entry class="28" argb="255,228,228,228" value="27" />
+			<entry class="29" argb="255,227,227,227" value="28" />
+			<entry class="30" argb="255,226,226,226" value="29" />
+			<entry class="31" argb="255,225,225,225" value="30" />
+			<entry class="32" argb="255,224,224,224" value="31" />
+			<entry class="33" argb="255,223,223,223" value="32" />
+			<entry class="34" argb="255,222,222,222" value="33" />
+			<entry class="35" argb="255,221,221,221" value="34" />
+			<entry class="36" argb="255,220,220,220" value="35" />
+			<entry class="37" argb="255,219,219,219" value="36" />
+			<entry class="38" argb="255,218,218,218" value="37" />
+			<entry class="39" argb="255,217,217,217" value="38" />
+			<entry class="40" argb="255,216,216,216" value="39" />
+			<entry class="41" argb="255,215,215,215" value="40" />
+			<entry class="42" argb="255,214,214,214" value="41" />
+			<entry class="43" argb="255,213,213,213" value="42" />
+			<entry class="44" argb="255,212,212,212" value="43" />
+			<entry class="45" argb="255,211,211,211" value="44" />
+			<entry class="46" argb="255,210,210,210" value="45" />
+			<entry class="47" argb="255,209,209,209" value="46" />
+			<entry class="48" argb="255,208,208,208" value="47" />
+			<entry class="49" argb="255,207,207,207" value="48" />
+			<entry class="50" argb="255,206,206,206" value="49" />
+			<entry class="51" argb="255,205,205,205" value="50" />
+			<entry class="52" argb="255,204,204,204" value="51" />
+			<entry class="53" argb="255,203,203,203" value="52" />
+			<entry class="54" argb="255,202,202,202" value="53" />
+			<entry class="55" argb="255,201,201,201" value="54" />
+			<entry class="56" argb="255,200,200,200" value="55" />
+			<entry class="57" argb="255,199,199,199" value="56" />
+			<entry class="58" argb="255,198,198,198" value="57" />
+			<entry class="59" argb="255,197,197,197" value="58" />
+			<entry class="60" argb="255,196,196,196" value="59" />
+			<entry class="61" argb="255,195,195,195" value="60" />
+			<entry class="62" argb="255,194,194,194" value="61" />
+			<entry class="63" argb="255,193,193,193" value="62" />
+			<entry class="64" argb="255,192,192,192" value="63" />
+			<entry class="65" argb="255,191,191,191" value="64" />
+			<entry class="66" argb="255,190,190,190" value="65" />
+			<entry class="67" argb="255,189,189,189" value="66" />
+			<entry class="68" argb="255,188,188,188" value="67" />
+			<entry class="69" argb="255,187,187,187" value="68" />
+			<entry class="70" argb="255,186,186,186" value="69" />
+			<entry class="71" argb="255,185,185,185" value="70" />
+			<entry class="72" argb="255,184,184,184" value="71" />
+			<entry class="73" argb="255,183,183,183" value="72" />
+			<entry class="74" argb="255,182,182,182" value="73" />
+			<entry class="75" argb="255,181,181,181" value="74" />
+			<entry class="76" argb="255,180,180,180" value="75" />
+			<entry class="77" argb="255,179,179,179" value="76" />
+			<entry class="78" argb="255,178,178,178" value="77" />
+			<entry class="79" argb="255,177,177,177" value="78" />
+			<entry class="80" argb="255,176,176,176" value="79" />
+			<entry class="81" argb="255,175,175,175" value="80" />
+			<entry class="82" argb="255,174,174,174" value="81" />
+			<entry class="83" argb="255,173,173,173" value="82" />
+			<entry class="84" argb="255,172,172,172" value="83" />
+			<entry class="85" argb="255,171,171,171" value="84" />
+			<entry class="86" argb="255,170,170,170" value="85" />
+			<entry class="87" argb="255,169,169,169" value="86" />
+			<entry class="88" argb="255,168,168,168" value="87" />
+			<entry class="89" argb="255,167,167,167" value="88" />
+			<entry class="90" argb="255,166,166,166" value="89" />
+			<entry class="91" argb="255,165,165,165" value="90" />
+			<entry class="92" argb="255,164,164,164" value="91" />
+			<entry class="93" argb="255,163,163,163" value="92" />
+			<entry class="94" argb="255,162,162,162" value="93" />
+			<entry class="95" argb="255,161,161,161" value="94" />
+			<entry class="96" argb="255,160,160,160" value="95" />
+			<entry class="97" argb="255,159,159,159" value="96" />
+			<entry class="98" argb="255,158,158,158" value="97" />
+			<entry class="99" argb="255,157,157,157" value="98" />
+			<entry class="100" argb="255,156,156,156" value="99" />
+			<entry class="101" argb="255,155,155,155" value="100" />
+			<entry class="102" argb="255,154,154,154" value="101" />
+			<entry class="103" argb="255,153,153,153" value="102" />
+			<entry class="104" argb="255,152,152,152" value="103" />
+			<entry class="105" argb="255,151,151,151" value="104" />
+			<entry class="106" argb="255,150,150,150" value="105" />
+			<entry class="107" argb="255,149,149,149" value="106" />
+			<entry class="108" argb="255,148,148,148" value="107" />
+			<entry class="109" argb="255,147,147,147" value="108" />
+			<entry class="110" argb="255,146,146,146" value="109" />
+			<entry class="111" argb="255,145,145,145" value="110" />
+			<entry class="112" argb="255,144,144,144" value="111" />
+			<entry class="113" argb="255,143,143,143" value="112" />
+			<entry class="114" argb="255,142,142,142" value="113" />
+			<entry class="115" argb="255,141,141,141" value="114" />
+			<entry class="116" argb="255,140,140,140" value="115" />
+			<entry class="117" argb="255,139,139,139" value="116" />
+			<entry class="118" argb="255,138,138,138" value="117" />
+			<entry class="119" argb="255,137,137,137" value="118" />
+			<entry class="120" argb="255,136,136,136" value="119" />
+			<entry class="121" argb="255,135,135,135" value="120" />
+			<entry class="122" argb="255,134,134,134" value="121" />
+			<entry class="123" argb="255,133,133,133" value="122" />
+			<entry class="124" argb="255,132,132,132" value="123" />
+			<entry class="125" argb="255,131,131,131" value="124" />
+			<entry class="126" argb="255,130,130,130" value="125" />
+			<entry class="127" argb="255,129,129,129" value="126" />
+			<entry class="128" argb="255,128,128,128" value="127" />
+			<entry class="129" argb="255,127,127,127" value="128" />
+			<entry class="130" argb="255,126,126,126" value="129" />
+			<entry class="131" argb="255,125,125,125" value="130" />
+			<entry class="132" argb="255,124,124,124" value="131" />
+			<entry class="133" argb="255,123,123,123" value="132" />
+			<entry class="134" argb="255,122,122,122" value="133" />
+			<entry class="135" argb="255,121,121,121" value="134" />
+			<entry class="136" argb="255,120,120,120" value="135" />
+			<entry class="137" argb="255,119,119,119" value="136" />
+			<entry class="138" argb="255,118,118,118" value="137" />
+			<entry class="139" argb="255,117,117,117" value="138" />
+			<entry class="140" argb="255,116,116,116" value="139" />
+			<entry class="141" argb="255,115,115,115" value="140" />
+			<entry class="142" argb="255,114,114,114" value="141" />
+			<entry class="143" argb="255,113,113,113" value="142" />
+			<entry class="144" argb="255,112,112,112" value="143" />
+			<entry class="145" argb="255,111,111,111" value="144" />
+			<entry class="146" argb="255,110,110,110" value="145" />
+			<entry class="147" argb="255,109,109,109" value="146" />
+			<entry class="148" argb="255,108,108,108" value="147" />
+			<entry class="149" argb="255,107,107,107" value="148" />
+			<entry class="150" argb="255,106,106,106" value="149" />
+			<entry class="151" argb="255,105,105,105" value="150" />
+			<entry class="152" argb="255,104,104,104" value="151" />
+			<entry class="153" argb="255,103,103,103" value="152" />
+			<entry class="154" argb="255,102,102,102" value="153" />
+			<entry class="155" argb="255,101,101,101" value="154" />
+			<entry class="156" argb="255,100,100,100" value="155" />
+			<entry class="157" argb="255,99,99,99" value="156" />
+			<entry class="158" argb="255,98,98,98" value="157" />
+			<entry class="159" argb="255,97,97,97" value="158" />
+			<entry class="160" argb="255,96,96,96" value="159" />
+			<entry class="161" argb="255,95,95,95" value="160" />
+			<entry class="162" argb="255,94,94,94" value="161" />
+			<entry class="163" argb="255,93,93,93" value="162" />
+			<entry class="164" argb="255,92,92,92" value="163" />
+			<entry class="165" argb="255,91,91,91" value="164" />
+			<entry class="166" argb="255,90,90,90" value="165" />
+			<entry class="167" argb="255,89,89,89" value="166" />
+			<entry class="168" argb="255,88,88,88" value="167" />
+			<entry class="169" argb="255,87,87,87" value="168" />
+			<entry class="170" argb="255,86,86,86" value="169" />
+			<entry class="171" argb="255,85,85,85" value="170" />
+			<entry class="172" argb="255,84,84,84" value="171" />
+			<entry class="173" argb="255,83,83,83" value="172" />
+			<entry class="174" argb="255,82,82,82" value="173" />
+			<entry class="175" argb="255,81,81,81" value="174" />
+			<entry class="176" argb="255,80,80,80" value="175" />
+			<entry class="177" argb="255,79,79,79" value="176" />
+			<entry class="178" argb="255,78,78,78" value="177" />
+			<entry class="179" argb="255,77,77,77" value="178" />
+			<entry class="180" argb="255,76,76,76" value="179" />
+			<entry class="181" argb="255,75,75,75" value="180" />
+			<entry class="182" argb="255,74,74,74" value="181" />
+			<entry class="183" argb="255,73,73,73" value="182" />
+			<entry class="184" argb="255,72,72,72" value="183" />
+			<entry class="185" argb="255,71,71,71" value="184" />
+			<entry class="186" argb="255,70,70,70" value="185" />
+			<entry class="187" argb="255,69,69,69" value="186" />
+			<entry class="188" argb="255,68,68,68" value="187" />
+			<entry class="189" argb="255,67,67,67" value="188" />
+			<entry class="190" argb="255,66,66,66" value="189" />
+			<entry class="191" argb="255,65,65,65" value="190" />
+			<entry class="192" argb="255,64,64,64" value="191" />
+			<entry class="193" argb="255,63,63,63" value="192" />
+			<entry class="194" argb="255,62,62,62" value="193" />
+			<entry class="195" argb="255,61,61,61" value="194" />
+			<entry class="196" argb="255,60,60,60" value="195" />
+			<entry class="197" argb="255,59,59,59" value="196" />
+			<entry class="198" argb="255,58,58,58" value="197" />
+			<entry class="199" argb="255,57,57,57" value="198" />
+			<entry class="200" argb="255,56,56,56" value="199" />
+			<entry class="201" argb="255,55,55,55" value="200" />
+			<entry class="202" argb="255,54,54,54" value="201" />
+			<entry class="203" argb="255,53,53,53" value="202" />
+			<entry class="204" argb="255,52,52,52" value="203" />
+			<entry class="205" argb="255,51,51,51" value="204" />
+			<entry class="206" argb="255,50,50,50" value="205" />
+			<entry class="207" argb="255,49,49,49" value="206" />
+			<entry class="208" argb="255,48,48,48" value="207" />
+			<entry class="209" argb="255,47,47,47" value="208" />
+			<entry class="210" argb="255,46,46,46" value="209" />
+			<entry class="211" argb="255,45,45,45" value="210" />
+			<entry class="212" argb="255,44,44,44" value="211" />
+			<entry class="213" argb="255,43,43,43" value="212" />
+			<entry class="214" argb="255,42,42,42" value="213" />
+			<entry class="215" argb="255,41,41,41" value="214" />
+			<entry class="216" argb="255,40,40,40" value="215" />
+			<entry class="217" argb="255,39,39,39" value="216" />
+			<entry class="218" argb="255,38,38,38" value="217" />
+			<entry class="219" argb="255,37,37,37" value="218" />
+			<entry class="220" argb="255,36,36,36" value="219" />
+			<entry class="221" argb="255,35,35,35" value="220" />
+			<entry class="222" argb="255,34,34,34" value="221" />
+			<entry class="223" argb="255,33,33,33" value="222" />
+			<entry class="224" argb="255,32,32,32" value="223" />
+			<entry class="225" argb="255,31,31,31" value="224" />
+			<entry class="226" argb="255,30,30,30" value="225" />
+			<entry class="227" argb="255,29,29,29" value="226" />
+			<entry class="228" argb="255,28,28,28" value="227" />
+			<entry class="229" argb="255,27,27,27" value="228" />
+			<entry class="230" argb="255,26,26,26" value="229" />
+			<entry class="231" argb="255,25,25,25" value="230" />
+			<entry class="232" argb="255,24,24,24" value="231" />
+			<entry class="233" argb="255,23,23,23" value="232" />
+			<entry class="234" argb="255,22,22,22" value="233" />
+			<entry class="235" argb="255,21,21,21" value="234" />
+			<entry class="236" argb="255,20,20,20" value="235" />
+			<entry class="237" argb="255,19,19,19" value="236" />
+			<entry class="238" argb="255,18,18,18" value="237" />
+			<entry class="239" argb="255,17,17,17" value="238" />
+			<entry class="240" argb="255,16,16,16" value="239" />
+			<entry class="241" argb="255,15,15,15" value="240" />
+			<entry class="242" argb="255,14,14,14" value="241" />
+			<entry class="243" argb="255,13,13,13" value="242" />
+			<entry class="244" argb="255,12,12,12" value="243" />
+			<entry class="245" argb="255,11,11,11" value="244" />
+			<entry class="246" argb="255,10,10,10" value="245" />
+			<entry class="247" argb="255,9,9,9" value="246" />
+			<entry class="248" argb="255,8,8,8" value="247" />
+			<entry class="249" argb="255,7,7,7" value="248" />
+			<entry class="250" argb="255,6,6,6" value="249" />
+			<entry class="251" argb="255,5,5,5" value="250" />
+			<entry class="252" argb="255,4,4,4" value="251" />
+			<entry class="253" argb="255,3,3,3" value="252" />
+			<entry class="254" argb="255,2,2,2" value="253" />
+			<entry class="255" argb="255,1,1,1" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+	
+</palettes>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/test/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml	(revision 15423)
@@ -0,0 +1,11253 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<palettes>
+	<palette_list>
+		<name>Ninguna</name>
+		<name>Default</name>
+		<name>purple-red+stripes</name>
+		<name>blue-white</name>
+		<name>ocean</name>
+		<name>red-temperature</name>
+		<name>16level</name>
+		<name>blue-green-red-yellow</name>
+		<name>blue-pastel-red</name>
+		<name>blue-red</name>
+		<name>blue-waves</name>
+		<name>green-red-blue</name>
+		<name>green-white-exponential</name>
+		<name>hardcandy</name>
+		<name>haze</name>
+		<name>mac-style</name>
+		<name>nature</name>
+		<name>pastels</name>
+		<name>plasma</name>
+		<name>prism</name>
+		<name>rainbow</name>
+		<name>red-purple</name>
+		<name>std-gamma-II</name>
+		<name>steps</name>
+		<name>stern-special</name>
+		<name>MDT1</name>
+		<name>MDT2</name>
+		<name>CLASIFICACION</name>
+		<name>1  Forest - Soil  (100)</name>
+		<name>1  Soil - Forest  (100)</name>
+		<name>2  Blues  (35)</name>
+		<name>2  Cool  (100)</name>
+		<name>2  Greens  (35)</name>
+		<name>2  Marine  (24)</name>
+		<name>2  Pumpkin  (24)</name>
+		<name>2  Reds  (35)</name>
+		<name>2  Sand  (24)</name>
+		<name>2  Warm  (64)</name>
+		<name>Candy  (9)</name>
+		<name>Color Wheel Long  (36)</name>
+		<name>Color Wheel Short  (9)</name>
+		<name>Deep Azure  (256)</name>
+		<name>Deep Blue  (256)</name>
+		<name>Deep Chartreuse  (256)</name>
+		<name>Deep Cyan  (256)</name>
+		<name>Deep Green  (256)</name>
+		<name>Deep Magenta  (256)</name>
+		<name>Deep Orange  (256)</name>
+		<name>Deep Red  (256)</name>
+		<name>Deep Rose  (256)</name>
+		<name>Deep Spring Green  (256)</name>
+		<name>Deep Violet  (256)</name>
+		<name>Deep Yellow  (256)</name>
+		<name>Default</name>
+		<name>Lava Lamp 1  (125)</name>
+		<name>Lava Lamp 2  (125)</name>
+		<name>Mosaic 1  (20)</name>
+		<name>Mosaic 2  (20)</name>
+		<name>Mosaic 3  (20)</name>
+		<name>Mosaic 4  (20)</name>
+		<name>Mosaic 5  (20)</name>
+		<name>Mosaic 6  (20)</name>
+		<name>Pastels Long  (36)</name>
+		<name>Pastels Short  (9)</name>
+		<name>Pastels Dark Long  (36)</name>
+		<name>Pastels Dark Short  (9)</name>
+		<name>Stairsteps Blue  (15)</name>
+		<name>Stairsteps Green  (15)</name>
+		<name>Stairsteps Orange  (15)</name>
+		<name>Stairsteps Purple  (15)</name>
+		<name>Stairsteps Yellow  (15)</name>
+		<name>Step Down Blue  (9)</name>
+		<name>Step Down Green  (9)</name>
+		<name>Step Down Red  (9)</name>
+		<name>Step Up Cyan  (9)</name>
+		<name>Step Up Magenta  (9)</name>
+		<name>Step Up Yellow  (9)</name>
+		<name>White-Black  (256)</name>
+	</palette_list>
+
+	<palette name="Default" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="purple-red+stripes" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,0" value="1" />
+			<entry class="" argb="255,127,127,127" value="2" />
+			<entry class="" argb="255,191,0,191" value="3" />
+			<entry class="" argb="255,188,0,192" value="4" />
+			<entry class="" argb="255,186,0,192" value="5" />
+			<entry class="" argb="255,184,0,193" value="6" />
+			<entry class="" argb="255,182,0,194" value="7" />
+			<entry class="" argb="255,179,0,195" value="8" />
+			<entry class="" argb="255,177,0,195" value="9" />
+			<entry class="" argb="255,140,0,157" value="10" />
+			<entry class="" argb="255,138,0,157" value="11" />
+			<entry class="" argb="255,170,0,198" value="12" />
+			<entry class="" argb="255,168,0,198" value="13" />
+			<entry class="" argb="255,165,0,199" value="14" />
+			<entry class="" argb="255,163,0,200" value="15" />
+			<entry class="" argb="255,161,0,201" value="16" />
+			<entry class="" argb="255,158,0,202" value="17" />
+			<entry class="" argb="255,156,0,202" value="18" />
+			<entry class="" argb="255,154,0,203" value="19" />
+			<entry class="" argb="255,121,0,163" value="20" />
+			<entry class="" argb="255,119,0,164" value="21" />
+			<entry class="" argb="255,147,0,205" value="22" />
+			<entry class="" argb="255,145,0,206" value="23" />
+			<entry class="" argb="255,142,0,207" value="24" />
+			<entry class="" argb="255,140,0,208" value="25" />
+			<entry class="" argb="255,138,0,208" value="26" />
+			<entry class="" argb="255,135,0,209" value="27" />
+			<entry class="" argb="255,133,0,210" value="28" />
+			<entry class="" argb="255,131,0,211" value="29" />
+			<entry class="" argb="255,103,0,169" value="30" />
+			<entry class="" argb="255,101,0,170" value="31" />
+			<entry class="" argb="255,124,0,213" value="32" />
+			<entry class="" argb="255,122,0,214" value="33" />
+			<entry class="" argb="255,119,0,215" value="34" />
+			<entry class="" argb="255,117,0,215" value="35" />
+			<entry class="" argb="255,115,0,216" value="36" />
+			<entry class="" argb="255,112,0,217" value="37" />
+			<entry class="" argb="255,110,0,218" value="38" />
+			<entry class="" argb="255,108,0,218" value="39" />
+			<entry class="" argb="255,84,0,175" value="40" />
+			<entry class="" argb="255,82,0,176" value="41" />
+			<entry class="" argb="255,101,0,221" value="42" />
+			<entry class="" argb="255,99,0,221" value="43" />
+			<entry class="" argb="255,96,0,222" value="44" />
+			<entry class="" argb="255,94,0,223" value="45" />
+			<entry class="" argb="255,92,0,224" value="46" />
+			<entry class="" argb="255,89,0,225" value="47" />
+			<entry class="" argb="255,87,0,225" value="48" />
+			<entry class="" argb="255,85,0,226" value="49" />
+			<entry class="" argb="255,66,0,181" value="50" />
+			<entry class="" argb="255,64,0,182" value="51" />
+			<entry class="" argb="255,78,0,228" value="52" />
+			<entry class="" argb="255,76,0,229" value="53" />
+			<entry class="" argb="255,73,0,230" value="54" />
+			<entry class="" argb="255,71,0,231" value="55" />
+			<entry class="" argb="255,69,0,231" value="56" />
+			<entry class="" argb="255,66,0,232" value="57" />
+			<entry class="" argb="255,64,0,233" value="58" />
+			<entry class="" argb="255,62,0,234" value="59" />
+			<entry class="" argb="255,47,0,188" value="60" />
+			<entry class="" argb="255,46,0,188" value="61" />
+			<entry class="" argb="255,55,0,236" value="62" />
+			<entry class="" argb="255,52,0,237" value="63" />
+			<entry class="" argb="255,50,0,238" value="64" />
+			<entry class="" argb="255,48,0,238" value="65" />
+			<entry class="" argb="255,46,0,239" value="66" />
+			<entry class="" argb="255,43,0,240" value="67" />
+			<entry class="" argb="255,41,0,241" value="68" />
+			<entry class="" argb="255,39,0,241" value="69" />
+			<entry class="" argb="255,29,0,194" value="70" />
+			<entry class="" argb="255,27,0,194" value="71" />
+			<entry class="" argb="255,32,0,244" value="72" />
+			<entry class="" argb="255,29,0,245" value="73" />
+			<entry class="" argb="255,27,0,245" value="74" />
+			<entry class="" argb="255,25,0,246" value="75" />
+			<entry class="" argb="255,23,0,247" value="76" />
+			<entry class="" argb="255,20,0,248" value="77" />
+			<entry class="" argb="255,18,0,248" value="78" />
+			<entry class="" argb="255,16,0,249" value="79" />
+			<entry class="" argb="255,11,0,200" value="80" />
+			<entry class="" argb="255,9,0,200" value="81" />
+			<entry class="" argb="255,9,0,251" value="82" />
+			<entry class="" argb="255,6,0,252" value="83" />
+			<entry class="" argb="255,4,0,253" value="84" />
+			<entry class="" argb="255,2,0,254" value="85" />
+			<entry class="" argb="255,0,0,255" value="86" />
+			<entry class="" argb="255,0,6,255" value="87" />
+			<entry class="" argb="255,0,12,255" value="88" />
+			<entry class="" argb="255,0,18,255" value="89" />
+			<entry class="" argb="255,0,19,204" value="90" />
+			<entry class="" argb="255,0,24,204" value="91" />
+			<entry class="" argb="255,0,36,255" value="92" />
+			<entry class="" argb="255,0,42,255" value="93" />
+			<entry class="" argb="255,0,48,255" value="94" />
+			<entry class="" argb="255,0,54,255" value="95" />
+			<entry class="" argb="255,0,60,255" value="96" />
+			<entry class="" argb="255,0,66,255" value="97" />
+			<entry class="" argb="255,0,72,255" value="98" />
+			<entry class="" argb="255,0,78,255" value="99" />
+			<entry class="" argb="255,0,68,204" value="100" />
+			<entry class="" argb="255,0,72,204" value="101" />
+			<entry class="" argb="255,0,97,255" value="102" />
+			<entry class="" argb="255,0,103,255" value="103" />
+			<entry class="" argb="255,0,109,255" value="104" />
+			<entry class="" argb="255,0,115,255" value="105" />
+			<entry class="" argb="255,0,121,255" value="106" />
+			<entry class="" argb="255,0,127,255" value="107" />
+			<entry class="" argb="255,0,133,255" value="108" />
+			<entry class="" argb="255,0,139,255" value="109" />
+			<entry class="" argb="255,0,116,204" value="110" />
+			<entry class="" argb="255,0,121,204" value="111" />
+			<entry class="" argb="255,0,157,255" value="112" />
+			<entry class="" argb="255,0,163,255" value="113" />
+			<entry class="" argb="255,0,170,255" value="114" />
+			<entry class="" argb="255,0,176,255" value="115" />
+			<entry class="" argb="255,0,182,255" value="116" />
+			<entry class="" argb="255,0,188,255" value="117" />
+			<entry class="" argb="255,0,194,255" value="118" />
+			<entry class="" argb="255,0,200,255" value="119" />
+			<entry class="" argb="255,0,165,204" value="120" />
+			<entry class="" argb="255,0,170,204" value="121" />
+			<entry class="" argb="255,0,218,255" value="122" />
+			<entry class="" argb="255,0,224,255" value="123" />
+			<entry class="" argb="255,0,230,255" value="124" />
+			<entry class="" argb="255,0,236,255" value="125" />
+			<entry class="" argb="255,0,242,255" value="126" />
+			<entry class="" argb="255,0,248,255" value="127" />
+			<entry class="" argb="255,0,255,255" value="128" />
+			<entry class="" argb="255,0,255,248" value="129" />
+			<entry class="" argb="255,0,204,194" value="130" />
+			<entry class="" argb="255,0,204,189" value="131" />
+			<entry class="" argb="255,0,255,230" value="132" />
+			<entry class="" argb="255,0,255,224" value="133" />
+			<entry class="" argb="255,0,255,218" value="134" />
+			<entry class="" argb="255,0,255,212" value="135" />
+			<entry class="" argb="255,0,255,206" value="136" />
+			<entry class="" argb="255,0,255,200" value="137" />
+			<entry class="" argb="255,0,255,194" value="138" />
+			<entry class="" argb="255,0,255,188" value="139" />
+			<entry class="" argb="255,0,204,145" value="140" />
+			<entry class="" argb="255,0,204,140" value="141" />
+			<entry class="" argb="255,0,255,169" value="142" />
+			<entry class="" argb="255,0,255,163" value="143" />
+			<entry class="" argb="255,0,255,157" value="144" />
+			<entry class="" argb="255,0,255,151" value="145" />
+			<entry class="" argb="255,0,255,145" value="146" />
+			<entry class="" argb="255,0,255,139" value="147" />
+			<entry class="" argb="255,0,255,133" value="148" />
+			<entry class="" argb="255,0,255,127" value="149" />
+			<entry class="" argb="255,0,204,97" value="150" />
+			<entry class="" argb="255,0,204,92" value="151" />
+			<entry class="" argb="255,0,255,109" value="152" />
+			<entry class="" argb="255,0,255,103" value="153" />
+			<entry class="" argb="255,0,255,97" value="154" />
+			<entry class="" argb="255,0,255,91" value="155" />
+			<entry class="" argb="255,0,255,84" value="156" />
+			<entry class="" argb="255,0,255,78" value="157" />
+			<entry class="" argb="255,0,255,72" value="158" />
+			<entry class="" argb="255,0,255,66" value="159" />
+			<entry class="" argb="255,0,204,48" value="160" />
+			<entry class="" argb="255,0,204,43" value="161" />
+			<entry class="" argb="255,0,255,48" value="162" />
+			<entry class="" argb="255,0,255,42" value="163" />
+			<entry class="" argb="255,0,255,36" value="164" />
+			<entry class="" argb="255,0,255,30" value="165" />
+			<entry class="" argb="255,0,255,24" value="166" />
+			<entry class="" argb="255,0,255,18" value="167" />
+			<entry class="" argb="255,0,255,12" value="168" />
+			<entry class="" argb="255,0,255,6" value="169" />
+			<entry class="" argb="255,0,204,0" value="170" />
+			<entry class="" argb="255,4,204,0" value="171" />
+			<entry class="" argb="255,12,255,0" value="172" />
+			<entry class="" argb="255,18,255,0" value="173" />
+			<entry class="" argb="255,24,255,0" value="174" />
+			<entry class="" argb="255,30,255,0" value="175" />
+			<entry class="" argb="255,36,255,0" value="176" />
+			<entry class="" argb="255,42,255,0" value="177" />
+			<entry class="" argb="255,48,255,0" value="178" />
+			<entry class="" argb="255,54,255,0" value="179" />
+			<entry class="" argb="255,48,204,0" value="180" />
+			<entry class="" argb="255,53,204,0" value="181" />
+			<entry class="" argb="255,72,255,0" value="182" />
+			<entry class="" argb="255,78,255,0" value="183" />
+			<entry class="" argb="255,85,255,0" value="184" />
+			<entry class="" argb="255,91,255,0" value="185" />
+			<entry class="" argb="255,97,255,0" value="186" />
+			<entry class="" argb="255,103,255,0" value="187" />
+			<entry class="" argb="255,109,255,0" value="188" />
+			<entry class="" argb="255,115,255,0" value="189" />
+			<entry class="" argb="255,97,204,0" value="190" />
+			<entry class="" argb="255,102,204,0" value="191" />
+			<entry class="" argb="255,133,255,0" value="192" />
+			<entry class="" argb="255,139,255,0" value="193" />
+			<entry class="" argb="255,145,255,0" value="194" />
+			<entry class="" argb="255,151,255,0" value="195" />
+			<entry class="" argb="255,157,255,0" value="196" />
+			<entry class="" argb="255,163,255,0" value="197" />
+			<entry class="" argb="255,170,255,0" value="198" />
+			<entry class="" argb="255,176,255,0" value="199" />
+			<entry class="" argb="255,145,204,0" value="200" />
+			<entry class="" argb="255,150,204,0" value="201" />
+			<entry class="" argb="255,194,255,0" value="202" />
+			<entry class="" argb="255,200,255,0" value="203" />
+			<entry class="" argb="255,206,255,0" value="204" />
+			<entry class="" argb="255,212,255,0" value="205" />
+			<entry class="" argb="255,218,255,0" value="206" />
+			<entry class="" argb="255,224,255,0" value="207" />
+			<entry class="" argb="255,230,255,0" value="208" />
+			<entry class="" argb="255,236,255,0" value="209" />
+			<entry class="" argb="255,194,204,0" value="210" />
+			<entry class="" argb="255,199,204,0" value="211" />
+			<entry class="" argb="255,255,255,0" value="212" />
+			<entry class="" argb="255,255,248,2" value="213" />
+			<entry class="" argb="255,255,242,5" value="214" />
+			<entry class="" argb="255,255,235,7" value="215" />
+			<entry class="" argb="255,255,229,10" value="216" />
+			<entry class="" argb="255,255,223,12" value="217" />
+			<entry class="" argb="255,255,216,15" value="218" />
+			<entry class="" argb="255,255,210,17" value="219" />
+			<entry class="" argb="255,204,163,16" value="220" />
+			<entry class="" argb="255,204,158,18" value="221" />
+			<entry class="" argb="255,255,191,25" value="222" />
+			<entry class="" argb="255,255,184,28" value="223" />
+			<entry class="" argb="255,255,178,30" value="224" />
+			<entry class="" argb="255,255,172,33" value="225" />
+			<entry class="" argb="255,255,165,35" value="226" />
+			<entry class="" argb="255,255,159,38" value="227" />
+			<entry class="" argb="255,255,153,40" value="228" />
+			<entry class="" argb="255,255,146,43" value="229" />
+			<entry class="" argb="255,204,112,36" value="230" />
+			<entry class="" argb="255,204,107,38" value="231" />
+			<entry class="" argb="255,255,127,51" value="232" />
+			<entry class="" argb="255,255,121,48" value="233" />
+			<entry class="" argb="255,255,115,46" value="234" />
+			<entry class="" argb="255,255,110,44" value="235" />
+			<entry class="" argb="255,255,104,41" value="236" />
+			<entry class="" argb="255,255,98,39" value="237" />
+			<entry class="" argb="255,255,92,37" value="238" />
+			<entry class="" argb="255,255,86,34" value="239" />
+			<entry class="" argb="255,204,64,25" value="240" />
+			<entry class="" argb="255,204,60,24" value="241" />
+			<entry class="" argb="255,255,69,27" value="242" />
+			<entry class="" argb="255,255,63,25" value="243" />
+			<entry class="" argb="255,255,57,23" value="244" />
+			<entry class="" argb="255,255,52,20" value="245" />
+			<entry class="" argb="255,255,46,18" value="246" />
+			<entry class="" argb="255,255,40,16" value="247" />
+			<entry class="" argb="255,255,34,13" value="248" />
+			<entry class="" argb="255,255,28,11" value="249" />
+			<entry class="" argb="255,204,18,7" value="250" />
+			<entry class="" argb="255,204,13,5" value="251" />
+			<entry class="" argb="255,255,11,4" value="252" />
+			<entry class="" argb="255,255,5,2" value="253" />
+			<entry class="" argb="255,255,0,0" value="254" />
+			<entry class="" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-white" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,1" value="1" />
+			<entry class="" argb="255,0,0,2" value="2" />
+			<entry class="" argb="255,0,0,4" value="3" />
+			<entry class="" argb="255,0,0,5" value="4" />
+			<entry class="" argb="255,0,0,6" value="5" />
+			<entry class="" argb="255,0,0,8" value="6" />
+			<entry class="" argb="255,0,0,9" value="7" />
+			<entry class="" argb="255,0,0,10" value="8" />
+			<entry class="" argb="255,0,0,12" value="9" />
+			<entry class="" argb="255,0,0,13" value="10" />
+			<entry class="" argb="255,0,0,14" value="11" />
+			<entry class="" argb="255,0,0,16" value="12" />
+			<entry class="" argb="255,0,0,17" value="13" />
+			<entry class="" argb="255,0,0,18" value="14" />
+			<entry class="" argb="255,0,0,20" value="15" />
+			<entry class="" argb="255,0,0,21" value="16" />
+			<entry class="" argb="255,0,0,23" value="17" />
+			<entry class="" argb="255,0,0,24" value="18" />
+			<entry class="" argb="255,0,0,25" value="19" />
+			<entry class="" argb="255,0,0,27" value="20" />
+			<entry class="" argb="255,0,0,28" value="21" />
+			<entry class="" argb="255,0,0,29" value="22" />
+			<entry class="" argb="255,0,0,31" value="23" />
+			<entry class="" argb="255,0,0,32" value="24" />
+			<entry class="" argb="255,0,0,33" value="25" />
+			<entry class="" argb="255,0,0,35" value="26" />
+			<entry class="" argb="255,0,0,36" value="27" />
+			<entry class="" argb="255,0,0,37" value="28" />
+			<entry class="" argb="255,0,0,39" value="29" />
+			<entry class="" argb="255,0,0,40" value="30" />
+			<entry class="" argb="255,0,0,42" value="31" />
+			<entry class="" argb="255,0,0,43" value="32" />
+			<entry class="" argb="255,0,0,44" value="33" />
+			<entry class="" argb="255,0,0,46" value="34" />
+			<entry class="" argb="255,0,0,47" value="35" />
+			<entry class="" argb="255,0,0,48" value="36" />
+			<entry class="" argb="255,0,0,50" value="37" />
+			<entry class="" argb="255,0,0,51" value="38" />
+			<entry class="" argb="255,0,0,52" value="39" />
+			<entry class="" argb="255,0,0,54" value="40" />
+			<entry class="" argb="255,0,0,55" value="41" />
+			<entry class="" argb="255,0,0,56" value="42" />
+			<entry class="" argb="255,0,0,58" value="43" />
+			<entry class="" argb="255,0,0,59" value="44" />
+			<entry class="" argb="255,0,0,61" value="45" />
+			<entry class="" argb="255,0,0,62" value="46" />
+			<entry class="" argb="255,0,0,63" value="47" />
+			<entry class="" argb="255,0,0,65" value="48" />
+			<entry class="" argb="255,0,0,66" value="49" />
+			<entry class="" argb="255,0,0,67" value="50" />
+			<entry class="" argb="255,0,0,69" value="51" />
+			<entry class="" argb="255,0,0,70" value="52" />
+			<entry class="" argb="255,0,0,71" value="53" />
+			<entry class="" argb="255,0,0,73" value="54" />
+			<entry class="" argb="255,0,0,74" value="55" />
+			<entry class="" argb="255,0,0,75" value="56" />
+			<entry class="" argb="255,0,0,77" value="57" />
+			<entry class="" argb="255,0,0,78" value="58" />
+			<entry class="" argb="255,0,0,80" value="59" />
+			<entry class="" argb="255,0,0,81" value="60" />
+			<entry class="" argb="255,0,0,82" value="61" />
+			<entry class="" argb="255,0,0,84" value="62" />
+			<entry class="" argb="255,0,0,85" value="63" />
+			<entry class="" argb="255,0,0,86" value="64" />
+			<entry class="" argb="255,0,0,88" value="65" />
+			<entry class="" argb="255,0,0,89" value="66" />
+			<entry class="" argb="255,0,0,90" value="67" />
+			<entry class="" argb="255,0,0,92" value="68" />
+			<entry class="" argb="255,0,0,93" value="69" />
+			<entry class="" argb="255,0,0,94" value="70" />
+			<entry class="" argb="255,0,0,96" value="71" />
+			<entry class="" argb="255,0,0,97" value="72" />
+			<entry class="" argb="255,0,0,99" value="73" />
+			<entry class="" argb="255,0,0,100" value="74" />
+			<entry class="" argb="255,0,0,101" value="75" />
+			<entry class="" argb="255,0,0,103" value="76" />
+			<entry class="" argb="255,0,0,104" value="77" />
+			<entry class="" argb="255,0,0,105" value="78" />
+			<entry class="" argb="255,0,0,107" value="79" />
+			<entry class="" argb="255,0,0,108" value="80" />
+			<entry class="" argb="255,0,0,109" value="81" />
+			<entry class="" argb="255,0,0,111" value="82" />
+			<entry class="" argb="255,0,0,112" value="83" />
+			<entry class="" argb="255,0,0,113" value="84" />
+			<entry class="" argb="255,0,0,115" value="85" />
+			<entry class="" argb="255,0,0,116" value="86" />
+			<entry class="" argb="255,0,0,118" value="87" />
+			<entry class="" argb="255,0,0,119" value="88" />
+			<entry class="" argb="255,0,0,120" value="89" />
+			<entry class="" argb="255,0,0,122" value="90" />
+			<entry class="" argb="255,0,0,123" value="91" />
+			<entry class="" argb="255,0,0,124" value="92" />
+			<entry class="" argb="255,0,0,126" value="93" />
+			<entry class="" argb="255,0,0,127" value="94" />
+			<entry class="" argb="255,0,0,128" value="95" />
+			<entry class="" argb="255,0,0,130" value="96" />
+			<entry class="" argb="255,0,2,131" value="97" />
+			<entry class="" argb="255,0,4,132" value="98" />
+			<entry class="" argb="255,0,5,134" value="99" />
+			<entry class="" argb="255,0,7,135" value="100" />
+			<entry class="" argb="255,0,9,136" value="101" />
+			<entry class="" argb="255,0,10,138" value="102" />
+			<entry class="" argb="255,0,12,139" value="103" />
+			<entry class="" argb="255,0,13,141" value="104" />
+			<entry class="" argb="255,0,15,142" value="105" />
+			<entry class="" argb="255,0,17,143" value="106" />
+			<entry class="" argb="255,0,18,145" value="107" />
+			<entry class="" argb="255,0,20,146" value="108" />
+			<entry class="" argb="255,0,21,147" value="109" />
+			<entry class="" argb="255,0,23,149" value="110" />
+			<entry class="" argb="255,0,25,150" value="111" />
+			<entry class="" argb="255,0,26,151" value="112" />
+			<entry class="" argb="255,0,28,153" value="113" />
+			<entry class="" argb="255,0,29,154" value="114" />
+			<entry class="" argb="255,0,31,155" value="115" />
+			<entry class="" argb="255,0,33,157" value="116" />
+			<entry class="" argb="255,0,34,158" value="117" />
+			<entry class="" argb="255,0,36,160" value="118" />
+			<entry class="" argb="255,0,37,161" value="119" />
+			<entry class="" argb="255,0,39,162" value="120" />
+			<entry class="" argb="255,0,41,164" value="121" />
+			<entry class="" argb="255,0,42,165" value="122" />
+			<entry class="" argb="255,0,44,166" value="123" />
+			<entry class="" argb="255,0,45,168" value="124" />
+			<entry class="" argb="255,0,47,169" value="125" />
+			<entry class="" argb="255,0,49,170" value="126" />
+			<entry class="" argb="255,0,50,172" value="127" />
+			<entry class="" argb="255,0,52,173" value="128" />
+			<entry class="" argb="255,0,53,174" value="129" />
+			<entry class="" argb="255,0,55,176" value="130" />
+			<entry class="" argb="255,0,57,177" value="131" />
+			<entry class="" argb="255,0,58,179" value="132" />
+			<entry class="" argb="255,0,60,180" value="133" />
+			<entry class="" argb="255,0,61,181" value="134" />
+			<entry class="" argb="255,0,63,183" value="135" />
+			<entry class="" argb="255,0,65,184" value="136" />
+			<entry class="" argb="255,0,66,185" value="137" />
+			<entry class="" argb="255,0,68,187" value="138" />
+			<entry class="" argb="255,0,69,188" value="139" />
+			<entry class="" argb="255,0,71,189" value="140" />
+			<entry class="" argb="255,0,73,191" value="141" />
+			<entry class="" argb="255,0,74,192" value="142" />
+			<entry class="" argb="255,0,76,193" value="143" />
+			<entry class="" argb="255,0,77,195" value="144" />
+			<entry class="" argb="255,0,79,196" value="145" />
+			<entry class="" argb="255,0,81,198" value="146" />
+			<entry class="" argb="255,0,82,199" value="147" />
+			<entry class="" argb="255,0,84,200" value="148" />
+			<entry class="" argb="255,0,85,202" value="149" />
+			<entry class="" argb="255,0,87,203" value="150" />
+			<entry class="" argb="255,0,89,204" value="151" />
+			<entry class="" argb="255,0,90,206" value="152" />
+			<entry class="" argb="255,0,92,207" value="153" />
+			<entry class="" argb="255,0,94,208" value="154" />
+			<entry class="" argb="255,0,95,210" value="155" />
+			<entry class="" argb="255,0,97,211" value="156" />
+			<entry class="" argb="255,0,98,212" value="157" />
+			<entry class="" argb="255,0,100,214" value="158" />
+			<entry class="" argb="255,0,102,215" value="159" />
+			<entry class="" argb="255,0,103,217" value="160" />
+			<entry class="" argb="255,0,105,218" value="161" />
+			<entry class="" argb="255,0,106,219" value="162" />
+			<entry class="" argb="255,0,108,221" value="163" />
+			<entry class="" argb="255,0,110,222" value="164" />
+			<entry class="" argb="255,0,111,223" value="165" />
+			<entry class="" argb="255,0,113,225" value="166" />
+			<entry class="" argb="255,0,114,226" value="167" />
+			<entry class="" argb="255,0,116,227" value="168" />
+			<entry class="" argb="255,0,118,229" value="169" />
+			<entry class="" argb="255,0,119,230" value="170" />
+			<entry class="" argb="255,0,121,231" value="171" />
+			<entry class="" argb="255,0,122,233" value="172" />
+			<entry class="" argb="255,0,124,234" value="173" />
+			<entry class="" argb="255,0,126,236" value="174" />
+			<entry class="" argb="255,0,127,237" value="175" />
+			<entry class="" argb="255,0,129,238" value="176" />
+			<entry class="" argb="255,0,130,240" value="177" />
+			<entry class="" argb="255,0,132,241" value="178" />
+			<entry class="" argb="255,0,134,242" value="179" />
+			<entry class="" argb="255,0,135,244" value="180" />
+			<entry class="" argb="255,0,137,245" value="181" />
+			<entry class="" argb="255,0,138,246" value="182" />
+			<entry class="" argb="255,0,140,248" value="183" />
+			<entry class="" argb="255,0,142,249" value="184" />
+			<entry class="" argb="255,0,143,250" value="185" />
+			<entry class="" argb="255,0,145,252" value="186" />
+			<entry class="" argb="255,0,146,253" value="187" />
+			<entry class="" argb="255,0,148,255" value="188" />
+			<entry class="" argb="255,0,150,255" value="189" />
+			<entry class="" argb="255,0,151,255" value="190" />
+			<entry class="" argb="255,0,153,255" value="191" />
+			<entry class="" argb="255,0,154,255" value="192" />
+			<entry class="" argb="255,5,156,255" value="193" />
+			<entry class="" argb="255,9,158,255" value="194" />
+			<entry class="" argb="255,13,159,255" value="195" />
+			<entry class="" argb="255,17,161,255" value="196" />
+			<entry class="" argb="255,21,162,255" value="197" />
+			<entry class="" argb="255,25,164,255" value="198" />
+			<entry class="" argb="255,29,166,255" value="199" />
+			<entry class="" argb="255,33,167,255" value="200" />
+			<entry class="" argb="255,37,169,255" value="201" />
+			<entry class="" argb="255,41,170,255" value="202" />
+			<entry class="" argb="255,45,172,255" value="203" />
+			<entry class="" argb="255,49,174,255" value="204" />
+			<entry class="" argb="255,53,175,255" value="205" />
+			<entry class="" argb="255,57,177,255" value="206" />
+			<entry class="" argb="255,61,179,255" value="207" />
+			<entry class="" argb="255,65,180,255" value="208" />
+			<entry class="" argb="255,69,182,255" value="209" />
+			<entry class="" argb="255,73,183,255" value="210" />
+			<entry class="" argb="255,77,185,255" value="211" />
+			<entry class="" argb="255,81,187,255" value="212" />
+			<entry class="" argb="255,85,188,255" value="213" />
+			<entry class="" argb="255,90,190,255" value="214" />
+			<entry class="" argb="255,94,191,255" value="215" />
+			<entry class="" argb="255,98,193,255" value="216" />
+			<entry class="" argb="255,102,195,255" value="217" />
+			<entry class="" argb="255,106,196,255" value="218" />
+			<entry class="" argb="255,110,198,255" value="219" />
+			<entry class="" argb="255,114,199,255" value="220" />
+			<entry class="" argb="255,118,201,255" value="221" />
+			<entry class="" argb="255,122,203,255" value="222" />
+			<entry class="" argb="255,126,204,255" value="223" />
+			<entry class="" argb="255,130,206,255" value="224" />
+			<entry class="" argb="255,134,207,255" value="225" />
+			<entry class="" argb="255,138,209,255" value="226" />
+			<entry class="" argb="255,142,211,255" value="227" />
+			<entry class="" argb="255,146,212,255" value="228" />
+			<entry class="" argb="255,150,214,255" value="229" />
+			<entry class="" argb="255,154,215,255" value="230" />
+			<entry class="" argb="255,158,217,255" value="231" />
+			<entry class="" argb="255,162,219,255" value="232" />
+			<entry class="" argb="255,166,220,255" value="233" />
+			<entry class="" argb="255,170,222,255" value="234" />
+			<entry class="" argb="255,175,223,255" value="235" />
+			<entry class="" argb="255,179,225,255" value="236" />
+			<entry class="" argb="255,183,227,255" value="237" />
+			<entry class="" argb="255,187,228,255" value="238" />
+			<entry class="" argb="255,191,230,255" value="239" />
+			<entry class="" argb="255,195,231,255" value="240" />
+			<entry class="" argb="255,199,233,255" value="241" />
+			<entry class="" argb="255,203,235,255" value="242" />
+			<entry class="" argb="255,207,236,255" value="243" />
+			<entry class="" argb="255,211,238,255" value="244" />
+			<entry class="" argb="255,215,239,255" value="245" />
+			<entry class="" argb="255,219,241,255" value="246" />
+			<entry class="" argb="255,223,243,255" value="247" />
+			<entry class="" argb="255,227,244,255" value="248" />
+			<entry class="" argb="255,231,246,255" value="249" />
+			<entry class="" argb="255,235,247,255" value="250" />
+			<entry class="" argb="255,239,249,255" value="251" />
+			<entry class="" argb="255,243,251,255" value="252" />
+			<entry class="" argb="255,247,252,255" value="253" />
+			<entry class="" argb="255,251,254,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="ocean" interpolate="false">
+		<table>
+			<entry class="" argb="255,54,67,141" value="0" />
+			<entry class="" argb="255,54,67,141" value="1" />
+			<entry class="" argb="255,59,67,153" value="2" />
+			<entry class="" argb="255,63,67,165" value="3" />
+			<entry class="" argb="255,68,67,177" value="4" />
+			<entry class="" argb="255,73,67,189" value="5" />
+			<entry class="" argb="255,77,67,202" value="6" />
+			<entry class="" argb="255,82,66,214" value="7" />
+			<entry class="" argb="255,82,66,214" value="8" />
+			<entry class="" argb="255,87,66,227" value="9" />
+			<entry class="" argb="255,91,65,239" value="10" />
+			<entry class="" argb="255,96,64,251" value="11" />
+			<entry class="" argb="255,100,64,246" value="12" />
+			<entry class="" argb="255,105,63,234" value="13" />
+			<entry class="" argb="255,110,62,222" value="14" />
+			<entry class="" argb="255,114,61,210" value="15" />
+			<entry class="" argb="255,119,60,198" value="16" />
+			<entry class="" argb="255,123,59,186" value="17" />
+			<entry class="" argb="255,127,57,175" value="18" />
+			<entry class="" argb="255,131,56,164" value="19" />
+			<entry class="" argb="255,135,55,153" value="20" />
+			<entry class="" argb="255,139,54,142" value="21" />
+			<entry class="" argb="255,143,53,132" value="22" />
+			<entry class="" argb="255,143,53,132" value="23" />
+			<entry class="" argb="255,147,52,122" value="24" />
+			<entry class="" argb="255,150,51,113" value="25" />
+			<entry class="" argb="255,154,49,104" value="26" />
+			<entry class="" argb="255,157,48,95" value="27" />
+			<entry class="" argb="255,160,47,87" value="28" />
+			<entry class="" argb="255,163,47,79" value="29" />
+			<entry class="" argb="255,165,46,72" value="30" />
+			<entry class="" argb="255,168,45,66" value="31" />
+			<entry class="" argb="255,170,44,59" value="32" />
+			<entry class="" argb="255,172,44,54" value="33" />
+			<entry class="" argb="255,174,44,49" value="34" />
+			<entry class="" argb="255,176,43,44" value="35" />
+			<entry class="" argb="255,177,43,40" value="36" />
+			<entry class="" argb="255,177,43,40" value="37" />
+			<entry class="" argb="255,179,43,37" value="38" />
+			<entry class="" argb="255,180,43,34" value="39" />
+			<entry class="" argb="255,180,44,32" value="40" />
+			<entry class="" argb="255,181,44,31" value="41" />
+			<entry class="" argb="255,181,45,30" value="42" />
+			<entry class="" argb="255,182,46,29" value="43" />
+			<entry class="" argb="255,181,47,30" value="44" />
+			<entry class="" argb="255,181,48,31" value="45" />
+			<entry class="" argb="255,180,50,32" value="46" />
+			<entry class="" argb="255,180,51,34" value="47" />
+			<entry class="" argb="255,179,53,37" value="48" />
+			<entry class="" argb="255,177,55,40" value="49" />
+			<entry class="" argb="255,176,57,44" value="50" />
+			<entry class="" argb="255,174,60,49" value="51" />
+			<entry class="" argb="255,174,60,49" value="52" />
+			<entry class="" argb="255,172,62,54" value="53" />
+			<entry class="" argb="255,170,65,59" value="54" />
+			<entry class="" argb="255,168,68,66" value="55" />
+			<entry class="" argb="255,165,71,72" value="56" />
+			<entry class="" argb="255,163,74,79" value="57" />
+			<entry class="" argb="255,160,78,87" value="58" />
+			<entry class="" argb="255,157,81,95" value="59" />
+			<entry class="" argb="255,154,85,104" value="60" />
+			<entry class="" argb="255,150,88,113" value="61" />
+			<entry class="" argb="255,147,92,122" value="62" />
+			<entry class="" argb="255,143,96,132" value="63" />
+			<entry class="" argb="255,139,100,142" value="64" />
+			<entry class="" argb="255,135,104,153" value="65" />
+			<entry class="" argb="255,131,108,164" value="66" />
+			<entry class="" argb="255,131,108,164" value="67" />
+			<entry class="" argb="255,127,112,175" value="68" />
+			<entry class="" argb="255,123,116,186" value="69" />
+			<entry class="" argb="255,119,120,198" value="70" />
+			<entry class="" argb="255,114,124,210" value="71" />
+			<entry class="" argb="255,110,128,222" value="72" />
+			<entry class="" argb="255,105,132,234" value="73" />
+			<entry class="" argb="255,100,136,246" value="74" />
+			<entry class="" argb="255,96,140,251" value="75" />
+			<entry class="" argb="255,91,144,239" value="76" />
+			<entry class="" argb="255,86,148,226" value="77" />
+			<entry class="" argb="255,82,151,214" value="78" />
+			<entry class="" argb="255,77,154,202" value="79" />
+			<entry class="" argb="255,73,158,189" value="80" />
+			<entry class="" argb="255,68,161,177" value="81" />
+			<entry class="" argb="255,68,161,177" value="82" />
+			<entry class="" argb="255,63,164,165" value="83" />
+			<entry class="" argb="255,59,166,153" value="84" />
+			<entry class="" argb="255,54,169,141" value="85" />
+			<entry class="" argb="255,50,171,129" value="86" />
+			<entry class="" argb="255,46,173,118" value="87" />
+			<entry class="" argb="255,42,175,107" value="88" />
+			<entry class="" argb="255,38,176,96" value="89" />
+			<entry class="" argb="255,34,178,85" value="90" />
+			<entry class="" argb="255,30,179,75" value="91" />
+			<entry class="" argb="255,26,180,65" value="92" />
+			<entry class="" argb="255,23,180,56" value="93" />
+			<entry class="" argb="255,19,180,47" value="94" />
+			<entry class="" argb="255,16,180,38" value="95" />
+			<entry class="" argb="255,13,180,30" value="96" />
+			<entry class="" argb="255,13,180,30" value="97" />
+			<entry class="" argb="255,13,179,22" value="98" />
+			<entry class="" argb="255,8,179,15" value="99" />
+			<entry class="" argb="255,5,178,9" value="100" />
+			<entry class="" argb="255,3,176,2" value="101" />
+			<entry class="" argb="255,1,175,2" value="102" />
+			<entry class="" argb="255,0,173,7" value="103" />
+			<entry class="" argb="255,2,171,12" value="104" />
+			<entry class="" argb="255,3,169,16" value="105" />
+			<entry class="" argb="255,5,166,19" value="106" />
+			<entry class="" argb="255,6,164,22" value="107" />
+			<entry class="" argb="255,6,161,24" value="108" />
+			<entry class="" argb="255,7,158,25" value="109" />
+			<entry class="" argb="255,7,155,26" value="110" />
+			<entry class="" argb="255,8,152,27" value="111" />
+			<entry class="" argb="255,8,152,27" value="112" />
+			<entry class="" argb="255,7,148,26" value="113" />
+			<entry class="" argb="255,7,145,25" value="114" />
+			<entry class="" argb="255,6,141,24" value="115" />
+			<entry class="" argb="255,6,138,22" value="116" />
+			<entry class="" argb="255,5,134,19" value="117" />
+			<entry class="" argb="255,3,131,16" value="118" />
+			<entry class="" argb="255,2,127,12" value="119" />
+			<entry class="" argb="255,0,124,7" value="120" />
+			<entry class="" argb="255,1,120,2" value="121" />
+			<entry class="" argb="255,3,117,2" value="122" />
+			<entry class="" argb="255,5,113,9" value="123" />
+			<entry class="" argb="255,8,110,15" value="124" />
+			<entry class="" argb="255,13,107,22" value="125" />
+			<entry class="" argb="255,13,104,30" value="126" />
+			<entry class="" argb="255,13,104,30" value="127" />
+			<entry class="" argb="255,16,101,38" value="128" />
+			<entry class="" argb="255,19,99,47" value="129" />
+			<entry class="" argb="255,23,97,56" value="130" />
+			<entry class="" argb="255,26,95,65" value="131" />
+			<entry class="" argb="255,30,93,75" value="132" />
+			<entry class="" argb="255,34,91,85" value="133" />
+			<entry class="" argb="255,38,90,96" value="134" />
+			<entry class="" argb="255,42,89,107" value="135" />
+			<entry class="" argb="255,46,88,118" value="136" />
+			<entry class="" argb="255,50,88,129" value="137" />
+			<entry class="" argb="255,54,88,141" value="138" />
+			<entry class="" argb="255,59,88,153" value="139" />
+			<entry class="" argb="255,63,88,165" value="140" />
+			<entry class="" argb="255,68,89,177" value="141" />
+			<entry class="" argb="255,68,89,177" value="142" />
+			<entry class="" argb="255,73,91,189" value="143" />
+			<entry class="" argb="255,77,92,202" value="144" />
+			<entry class="" argb="255,82,94,214" value="145" />
+			<entry class="" argb="255,87,96,227" value="146" />
+			<entry class="" argb="255,91,99,239" value="147" />
+			<entry class="" argb="255,96,102,251" value="148" />
+			<entry class="" argb="255,100,105,246" value="149" />
+			<entry class="" argb="255,105,109,234" value="150" />
+			<entry class="" argb="255,110,113,222" value="151" />
+			<entry class="" argb="255,114,117,210" value="152" />
+			<entry class="" argb="255,119,122,198" value="153" />
+			<entry class="" argb="255,123,127,186" value="154" />
+			<entry class="" argb="255,127,132,175" value="155" />
+			<entry class="" argb="255,131,137,164" value="156" />
+			<entry class="" argb="255,131,137,164" value="157" />
+			<entry class="" argb="255,135,142,153" value="158" />
+			<entry class="" argb="255,139,148,142" value="159" />
+			<entry class="" argb="255,143,154,132" value="160" />
+			<entry class="" argb="255,147,160,122" value="161" />
+			<entry class="" argb="255,150,166,113" value="162" />
+			<entry class="" argb="255,154,173,104" value="163" />
+			<entry class="" argb="255,157,179,95" value="164" />
+			<entry class="" argb="255,160,186,87" value="165" />
+			<entry class="" argb="255,163,192,79" value="166" />
+			<entry class="" argb="255,165,199,72" value="167" />
+			<entry class="" argb="255,168,205,66" value="168" />
+			<entry class="" argb="255,170,212,59" value="169" />
+			<entry class="" argb="255,172,218,54" value="170" />
+			<entry class="" argb="255,172,218,54" value="171" />
+			<entry class="" argb="255,174,225,49" value="172" />
+			<entry class="" argb="255,176,231,44" value="173" />
+			<entry class="" argb="255,177,237,40" value="174" />
+			<entry class="" argb="255,179,243,37" value="175" />
+			<entry class="" argb="255,180,248,34" value="176" />
+			<entry class="" argb="255,180,254,32" value="177" />
+			<entry class="" argb="255,181,251,31" value="178" />
+			<entry class="" argb="255,181,246,30" value="179" />
+			<entry class="" argb="255,182,241,29" value="180" />
+			<entry class="" argb="255,181,237,30" value="181" />
+			<entry class="" argb="255,181,233,31" value="182" />
+			<entry class="" argb="255,180,229,32" value="183" />
+			<entry class="" argb="255,180,226,34" value="184" />
+			<entry class="" argb="255,179,223,37" value="185" />
+			<entry class="" argb="255,179,223,37" value="186" />
+			<entry class="" argb="255,177,220,40" value="187" />
+			<entry class="" argb="255,176,218,44" value="188" />
+			<entry class="" argb="255,174,216,49" value="189" />
+			<entry class="" argb="255,172,215,54" value="190" />
+			<entry class="" argb="255,170,214,59" value="191" />
+			<entry class="" argb="255,168,213,66" value="192" />
+			<entry class="" argb="255,165,213,72" value="193" />
+			<entry class="" argb="255,163,214,79" value="194" />
+			<entry class="" argb="255,160,214,87" value="195" />
+			<entry class="" argb="255,157,216,95" value="196" />
+			<entry class="" argb="255,154,217,104" value="197" />
+			<entry class="" argb="255,150,219,113" value="198" />
+			<entry class="" argb="255,147,222,122" value="199" />
+			<entry class="" argb="255,143,224,132" value="200" />
+			<entry class="" argb="255,143,224,132" value="201" />
+			<entry class="" argb="255,139,228,142" value="202" />
+			<entry class="" argb="255,135,231,153" value="203" />
+			<entry class="" argb="255,131,235,164" value="204" />
+			<entry class="" argb="255,127,239,175" value="205" />
+			<entry class="" argb="255,123,244,186" value="206" />
+			<entry class="" argb="255,119,248,198" value="207" />
+			<entry class="" argb="255,114,253,210" value="208" />
+			<entry class="" argb="255,110,251,222" value="209" />
+			<entry class="" argb="255,105,246,234" value="210" />
+			<entry class="" argb="255,105,246,234" value="211" />
+			<entry class="" argb="255,105,246,234" value="212" />
+			<entry class="" argb="255,105,246,234" value="213" />
+			<entry class="" argb="255,105,246,234" value="214" />
+			<entry class="" argb="255,105,246,234" value="215" />
+			<entry class="" argb="255,105,246,234" value="216" />
+			<entry class="" argb="255,105,246,234" value="217" />
+			<entry class="" argb="255,105,246,234" value="218" />
+			<entry class="" argb="255,105,246,234" value="219" />
+			<entry class="" argb="255,105,246,234" value="220" />
+			<entry class="" argb="255,105,246,234" value="221" />
+			<entry class="" argb="255,105,246,234" value="222" />
+			<entry class="" argb="255,105,246,234" value="223" />
+			<entry class="" argb="255,105,246,234" value="224" />
+			<entry class="" argb="255,105,246,234" value="225" />
+			<entry class="" argb="255,105,246,234" value="226" />
+			<entry class="" argb="255,105,246,234" value="227" />
+			<entry class="" argb="255,105,246,234" value="228" />
+			<entry class="" argb="255,105,246,234" value="229" />
+			<entry class="" argb="255,105,246,234" value="230" />
+			<entry class="" argb="255,105,246,234" value="231" />
+			<entry class="" argb="255,105,246,234" value="232" />
+			<entry class="" argb="255,105,246,234" value="233" />
+			<entry class="" argb="255,105,246,234" value="234" />
+			<entry class="" argb="255,105,246,234" value="235" />
+			<entry class="" argb="255,105,246,234" value="236" />
+			<entry class="" argb="255,105,246,234" value="237" />
+			<entry class="" argb="255,105,246,234" value="238" />
+			<entry class="" argb="255,105,246,234" value="239" />
+			<entry class="" argb="255,105,246,234" value="240" />
+			<entry class="" argb="255,105,246,234" value="241" />
+			<entry class="" argb="255,105,246,234" value="242" />
+			<entry class="" argb="255,105,246,234" value="243" />
+			<entry class="" argb="255,105,246,234" value="244" />
+			<entry class="" argb="255,105,246,234" value="245" />
+			<entry class="" argb="255,105,246,234" value="246" />
+			<entry class="" argb="255,105,246,234" value="247" />
+			<entry class="" argb="255,105,246,234" value="248" />
+			<entry class="" argb="255,105,246,234" value="249" />
+			<entry class="" argb="255,105,246,234" value="250" />
+			<entry class="" argb="255,105,246,234" value="251" />
+			<entry class="" argb="255,105,246,234" value="252" />
+			<entry class="" argb="255,0,0,0" value="253" />
+			<entry class="" argb="255,255,255,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="red-temperature" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,1,0,0" value="1" />
+			<entry class="" argb="255,2,0,0" value="2" />
+			<entry class="" argb="255,4,0,0" value="3" />
+			<entry class="" argb="255,5,0,0" value="4" />
+			<entry class="" argb="255,7,0,0" value="5" />
+			<entry class="" argb="255,8,0,0" value="6" />
+			<entry class="" argb="255,10,0,0" value="7" />
+			<entry class="" argb="255,11,0,0" value="8" />
+			<entry class="" argb="255,13,0,0" value="9" />
+			<entry class="" argb="255,14,0,0" value="10" />
+			<entry class="" argb="255,15,0,0" value="11" />
+			<entry class="" argb="255,17,0,0" value="12" />
+			<entry class="" argb="255,18,0,0" value="13" />
+			<entry class="" argb="255,20,0,0" value="14" />
+			<entry class="" argb="255,21,0,0" value="15" />
+			<entry class="" argb="255,23,0,0" value="16" />
+			<entry class="" argb="255,24,0,0" value="17" />
+			<entry class="" argb="255,26,0,0" value="18" />
+			<entry class="" argb="255,27,0,0" value="19" />
+			<entry class="" argb="255,28,0,0" value="20" />
+			<entry class="" argb="255,30,0,0" value="21" />
+			<entry class="" argb="255,31,0,0" value="22" />
+			<entry class="" argb="255,33,0,0" value="23" />
+			<entry class="" argb="255,34,0,0" value="24" />
+			<entry class="" argb="255,36,0,0" value="25" />
+			<entry class="" argb="255,37,0,0" value="26" />
+			<entry class="" argb="255,39,0,0" value="27" />
+			<entry class="" argb="255,40,0,0" value="28" />
+			<entry class="" argb="255,42,0,0" value="29" />
+			<entry class="" argb="255,43,0,0" value="30" />
+			<entry class="" argb="255,44,0,0" value="31" />
+			<entry class="" argb="255,46,0,0" value="32" />
+			<entry class="" argb="255,47,0,0" value="33" />
+			<entry class="" argb="255,49,0,0" value="34" />
+			<entry class="" argb="255,50,0,0" value="35" />
+			<entry class="" argb="255,52,0,0" value="36" />
+			<entry class="" argb="255,53,0,0" value="37" />
+			<entry class="" argb="255,55,0,0" value="38" />
+			<entry class="" argb="255,56,0,0" value="39" />
+			<entry class="" argb="255,57,0,0" value="40" />
+			<entry class="" argb="255,59,0,0" value="41" />
+			<entry class="" argb="255,60,0,0" value="42" />
+			<entry class="" argb="255,62,0,0" value="43" />
+			<entry class="" argb="255,63,0,0" value="44" />
+			<entry class="" argb="255,65,0,0" value="45" />
+			<entry class="" argb="255,66,0,0" value="46" />
+			<entry class="" argb="255,68,0,0" value="47" />
+			<entry class="" argb="255,69,0,0" value="48" />
+			<entry class="" argb="255,70,0,0" value="49" />
+			<entry class="" argb="255,72,0,0" value="50" />
+			<entry class="" argb="255,73,0,0" value="51" />
+			<entry class="" argb="255,75,0,0" value="52" />
+			<entry class="" argb="255,76,0,0" value="53" />
+			<entry class="" argb="255,78,0,0" value="54" />
+			<entry class="" argb="255,79,0,0" value="55" />
+			<entry class="" argb="255,81,0,0" value="56" />
+			<entry class="" argb="255,82,0,0" value="57" />
+			<entry class="" argb="255,84,0,0" value="58" />
+			<entry class="" argb="255,85,0,0" value="59" />
+			<entry class="" argb="255,86,0,0" value="60" />
+			<entry class="" argb="255,88,0,0" value="61" />
+			<entry class="" argb="255,89,0,0" value="62" />
+			<entry class="" argb="255,91,0,0" value="63" />
+			<entry class="" argb="255,92,0,0" value="64" />
+			<entry class="" argb="255,94,0,0" value="65" />
+			<entry class="" argb="255,95,0,0" value="66" />
+			<entry class="" argb="255,97,0,0" value="67" />
+			<entry class="" argb="255,98,0,0" value="68" />
+			<entry class="" argb="255,99,0,0" value="69" />
+			<entry class="" argb="255,101,0,0" value="70" />
+			<entry class="" argb="255,102,0,0" value="71" />
+			<entry class="" argb="255,104,0,0" value="72" />
+			<entry class="" argb="255,105,0,0" value="73" />
+			<entry class="" argb="255,107,0,0" value="74" />
+			<entry class="" argb="255,108,0,0" value="75" />
+			<entry class="" argb="255,110,0,0" value="76" />
+			<entry class="" argb="255,111,0,0" value="77" />
+			<entry class="" argb="255,113,0,0" value="78" />
+			<entry class="" argb="255,114,0,0" value="79" />
+			<entry class="" argb="255,115,0,0" value="80" />
+			<entry class="" argb="255,117,0,0" value="81" />
+			<entry class="" argb="255,118,0,0" value="82" />
+			<entry class="" argb="255,120,0,0" value="83" />
+			<entry class="" argb="255,121,0,0" value="84" />
+			<entry class="" argb="255,123,0,0" value="85" />
+			<entry class="" argb="255,124,0,0" value="86" />
+			<entry class="" argb="255,126,0,0" value="87" />
+			<entry class="" argb="255,127,0,0" value="88" />
+			<entry class="" argb="255,128,0,0" value="89" />
+			<entry class="" argb="255,130,0,0" value="90" />
+			<entry class="" argb="255,131,0,0" value="91" />
+			<entry class="" argb="255,133,0,0" value="92" />
+			<entry class="" argb="255,134,0,0" value="93" />
+			<entry class="" argb="255,136,0,0" value="94" />
+			<entry class="" argb="255,137,0,0" value="95" />
+			<entry class="" argb="255,139,0,0" value="96" />
+			<entry class="" argb="255,140,0,0" value="97" />
+			<entry class="" argb="255,141,0,0" value="98" />
+			<entry class="" argb="255,143,0,0" value="99" />
+			<entry class="" argb="255,144,0,0" value="100" />
+			<entry class="" argb="255,146,0,0" value="101" />
+			<entry class="" argb="255,147,0,0" value="102" />
+			<entry class="" argb="255,149,0,0" value="103" />
+			<entry class="" argb="255,150,0,0" value="104" />
+			<entry class="" argb="255,152,0,0" value="105" />
+			<entry class="" argb="255,153,0,0" value="106" />
+			<entry class="" argb="255,155,0,0" value="107" />
+			<entry class="" argb="255,156,0,0" value="108" />
+			<entry class="" argb="255,157,0,0" value="109" />
+			<entry class="" argb="255,159,0,0" value="110" />
+			<entry class="" argb="255,160,0,0" value="111" />
+			<entry class="" argb="255,162,0,0" value="112" />
+			<entry class="" argb="255,163,0,0" value="113" />
+			<entry class="" argb="255,165,0,0" value="114" />
+			<entry class="" argb="255,166,0,0" value="115" />
+			<entry class="" argb="255,168,0,0" value="116" />
+			<entry class="" argb="255,169,0,0" value="117" />
+			<entry class="" argb="255,170,0,0" value="118" />
+			<entry class="" argb="255,172,0,0" value="119" />
+			<entry class="" argb="255,173,0,0" value="120" />
+			<entry class="" argb="255,175,1,0" value="121" />
+			<entry class="" argb="255,176,3,0" value="122" />
+			<entry class="" argb="255,178,5,0" value="123" />
+			<entry class="" argb="255,179,7,0" value="124" />
+			<entry class="" argb="255,181,9,0" value="125" />
+			<entry class="" argb="255,182,11,0" value="126" />
+			<entry class="" argb="255,184,13,0" value="127" />
+			<entry class="" argb="255,185,15,0" value="128" />
+			<entry class="" argb="255,186,17,0" value="129" />
+			<entry class="" argb="255,188,18,0" value="130" />
+			<entry class="" argb="255,189,20,0" value="131" />
+			<entry class="" argb="255,191,22,0" value="132" />
+			<entry class="" argb="255,192,24,0" value="133" />
+			<entry class="" argb="255,194,26,0" value="134" />
+			<entry class="" argb="255,195,28,0" value="135" />
+			<entry class="" argb="255,197,30,0" value="136" />
+			<entry class="" argb="255,198,32,0" value="137" />
+			<entry class="" argb="255,199,34,0" value="138" />
+			<entry class="" argb="255,201,35,0" value="139" />
+			<entry class="" argb="255,202,37,0" value="140" />
+			<entry class="" argb="255,204,39,0" value="141" />
+			<entry class="" argb="255,205,41,0" value="142" />
+			<entry class="" argb="255,207,43,0" value="143" />
+			<entry class="" argb="255,208,45,0" value="144" />
+			<entry class="" argb="255,210,47,0" value="145" />
+			<entry class="" argb="255,211,49,0" value="146" />
+			<entry class="" argb="255,212,51,0" value="147" />
+			<entry class="" argb="255,214,52,0" value="148" />
+			<entry class="" argb="255,215,54,0" value="149" />
+			<entry class="" argb="255,217,56,0" value="150" />
+			<entry class="" argb="255,218,58,0" value="151" />
+			<entry class="" argb="255,220,60,0" value="152" />
+			<entry class="" argb="255,221,62,0" value="153" />
+			<entry class="" argb="255,223,64,0" value="154" />
+			<entry class="" argb="255,224,66,0" value="155" />
+			<entry class="" argb="255,226,68,0" value="156" />
+			<entry class="" argb="255,227,69,0" value="157" />
+			<entry class="" argb="255,228,71,0" value="158" />
+			<entry class="" argb="255,230,73,0" value="159" />
+			<entry class="" argb="255,231,75,0" value="160" />
+			<entry class="" argb="255,233,77,0" value="161" />
+			<entry class="" argb="255,234,79,0" value="162" />
+			<entry class="" argb="255,236,81,0" value="163" />
+			<entry class="" argb="255,237,83,0" value="164" />
+			<entry class="" argb="255,239,85,0" value="165" />
+			<entry class="" argb="255,240,86,0" value="166" />
+			<entry class="" argb="255,241,88,0" value="167" />
+			<entry class="" argb="255,243,90,0" value="168" />
+			<entry class="" argb="255,244,92,0" value="169" />
+			<entry class="" argb="255,246,94,0" value="170" />
+			<entry class="" argb="255,247,96,0" value="171" />
+			<entry class="" argb="255,249,98,0" value="172" />
+			<entry class="" argb="255,250,100,0" value="173" />
+			<entry class="" argb="255,252,102,0" value="174" />
+			<entry class="" argb="255,253,103,0" value="175" />
+			<entry class="" argb="255,255,105,0" value="176" />
+			<entry class="" argb="255,255,107,0" value="177" />
+			<entry class="" argb="255,255,109,0" value="178" />
+			<entry class="" argb="255,255,111,0" value="179" />
+			<entry class="" argb="255,255,113,0" value="180" />
+			<entry class="" argb="255,255,115,0" value="181" />
+			<entry class="" argb="255,255,117,0" value="182" />
+			<entry class="" argb="255,255,119,0" value="183" />
+			<entry class="" argb="255,255,120,0" value="184" />
+			<entry class="" argb="255,255,122,0" value="185" />
+			<entry class="" argb="255,255,124,0" value="186" />
+			<entry class="" argb="255,255,126,0" value="187" />
+			<entry class="" argb="255,255,128,0" value="188" />
+			<entry class="" argb="255,255,130,0" value="189" />
+			<entry class="" argb="255,255,132,0" value="190" />
+			<entry class="" argb="255,255,134,3" value="191" />
+			<entry class="" argb="255,255,136,7" value="192" />
+			<entry class="" argb="255,255,137,11" value="193" />
+			<entry class="" argb="255,255,139,15" value="194" />
+			<entry class="" argb="255,255,141,19" value="195" />
+			<entry class="" argb="255,255,143,23" value="196" />
+			<entry class="" argb="255,255,145,27" value="197" />
+			<entry class="" argb="255,255,147,31" value="198" />
+			<entry class="" argb="255,255,149,35" value="199" />
+			<entry class="" argb="255,255,151,39" value="200" />
+			<entry class="" argb="255,255,153,43" value="201" />
+			<entry class="" argb="255,255,154,47" value="202" />
+			<entry class="" argb="255,255,156,51" value="203" />
+			<entry class="" argb="255,255,158,54" value="204" />
+			<entry class="" argb="255,255,160,58" value="205" />
+			<entry class="" argb="255,255,162,62" value="206" />
+			<entry class="" argb="255,255,164,66" value="207" />
+			<entry class="" argb="255,255,166,70" value="208" />
+			<entry class="" argb="255,255,168,74" value="209" />
+			<entry class="" argb="255,255,170,78" value="210" />
+			<entry class="" argb="255,255,171,82" value="211" />
+			<entry class="" argb="255,255,173,86" value="212" />
+			<entry class="" argb="255,255,175,90" value="213" />
+			<entry class="" argb="255,255,177,94" value="214" />
+			<entry class="" argb="255,255,179,98" value="215" />
+			<entry class="" argb="255,255,181,102" value="216" />
+			<entry class="" argb="255,255,183,105" value="217" />
+			<entry class="" argb="255,255,185,109" value="218" />
+			<entry class="" argb="255,255,187,113" value="219" />
+			<entry class="" argb="255,255,188,117" value="220" />
+			<entry class="" argb="255,255,190,121" value="221" />
+			<entry class="" argb="255,255,192,125" value="222" />
+			<entry class="" argb="255,255,194,129" value="223" />
+			<entry class="" argb="255,255,196,133" value="224" />
+			<entry class="" argb="255,255,198,137" value="225" />
+			<entry class="" argb="255,255,200,141" value="226" />
+			<entry class="" argb="255,255,202,145" value="227" />
+			<entry class="" argb="255,255,204,149" value="228" />
+			<entry class="" argb="255,255,205,153" value="229" />
+			<entry class="" argb="255,255,207,156" value="230" />
+			<entry class="" argb="255,255,209,160" value="231" />
+			<entry class="" argb="255,255,211,164" value="232" />
+			<entry class="" argb="255,255,213,168" value="233" />
+			<entry class="" argb="255,255,215,172" value="234" />
+			<entry class="" argb="255,255,217,176" value="235" />
+			<entry class="" argb="255,255,219,180" value="236" />
+			<entry class="" argb="255,255,221,184" value="237" />
+			<entry class="" argb="255,255,222,188" value="238" />
+			<entry class="" argb="255,255,224,192" value="239" />
+			<entry class="" argb="255,255,226,196" value="240" />
+			<entry class="" argb="255,255,228,200" value="241" />
+			<entry class="" argb="255,255,230,204" value="242" />
+			<entry class="" argb="255,255,232,207" value="243" />
+			<entry class="" argb="255,255,234,211" value="244" />
+			<entry class="" argb="255,255,236,215" value="245" />
+			<entry class="" argb="255,255,238,219" value="246" />
+			<entry class="" argb="255,255,239,223" value="247" />
+			<entry class="" argb="255,255,241,227" value="248" />
+			<entry class="" argb="255,255,243,231" value="249" />
+			<entry class="" argb="255,255,245,235" value="250" />
+			<entry class="" argb="255,255,247,239" value="251" />
+			<entry class="" argb="255,255,249,243" value="252" />
+			<entry class="" argb="255,255,251,247" value="253" />
+			<entry class="" argb="255,255,253,251" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="16level" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,84,0" value="1" />
+			<entry class="" argb="255,0,84,0" value="2" />
+			<entry class="" argb="255,0,84,0" value="3" />
+			<entry class="" argb="255,0,84,0" value="4" />
+			<entry class="" argb="255,0,84,0" value="5" />
+			<entry class="" argb="255,0,84,0" value="6" />
+			<entry class="" argb="255,0,84,0" value="7" />
+			<entry class="" argb="255,0,84,0" value="8" />
+			<entry class="" argb="255,0,84,0" value="9" />
+			<entry class="" argb="255,0,84,0" value="10" />
+			<entry class="" argb="255,0,84,0" value="11" />
+			<entry class="" argb="255,0,84,0" value="12" />
+			<entry class="" argb="255,0,84,0" value="13" />
+			<entry class="" argb="255,0,84,0" value="14" />
+			<entry class="" argb="255,0,84,0" value="15" />
+			<entry class="" argb="255,0,168,0" value="16" />
+			<entry class="" argb="255,0,168,0" value="17" />
+			<entry class="" argb="255,0,168,0" value="18" />
+			<entry class="" argb="255,0,168,0" value="19" />
+			<entry class="" argb="255,0,168,0" value="20" />
+			<entry class="" argb="255,0,168,0" value="21" />
+			<entry class="" argb="255,0,168,0" value="22" />
+			<entry class="" argb="255,0,168,0" value="23" />
+			<entry class="" argb="255,0,168,0" value="24" />
+			<entry class="" argb="255,0,168,0" value="25" />
+			<entry class="" argb="255,0,168,0" value="26" />
+			<entry class="" argb="255,0,168,0" value="27" />
+			<entry class="" argb="255,0,168,0" value="28" />
+			<entry class="" argb="255,0,168,0" value="29" />
+			<entry class="" argb="255,0,168,0" value="30" />
+			<entry class="" argb="255,0,168,0" value="31" />
+			<entry class="" argb="255,0,255,0" value="32" />
+			<entry class="" argb="255,0,255,0" value="33" />
+			<entry class="" argb="255,0,255,0" value="34" />
+			<entry class="" argb="255,0,255,0" value="35" />
+			<entry class="" argb="255,0,255,0" value="36" />
+			<entry class="" argb="255,0,255,0" value="37" />
+			<entry class="" argb="255,0,255,0" value="38" />
+			<entry class="" argb="255,0,255,0" value="39" />
+			<entry class="" argb="255,0,255,0" value="40" />
+			<entry class="" argb="255,0,255,0" value="41" />
+			<entry class="" argb="255,0,255,0" value="42" />
+			<entry class="" argb="255,0,255,0" value="43" />
+			<entry class="" argb="255,0,255,0" value="44" />
+			<entry class="" argb="255,0,255,0" value="45" />
+			<entry class="" argb="255,0,255,0" value="46" />
+			<entry class="" argb="255,0,255,0" value="47" />
+			<entry class="" argb="255,0,255,84" value="48" />
+			<entry class="" argb="255,0,255,84" value="49" />
+			<entry class="" argb="255,0,255,84" value="50" />
+			<entry class="" argb="255,0,255,84" value="51" />
+			<entry class="" argb="255,0,255,84" value="52" />
+			<entry class="" argb="255,0,255,84" value="53" />
+			<entry class="" argb="255,0,255,84" value="54" />
+			<entry class="" argb="255,0,255,84" value="55" />
+			<entry class="" argb="255,0,255,84" value="56" />
+			<entry class="" argb="255,0,255,84" value="57" />
+			<entry class="" argb="255,0,255,84" value="58" />
+			<entry class="" argb="255,0,255,84" value="59" />
+			<entry class="" argb="255,0,255,84" value="60" />
+			<entry class="" argb="255,0,255,84" value="61" />
+			<entry class="" argb="255,0,255,84" value="62" />
+			<entry class="" argb="255,0,255,84" value="63" />
+			<entry class="" argb="255,0,255,168" value="64" />
+			<entry class="" argb="255,0,255,168" value="65" />
+			<entry class="" argb="255,0,255,168" value="66" />
+			<entry class="" argb="255,0,255,168" value="67" />
+			<entry class="" argb="255,0,255,168" value="68" />
+			<entry class="" argb="255,0,255,168" value="69" />
+			<entry class="" argb="255,0,255,168" value="70" />
+			<entry class="" argb="255,0,255,168" value="71" />
+			<entry class="" argb="255,0,255,168" value="72" />
+			<entry class="" argb="255,0,255,168" value="73" />
+			<entry class="" argb="255,0,255,168" value="74" />
+			<entry class="" argb="255,0,255,168" value="75" />
+			<entry class="" argb="255,0,255,168" value="76" />
+			<entry class="" argb="255,0,255,168" value="77" />
+			<entry class="" argb="255,0,255,168" value="78" />
+			<entry class="" argb="255,0,255,168" value="79" />
+			<entry class="" argb="255,0,255,255" value="80" />
+			<entry class="" argb="255,0,255,255" value="81" />
+			<entry class="" argb="255,0,255,255" value="82" />
+			<entry class="" argb="255,0,255,255" value="83" />
+			<entry class="" argb="255,0,255,255" value="84" />
+			<entry class="" argb="255,0,255,255" value="85" />
+			<entry class="" argb="255,0,255,255" value="86" />
+			<entry class="" argb="255,0,255,255" value="87" />
+			<entry class="" argb="255,0,255,255" value="88" />
+			<entry class="" argb="255,0,255,255" value="89" />
+			<entry class="" argb="255,0,255,255" value="90" />
+			<entry class="" argb="255,0,255,255" value="91" />
+			<entry class="" argb="255,0,255,255" value="92" />
+			<entry class="" argb="255,0,255,255" value="93" />
+			<entry class="" argb="255,0,255,255" value="94" />
+			<entry class="" argb="255,0,255,255" value="95" />
+			<entry class="" argb="255,0,0,255" value="96" />
+			<entry class="" argb="255,0,0,255" value="97" />
+			<entry class="" argb="255,0,0,255" value="98" />
+			<entry class="" argb="255,0,0,255" value="99" />
+			<entry class="" argb="255,0,0,255" value="100" />
+			<entry class="" argb="255,0,0,255" value="101" />
+			<entry class="" argb="255,0,0,255" value="102" />
+			<entry class="" argb="255,0,0,255" value="103" />
+			<entry class="" argb="255,0,0,255" value="104" />
+			<entry class="" argb="255,0,0,255" value="105" />
+			<entry class="" argb="255,0,0,255" value="106" />
+			<entry class="" argb="255,0,0,255" value="107" />
+			<entry class="" argb="255,0,0,255" value="108" />
+			<entry class="" argb="255,0,0,255" value="109" />
+			<entry class="" argb="255,0,0,255" value="110" />
+			<entry class="" argb="255,0,0,255" value="111" />
+			<entry class="" argb="255,128,0,255" value="112" />
+			<entry class="" argb="255,128,0,255" value="113" />
+			<entry class="" argb="255,128,0,255" value="114" />
+			<entry class="" argb="255,128,0,255" value="115" />
+			<entry class="" argb="255,128,0,255" value="116" />
+			<entry class="" argb="255,128,0,255" value="117" />
+			<entry class="" argb="255,128,0,255" value="118" />
+			<entry class="" argb="255,128,0,255" value="119" />
+			<entry class="" argb="255,128,0,255" value="120" />
+			<entry class="" argb="255,128,0,255" value="121" />
+			<entry class="" argb="255,128,0,255" value="122" />
+			<entry class="" argb="255,128,0,255" value="123" />
+			<entry class="" argb="255,128,0,255" value="124" />
+			<entry class="" argb="255,128,0,255" value="125" />
+			<entry class="" argb="255,128,0,255" value="126" />
+			<entry class="" argb="255,128,0,255" value="127" />
+			<entry class="" argb="255,255,0,220" value="128" />
+			<entry class="" argb="255,255,0,220" value="129" />
+			<entry class="" argb="255,255,0,220" value="130" />
+			<entry class="" argb="255,255,0,220" value="131" />
+			<entry class="" argb="255,255,0,220" value="132" />
+			<entry class="" argb="255,255,0,220" value="133" />
+			<entry class="" argb="255,255,0,220" value="134" />
+			<entry class="" argb="255,255,0,220" value="135" />
+			<entry class="" argb="255,255,0,220" value="136" />
+			<entry class="" argb="255,255,0,220" value="137" />
+			<entry class="" argb="255,255,0,220" value="138" />
+			<entry class="" argb="255,255,0,220" value="139" />
+			<entry class="" argb="255,255,0,220" value="140" />
+			<entry class="" argb="255,255,0,220" value="141" />
+			<entry class="" argb="255,255,0,220" value="142" />
+			<entry class="" argb="255,255,0,220" value="143" />
+			<entry class="" argb="255,255,0,180" value="144" />
+			<entry class="" argb="255,255,0,180" value="145" />
+			<entry class="" argb="255,255,0,180" value="146" />
+			<entry class="" argb="255,255,0,180" value="147" />
+			<entry class="" argb="255,255,0,180" value="148" />
+			<entry class="" argb="255,255,0,180" value="149" />
+			<entry class="" argb="255,255,0,180" value="150" />
+			<entry class="" argb="255,255,0,180" value="151" />
+			<entry class="" argb="255,255,0,180" value="152" />
+			<entry class="" argb="255,255,0,180" value="153" />
+			<entry class="" argb="255,255,0,180" value="154" />
+			<entry class="" argb="255,255,0,180" value="155" />
+			<entry class="" argb="255,255,0,180" value="156" />
+			<entry class="" argb="255,255,0,180" value="157" />
+			<entry class="" argb="255,255,0,180" value="158" />
+			<entry class="" argb="255,255,0,180" value="159" />
+			<entry class="" argb="255,255,0,128" value="160" />
+			<entry class="" argb="255,255,0,128" value="161" />
+			<entry class="" argb="255,255,0,128" value="162" />
+			<entry class="" argb="255,255,0,128" value="163" />
+			<entry class="" argb="255,255,0,128" value="164" />
+			<entry class="" argb="255,255,0,128" value="165" />
+			<entry class="" argb="255,255,0,128" value="166" />
+			<entry class="" argb="255,255,0,128" value="167" />
+			<entry class="" argb="255,255,0,128" value="168" />
+			<entry class="" argb="255,255,0,128" value="169" />
+			<entry class="" argb="255,255,0,128" value="170" />
+			<entry class="" argb="255,255,0,128" value="171" />
+			<entry class="" argb="255,255,0,128" value="172" />
+			<entry class="" argb="255,255,0,128" value="173" />
+			<entry class="" argb="255,255,0,128" value="174" />
+			<entry class="" argb="255,255,0,128" value="175" />
+			<entry class="" argb="255,255,0,64" value="176" />
+			<entry class="" argb="255,255,0,64" value="177" />
+			<entry class="" argb="255,255,0,64" value="178" />
+			<entry class="" argb="255,255,0,64" value="179" />
+			<entry class="" argb="255,255,0,64" value="180" />
+			<entry class="" argb="255,255,0,64" value="181" />
+			<entry class="" argb="255,255,0,64" value="182" />
+			<entry class="" argb="255,255,0,64" value="183" />
+			<entry class="" argb="255,255,0,64" value="184" />
+			<entry class="" argb="255,255,0,64" value="185" />
+			<entry class="" argb="255,255,0,64" value="186" />
+			<entry class="" argb="255,255,0,64" value="187" />
+			<entry class="" argb="255,255,0,64" value="188" />
+			<entry class="" argb="255,255,0,64" value="189" />
+			<entry class="" argb="255,255,0,64" value="190" />
+			<entry class="" argb="255,255,0,64" value="191" />
+			<entry class="" argb="255,255,0,0" value="192" />
+			<entry class="" argb="255,255,0,0" value="193" />
+			<entry class="" argb="255,255,0,0" value="194" />
+			<entry class="" argb="255,255,0,0" value="195" />
+			<entry class="" argb="255,255,0,0" value="196" />
+			<entry class="" argb="255,255,0,0" value="197" />
+			<entry class="" argb="255,255,0,0" value="198" />
+			<entry class="" argb="255,255,0,0" value="199" />
+			<entry class="" argb="255,255,0,0" value="200" />
+			<entry class="" argb="255,255,0,0" value="201" />
+			<entry class="" argb="255,255,0,0" value="202" />
+			<entry class="" argb="255,255,0,0" value="203" />
+			<entry class="" argb="255,255,0,0" value="204" />
+			<entry class="" argb="255,255,0,0" value="205" />
+			<entry class="" argb="255,255,0,0" value="206" />
+			<entry class="" argb="255,255,0,0" value="207" />
+			<entry class="" argb="255,220,190,190" value="208" />
+			<entry class="" argb="255,220,190,190" value="209" />
+			<entry class="" argb="255,220,190,190" value="210" />
+			<entry class="" argb="255,220,190,190" value="211" />
+			<entry class="" argb="255,220,190,190" value="212" />
+			<entry class="" argb="255,221,190,190" value="213" />
+			<entry class="" argb="255,221,190,190" value="214" />
+			<entry class="" argb="255,221,190,190" value="215" />
+			<entry class="" argb="255,221,190,190" value="216" />
+			<entry class="" argb="255,221,190,190" value="217" />
+			<entry class="" argb="255,222,190,190" value="218" />
+			<entry class="" argb="255,222,190,190" value="219" />
+			<entry class="" argb="255,222,190,190" value="220" />
+			<entry class="" argb="255,222,190,190" value="221" />
+			<entry class="" argb="255,222,190,190" value="222" />
+			<entry class="" argb="255,223,190,190" value="223" />
+			<entry class="" argb="255,220,220,220" value="224" />
+			<entry class="" argb="255,220,220,220" value="225" />
+			<entry class="" argb="255,220,220,220" value="226" />
+			<entry class="" argb="255,220,220,220" value="227" />
+			<entry class="" argb="255,220,220,220" value="228" />
+			<entry class="" argb="255,220,220,220" value="229" />
+			<entry class="" argb="255,220,220,220" value="230" />
+			<entry class="" argb="255,220,220,220" value="231" />
+			<entry class="" argb="255,220,220,220" value="232" />
+			<entry class="" argb="255,220,220,220" value="233" />
+			<entry class="" argb="255,220,220,220" value="234" />
+			<entry class="" argb="255,220,220,220" value="235" />
+			<entry class="" argb="255,220,220,220" value="236" />
+			<entry class="" argb="255,220,220,220" value="237" />
+			<entry class="" argb="255,220,220,220" value="238" />
+			<entry class="" argb="255,220,220,220" value="239" />
+			<entry class="" argb="255,255,255,255" value="240" />
+			<entry class="" argb="255,255,255,255" value="241" />
+			<entry class="" argb="255,255,255,255" value="242" />
+			<entry class="" argb="255,255,255,255" value="243" />
+			<entry class="" argb="255,255,255,255" value="244" />
+			<entry class="" argb="255,255,255,255" value="245" />
+			<entry class="" argb="255,255,255,255" value="246" />
+			<entry class="" argb="255,255,255,255" value="247" />
+			<entry class="" argb="255,255,255,255" value="248" />
+			<entry class="" argb="255,255,255,255" value="249" />
+			<entry class="" argb="255,255,255,255" value="250" />
+			<entry class="" argb="255,255,255,255" value="251" />
+			<entry class="" argb="255,255,255,255" value="252" />
+			<entry class="" argb="255,255,255,255" value="253" />
+			<entry class="" argb="255,255,255,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-green-red-yellow" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,2" value="1" />
+			<entry class="" argb="255,0,0,4" value="2" />
+			<entry class="" argb="255,0,0,6" value="3" />
+			<entry class="" argb="255,0,0,8" value="4" />
+			<entry class="" argb="255,0,0,10" value="5" />
+			<entry class="" argb="255,0,0,12" value="6" />
+			<entry class="" argb="255,0,0,14" value="7" />
+			<entry class="" argb="255,0,0,16" value="8" />
+			<entry class="" argb="255,0,0,18" value="9" />
+			<entry class="" argb="255,0,0,20" value="10" />
+			<entry class="" argb="255,0,0,22" value="11" />
+			<entry class="" argb="255,0,0,25" value="12" />
+			<entry class="" argb="255,0,0,27" value="13" />
+			<entry class="" argb="255,0,0,29" value="14" />
+			<entry class="" argb="255,0,0,31" value="15" />
+			<entry class="" argb="255,0,0,33" value="16" />
+			<entry class="" argb="255,0,0,35" value="17" />
+			<entry class="" argb="255,0,0,37" value="18" />
+			<entry class="" argb="255,0,0,39" value="19" />
+			<entry class="" argb="255,0,0,41" value="20" />
+			<entry class="" argb="255,0,0,43" value="21" />
+			<entry class="" argb="255,0,0,45" value="22" />
+			<entry class="" argb="255,0,0,47" value="23" />
+			<entry class="" argb="255,0,0,50" value="24" />
+			<entry class="" argb="255,0,0,52" value="25" />
+			<entry class="" argb="255,0,0,54" value="26" />
+			<entry class="" argb="255,0,0,56" value="27" />
+			<entry class="" argb="255,0,0,58" value="28" />
+			<entry class="" argb="255,0,0,60" value="29" />
+			<entry class="" argb="255,0,0,62" value="30" />
+			<entry class="" argb="255,0,0,64" value="31" />
+			<entry class="" argb="255,0,0,66" value="32" />
+			<entry class="" argb="255,0,3,68" value="33" />
+			<entry class="" argb="255,0,6,70" value="34" />
+			<entry class="" argb="255,0,9,72" value="35" />
+			<entry class="" argb="255,0,12,75" value="36" />
+			<entry class="" argb="255,0,15,77" value="37" />
+			<entry class="" argb="255,0,18,79" value="38" />
+			<entry class="" argb="255,0,21,81" value="39" />
+			<entry class="" argb="255,0,25,83" value="40" />
+			<entry class="" argb="255,0,28,85" value="41" />
+			<entry class="" argb="255,0,31,87" value="42" />
+			<entry class="" argb="255,0,34,89" value="43" />
+			<entry class="" argb="255,0,37,91" value="44" />
+			<entry class="" argb="255,0,40,93" value="45" />
+			<entry class="" argb="255,0,43,95" value="46" />
+			<entry class="" argb="255,0,46,97" value="47" />
+			<entry class="" argb="255,0,50,100" value="48" />
+			<entry class="" argb="255,0,53,100" value="49" />
+			<entry class="" argb="255,0,56,100" value="50" />
+			<entry class="" argb="255,0,59,100" value="51" />
+			<entry class="" argb="255,0,62,100" value="52" />
+			<entry class="" argb="255,0,65,100" value="53" />
+			<entry class="" argb="255,0,68,100" value="54" />
+			<entry class="" argb="255,0,71,100" value="55" />
+			<entry class="" argb="255,0,75,100" value="56" />
+			<entry class="" argb="255,0,78,100" value="57" />
+			<entry class="" argb="255,0,81,100" value="58" />
+			<entry class="" argb="255,0,84,100" value="59" />
+			<entry class="" argb="255,0,87,100" value="60" />
+			<entry class="" argb="255,0,90,100" value="61" />
+			<entry class="" argb="255,0,93,100" value="62" />
+			<entry class="" argb="255,0,96,100" value="63" />
+			<entry class="" argb="255,0,100,100" value="64" />
+			<entry class="" argb="255,0,103,100" value="65" />
+			<entry class="" argb="255,0,106,100" value="66" />
+			<entry class="" argb="255,0,109,100" value="67" />
+			<entry class="" argb="255,0,112,100" value="68" />
+			<entry class="" argb="255,0,115,100" value="69" />
+			<entry class="" argb="255,0,118,100" value="70" />
+			<entry class="" argb="255,0,121,100" value="71" />
+			<entry class="" argb="255,0,125,100" value="72" />
+			<entry class="" argb="255,0,128,100" value="73" />
+			<entry class="" argb="255,0,131,100" value="74" />
+			<entry class="" argb="255,0,134,100" value="75" />
+			<entry class="" argb="255,0,137,100" value="76" />
+			<entry class="" argb="255,0,140,100" value="77" />
+			<entry class="" argb="255,0,143,100" value="78" />
+			<entry class="" argb="255,0,146,100" value="79" />
+			<entry class="" argb="255,0,150,100" value="80" />
+			<entry class="" argb="255,0,150,96" value="81" />
+			<entry class="" argb="255,0,150,93" value="82" />
+			<entry class="" argb="255,0,150,90" value="83" />
+			<entry class="" argb="255,0,150,87" value="84" />
+			<entry class="" argb="255,0,150,84" value="85" />
+			<entry class="" argb="255,0,150,81" value="86" />
+			<entry class="" argb="255,0,150,78" value="87" />
+			<entry class="" argb="255,0,150,75" value="88" />
+			<entry class="" argb="255,0,150,71" value="89" />
+			<entry class="" argb="255,0,150,68" value="90" />
+			<entry class="" argb="255,0,150,65" value="91" />
+			<entry class="" argb="255,0,150,62" value="92" />
+			<entry class="" argb="255,0,150,59" value="93" />
+			<entry class="" argb="255,0,150,56" value="94" />
+			<entry class="" argb="255,0,150,53" value="95" />
+			<entry class="" argb="255,0,150,50" value="96" />
+			<entry class="" argb="255,0,149,46" value="97" />
+			<entry class="" argb="255,0,148,43" value="98" />
+			<entry class="" argb="255,0,148,40" value="99" />
+			<entry class="" argb="255,0,147,37" value="100" />
+			<entry class="" argb="255,0,146,34" value="101" />
+			<entry class="" argb="255,0,146,31" value="102" />
+			<entry class="" argb="255,0,145,28" value="103" />
+			<entry class="" argb="255,0,145,25" value="104" />
+			<entry class="" argb="255,0,144,21" value="105" />
+			<entry class="" argb="255,0,143,18" value="106" />
+			<entry class="" argb="255,0,143,15" value="107" />
+			<entry class="" argb="255,0,142,12" value="108" />
+			<entry class="" argb="255,0,141,9" value="109" />
+			<entry class="" argb="255,0,141,6" value="110" />
+			<entry class="" argb="255,0,140,3" value="111" />
+			<entry class="" argb="255,0,140,0" value="112" />
+			<entry class="" argb="255,7,137,0" value="113" />
+			<entry class="" argb="255,15,135,0" value="114" />
+			<entry class="" argb="255,22,132,0" value="115" />
+			<entry class="" argb="255,30,130,0" value="116" />
+			<entry class="" argb="255,37,127,0" value="117" />
+			<entry class="" argb="255,45,125,0" value="118" />
+			<entry class="" argb="255,52,122,0" value="119" />
+			<entry class="" argb="255,60,120,0" value="120" />
+			<entry class="" argb="255,67,117,0" value="121" />
+			<entry class="" argb="255,75,115,0" value="122" />
+			<entry class="" argb="255,82,112,0" value="123" />
+			<entry class="" argb="255,90,110,0" value="124" />
+			<entry class="" argb="255,97,107,0" value="125" />
+			<entry class="" argb="255,105,105,0" value="126" />
+			<entry class="" argb="255,112,102,0" value="127" />
+			<entry class="" argb="255,120,100,0" value="128" />
+			<entry class="" argb="255,125,93,0" value="129" />
+			<entry class="" argb="255,130,87,0" value="130" />
+			<entry class="" argb="255,135,81,0" value="131" />
+			<entry class="" argb="255,140,75,0" value="132" />
+			<entry class="" argb="255,145,68,0" value="133" />
+			<entry class="" argb="255,150,62,0" value="134" />
+			<entry class="" argb="255,155,56,0" value="135" />
+			<entry class="" argb="255,160,50,0" value="136" />
+			<entry class="" argb="255,165,43,0" value="137" />
+			<entry class="" argb="255,170,37,0" value="138" />
+			<entry class="" argb="255,175,31,0" value="139" />
+			<entry class="" argb="255,180,25,0" value="140" />
+			<entry class="" argb="255,185,18,0" value="141" />
+			<entry class="" argb="255,190,12,0" value="142" />
+			<entry class="" argb="255,195,6,0" value="143" />
+			<entry class="" argb="255,200,0,0" value="144" />
+			<entry class="" argb="255,200,2,0" value="145" />
+			<entry class="" argb="255,201,4,0" value="146" />
+			<entry class="" argb="255,201,6,0" value="147" />
+			<entry class="" argb="255,202,9,0" value="148" />
+			<entry class="" argb="255,202,11,0" value="149" />
+			<entry class="" argb="255,203,13,0" value="150" />
+			<entry class="" argb="255,203,16,0" value="151" />
+			<entry class="" argb="255,204,18,0" value="152" />
+			<entry class="" argb="255,204,20,0" value="153" />
+			<entry class="" argb="255,205,23,0" value="154" />
+			<entry class="" argb="255,205,25,0" value="155" />
+			<entry class="" argb="255,206,27,0" value="156" />
+			<entry class="" argb="255,206,29,0" value="157" />
+			<entry class="" argb="255,207,32,0" value="158" />
+			<entry class="" argb="255,207,34,0" value="159" />
+			<entry class="" argb="255,208,36,0" value="160" />
+			<entry class="" argb="255,208,39,0" value="161" />
+			<entry class="" argb="255,209,41,0" value="162" />
+			<entry class="" argb="255,209,43,0" value="163" />
+			<entry class="" argb="255,210,46,0" value="164" />
+			<entry class="" argb="255,210,48,0" value="165" />
+			<entry class="" argb="255,211,50,0" value="166" />
+			<entry class="" argb="255,211,53,0" value="167" />
+			<entry class="" argb="255,212,55,0" value="168" />
+			<entry class="" argb="255,212,57,0" value="169" />
+			<entry class="" argb="255,213,59,0" value="170" />
+			<entry class="" argb="255,213,62,0" value="171" />
+			<entry class="" argb="255,214,64,0" value="172" />
+			<entry class="" argb="255,214,66,0" value="173" />
+			<entry class="" argb="255,215,69,0" value="174" />
+			<entry class="" argb="255,215,71,0" value="175" />
+			<entry class="" argb="255,216,73,0" value="176" />
+			<entry class="" argb="255,216,76,0" value="177" />
+			<entry class="" argb="255,217,78,0" value="178" />
+			<entry class="" argb="255,217,80,0" value="179" />
+			<entry class="" argb="255,218,83,0" value="180" />
+			<entry class="" argb="255,218,85,0" value="181" />
+			<entry class="" argb="255,219,87,0" value="182" />
+			<entry class="" argb="255,219,89,0" value="183" />
+			<entry class="" argb="255,220,92,0" value="184" />
+			<entry class="" argb="255,220,94,0" value="185" />
+			<entry class="" argb="255,221,96,0" value="186" />
+			<entry class="" argb="255,221,99,0" value="187" />
+			<entry class="" argb="255,222,101,0" value="188" />
+			<entry class="" argb="255,222,103,0" value="189" />
+			<entry class="" argb="255,223,106,0" value="190" />
+			<entry class="" argb="255,223,108,0" value="191" />
+			<entry class="" argb="255,224,110,0" value="192" />
+			<entry class="" argb="255,224,113,0" value="193" />
+			<entry class="" argb="255,225,115,0" value="194" />
+			<entry class="" argb="255,225,117,0" value="195" />
+			<entry class="" argb="255,226,119,0" value="196" />
+			<entry class="" argb="255,226,122,0" value="197" />
+			<entry class="" argb="255,227,124,0" value="198" />
+			<entry class="" argb="255,227,126,0" value="199" />
+			<entry class="" argb="255,228,129,0" value="200" />
+			<entry class="" argb="255,228,131,0" value="201" />
+			<entry class="" argb="255,229,133,0" value="202" />
+			<entry class="" argb="255,229,136,0" value="203" />
+			<entry class="" argb="255,230,138,0" value="204" />
+			<entry class="" argb="255,230,140,0" value="205" />
+			<entry class="" argb="255,231,142,0" value="206" />
+			<entry class="" argb="255,231,145,0" value="207" />
+			<entry class="" argb="255,232,147,0" value="208" />
+			<entry class="" argb="255,232,149,0" value="209" />
+			<entry class="" argb="255,233,152,0" value="210" />
+			<entry class="" argb="255,233,154,0" value="211" />
+			<entry class="" argb="255,234,156,0" value="212" />
+			<entry class="" argb="255,234,159,0" value="213" />
+			<entry class="" argb="255,235,161,0" value="214" />
+			<entry class="" argb="255,235,163,0" value="215" />
+			<entry class="" argb="255,236,166,0" value="216" />
+			<entry class="" argb="255,236,168,0" value="217" />
+			<entry class="" argb="255,237,170,0" value="218" />
+			<entry class="" argb="255,237,172,0" value="219" />
+			<entry class="" argb="255,238,175,0" value="220" />
+			<entry class="" argb="255,238,177,0" value="221" />
+			<entry class="" argb="255,239,179,0" value="222" />
+			<entry class="" argb="255,239,182,0" value="223" />
+			<entry class="" argb="255,240,184,0" value="224" />
+			<entry class="" argb="255,240,186,0" value="225" />
+			<entry class="" argb="255,241,189,0" value="226" />
+			<entry class="" argb="255,241,191,0" value="227" />
+			<entry class="" argb="255,242,193,0" value="228" />
+			<entry class="" argb="255,242,196,0" value="229" />
+			<entry class="" argb="255,243,198,0" value="230" />
+			<entry class="" argb="255,243,200,0" value="231" />
+			<entry class="" argb="255,244,202,0" value="232" />
+			<entry class="" argb="255,244,205,0" value="233" />
+			<entry class="" argb="255,245,207,0" value="234" />
+			<entry class="" argb="255,245,209,0" value="235" />
+			<entry class="" argb="255,246,212,0" value="236" />
+			<entry class="" argb="255,246,214,0" value="237" />
+			<entry class="" argb="255,247,216,0" value="238" />
+			<entry class="" argb="255,247,219,0" value="239" />
+			<entry class="" argb="255,248,221,0" value="240" />
+			<entry class="" argb="255,248,223,0" value="241" />
+			<entry class="" argb="255,249,226,0" value="242" />
+			<entry class="" argb="255,249,228,0" value="243" />
+			<entry class="" argb="255,250,230,0" value="244" />
+			<entry class="" argb="255,250,232,0" value="245" />
+			<entry class="" argb="255,251,235,0" value="246" />
+			<entry class="" argb="255,251,237,0" value="247" />
+			<entry class="" argb="255,252,239,0" value="248" />
+			<entry class="" argb="255,252,242,0" value="249" />
+			<entry class="" argb="255,253,244,0" value="250" />
+			<entry class="" argb="255,253,246,0" value="251" />
+			<entry class="" argb="255,254,249,0" value="252" />
+			<entry class="" argb="255,254,251,0" value="253" />
+			<entry class="" argb="255,255,253,0" value="254" />
+			<entry class="" argb="255,255,255,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-pastel-red" interpolate="false">
+		<table>
+			<entry class="" argb="255,33,0,96" value="0" />
+			<entry class="" argb="255,33,0,96" value="1" />
+			<entry class="" argb="255,32,0,97" value="2" />
+			<entry class="" argb="255,31,0,99" value="3" />
+			<entry class="" argb="255,31,0,100" value="4" />
+			<entry class="" argb="255,30,0,101" value="5" />
+			<entry class="" argb="255,29,0,102" value="6" />
+			<entry class="" argb="255,28,0,104" value="7" />
+			<entry class="" argb="255,27,0,105" value="8" />
+			<entry class="" argb="255,26,0,106" value="9" />
+			<entry class="" argb="255,25,0,107" value="10" />
+			<entry class="" argb="255,24,0,108" value="11" />
+			<entry class="" argb="255,23,0,110" value="12" />
+			<entry class="" argb="255,22,0,111" value="13" />
+			<entry class="" argb="255,21,0,112" value="14" />
+			<entry class="" argb="255,20,0,113" value="15" />
+			<entry class="" argb="255,19,0,115" value="16" />
+			<entry class="" argb="255,17,0,116" value="17" />
+			<entry class="" argb="255,16,0,117" value="18" />
+			<entry class="" argb="255,15,0,118" value="19" />
+			<entry class="" argb="255,14,0,119" value="20" />
+			<entry class="" argb="255,12,0,121" value="21" />
+			<entry class="" argb="255,11,0,122" value="22" />
+			<entry class="" argb="255,13,0,123" value="23" />
+			<entry class="" argb="255,8,0,124" value="24" />
+			<entry class="" argb="255,7,0,125" value="25" />
+			<entry class="" argb="255,5,0,127" value="26" />
+			<entry class="" argb="255,4,0,128" value="27" />
+			<entry class="" argb="255,2,0,129" value="28" />
+			<entry class="" argb="255,1,0,130" value="29" />
+			<entry class="" argb="255,0,0,132" value="30" />
+			<entry class="" argb="255,0,1,133" value="31" />
+			<entry class="" argb="255,0,3,134" value="32" />
+			<entry class="" argb="255,0,5,135" value="33" />
+			<entry class="" argb="255,0,6,136" value="34" />
+			<entry class="" argb="255,0,8,138" value="35" />
+			<entry class="" argb="255,0,13,139" value="36" />
+			<entry class="" argb="255,0,12,140" value="37" />
+			<entry class="" argb="255,0,13,141" value="38" />
+			<entry class="" argb="255,0,15,143" value="39" />
+			<entry class="" argb="255,0,17,144" value="40" />
+			<entry class="" argb="255,0,19,145" value="41" />
+			<entry class="" argb="255,0,21,146" value="42" />
+			<entry class="" argb="255,0,23,147" value="43" />
+			<entry class="" argb="255,0,25,149" value="44" />
+			<entry class="" argb="255,0,27,150" value="45" />
+			<entry class="" argb="255,0,29,151" value="46" />
+			<entry class="" argb="255,0,31,152" value="47" />
+			<entry class="" argb="255,0,33,154" value="48" />
+			<entry class="" argb="255,0,35,155" value="49" />
+			<entry class="" argb="255,0,37,156" value="50" />
+			<entry class="" argb="255,0,39,157" value="51" />
+			<entry class="" argb="255,0,42,158" value="52" />
+			<entry class="" argb="255,0,44,160" value="53" />
+			<entry class="" argb="255,0,46,161" value="54" />
+			<entry class="" argb="255,0,49,162" value="55" />
+			<entry class="" argb="255,0,51,163" value="56" />
+			<entry class="" argb="255,0,53,164" value="57" />
+			<entry class="" argb="255,0,56,166" value="58" />
+			<entry class="" argb="255,0,58,167" value="59" />
+			<entry class="" argb="255,0,60,168" value="60" />
+			<entry class="" argb="255,0,63,169" value="61" />
+			<entry class="" argb="255,0,65,171" value="62" />
+			<entry class="" argb="255,0,68,172" value="63" />
+			<entry class="" argb="255,0,71,173" value="64" />
+			<entry class="" argb="255,0,73,174" value="65" />
+			<entry class="" argb="255,0,76,175" value="66" />
+			<entry class="" argb="255,0,78,177" value="67" />
+			<entry class="" argb="255,0,81,178" value="68" />
+			<entry class="" argb="255,0,84,179" value="69" />
+			<entry class="" argb="255,0,87,180" value="70" />
+			<entry class="" argb="255,0,89,182" value="71" />
+			<entry class="" argb="255,0,92,183" value="72" />
+			<entry class="" argb="255,0,95,184" value="73" />
+			<entry class="" argb="255,0,98,185" value="74" />
+			<entry class="" argb="255,0,101,186" value="75" />
+			<entry class="" argb="255,0,104,188" value="76" />
+			<entry class="" argb="255,0,107,189" value="77" />
+			<entry class="" argb="255,0,110,190" value="78" />
+			<entry class="" argb="255,0,113,191" value="79" />
+			<entry class="" argb="255,0,116,193" value="80" />
+			<entry class="" argb="255,0,119,194" value="81" />
+			<entry class="" argb="255,0,122,195" value="82" />
+			<entry class="" argb="255,0,125,196" value="83" />
+			<entry class="" argb="255,0,128,197" value="84" />
+			<entry class="" argb="255,0,131,199" value="85" />
+			<entry class="" argb="255,0,134,200" value="86" />
+			<entry class="" argb="255,0,138,201" value="87" />
+			<entry class="" argb="255,0,141,202" value="88" />
+			<entry class="" argb="255,0,144,203" value="89" />
+			<entry class="" argb="255,0,148,205" value="90" />
+			<entry class="" argb="255,0,151,206" value="91" />
+			<entry class="" argb="255,0,154,207" value="92" />
+			<entry class="" argb="255,0,158,208" value="93" />
+			<entry class="" argb="255,0,161,210" value="94" />
+			<entry class="" argb="255,0,165,211" value="95" />
+			<entry class="" argb="255,0,168,212" value="96" />
+			<entry class="" argb="255,0,172,213" value="97" />
+			<entry class="" argb="255,0,175,214" value="98" />
+			<entry class="" argb="255,0,179,216" value="99" />
+			<entry class="" argb="255,0,182,217" value="100" />
+			<entry class="" argb="255,0,186,218" value="101" />
+			<entry class="" argb="255,0,190,219" value="102" />
+			<entry class="" argb="255,0,193,221" value="103" />
+			<entry class="" argb="255,0,197,222" value="104" />
+			<entry class="" argb="255,0,201,223" value="105" />
+			<entry class="" argb="255,0,205,224" value="106" />
+			<entry class="" argb="255,0,209,225" value="107" />
+			<entry class="" argb="255,0,212,227" value="108" />
+			<entry class="" argb="255,0,216,228" value="109" />
+			<entry class="" argb="255,0,220,229" value="110" />
+			<entry class="" argb="255,0,224,230" value="111" />
+			<entry class="" argb="255,0,228,232" value="112" />
+			<entry class="" argb="255,0,232,233" value="113" />
+			<entry class="" argb="255,0,234,232" value="114" />
+			<entry class="" argb="255,0,235,230" value="115" />
+			<entry class="" argb="255,0,236,229" value="116" />
+			<entry class="" argb="255,0,238,227" value="117" />
+			<entry class="" argb="255,0,239,225" value="118" />
+			<entry class="" argb="255,0,240,223" value="119" />
+			<entry class="" argb="255,0,241,222" value="120" />
+			<entry class="" argb="255,0,243,220" value="121" />
+			<entry class="" argb="255,0,244,218" value="122" />
+			<entry class="" argb="255,0,245,216" value="123" />
+			<entry class="" argb="255,0,246,214" value="124" />
+			<entry class="" argb="255,0,247,212" value="125" />
+			<entry class="" argb="255,0,249,210" value="126" />
+			<entry class="" argb="255,0,249,208" value="127" />
+			<entry class="" argb="255,0,246,149" value="128" />
+			<entry class="" argb="255,0,244,142" value="129" />
+			<entry class="" argb="255,0,241,135" value="130" />
+			<entry class="" argb="255,0,237,127" value="131" />
+			<entry class="" argb="255,2,232,118" value="132" />
+			<entry class="" argb="255,4,227,111" value="133" />
+			<entry class="" argb="255,5,223,103" value="134" />
+			<entry class="" argb="255,7,218,95" value="135" />
+			<entry class="" argb="255,8,214,88" value="136" />
+			<entry class="" argb="255,13,209,81" value="137" />
+			<entry class="" argb="255,11,205,74" value="138" />
+			<entry class="" argb="255,13,201,67" value="139" />
+			<entry class="" argb="255,14,196,60" value="140" />
+			<entry class="" argb="255,15,192,53" value="141" />
+			<entry class="" argb="255,17,188,47" value="142" />
+			<entry class="" argb="255,18,184,40" value="143" />
+			<entry class="" argb="255,19,180,34" value="144" />
+			<entry class="" argb="255,20,175,28" value="145" />
+			<entry class="" argb="255,21,171,22" value="146" />
+			<entry class="" argb="255,29,167,22" value="147" />
+			<entry class="" argb="255,36,163,23" value="148" />
+			<entry class="" argb="255,42,160,24" value="149" />
+			<entry class="" argb="255,48,156,25" value="150" />
+			<entry class="" argb="255,53,152,26" value="151" />
+			<entry class="" argb="255,58,148,27" value="152" />
+			<entry class="" argb="255,61,144,28" value="153" />
+			<entry class="" argb="255,65,141,28" value="154" />
+			<entry class="" argb="255,68,137,29" value="155" />
+			<entry class="" argb="255,70,133,30" value="156" />
+			<entry class="" argb="255,72,130,30" value="157" />
+			<entry class="" argb="255,73,126,31" value="158" />
+			<entry class="" argb="255,74,123,31" value="159" />
+			<entry class="" argb="255,74,119,32" value="160" />
+			<entry class="" argb="255,74,116,32" value="161" />
+			<entry class="" argb="255,75,116,29" value="162" />
+			<entry class="" argb="255,75,115,28" value="163" />
+			<entry class="" argb="255,76,113,26" value="164" />
+			<entry class="" argb="255,76,112,25" value="165" />
+			<entry class="" argb="255,76,110,23" value="166" />
+			<entry class="" argb="255,77,109,22" value="167" />
+			<entry class="" argb="255,76,104,20" value="168" />
+			<entry class="" argb="255,77,104,18" value="169" />
+			<entry class="" argb="255,78,103,17" value="170" />
+			<entry class="" argb="255,79,102,16" value="171" />
+			<entry class="" argb="255,80,101,15" value="172" />
+			<entry class="" argb="255,81,100,14" value="173" />
+			<entry class="" argb="255,83,99,13" value="174" />
+			<entry class="" argb="255,84,98,12" value="175" />
+			<entry class="" argb="255,85,97,11" value="176" />
+			<entry class="" argb="255,86,96,13" value="177" />
+			<entry class="" argb="255,88,95,9" value="178" />
+			<entry class="" argb="255,89,94,8" value="179" />
+			<entry class="" argb="255,91,93,7" value="180" />
+			<entry class="" argb="255,92,92,6" value="181" />
+			<entry class="" argb="255,91,88,5" value="182" />
+			<entry class="" argb="255,94,88,5" value="183" />
+			<entry class="" argb="255,96,88,4" value="184" />
+			<entry class="" argb="255,98,87,3" value="185" />
+			<entry class="" argb="255,100,86,3" value="186" />
+			<entry class="" argb="255,102,85,2" value="187" />
+			<entry class="" argb="255,104,85,1" value="188" />
+			<entry class="" argb="255,106,84,0" value="189" />
+			<entry class="" argb="255,108,83,0" value="190" />
+			<entry class="" argb="255,109,82,0" value="191" />
+			<entry class="" argb="255,111,80,0" value="192" />
+			<entry class="" argb="255,112,79,0" value="193" />
+			<entry class="" argb="255,113,78,0" value="194" />
+			<entry class="" argb="255,115,76,0" value="195" />
+			<entry class="" argb="255,116,75,0" value="196" />
+			<entry class="" argb="255,117,74,0" value="197" />
+			<entry class="" argb="255,119,73,0" value="198" />
+			<entry class="" argb="255,120,71,0" value="199" />
+			<entry class="" argb="255,121,70,0" value="200" />
+			<entry class="" argb="255,123,69,0" value="201" />
+			<entry class="" argb="255,124,68,0" value="202" />
+			<entry class="" argb="255,125,67,0" value="203" />
+			<entry class="" argb="255,127,66,0" value="204" />
+			<entry class="" argb="255,128,64,0" value="205" />
+			<entry class="" argb="255,129,63,0" value="206" />
+			<entry class="" argb="255,131,61,0" value="207" />
+			<entry class="" argb="255,132,58,0" value="208" />
+			<entry class="" argb="255,133,56,0" value="209" />
+			<entry class="" argb="255,135,54,0" value="210" />
+			<entry class="" argb="255,136,52,0" value="211" />
+			<entry class="" argb="255,137,49,0" value="212" />
+			<entry class="" argb="255,138,47,0" value="213" />
+			<entry class="" argb="255,140,45,0" value="214" />
+			<entry class="" argb="255,141,43,0" value="215" />
+			<entry class="" argb="255,142,41,0" value="216" />
+			<entry class="" argb="255,144,40,0" value="217" />
+			<entry class="" argb="255,145,38,0" value="218" />
+			<entry class="" argb="255,146,36,0" value="219" />
+			<entry class="" argb="255,148,34,0" value="220" />
+			<entry class="" argb="255,149,33,0" value="221" />
+			<entry class="" argb="255,150,31,0" value="222" />
+			<entry class="" argb="255,152,29,0" value="223" />
+			<entry class="" argb="255,153,28,0" value="224" />
+			<entry class="" argb="255,154,26,0" value="225" />
+			<entry class="" argb="255,156,25,0" value="226" />
+			<entry class="" argb="255,157,23,0" value="227" />
+			<entry class="" argb="255,158,22,0" value="228" />
+			<entry class="" argb="255,160,21,0" value="229" />
+			<entry class="" argb="255,161,19,0" value="230" />
+			<entry class="" argb="255,162,18,0" value="231" />
+			<entry class="" argb="255,164,17,0" value="232" />
+			<entry class="" argb="255,165,16,0" value="233" />
+			<entry class="" argb="255,166,14,0" value="234" />
+			<entry class="" argb="255,168,13,0" value="235" />
+			<entry class="" argb="255,169,12,0" value="236" />
+			<entry class="" argb="255,170,11,0" value="237" />
+			<entry class="" argb="255,172,13,0" value="238" />
+			<entry class="" argb="255,173,9,0" value="239" />
+			<entry class="" argb="255,174,8,0" value="240" />
+			<entry class="" argb="255,175,7,0" value="241" />
+			<entry class="" argb="255,177,7,0" value="242" />
+			<entry class="" argb="255,178,6,0" value="243" />
+			<entry class="" argb="255,179,5,0" value="244" />
+			<entry class="" argb="255,181,4,0" value="245" />
+			<entry class="" argb="255,182,4,0" value="246" />
+			<entry class="" argb="255,183,3,0" value="247" />
+			<entry class="" argb="255,185,2,0" value="248" />
+			<entry class="" argb="255,186,2,0" value="249" />
+			<entry class="" argb="255,187,1,0" value="250" />
+			<entry class="" argb="255,189,1,0" value="251" />
+			<entry class="" argb="255,190,0,0" value="252" />
+			<entry class="" argb="255,191,0,0" value="253" />
+			<entry class="" argb="255,193,0,0" value="254" />
+			<entry class="" argb="255,193,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-red" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,1,1" value="1" />
+			<entry class="" argb="255,0,2,2" value="2" />
+			<entry class="" argb="255,0,3,3" value="3" />
+			<entry class="" argb="255,0,4,4" value="4" />
+			<entry class="" argb="255,0,8,8" value="5" />
+			<entry class="" argb="255,0,12,12" value="6" />
+			<entry class="" argb="255,0,16,16" value="7" />
+			<entry class="" argb="255,0,21,21" value="8" />
+			<entry class="" argb="255,0,25,25" value="9" />
+			<entry class="" argb="255,0,29,29" value="10" />
+			<entry class="" argb="255,0,33,33" value="11" />
+			<entry class="" argb="255,0,38,38" value="12" />
+			<entry class="" argb="255,0,42,42" value="13" />
+			<entry class="" argb="255,0,46,46" value="14" />
+			<entry class="" argb="255,0,50,50" value="15" />
+			<entry class="" argb="255,0,55,55" value="16" />
+			<entry class="" argb="255,0,59,59" value="17" />
+			<entry class="" argb="255,0,63,63" value="18" />
+			<entry class="" argb="255,0,67,67" value="19" />
+			<entry class="" argb="255,0,72,72" value="20" />
+			<entry class="" argb="255,0,76,76" value="21" />
+			<entry class="" argb="255,0,80,80" value="22" />
+			<entry class="" argb="255,0,84,84" value="23" />
+			<entry class="" argb="255,0,89,89" value="24" />
+			<entry class="" argb="255,0,93,93" value="25" />
+			<entry class="" argb="255,0,97,97" value="26" />
+			<entry class="" argb="255,0,101,101" value="27" />
+			<entry class="" argb="255,0,106,106" value="28" />
+			<entry class="" argb="255,0,110,110" value="29" />
+			<entry class="" argb="255,0,114,114" value="30" />
+			<entry class="" argb="255,0,118,118" value="31" />
+			<entry class="" argb="255,0,123,123" value="32" />
+			<entry class="" argb="255,0,127,127" value="33" />
+			<entry class="" argb="255,0,131,131" value="34" />
+			<entry class="" argb="255,0,135,135" value="35" />
+			<entry class="" argb="255,0,140,140" value="36" />
+			<entry class="" argb="255,0,144,144" value="37" />
+			<entry class="" argb="255,0,148,148" value="38" />
+			<entry class="" argb="255,0,152,152" value="39" />
+			<entry class="" argb="255,0,157,157" value="40" />
+			<entry class="" argb="255,0,161,161" value="41" />
+			<entry class="" argb="255,0,165,165" value="42" />
+			<entry class="" argb="255,0,169,169" value="43" />
+			<entry class="" argb="255,0,174,174" value="44" />
+			<entry class="" argb="255,0,178,178" value="45" />
+			<entry class="" argb="255,0,182,182" value="46" />
+			<entry class="" argb="255,0,186,186" value="47" />
+			<entry class="" argb="255,0,191,191" value="48" />
+			<entry class="" argb="255,0,195,195" value="49" />
+			<entry class="" argb="255,0,199,199" value="50" />
+			<entry class="" argb="255,0,203,203" value="51" />
+			<entry class="" argb="255,0,208,208" value="52" />
+			<entry class="" argb="255,0,212,212" value="53" />
+			<entry class="" argb="255,0,216,216" value="54" />
+			<entry class="" argb="255,0,220,220" value="55" />
+			<entry class="" argb="255,0,225,225" value="56" />
+			<entry class="" argb="255,0,229,229" value="57" />
+			<entry class="" argb="255,0,233,233" value="58" />
+			<entry class="" argb="255,0,237,237" value="59" />
+			<entry class="" argb="255,0,242,242" value="60" />
+			<entry class="" argb="255,0,246,246" value="61" />
+			<entry class="" argb="255,0,250,250" value="62" />
+			<entry class="" argb="255,0,255,255" value="63" />
+			<entry class="" argb="255,0,255,255" value="64" />
+			<entry class="" argb="255,0,251,255" value="65" />
+			<entry class="" argb="255,0,247,255" value="66" />
+			<entry class="" argb="255,0,243,255" value="67" />
+			<entry class="" argb="255,0,239,255" value="68" />
+			<entry class="" argb="255,0,235,255" value="69" />
+			<entry class="" argb="255,0,231,255" value="70" />
+			<entry class="" argb="255,0,227,255" value="71" />
+			<entry class="" argb="255,0,223,255" value="72" />
+			<entry class="" argb="255,0,219,255" value="73" />
+			<entry class="" argb="255,0,215,255" value="74" />
+			<entry class="" argb="255,0,211,255" value="75" />
+			<entry class="" argb="255,0,207,255" value="76" />
+			<entry class="" argb="255,0,203,255" value="77" />
+			<entry class="" argb="255,0,199,255" value="78" />
+			<entry class="" argb="255,0,195,255" value="79" />
+			<entry class="" argb="255,0,191,255" value="80" />
+			<entry class="" argb="255,0,187,255" value="81" />
+			<entry class="" argb="255,0,183,255" value="82" />
+			<entry class="" argb="255,0,179,255" value="83" />
+			<entry class="" argb="255,0,175,255" value="84" />
+			<entry class="" argb="255,0,170,255" value="85" />
+			<entry class="" argb="255,0,166,255" value="86" />
+			<entry class="" argb="255,0,162,255" value="87" />
+			<entry class="" argb="255,0,158,255" value="88" />
+			<entry class="" argb="255,0,154,255" value="89" />
+			<entry class="" argb="255,0,150,255" value="90" />
+			<entry class="" argb="255,0,146,255" value="91" />
+			<entry class="" argb="255,0,142,255" value="92" />
+			<entry class="" argb="255,0,138,255" value="93" />
+			<entry class="" argb="255,0,134,255" value="94" />
+			<entry class="" argb="255,0,130,255" value="95" />
+			<entry class="" argb="255,0,126,255" value="96" />
+			<entry class="" argb="255,0,122,255" value="97" />
+			<entry class="" argb="255,0,118,255" value="98" />
+			<entry class="" argb="255,0,114,255" value="99" />
+			<entry class="" argb="255,0,110,255" value="100" />
+			<entry class="" argb="255,0,106,255" value="101" />
+			<entry class="" argb="255,0,102,255" value="102" />
+			<entry class="" argb="255,0,98,255" value="103" />
+			<entry class="" argb="255,0,94,255" value="104" />
+			<entry class="" argb="255,0,90,255" value="105" />
+			<entry class="" argb="255,0,85,255" value="106" />
+			<entry class="" argb="255,0,81,255" value="107" />
+			<entry class="" argb="255,0,77,255" value="108" />
+			<entry class="" argb="255,0,73,255" value="109" />
+			<entry class="" argb="255,0,69,255" value="110" />
+			<entry class="" argb="255,0,65,255" value="111" />
+			<entry class="" argb="255,0,61,255" value="112" />
+			<entry class="" argb="255,0,57,255" value="113" />
+			<entry class="" argb="255,0,53,255" value="114" />
+			<entry class="" argb="255,0,49,255" value="115" />
+			<entry class="" argb="255,0,45,255" value="116" />
+			<entry class="" argb="255,0,41,255" value="117" />
+			<entry class="" argb="255,0,37,255" value="118" />
+			<entry class="" argb="255,0,33,255" value="119" />
+			<entry class="" argb="255,0,29,255" value="120" />
+			<entry class="" argb="255,0,25,255" value="121" />
+			<entry class="" argb="255,0,21,255" value="122" />
+			<entry class="" argb="255,0,17,255" value="123" />
+			<entry class="" argb="255,0,13,255" value="124" />
+			<entry class="" argb="255,0,9,255" value="125" />
+			<entry class="" argb="255,0,5,255" value="126" />
+			<entry class="" argb="255,0,0,255" value="127" />
+			<entry class="" argb="255,0,0,255" value="128" />
+			<entry class="" argb="255,4,0,255" value="129" />
+			<entry class="" argb="255,8,0,255" value="130" />
+			<entry class="" argb="255,12,0,255" value="131" />
+			<entry class="" argb="255,16,0,255" value="132" />
+			<entry class="" argb="255,20,0,255" value="133" />
+			<entry class="" argb="255,24,0,255" value="134" />
+			<entry class="" argb="255,28,0,255" value="135" />
+			<entry class="" argb="255,32,0,255" value="136" />
+			<entry class="" argb="255,36,0,255" value="137" />
+			<entry class="" argb="255,40,0,255" value="138" />
+			<entry class="" argb="255,44,0,255" value="139" />
+			<entry class="" argb="255,48,0,255" value="140" />
+			<entry class="" argb="255,52,0,255" value="141" />
+			<entry class="" argb="255,56,0,255" value="142" />
+			<entry class="" argb="255,60,0,255" value="143" />
+			<entry class="" argb="255,64,0,255" value="144" />
+			<entry class="" argb="255,68,0,255" value="145" />
+			<entry class="" argb="255,72,0,255" value="146" />
+			<entry class="" argb="255,76,0,255" value="147" />
+			<entry class="" argb="255,80,0,255" value="148" />
+			<entry class="" argb="255,85,0,255" value="149" />
+			<entry class="" argb="255,89,0,255" value="150" />
+			<entry class="" argb="255,93,0,255" value="151" />
+			<entry class="" argb="255,97,0,255" value="152" />
+			<entry class="" argb="255,101,0,255" value="153" />
+			<entry class="" argb="255,105,0,255" value="154" />
+			<entry class="" argb="255,109,0,255" value="155" />
+			<entry class="" argb="255,113,0,255" value="156" />
+			<entry class="" argb="255,117,0,255" value="157" />
+			<entry class="" argb="255,121,0,255" value="158" />
+			<entry class="" argb="255,125,0,255" value="159" />
+			<entry class="" argb="255,129,0,255" value="160" />
+			<entry class="" argb="255,133,0,255" value="161" />
+			<entry class="" argb="255,137,0,255" value="162" />
+			<entry class="" argb="255,141,0,255" value="163" />
+			<entry class="" argb="255,145,0,255" value="164" />
+			<entry class="" argb="255,149,0,255" value="165" />
+			<entry class="" argb="255,153,0,255" value="166" />
+			<entry class="" argb="255,157,0,255" value="167" />
+			<entry class="" argb="255,161,0,255" value="168" />
+			<entry class="" argb="255,165,0,255" value="169" />
+			<entry class="" argb="255,170,0,255" value="170" />
+			<entry class="" argb="255,174,0,255" value="171" />
+			<entry class="" argb="255,178,0,255" value="172" />
+			<entry class="" argb="255,182,0,255" value="173" />
+			<entry class="" argb="255,186,0,255" value="174" />
+			<entry class="" argb="255,190,0,255" value="175" />
+			<entry class="" argb="255,194,0,255" value="176" />
+			<entry class="" argb="255,198,0,255" value="177" />
+			<entry class="" argb="255,202,0,255" value="178" />
+			<entry class="" argb="255,206,0,255" value="179" />
+			<entry class="" argb="255,210,0,255" value="180" />
+			<entry class="" argb="255,214,0,255" value="181" />
+			<entry class="" argb="255,218,0,255" value="182" />
+			<entry class="" argb="255,222,0,255" value="183" />
+			<entry class="" argb="255,226,0,255" value="184" />
+			<entry class="" argb="255,230,0,255" value="185" />
+			<entry class="" argb="255,234,0,255" value="186" />
+			<entry class="" argb="255,238,0,255" value="187" />
+			<entry class="" argb="255,242,0,255" value="188" />
+			<entry class="" argb="255,246,0,255" value="189" />
+			<entry class="" argb="255,250,0,255" value="190" />
+			<entry class="" argb="255,255,0,255" value="191" />
+			<entry class="" argb="255,255,0,255" value="192" />
+			<entry class="" argb="255,255,0,251" value="193" />
+			<entry class="" argb="255,255,0,247" value="194" />
+			<entry class="" argb="255,255,0,243" value="195" />
+			<entry class="" argb="255,255,0,239" value="196" />
+			<entry class="" argb="255,255,0,235" value="197" />
+			<entry class="" argb="255,255,0,231" value="198" />
+			<entry class="" argb="255,255,0,227" value="199" />
+			<entry class="" argb="255,255,0,223" value="200" />
+			<entry class="" argb="255,255,0,218" value="201" />
+			<entry class="" argb="255,255,0,214" value="202" />
+			<entry class="" argb="255,255,0,210" value="203" />
+			<entry class="" argb="255,255,0,206" value="204" />
+			<entry class="" argb="255,255,0,202" value="205" />
+			<entry class="" argb="255,255,0,198" value="206" />
+			<entry class="" argb="255,255,0,194" value="207" />
+			<entry class="" argb="255,255,0,190" value="208" />
+			<entry class="" argb="255,255,0,186" value="209" />
+			<entry class="" argb="255,255,0,181" value="210" />
+			<entry class="" argb="255,255,0,177" value="211" />
+			<entry class="" argb="255,255,0,173" value="212" />
+			<entry class="" argb="255,255,0,169" value="213" />
+			<entry class="" argb="255,255,0,165" value="214" />
+			<entry class="" argb="255,255,0,161" value="215" />
+			<entry class="" argb="255,255,0,157" value="216" />
+			<entry class="" argb="255,255,0,153" value="217" />
+			<entry class="" argb="255,255,0,149" value="218" />
+			<entry class="" argb="255,255,0,144" value="219" />
+			<entry class="" argb="255,255,0,140" value="220" />
+			<entry class="" argb="255,255,0,136" value="221" />
+			<entry class="" argb="255,255,0,132" value="222" />
+			<entry class="" argb="255,255,0,128" value="223" />
+			<entry class="" argb="255,255,0,124" value="224" />
+			<entry class="" argb="255,255,0,120" value="225" />
+			<entry class="" argb="255,255,0,116" value="226" />
+			<entry class="" argb="255,255,0,112" value="227" />
+			<entry class="" argb="255,255,0,107" value="228" />
+			<entry class="" argb="255,255,0,103" value="229" />
+			<entry class="" argb="255,255,0,99" value="230" />
+			<entry class="" argb="255,255,0,95" value="231" />
+			<entry class="" argb="255,255,0,91" value="232" />
+			<entry class="" argb="255,255,0,87" value="233" />
+			<entry class="" argb="255,255,0,83" value="234" />
+			<entry class="" argb="255,255,0,79" value="235" />
+			<entry class="" argb="255,255,0,75" value="236" />
+			<entry class="" argb="255,255,0,70" value="237" />
+			<entry class="" argb="255,255,0,66" value="238" />
+			<entry class="" argb="255,255,0,62" value="239" />
+			<entry class="" argb="255,255,0,58" value="240" />
+			<entry class="" argb="255,255,0,54" value="241" />
+			<entry class="" argb="255,255,0,50" value="242" />
+			<entry class="" argb="255,255,0,46" value="243" />
+			<entry class="" argb="255,255,0,42" value="244" />
+			<entry class="" argb="255,255,0,38" value="245" />
+			<entry class="" argb="255,255,0,33" value="246" />
+			<entry class="" argb="255,255,0,29" value="247" />
+			<entry class="" argb="255,255,0,25" value="248" />
+			<entry class="" argb="255,255,0,21" value="249" />
+			<entry class="" argb="255,255,0,17" value="250" />
+			<entry class="" argb="255,255,0,13" value="251" />
+			<entry class="" argb="255,255,0,9" value="252" />
+			<entry class="" argb="255,255,0,5" value="253" />
+			<entry class="" argb="255,255,0,0" value="254" />
+			<entry class="" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="blue-waves" interpolate="false">
+		<table>
+			<entry class="" argb="255,82,0,214" value="0" />
+			<entry class="" argb="255,82,0,214" value="1" />
+			<entry class="" argb="255,77,1,202" value="2" />
+			<entry class="" argb="255,73,1,189" value="3" />
+			<entry class="" argb="255,68,2,177" value="4" />
+			<entry class="" argb="255,63,2,165" value="5" />
+			<entry class="" argb="255,59,3,153" value="6" />
+			<entry class="" argb="255,54,4,141" value="7" />
+			<entry class="" argb="255,50,4,129" value="8" />
+			<entry class="" argb="255,46,5,118" value="9" />
+			<entry class="" argb="255,42,6,107" value="10" />
+			<entry class="" argb="255,38,6,96" value="11" />
+			<entry class="" argb="255,34,7,85" value="12" />
+			<entry class="" argb="255,30,8,75" value="13" />
+			<entry class="" argb="255,26,9,65" value="14" />
+			<entry class="" argb="255,23,13,56" value="15" />
+			<entry class="" argb="255,19,11,47" value="16" />
+			<entry class="" argb="255,16,12,38" value="17" />
+			<entry class="" argb="255,13,13,30" value="18" />
+			<entry class="" argb="255,13,15,22" value="19" />
+			<entry class="" argb="255,8,16,15" value="20" />
+			<entry class="" argb="255,5,17,9" value="21" />
+			<entry class="" argb="255,3,19,2" value="22" />
+			<entry class="" argb="255,1,20,2" value="23" />
+			<entry class="" argb="255,0,22,7" value="24" />
+			<entry class="" argb="255,2,23,12" value="25" />
+			<entry class="" argb="255,3,25,16" value="26" />
+			<entry class="" argb="255,5,27,19" value="27" />
+			<entry class="" argb="255,6,28,22" value="28" />
+			<entry class="" argb="255,6,30,24" value="29" />
+			<entry class="" argb="255,7,32,25" value="30" />
+			<entry class="" argb="255,7,34,26" value="31" />
+			<entry class="" argb="255,8,35,27" value="32" />
+			<entry class="" argb="255,7,37,26" value="33" />
+			<entry class="" argb="255,7,39,25" value="34" />
+			<entry class="" argb="255,6,41,24" value="35" />
+			<entry class="" argb="255,6,43,22" value="36" />
+			<entry class="" argb="255,5,45,19" value="37" />
+			<entry class="" argb="255,3,46,16" value="38" />
+			<entry class="" argb="255,2,48,12" value="39" />
+			<entry class="" argb="255,0,50,7" value="40" />
+			<entry class="" argb="255,1,51,2" value="41" />
+			<entry class="" argb="255,3,53,2" value="42" />
+			<entry class="" argb="255,5,55,9" value="43" />
+			<entry class="" argb="255,8,56,15" value="44" />
+			<entry class="" argb="255,13,58,22" value="45" />
+			<entry class="" argb="255,13,59,30" value="46" />
+			<entry class="" argb="255,16,60,38" value="47" />
+			<entry class="" argb="255,19,61,47" value="48" />
+			<entry class="" argb="255,23,62,56" value="49" />
+			<entry class="" argb="255,26,63,65" value="50" />
+			<entry class="" argb="255,30,64,75" value="51" />
+			<entry class="" argb="255,34,65,85" value="52" />
+			<entry class="" argb="255,38,66,96" value="53" />
+			<entry class="" argb="255,42,66,107" value="54" />
+			<entry class="" argb="255,46,67,118" value="55" />
+			<entry class="" argb="255,50,67,129" value="56" />
+			<entry class="" argb="255,54,67,141" value="57" />
+			<entry class="" argb="255,59,67,153" value="58" />
+			<entry class="" argb="255,63,67,165" value="59" />
+			<entry class="" argb="255,68,67,177" value="60" />
+			<entry class="" argb="255,73,67,189" value="61" />
+			<entry class="" argb="255,77,67,202" value="62" />
+			<entry class="" argb="255,82,66,214" value="63" />
+			<entry class="" argb="255,87,66,227" value="64" />
+			<entry class="" argb="255,91,65,239" value="65" />
+			<entry class="" argb="255,96,64,251" value="66" />
+			<entry class="" argb="255,100,64,246" value="67" />
+			<entry class="" argb="255,105,63,234" value="68" />
+			<entry class="" argb="255,110,62,222" value="69" />
+			<entry class="" argb="255,114,61,210" value="70" />
+			<entry class="" argb="255,119,60,198" value="71" />
+			<entry class="" argb="255,123,59,186" value="72" />
+			<entry class="" argb="255,127,57,175" value="73" />
+			<entry class="" argb="255,131,56,164" value="74" />
+			<entry class="" argb="255,135,55,153" value="75" />
+			<entry class="" argb="255,139,54,142" value="76" />
+			<entry class="" argb="255,143,53,132" value="77" />
+			<entry class="" argb="255,147,52,122" value="78" />
+			<entry class="" argb="255,150,51,113" value="79" />
+			<entry class="" argb="255,154,49,104" value="80" />
+			<entry class="" argb="255,157,48,95" value="81" />
+			<entry class="" argb="255,160,47,87" value="82" />
+			<entry class="" argb="255,163,47,79" value="83" />
+			<entry class="" argb="255,165,46,72" value="84" />
+			<entry class="" argb="255,168,45,66" value="85" />
+			<entry class="" argb="255,170,44,59" value="86" />
+			<entry class="" argb="255,172,44,54" value="87" />
+			<entry class="" argb="255,174,44,49" value="88" />
+			<entry class="" argb="255,176,43,44" value="89" />
+			<entry class="" argb="255,177,43,40" value="90" />
+			<entry class="" argb="255,179,43,37" value="91" />
+			<entry class="" argb="255,180,43,34" value="92" />
+			<entry class="" argb="255,180,44,32" value="93" />
+			<entry class="" argb="255,181,44,31" value="94" />
+			<entry class="" argb="255,181,45,30" value="95" />
+			<entry class="" argb="255,182,46,29" value="96" />
+			<entry class="" argb="255,181,47,30" value="97" />
+			<entry class="" argb="255,181,48,31" value="98" />
+			<entry class="" argb="255,180,50,32" value="99" />
+			<entry class="" argb="255,180,51,34" value="100" />
+			<entry class="" argb="255,179,53,37" value="101" />
+			<entry class="" argb="255,177,55,40" value="102" />
+			<entry class="" argb="255,176,57,44" value="103" />
+			<entry class="" argb="255,174,60,49" value="104" />
+			<entry class="" argb="255,172,62,54" value="105" />
+			<entry class="" argb="255,170,65,59" value="106" />
+			<entry class="" argb="255,168,68,66" value="107" />
+			<entry class="" argb="255,165,71,72" value="108" />
+			<entry class="" argb="255,163,74,79" value="109" />
+			<entry class="" argb="255,160,78,87" value="110" />
+			<entry class="" argb="255,157,81,95" value="111" />
+			<entry class="" argb="255,154,85,104" value="112" />
+			<entry class="" argb="255,150,88,113" value="113" />
+			<entry class="" argb="255,147,92,122" value="114" />
+			<entry class="" argb="255,143,96,132" value="115" />
+			<entry class="" argb="255,139,100,142" value="116" />
+			<entry class="" argb="255,135,104,153" value="117" />
+			<entry class="" argb="255,131,108,164" value="118" />
+			<entry class="" argb="255,127,112,175" value="119" />
+			<entry class="" argb="255,123,116,186" value="120" />
+			<entry class="" argb="255,119,120,198" value="121" />
+			<entry class="" argb="255,114,124,210" value="122" />
+			<entry class="" argb="255,110,128,222" value="123" />
+			<entry class="" argb="255,105,132,234" value="124" />
+			<entry class="" argb="255,100,136,246" value="125" />
+			<entry class="" argb="255,96,140,251" value="126" />
+			<entry class="" argb="255,91,144,239" value="127" />
+			<entry class="" argb="255,86,148,226" value="128" />
+			<entry class="" argb="255,82,151,214" value="129" />
+			<entry class="" argb="255,77,154,202" value="130" />
+			<entry class="" argb="255,73,158,189" value="131" />
+			<entry class="" argb="255,68,161,177" value="132" />
+			<entry class="" argb="255,63,164,165" value="133" />
+			<entry class="" argb="255,59,166,153" value="134" />
+			<entry class="" argb="255,54,169,141" value="135" />
+			<entry class="" argb="255,50,171,129" value="136" />
+			<entry class="" argb="255,46,173,118" value="137" />
+			<entry class="" argb="255,42,175,107" value="138" />
+			<entry class="" argb="255,38,176,96" value="139" />
+			<entry class="" argb="255,34,178,85" value="140" />
+			<entry class="" argb="255,30,179,75" value="141" />
+			<entry class="" argb="255,26,180,65" value="142" />
+			<entry class="" argb="255,23,180,56" value="143" />
+			<entry class="" argb="255,19,180,47" value="144" />
+			<entry class="" argb="255,16,180,38" value="145" />
+			<entry class="" argb="255,13,180,30" value="146" />
+			<entry class="" argb="255,13,179,22" value="147" />
+			<entry class="" argb="255,8,179,15" value="148" />
+			<entry class="" argb="255,5,178,9" value="149" />
+			<entry class="" argb="255,3,176,2" value="150" />
+			<entry class="" argb="255,1,175,2" value="151" />
+			<entry class="" argb="255,0,173,7" value="152" />
+			<entry class="" argb="255,2,171,12" value="153" />
+			<entry class="" argb="255,3,169,16" value="154" />
+			<entry class="" argb="255,5,166,19" value="155" />
+			<entry class="" argb="255,6,164,22" value="156" />
+			<entry class="" argb="255,6,161,24" value="157" />
+			<entry class="" argb="255,7,158,25" value="158" />
+			<entry class="" argb="255,7,155,26" value="159" />
+			<entry class="" argb="255,8,152,27" value="160" />
+			<entry class="" argb="255,7,148,26" value="161" />
+			<entry class="" argb="255,7,145,25" value="162" />
+			<entry class="" argb="255,6,141,24" value="163" />
+			<entry class="" argb="255,6,138,22" value="164" />
+			<entry class="" argb="255,5,134,19" value="165" />
+			<entry class="" argb="255,3,131,16" value="166" />
+			<entry class="" argb="255,2,127,12" value="167" />
+			<entry class="" argb="255,0,124,7" value="168" />
+			<entry class="" argb="255,1,120,2" value="169" />
+			<entry class="" argb="255,3,117,2" value="170" />
+			<entry class="" argb="255,5,113,9" value="171" />
+			<entry class="" argb="255,8,110,15" value="172" />
+			<entry class="" argb="255,13,107,22" value="173" />
+			<entry class="" argb="255,13,104,30" value="174" />
+			<entry class="" argb="255,16,101,38" value="175" />
+			<entry class="" argb="255,19,99,47" value="176" />
+			<entry class="" argb="255,23,97,56" value="177" />
+			<entry class="" argb="255,26,95,65" value="178" />
+			<entry class="" argb="255,30,93,75" value="179" />
+			<entry class="" argb="255,34,91,85" value="180" />
+			<entry class="" argb="255,38,90,96" value="181" />
+			<entry class="" argb="255,42,89,107" value="182" />
+			<entry class="" argb="255,46,88,118" value="183" />
+			<entry class="" argb="255,50,88,129" value="184" />
+			<entry class="" argb="255,54,88,141" value="185" />
+			<entry class="" argb="255,59,88,153" value="186" />
+			<entry class="" argb="255,63,88,165" value="187" />
+			<entry class="" argb="255,68,89,177" value="188" />
+			<entry class="" argb="255,73,91,189" value="189" />
+			<entry class="" argb="255,77,92,202" value="190" />
+			<entry class="" argb="255,82,94,214" value="191" />
+			<entry class="" argb="255,87,96,227" value="192" />
+			<entry class="" argb="255,91,99,239" value="193" />
+			<entry class="" argb="255,96,102,251" value="194" />
+			<entry class="" argb="255,100,105,246" value="195" />
+			<entry class="" argb="255,105,109,234" value="196" />
+			<entry class="" argb="255,110,113,222" value="197" />
+			<entry class="" argb="255,114,117,210" value="198" />
+			<entry class="" argb="255,119,122,198" value="199" />
+			<entry class="" argb="255,123,127,186" value="200" />
+			<entry class="" argb="255,127,132,175" value="201" />
+			<entry class="" argb="255,131,137,164" value="202" />
+			<entry class="" argb="255,135,142,153" value="203" />
+			<entry class="" argb="255,139,148,142" value="204" />
+			<entry class="" argb="255,143,154,132" value="205" />
+			<entry class="" argb="255,147,160,122" value="206" />
+			<entry class="" argb="255,150,166,113" value="207" />
+			<entry class="" argb="255,154,173,104" value="208" />
+			<entry class="" argb="255,157,179,95" value="209" />
+			<entry class="" argb="255,160,186,87" value="210" />
+			<entry class="" argb="255,163,192,79" value="211" />
+			<entry class="" argb="255,165,199,72" value="212" />
+			<entry class="" argb="255,168,205,66" value="213" />
+			<entry class="" argb="255,170,212,59" value="214" />
+			<entry class="" argb="255,172,218,54" value="215" />
+			<entry class="" argb="255,174,225,49" value="216" />
+			<entry class="" argb="255,176,231,44" value="217" />
+			<entry class="" argb="255,177,237,40" value="218" />
+			<entry class="" argb="255,179,243,37" value="219" />
+			<entry class="" argb="255,180,248,34" value="220" />
+			<entry class="" argb="255,180,254,32" value="221" />
+			<entry class="" argb="255,181,251,31" value="222" />
+			<entry class="" argb="255,181,246,30" value="223" />
+			<entry class="" argb="255,182,241,29" value="224" />
+			<entry class="" argb="255,181,237,30" value="225" />
+			<entry class="" argb="255,181,233,31" value="226" />
+			<entry class="" argb="255,180,229,32" value="227" />
+			<entry class="" argb="255,180,226,34" value="228" />
+			<entry class="" argb="255,179,223,37" value="229" />
+			<entry class="" argb="255,177,220,40" value="230" />
+			<entry class="" argb="255,176,218,44" value="231" />
+			<entry class="" argb="255,174,216,49" value="232" />
+			<entry class="" argb="255,172,215,54" value="233" />
+			<entry class="" argb="255,170,214,59" value="234" />
+			<entry class="" argb="255,168,213,66" value="235" />
+			<entry class="" argb="255,165,213,72" value="236" />
+			<entry class="" argb="255,163,214,79" value="237" />
+			<entry class="" argb="255,160,214,87" value="238" />
+			<entry class="" argb="255,157,216,95" value="239" />
+			<entry class="" argb="255,154,217,104" value="240" />
+			<entry class="" argb="255,150,219,113" value="241" />
+			<entry class="" argb="255,147,222,122" value="242" />
+			<entry class="" argb="255,143,224,132" value="243" />
+			<entry class="" argb="255,139,228,142" value="244" />
+			<entry class="" argb="255,135,231,153" value="245" />
+			<entry class="" argb="255,131,235,164" value="246" />
+			<entry class="" argb="255,127,239,175" value="247" />
+			<entry class="" argb="255,123,244,186" value="248" />
+			<entry class="" argb="255,119,248,198" value="249" />
+			<entry class="" argb="255,114,253,210" value="250" />
+			<entry class="" argb="255,110,251,222" value="251" />
+			<entry class="" argb="255,105,246,234" value="252" />
+			<entry class="" argb="255,100,240,246" value="253" />
+			<entry class="" argb="255,96,234,251" value="254" />
+			<entry class="" argb="255,96,234,251" value="255" />
+		</table>
+	</palette>
+
+	<palette name="green-red-blue" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,36,0" value="1" />
+			<entry class="" argb="255,0,72,0" value="2" />
+			<entry class="" argb="255,0,75,0" value="3" />
+			<entry class="" argb="255,0,79,0" value="4" />
+			<entry class="" argb="255,0,82,0" value="5" />
+			<entry class="" argb="255,0,86,0" value="6" />
+			<entry class="" argb="255,0,90,0" value="7" />
+			<entry class="" argb="255,0,93,0" value="8" />
+			<entry class="" argb="255,0,97,0" value="9" />
+			<entry class="" argb="255,0,100,0" value="10" />
+			<entry class="" argb="255,0,104,0" value="11" />
+			<entry class="" argb="255,0,108,0" value="12" />
+			<entry class="" argb="255,0,117,0" value="13" />
+			<entry class="" argb="255,0,126,0" value="14" />
+			<entry class="" argb="255,0,135,0" value="15" />
+			<entry class="" argb="255,0,144,0" value="16" />
+			<entry class="" argb="255,0,153,0" value="17" />
+			<entry class="" argb="255,0,162,0" value="18" />
+			<entry class="" argb="255,0,171,0" value="19" />
+			<entry class="" argb="255,0,180,0" value="20" />
+			<entry class="" argb="255,0,189,0" value="21" />
+			<entry class="" argb="255,0,198,0" value="22" />
+			<entry class="" argb="255,0,207,0" value="23" />
+			<entry class="" argb="255,0,216,0" value="24" />
+			<entry class="" argb="255,0,225,0" value="25" />
+			<entry class="" argb="255,0,234,0" value="26" />
+			<entry class="" argb="255,0,243,0" value="27" />
+			<entry class="" argb="255,0,252,0" value="28" />
+			<entry class="" argb="255,6,249,0" value="29" />
+			<entry class="" argb="255,12,246,0" value="30" />
+			<entry class="" argb="255,18,243,0" value="31" />
+			<entry class="" argb="255,24,240,0" value="32" />
+			<entry class="" argb="255,30,234,0" value="33" />
+			<entry class="" argb="255,36,228,0" value="34" />
+			<entry class="" argb="255,42,222,0" value="35" />
+			<entry class="" argb="255,48,216,0" value="36" />
+			<entry class="" argb="255,54,210,0" value="37" />
+			<entry class="" argb="255,60,204,0" value="38" />
+			<entry class="" argb="255,66,198,0" value="39" />
+			<entry class="" argb="255,72,192,0" value="40" />
+			<entry class="" argb="255,78,186,0" value="41" />
+			<entry class="" argb="255,84,180,0" value="42" />
+			<entry class="" argb="255,90,174,0" value="43" />
+			<entry class="" argb="255,96,168,0" value="44" />
+			<entry class="" argb="255,102,162,0" value="45" />
+			<entry class="" argb="255,108,156,0" value="46" />
+			<entry class="" argb="255,114,150,0" value="47" />
+			<entry class="" argb="255,120,144,0" value="48" />
+			<entry class="" argb="255,126,138,0" value="49" />
+			<entry class="" argb="255,132,132,0" value="50" />
+			<entry class="" argb="255,138,126,0" value="51" />
+			<entry class="" argb="255,144,120,0" value="52" />
+			<entry class="" argb="255,150,114,0" value="53" />
+			<entry class="" argb="255,156,108,0" value="54" />
+			<entry class="" argb="255,162,102,0" value="55" />
+			<entry class="" argb="255,168,96,0" value="56" />
+			<entry class="" argb="255,174,90,0" value="57" />
+			<entry class="" argb="255,180,84,0" value="58" />
+			<entry class="" argb="255,186,78,0" value="59" />
+			<entry class="" argb="255,192,72,0" value="60" />
+			<entry class="" argb="255,198,66,0" value="61" />
+			<entry class="" argb="255,204,60,0" value="62" />
+			<entry class="" argb="255,210,54,0" value="63" />
+			<entry class="" argb="255,216,48,0" value="64" />
+			<entry class="" argb="255,222,42,0" value="65" />
+			<entry class="" argb="255,228,36,0" value="66" />
+			<entry class="" argb="255,234,30,0" value="67" />
+			<entry class="" argb="255,240,24,0" value="68" />
+			<entry class="" argb="255,243,18,0" value="69" />
+			<entry class="" argb="255,246,12,0" value="70" />
+			<entry class="" argb="255,249,6,0" value="71" />
+			<entry class="" argb="255,252,0,0" value="72" />
+			<entry class="" argb="255,252,0,0" value="73" />
+			<entry class="" argb="255,252,0,0" value="74" />
+			<entry class="" argb="255,252,0,0" value="75" />
+			<entry class="" argb="255,252,0,1" value="76" />
+			<entry class="" argb="255,251,0,3" value="77" />
+			<entry class="" argb="255,250,0,5" value="78" />
+			<entry class="" argb="255,249,0,7" value="79" />
+			<entry class="" argb="255,248,0,9" value="80" />
+			<entry class="" argb="255,248,0,10" value="81" />
+			<entry class="" argb="255,248,0,12" value="82" />
+			<entry class="" argb="255,248,0,14" value="83" />
+			<entry class="" argb="255,248,0,16" value="84" />
+			<entry class="" argb="255,247,0,18" value="85" />
+			<entry class="" argb="255,246,0,20" value="86" />
+			<entry class="" argb="255,245,0,22" value="87" />
+			<entry class="" argb="255,244,0,25" value="88" />
+			<entry class="" argb="255,243,0,27" value="89" />
+			<entry class="" argb="255,242,0,29" value="90" />
+			<entry class="" argb="255,241,0,31" value="91" />
+			<entry class="" argb="255,240,0,34" value="92" />
+			<entry class="" argb="255,240,0,35" value="93" />
+			<entry class="" argb="255,239,0,37" value="94" />
+			<entry class="" argb="255,238,0,39" value="95" />
+			<entry class="" argb="255,237,0,41" value="96" />
+			<entry class="" argb="255,236,0,43" value="97" />
+			<entry class="" argb="255,236,0,45" value="98" />
+			<entry class="" argb="255,236,0,47" value="99" />
+			<entry class="" argb="255,236,0,50" value="100" />
+			<entry class="" argb="255,235,0,52" value="101" />
+			<entry class="" argb="255,234,0,54" value="102" />
+			<entry class="" argb="255,233,0,56" value="103" />
+			<entry class="" argb="255,232,0,59" value="104" />
+			<entry class="" argb="255,231,0,61" value="105" />
+			<entry class="" argb="255,230,0,63" value="106" />
+			<entry class="" argb="255,229,0,65" value="107" />
+			<entry class="" argb="255,228,0,67" value="108" />
+			<entry class="" argb="255,228,0,68" value="109" />
+			<entry class="" argb="255,228,0,70" value="110" />
+			<entry class="" argb="255,228,0,72" value="111" />
+			<entry class="" argb="255,228,0,74" value="112" />
+			<entry class="" argb="255,227,0,76" value="113" />
+			<entry class="" argb="255,226,0,78" value="114" />
+			<entry class="" argb="255,225,0,80" value="115" />
+			<entry class="" argb="255,224,0,83" value="116" />
+			<entry class="" argb="255,223,0,85" value="117" />
+			<entry class="" argb="255,222,0,87" value="118" />
+			<entry class="" argb="255,221,0,89" value="119" />
+			<entry class="" argb="255,220,1,92" value="120" />
+			<entry class="" argb="255,219,1,94" value="121" />
+			<entry class="" argb="255,218,1,96" value="122" />
+			<entry class="" argb="255,217,1,98" value="123" />
+			<entry class="" argb="255,216,0,101" value="124" />
+			<entry class="" argb="255,216,0,102" value="125" />
+			<entry class="" argb="255,216,0,104" value="126" />
+			<entry class="" argb="255,216,0,106" value="127" />
+			<entry class="" argb="255,216,0,108" value="128" />
+			<entry class="" argb="255,215,0,110" value="129" />
+			<entry class="" argb="255,214,0,112" value="130" />
+			<entry class="" argb="255,213,0,114" value="131" />
+			<entry class="" argb="255,212,0,116" value="132" />
+			<entry class="" argb="255,211,0,118" value="133" />
+			<entry class="" argb="255,210,0,120" value="134" />
+			<entry class="" argb="255,209,0,122" value="135" />
+			<entry class="" argb="255,208,0,125" value="136" />
+			<entry class="" argb="255,207,0,127" value="137" />
+			<entry class="" argb="255,206,0,129" value="138" />
+			<entry class="" argb="255,205,0,131" value="139" />
+			<entry class="" argb="255,204,0,134" value="140" />
+			<entry class="" argb="255,204,0,135" value="141" />
+			<entry class="" argb="255,204,0,137" value="142" />
+			<entry class="" argb="255,204,0,139" value="143" />
+			<entry class="" argb="255,204,0,141" value="144" />
+			<entry class="" argb="255,203,0,143" value="145" />
+			<entry class="" argb="255,202,0,145" value="146" />
+			<entry class="" argb="255,201,0,147" value="147" />
+			<entry class="" argb="255,200,0,150" value="148" />
+			<entry class="" argb="255,199,0,152" value="149" />
+			<entry class="" argb="255,198,0,154" value="150" />
+			<entry class="" argb="255,197,0,156" value="151" />
+			<entry class="" argb="255,196,0,159" value="152" />
+			<entry class="" argb="255,196,0,160" value="153" />
+			<entry class="" argb="255,196,0,162" value="154" />
+			<entry class="" argb="255,196,0,163" value="155" />
+			<entry class="" argb="255,196,0,165" value="156" />
+			<entry class="" argb="255,195,0,167" value="157" />
+			<entry class="" argb="255,194,0,169" value="158" />
+			<entry class="" argb="255,193,0,171" value="159" />
+			<entry class="" argb="255,192,0,174" value="160" />
+			<entry class="" argb="255,191,0,176" value="161" />
+			<entry class="" argb="255,190,0,178" value="162" />
+			<entry class="" argb="255,189,0,180" value="163" />
+			<entry class="" argb="255,188,0,183" value="164" />
+			<entry class="" argb="255,187,0,185" value="165" />
+			<entry class="" argb="255,186,0,187" value="166" />
+			<entry class="" argb="255,185,0,189" value="167" />
+			<entry class="" argb="255,184,0,192" value="168" />
+			<entry class="" argb="255,184,0,193" value="169" />
+			<entry class="" argb="255,184,0,195" value="170" />
+			<entry class="" argb="255,184,0,197" value="171" />
+			<entry class="" argb="255,184,0,199" value="172" />
+			<entry class="" argb="255,183,0,201" value="173" />
+			<entry class="" argb="255,182,0,203" value="174" />
+			<entry class="" argb="255,181,0,205" value="175" />
+			<entry class="" argb="255,180,0,208" value="176" />
+			<entry class="" argb="255,179,0,210" value="177" />
+			<entry class="" argb="255,178,0,212" value="178" />
+			<entry class="" argb="255,177,0,214" value="179" />
+			<entry class="" argb="255,176,0,216" value="180" />
+			<entry class="" argb="255,176,0,217" value="181" />
+			<entry class="" argb="255,176,0,219" value="182" />
+			<entry class="" argb="255,176,0,221" value="183" />
+			<entry class="" argb="255,176,0,223" value="184" />
+			<entry class="" argb="255,175,0,225" value="185" />
+			<entry class="" argb="255,174,0,227" value="186" />
+			<entry class="" argb="255,173,0,229" value="187" />
+			<entry class="" argb="255,172,0,232" value="188" />
+			<entry class="" argb="255,171,0,234" value="189" />
+			<entry class="" argb="255,170,0,236" value="190" />
+			<entry class="" argb="255,169,0,238" value="191" />
+			<entry class="" argb="255,168,0,241" value="192" />
+			<entry class="" argb="255,167,0,243" value="193" />
+			<entry class="" argb="255,166,0,245" value="194" />
+			<entry class="" argb="255,165,0,247" value="195" />
+			<entry class="" argb="255,164,0,250" value="196" />
+			<entry class="" argb="255,164,0,251" value="197" />
+			<entry class="" argb="255,164,0,252" value="198" />
+			<entry class="" argb="255,164,0,253" value="199" />
+			<entry class="" argb="255,164,0,255" value="200" />
+			<entry class="" argb="255,163,0,255" value="201" />
+			<entry class="" argb="255,162,0,255" value="202" />
+			<entry class="" argb="255,161,0,255" value="203" />
+			<entry class="" argb="255,160,0,255" value="204" />
+			<entry class="" argb="255,159,0,255" value="205" />
+			<entry class="" argb="255,158,0,255" value="206" />
+			<entry class="" argb="255,157,0,255" value="207" />
+			<entry class="" argb="255,156,0,255" value="208" />
+			<entry class="" argb="255,155,0,255" value="209" />
+			<entry class="" argb="255,154,0,255" value="210" />
+			<entry class="" argb="255,153,0,255" value="211" />
+			<entry class="" argb="255,152,0,255" value="212" />
+			<entry class="" argb="255,152,0,255" value="213" />
+			<entry class="" argb="255,152,0,255" value="214" />
+			<entry class="" argb="255,152,0,255" value="215" />
+			<entry class="" argb="255,152,0,255" value="216" />
+			<entry class="" argb="255,151,0,255" value="217" />
+			<entry class="" argb="255,150,0,255" value="218" />
+			<entry class="" argb="255,149,0,255" value="219" />
+			<entry class="" argb="255,148,0,255" value="220" />
+			<entry class="" argb="255,151,8,255" value="221" />
+			<entry class="" argb="255,154,16,255" value="222" />
+			<entry class="" argb="255,157,24,255" value="223" />
+			<entry class="" argb="255,160,32,255" value="224" />
+			<entry class="" argb="255,163,40,255" value="225" />
+			<entry class="" argb="255,166,48,255" value="226" />
+			<entry class="" argb="255,169,56,255" value="227" />
+			<entry class="" argb="255,172,64,255" value="228" />
+			<entry class="" argb="255,176,72,255" value="229" />
+			<entry class="" argb="255,180,80,255" value="230" />
+			<entry class="" argb="255,184,88,255" value="231" />
+			<entry class="" argb="255,188,96,255" value="232" />
+			<entry class="" argb="255,191,104,255" value="233" />
+			<entry class="" argb="255,194,112,255" value="234" />
+			<entry class="" argb="255,197,120,255" value="235" />
+			<entry class="" argb="255,200,128,255" value="236" />
+			<entry class="" argb="255,203,135,255" value="237" />
+			<entry class="" argb="255,206,142,255" value="238" />
+			<entry class="" argb="255,209,149,255" value="239" />
+			<entry class="" argb="255,212,156,255" value="240" />
+			<entry class="" argb="255,215,164,255" value="241" />
+			<entry class="" argb="255,218,172,255" value="242" />
+			<entry class="" argb="255,221,180,255" value="243" />
+			<entry class="" argb="255,224,188,255" value="244" />
+			<entry class="" argb="255,228,196,255" value="245" />
+			<entry class="" argb="255,232,204,255" value="246" />
+			<entry class="" argb="255,236,212,255" value="247" />
+			<entry class="" argb="255,240,220,255" value="248" />
+			<entry class="" argb="255,243,228,255" value="249" />
+			<entry class="" argb="255,246,236,255" value="250" />
+			<entry class="" argb="255,249,244,255" value="251" />
+			<entry class="" argb="255,252,252,255" value="252" />
+			<entry class="" argb="255,253,253,255" value="253" />
+			<entry class="" argb="255,254,254,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="green-white-exponential" interpolate="false">
+		<table>
+			<entry class="" argb="255,1,0,0" value="0" />
+			<entry class="" argb="255,1,0,0" value="1" />
+			<entry class="" argb="255,1,1,0" value="2" />
+			<entry class="" argb="255,2,2,0" value="3" />
+			<entry class="" argb="255,2,2,1" value="4" />
+			<entry class="" argb="255,2,3,1" value="5" />
+			<entry class="" argb="255,3,4,1" value="6" />
+			<entry class="" argb="255,3,4,1" value="7" />
+			<entry class="" argb="255,4,5,2" value="8" />
+			<entry class="" argb="255,4,6,2" value="9" />
+			<entry class="" argb="255,4,6,2" value="10" />
+			<entry class="" argb="255,5,7,2" value="11" />
+			<entry class="" argb="255,5,8,3" value="12" />
+			<entry class="" argb="255,5,8,3" value="13" />
+			<entry class="" argb="255,6,9,3" value="14" />
+			<entry class="" argb="255,6,10,3" value="15" />
+			<entry class="" argb="255,7,10,4" value="16" />
+			<entry class="" argb="255,7,11,4" value="17" />
+			<entry class="" argb="255,7,12,4" value="18" />
+			<entry class="" argb="255,8,12,5" value="19" />
+			<entry class="" argb="255,8,13,5" value="20" />
+			<entry class="" argb="255,9,14,5" value="21" />
+			<entry class="" argb="255,9,14,5" value="22" />
+			<entry class="" argb="255,9,15,6" value="23" />
+			<entry class="" argb="255,10,16,6" value="24" />
+			<entry class="" argb="255,10,16,6" value="25" />
+			<entry class="" argb="255,10,17,6" value="26" />
+			<entry class="" argb="255,11,18,7" value="27" />
+			<entry class="" argb="255,11,18,7" value="28" />
+			<entry class="" argb="255,12,19,7" value="29" />
+			<entry class="" argb="255,12,20,7" value="30" />
+			<entry class="" argb="255,12,20,8" value="31" />
+			<entry class="" argb="255,13,21,8" value="32" />
+			<entry class="" argb="255,13,22,8" value="33" />
+			<entry class="" argb="255,13,22,8" value="34" />
+			<entry class="" argb="255,14,23,9" value="35" />
+			<entry class="" argb="255,14,24,9" value="36" />
+			<entry class="" argb="255,15,24,9" value="37" />
+			<entry class="" argb="255,15,25,10" value="38" />
+			<entry class="" argb="255,15,26,10" value="39" />
+			<entry class="" argb="255,16,26,10" value="40" />
+			<entry class="" argb="255,16,27,10" value="41" />
+			<entry class="" argb="255,17,28,11" value="42" />
+			<entry class="" argb="255,17,28,11" value="43" />
+			<entry class="" argb="255,17,29,11" value="44" />
+			<entry class="" argb="255,18,30,11" value="45" />
+			<entry class="" argb="255,18,30,12" value="46" />
+			<entry class="" argb="255,18,31,12" value="47" />
+			<entry class="" argb="255,19,32,12" value="48" />
+			<entry class="" argb="255,19,32,12" value="49" />
+			<entry class="" argb="255,20,33,13" value="50" />
+			<entry class="" argb="255,20,34,13" value="51" />
+			<entry class="" argb="255,20,34,13" value="52" />
+			<entry class="" argb="255,21,35,13" value="53" />
+			<entry class="" argb="255,21,36,14" value="54" />
+			<entry class="" argb="255,21,36,14" value="55" />
+			<entry class="" argb="255,22,37,14" value="56" />
+			<entry class="" argb="255,22,38,15" value="57" />
+			<entry class="" argb="255,23,38,15" value="58" />
+			<entry class="" argb="255,23,39,15" value="59" />
+			<entry class="" argb="255,23,40,15" value="60" />
+			<entry class="" argb="255,24,40,16" value="61" />
+			<entry class="" argb="255,24,41,16" value="62" />
+			<entry class="" argb="255,25,42,16" value="63" />
+			<entry class="" argb="255,25,42,16" value="64" />
+			<entry class="" argb="255,25,43,17" value="65" />
+			<entry class="" argb="255,26,44,17" value="66" />
+			<entry class="" argb="255,26,44,17" value="67" />
+			<entry class="" argb="255,26,45,17" value="68" />
+			<entry class="" argb="255,27,46,18" value="69" />
+			<entry class="" argb="255,27,46,18" value="70" />
+			<entry class="" argb="255,28,47,18" value="71" />
+			<entry class="" argb="255,28,48,18" value="72" />
+			<entry class="" argb="255,28,48,19" value="73" />
+			<entry class="" argb="255,29,49,19" value="74" />
+			<entry class="" argb="255,29,50,19" value="75" />
+			<entry class="" argb="255,29,50,20" value="76" />
+			<entry class="" argb="255,30,51,20" value="77" />
+			<entry class="" argb="255,30,52,20" value="78" />
+			<entry class="" argb="255,31,52,20" value="79" />
+			<entry class="" argb="255,31,53,21" value="80" />
+			<entry class="" argb="255,31,54,21" value="81" />
+			<entry class="" argb="255,32,54,21" value="82" />
+			<entry class="" argb="255,32,55,21" value="83" />
+			<entry class="" argb="255,33,56,22" value="84" />
+			<entry class="" argb="255,33,56,22" value="85" />
+			<entry class="" argb="255,33,57,22" value="86" />
+			<entry class="" argb="255,34,58,22" value="87" />
+			<entry class="" argb="255,34,58,23" value="88" />
+			<entry class="" argb="255,34,59,23" value="89" />
+			<entry class="" argb="255,35,60,23" value="90" />
+			<entry class="" argb="255,35,60,23" value="91" />
+			<entry class="" argb="255,36,61,24" value="92" />
+			<entry class="" argb="255,36,62,24" value="93" />
+			<entry class="" argb="255,36,62,24" value="94" />
+			<entry class="" argb="255,37,63,25" value="95" />
+			<entry class="" argb="255,37,64,25" value="96" />
+			<entry class="" argb="255,37,64,25" value="97" />
+			<entry class="" argb="255,38,65,25" value="98" />
+			<entry class="" argb="255,38,66,26" value="99" />
+			<entry class="" argb="255,39,66,26" value="100" />
+			<entry class="" argb="255,39,67,26" value="101" />
+			<entry class="" argb="255,39,68,26" value="102" />
+			<entry class="" argb="255,40,68,27" value="103" />
+			<entry class="" argb="255,40,69,27" value="104" />
+			<entry class="" argb="255,41,70,27" value="105" />
+			<entry class="" argb="255,41,70,27" value="106" />
+			<entry class="" argb="255,41,71,28" value="107" />
+			<entry class="" argb="255,42,72,28" value="108" />
+			<entry class="" argb="255,42,72,28" value="109" />
+			<entry class="" argb="255,42,73,28" value="110" />
+			<entry class="" argb="255,43,74,29" value="111" />
+			<entry class="" argb="255,43,74,29" value="112" />
+			<entry class="" argb="255,44,75,29" value="113" />
+			<entry class="" argb="255,44,76,30" value="114" />
+			<entry class="" argb="255,44,76,30" value="115" />
+			<entry class="" argb="255,45,77,30" value="116" />
+			<entry class="" argb="255,45,78,30" value="117" />
+			<entry class="" argb="255,45,78,31" value="118" />
+			<entry class="" argb="255,46,79,31" value="119" />
+			<entry class="" argb="255,46,80,31" value="120" />
+			<entry class="" argb="255,47,80,31" value="121" />
+			<entry class="" argb="255,47,81,32" value="122" />
+			<entry class="" argb="255,47,82,32" value="123" />
+			<entry class="" argb="255,48,82,32" value="124" />
+			<entry class="" argb="255,48,83,32" value="125" />
+			<entry class="" argb="255,49,84,33" value="126" />
+			<entry class="" argb="255,49,84,33" value="127" />
+			<entry class="" argb="255,49,85,33" value="128" />
+			<entry class="" argb="255,50,86,33" value="129" />
+			<entry class="" argb="255,50,87,34" value="130" />
+			<entry class="" argb="255,50,88,34" value="131" />
+			<entry class="" argb="255,51,90,34" value="132" />
+			<entry class="" argb="255,51,91,35" value="133" />
+			<entry class="" argb="255,52,92,35" value="134" />
+			<entry class="" argb="255,52,94,35" value="135" />
+			<entry class="" argb="255,52,95,35" value="136" />
+			<entry class="" argb="255,54,96,36" value="137" />
+			<entry class="" argb="255,54,98,36" value="138" />
+			<entry class="" argb="255,55,99,36" value="139" />
+			<entry class="" argb="255,56,100,36" value="140" />
+			<entry class="" argb="255,56,102,37" value="141" />
+			<entry class="" argb="255,57,103,37" value="142" />
+			<entry class="" argb="255,58,104,37" value="143" />
+			<entry class="" argb="255,58,106,37" value="144" />
+			<entry class="" argb="255,59,107,38" value="145" />
+			<entry class="" argb="255,60,108,38" value="146" />
+			<entry class="" argb="255,60,110,38" value="147" />
+			<entry class="" argb="255,61,111,38" value="148" />
+			<entry class="" argb="255,62,112,39" value="149" />
+			<entry class="" argb="255,62,114,39" value="150" />
+			<entry class="" argb="255,63,115,39" value="151" />
+			<entry class="" argb="255,64,116,40" value="152" />
+			<entry class="" argb="255,64,118,40" value="153" />
+			<entry class="" argb="255,66,119,40" value="154" />
+			<entry class="" argb="255,68,120,40" value="155" />
+			<entry class="" argb="255,70,122,41" value="156" />
+			<entry class="" argb="255,71,123,41" value="157" />
+			<entry class="" argb="255,73,124,41" value="158" />
+			<entry class="" argb="255,75,126,41" value="159" />
+			<entry class="" argb="255,77,127,42" value="160" />
+			<entry class="" argb="255,79,128,42" value="161" />
+			<entry class="" argb="255,81,130,42" value="162" />
+			<entry class="" argb="255,83,131,42" value="163" />
+			<entry class="" argb="255,85,132,43" value="164" />
+			<entry class="" argb="255,86,134,43" value="165" />
+			<entry class="" argb="255,88,135,43" value="166" />
+			<entry class="" argb="255,90,136,43" value="167" />
+			<entry class="" argb="255,92,138,44" value="168" />
+			<entry class="" argb="255,94,139,44" value="169" />
+			<entry class="" argb="255,96,140,44" value="170" />
+			<entry class="" argb="255,98,142,45" value="171" />
+			<entry class="" argb="255,99,143,45" value="172" />
+			<entry class="" argb="255,101,145,45" value="173" />
+			<entry class="" argb="255,103,146,45" value="174" />
+			<entry class="" argb="255,105,147,46" value="175" />
+			<entry class="" argb="255,107,149,46" value="176" />
+			<entry class="" argb="255,109,150,46" value="177" />
+			<entry class="" argb="255,111,151,46" value="178" />
+			<entry class="" argb="255,113,153,47" value="179" />
+			<entry class="" argb="255,114,154,47" value="180" />
+			<entry class="" argb="255,116,155,47" value="181" />
+			<entry class="" argb="255,118,157,47" value="182" />
+			<entry class="" argb="255,120,158,48" value="183" />
+			<entry class="" argb="255,122,159,47" value="184" />
+			<entry class="" argb="255,124,161,49" value="185" />
+			<entry class="" argb="255,126,162,52" value="186" />
+			<entry class="" argb="255,127,163,55" value="187" />
+			<entry class="" argb="255,129,165,58" value="188" />
+			<entry class="" argb="255,131,166,61" value="189" />
+			<entry class="" argb="255,133,167,64" value="190" />
+			<entry class="" argb="255,135,169,67" value="191" />
+			<entry class="" argb="255,137,170,70" value="192" />
+			<entry class="" argb="255,139,171,73" value="193" />
+			<entry class="" argb="255,141,173,76" value="194" />
+			<entry class="" argb="255,142,174,79" value="195" />
+			<entry class="" argb="255,144,175,82" value="196" />
+			<entry class="" argb="255,146,177,85" value="197" />
+			<entry class="" argb="255,148,178,88" value="198" />
+			<entry class="" argb="255,150,179,90" value="199" />
+			<entry class="" argb="255,152,181,93" value="200" />
+			<entry class="" argb="255,154,182,96" value="201" />
+			<entry class="" argb="255,156,183,99" value="202" />
+			<entry class="" argb="255,157,185,102" value="203" />
+			<entry class="" argb="255,159,186,105" value="204" />
+			<entry class="" argb="255,161,187,108" value="205" />
+			<entry class="" argb="255,163,189,111" value="206" />
+			<entry class="" argb="255,165,190,114" value="207" />
+			<entry class="" argb="255,167,191,117" value="208" />
+			<entry class="" argb="255,169,193,120" value="209" />
+			<entry class="" argb="255,170,194,123" value="210" />
+			<entry class="" argb="255,172,195,126" value="211" />
+			<entry class="" argb="255,174,197,129" value="212" />
+			<entry class="" argb="255,176,198,131" value="213" />
+			<entry class="" argb="255,178,200,134" value="214" />
+			<entry class="" argb="255,180,201,137" value="215" />
+			<entry class="" argb="255,182,202,140" value="216" />
+			<entry class="" argb="255,184,204,143" value="217" />
+			<entry class="" argb="255,185,205,146" value="218" />
+			<entry class="" argb="255,187,206,149" value="219" />
+			<entry class="" argb="255,189,208,152" value="220" />
+			<entry class="" argb="255,191,209,155" value="221" />
+			<entry class="" argb="255,193,210,158" value="222" />
+			<entry class="" argb="255,195,212,161" value="223" />
+			<entry class="" argb="255,197,213,164" value="224" />
+			<entry class="" argb="255,198,214,167" value="225" />
+			<entry class="" argb="255,200,216,170" value="226" />
+			<entry class="" argb="255,202,217,172" value="227" />
+			<entry class="" argb="255,204,218,175" value="228" />
+			<entry class="" argb="255,206,220,178" value="229" />
+			<entry class="" argb="255,208,221,181" value="230" />
+			<entry class="" argb="255,210,222,184" value="231" />
+			<entry class="" argb="255,212,224,187" value="232" />
+			<entry class="" argb="255,213,225,190" value="233" />
+			<entry class="" argb="255,215,226,193" value="234" />
+			<entry class="" argb="255,217,228,196" value="235" />
+			<entry class="" argb="255,219,229,199" value="236" />
+			<entry class="" argb="255,221,230,202" value="237" />
+			<entry class="" argb="255,223,232,205" value="238" />
+			<entry class="" argb="255,225,233,208" value="239" />
+			<entry class="" argb="255,226,234,211" value="240" />
+			<entry class="" argb="255,228,236,213" value="241" />
+			<entry class="" argb="255,230,237,216" value="242" />
+			<entry class="" argb="255,232,238,219" value="243" />
+			<entry class="" argb="255,234,240,222" value="244" />
+			<entry class="" argb="255,236,241,225" value="245" />
+			<entry class="" argb="255,238,242,228" value="246" />
+			<entry class="" argb="255,240,244,231" value="247" />
+			<entry class="" argb="255,241,245,234" value="248" />
+			<entry class="" argb="255,243,246,237" value="249" />
+			<entry class="" argb="255,245,248,240" value="250" />
+			<entry class="" argb="255,247,249,243" value="251" />
+			<entry class="" argb="255,249,250,246" value="252" />
+			<entry class="" argb="255,251,252,249" value="253" />
+			<entry class="" argb="255,253,253,252" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="hardcandy" interpolate="false">
+		<table>
+			<entry class="" argb="255,4,51,116" value="0" />
+			<entry class="" argb="255,4,51,116" value="1" />
+			<entry class="" argb="255,5,58,105" value="2" />
+			<entry class="" argb="255,7,65,94" value="3" />
+			<entry class="" argb="255,9,72,84" value="4" />
+			<entry class="" argb="255,11,79,74" value="5" />
+			<entry class="" argb="255,12,85,64" value="6" />
+			<entry class="" argb="255,14,92,55" value="7" />
+			<entry class="" argb="255,15,99,46" value="8" />
+			<entry class="" argb="255,16,105,38" value="9" />
+			<entry class="" argb="255,17,111,30" value="10" />
+			<entry class="" argb="255,17,117,24" value="11" />
+			<entry class="" argb="255,18,124,18" value="12" />
+			<entry class="" argb="255,18,129,12" value="13" />
+			<entry class="" argb="255,18,135,8" value="14" />
+			<entry class="" argb="255,17,141,5" value="15" />
+			<entry class="" argb="255,16,146,2" value="16" />
+			<entry class="" argb="255,15,152,0" value="17" />
+			<entry class="" argb="255,14,157,0" value="18" />
+			<entry class="" argb="255,13,162,0" value="19" />
+			<entry class="" argb="255,11,167,1" value="20" />
+			<entry class="" argb="255,13,171,3" value="21" />
+			<entry class="" argb="255,8,176,6" value="22" />
+			<entry class="" argb="255,5,180,13" value="23" />
+			<entry class="" argb="255,3,184,14" value="24" />
+			<entry class="" argb="255,1,188,20" value="25" />
+			<entry class="" argb="255,0,191,26" value="26" />
+			<entry class="" argb="255,3,195,33" value="27" />
+			<entry class="" argb="255,5,198,41" value="28" />
+			<entry class="" argb="255,7,201,50" value="29" />
+			<entry class="" argb="255,13,203,59" value="30" />
+			<entry class="" argb="255,12,206,68" value="31" />
+			<entry class="" argb="255,13,208,78" value="32" />
+			<entry class="" argb="255,15,210,88" value="33" />
+			<entry class="" argb="255,17,212,99" value="34" />
+			<entry class="" argb="255,18,213,109" value="35" />
+			<entry class="" argb="255,19,214,120" value="36" />
+			<entry class="" argb="255,19,215,131" value="37" />
+			<entry class="" argb="255,19,216,142" value="38" />
+			<entry class="" argb="255,19,216,153" value="39" />
+			<entry class="" argb="255,19,216,163" value="40" />
+			<entry class="" argb="255,18,216,174" value="41" />
+			<entry class="" argb="255,16,216,184" value="42" />
+			<entry class="" argb="255,14,215,193" value="43" />
+			<entry class="" argb="255,12,215,202" value="44" />
+			<entry class="" argb="255,9,213,211" value="45" />
+			<entry class="" argb="255,5,212,218" value="46" />
+			<entry class="" argb="255,2,210,226" value="47" />
+			<entry class="" argb="255,2,209,232" value="48" />
+			<entry class="" argb="255,6,206,238" value="49" />
+			<entry class="" argb="255,11,204,243" value="50" />
+			<entry class="" argb="255,17,201,247" value="51" />
+			<entry class="" argb="255,23,199,250" value="52" />
+			<entry class="" argb="255,29,195,252" value="53" />
+			<entry class="" argb="255,36,192,253" value="54" />
+			<entry class="" argb="255,42,189,253" value="55" />
+			<entry class="" argb="255,49,185,253" value="56" />
+			<entry class="" argb="255,56,181,251" value="57" />
+			<entry class="" argb="255,64,177,249" value="58" />
+			<entry class="" argb="255,71,172,246" value="59" />
+			<entry class="" argb="255,78,168,241" value="60" />
+			<entry class="" argb="255,85,163,236" value="61" />
+			<entry class="" argb="255,93,158,230" value="62" />
+			<entry class="" argb="255,100,153,224" value="63" />
+			<entry class="" argb="255,106,148,216" value="64" />
+			<entry class="" argb="255,113,142,208" value="65" />
+			<entry class="" argb="255,119,137,200" value="66" />
+			<entry class="" argb="255,125,131,190" value="67" />
+			<entry class="" argb="255,130,125,181" value="68" />
+			<entry class="" argb="255,135,119,171" value="69" />
+			<entry class="" argb="255,139,113,160" value="70" />
+			<entry class="" argb="255,143,106,150" value="71" />
+			<entry class="" argb="255,146,100,139" value="72" />
+			<entry class="" argb="255,149,93,128" value="73" />
+			<entry class="" argb="255,150,87,117" value="74" />
+			<entry class="" argb="255,151,80,106" value="75" />
+			<entry class="" argb="255,152,73,96" value="76" />
+			<entry class="" argb="255,151,67,85" value="77" />
+			<entry class="" argb="255,150,60,75" value="78" />
+			<entry class="" argb="255,148,53,65" value="79" />
+			<entry class="" argb="255,145,46,56" value="80" />
+			<entry class="" argb="255,142,39,47" value="81" />
+			<entry class="" argb="255,138,32,39" value="82" />
+			<entry class="" argb="255,133,25,31" value="83" />
+			<entry class="" argb="255,127,18,24" value="84" />
+			<entry class="" argb="255,121,11,18" value="85" />
+			<entry class="" argb="255,114,4,13" value="86" />
+			<entry class="" argb="255,107,2,9" value="87" />
+			<entry class="" argb="255,99,9,5" value="88" />
+			<entry class="" argb="255,90,16,2" value="89" />
+			<entry class="" argb="255,82,22,0" value="90" />
+			<entry class="" argb="255,73,29,0" value="91" />
+			<entry class="" argb="255,63,36,0" value="92" />
+			<entry class="" argb="255,54,42,1" value="93" />
+			<entry class="" argb="255,44,49,3" value="94" />
+			<entry class="" argb="255,35,55,5" value="95" />
+			<entry class="" argb="255,25,61,9" value="96" />
+			<entry class="" argb="255,16,68,14" value="97" />
+			<entry class="" argb="255,6,74,19" value="98" />
+			<entry class="" argb="255,1,79,25" value="99" />
+			<entry class="" argb="255,13,85,32" value="100" />
+			<entry class="" argb="255,18,91,40" value="101" />
+			<entry class="" argb="255,25,96,48" value="102" />
+			<entry class="" argb="255,32,101,57" value="103" />
+			<entry class="" argb="255,38,106,67" value="104" />
+			<entry class="" argb="255,44,111,76" value="105" />
+			<entry class="" argb="255,48,116,87" value="106" />
+			<entry class="" argb="255,52,120,97" value="107" />
+			<entry class="" argb="255,55,125,108" value="108" />
+			<entry class="" argb="255,56,129,119" value="109" />
+			<entry class="" argb="255,57,133,130" value="110" />
+			<entry class="" argb="255,57,136,140" value="111" />
+			<entry class="" argb="255,56,140,151" value="112" />
+			<entry class="" argb="255,53,143,162" value="113" />
+			<entry class="" argb="255,50,146,172" value="114" />
+			<entry class="" argb="255,45,149,182" value="115" />
+			<entry class="" argb="255,39,151,192" value="116" />
+			<entry class="" argb="255,33,153,201" value="117" />
+			<entry class="" argb="255,25,155,209" value="118" />
+			<entry class="" argb="255,16,157,217" value="119" />
+			<entry class="" argb="255,6,159,225" value="120" />
+			<entry class="" argb="255,3,160,231" value="121" />
+			<entry class="" argb="255,15,161,237" value="122" />
+			<entry class="" argb="255,27,162,242" value="123" />
+			<entry class="" argb="255,40,162,246" value="124" />
+			<entry class="" argb="255,53,162,249" value="125" />
+			<entry class="" argb="255,67,162,252" value="126" />
+			<entry class="" argb="255,81,162,253" value="127" />
+			<entry class="" argb="255,96,162,254" value="128" />
+			<entry class="" argb="255,111,161,253" value="129" />
+			<entry class="" argb="255,126,160,252" value="130" />
+			<entry class="" argb="255,141,159,249" value="131" />
+			<entry class="" argb="255,156,157,246" value="132" />
+			<entry class="" argb="255,170,155,242" value="133" />
+			<entry class="" argb="255,185,153,237" value="134" />
+			<entry class="" argb="255,199,151,231" value="135" />
+			<entry class="" argb="255,212,148,225" value="136" />
+			<entry class="" argb="255,225,146,217" value="137" />
+			<entry class="" argb="255,237,143,209" value="138" />
+			<entry class="" argb="255,248,139,201" value="139" />
+			<entry class="" argb="255,252,136,192" value="140" />
+			<entry class="" argb="255,242,132,182" value="141" />
+			<entry class="" argb="255,234,128,172" value="142" />
+			<entry class="" argb="255,227,124,162" value="143" />
+			<entry class="" argb="255,222,120,151" value="144" />
+			<entry class="" argb="255,217,115,140" value="145" />
+			<entry class="" argb="255,214,111,130" value="146" />
+			<entry class="" argb="255,212,106,119" value="147" />
+			<entry class="" argb="255,212,101,108" value="148" />
+			<entry class="" argb="255,213,95,97" value="149" />
+			<entry class="" argb="255,216,90,87" value="150" />
+			<entry class="" argb="255,220,84,76" value="151" />
+			<entry class="" argb="255,225,79,67" value="152" />
+			<entry class="" argb="255,232,73,57" value="153" />
+			<entry class="" argb="255,240,67,48" value="154" />
+			<entry class="" argb="255,249,61,40" value="155" />
+			<entry class="" argb="255,251,54,32" value="156" />
+			<entry class="" argb="255,239,48,25" value="157" />
+			<entry class="" argb="255,226,42,19" value="158" />
+			<entry class="" argb="255,213,35,14" value="159" />
+			<entry class="" argb="255,198,28,9" value="160" />
+			<entry class="" argb="255,183,22,5" value="161" />
+			<entry class="" argb="255,167,15,3" value="162" />
+			<entry class="" argb="255,150,8,1" value="163" />
+			<entry class="" argb="255,133,1,0" value="164" />
+			<entry class="" argb="255,116,5,0" value="165" />
+			<entry class="" argb="255,98,12,0" value="166" />
+			<entry class="" argb="255,81,19,2" value="167" />
+			<entry class="" argb="255,64,26,5" value="168" />
+			<entry class="" argb="255,47,33,9" value="169" />
+			<entry class="" argb="255,30,40,13" value="170" />
+			<entry class="" argb="255,14,47,18" value="171" />
+			<entry class="" argb="255,1,54,24" value="172" />
+			<entry class="" argb="255,15,61,31" value="173" />
+			<entry class="" argb="255,29,67,39" value="174" />
+			<entry class="" argb="255,42,74,47" value="175" />
+			<entry class="" argb="255,54,81,56" value="176" />
+			<entry class="" argb="255,64,88,65" value="177" />
+			<entry class="" argb="255,73,94,75" value="178" />
+			<entry class="" argb="255,81,101,85" value="179" />
+			<entry class="" argb="255,87,107,96" value="180" />
+			<entry class="" argb="255,91,113,106" value="181" />
+			<entry class="" argb="255,94,120,117" value="182" />
+			<entry class="" argb="255,95,126,128" value="183" />
+			<entry class="" argb="255,95,131,139" value="184" />
+			<entry class="" argb="255,92,137,150" value="185" />
+			<entry class="" argb="255,88,143,160" value="186" />
+			<entry class="" argb="255,82,148,171" value="187" />
+			<entry class="" argb="255,75,154,181" value="188" />
+			<entry class="" argb="255,66,159,190" value="189" />
+			<entry class="" argb="255,55,164,200" value="190" />
+			<entry class="" argb="255,42,168,208" value="191" />
+			<entry class="" argb="255,28,173,216" value="192" />
+			<entry class="" argb="255,13,177,224" value="193" />
+			<entry class="" argb="255,3,181,230" value="194" />
+			<entry class="" argb="255,21,185,236" value="195" />
+			<entry class="" argb="255,40,189,241" value="196" />
+			<entry class="" argb="255,60,193,246" value="197" />
+			<entry class="" argb="255,81,196,249" value="198" />
+			<entry class="" argb="255,103,199,251" value="199" />
+			<entry class="" argb="255,125,202,253" value="200" />
+			<entry class="" argb="255,147,204,253" value="201" />
+			<entry class="" argb="255,170,207,253" value="202" />
+			<entry class="" argb="255,193,209,252" value="203" />
+			<entry class="" argb="255,216,211,250" value="204" />
+			<entry class="" argb="255,239,212,247" value="205" />
+			<entry class="" argb="255,249,214,243" value="206" />
+			<entry class="" argb="255,228,215,238" value="207" />
+			<entry class="" argb="255,207,216,232" value="208" />
+			<entry class="" argb="255,187,216,226" value="209" />
+			<entry class="" argb="255,168,216,218" value="210" />
+			<entry class="" argb="255,151,216,211" value="211" />
+			<entry class="" argb="255,134,216,202" value="212" />
+			<entry class="" argb="255,119,216,193" value="213" />
+			<entry class="" argb="255,106,215,184" value="214" />
+			<entry class="" argb="255,95,214,174" value="215" />
+			<entry class="" argb="255,85,213,163" value="216" />
+			<entry class="" argb="255,77,212,153" value="217" />
+			<entry class="" argb="255,71,210,142" value="218" />
+			<entry class="" argb="255,67,208,131" value="219" />
+			<entry class="" argb="255,65,206,120" value="220" />
+			<entry class="" argb="255,66,203,109" value="221" />
+			<entry class="" argb="255,68,201,99" value="222" />
+			<entry class="" argb="255,72,198,88" value="223" />
+			<entry class="" argb="255,79,194,78" value="224" />
+			<entry class="" argb="255,87,191,68" value="225" />
+			<entry class="" argb="255,98,187,59" value="226" />
+			<entry class="" argb="255,110,184,50" value="227" />
+			<entry class="" argb="255,124,180,41" value="228" />
+			<entry class="" argb="255,140,175,33" value="229" />
+			<entry class="" argb="255,158,171,26" value="230" />
+			<entry class="" argb="255,177,166,20" value="231" />
+			<entry class="" argb="255,197,161,14" value="232" />
+			<entry class="" argb="255,219,156,13" value="233" />
+			<entry class="" argb="255,241,151,6" value="234" />
+			<entry class="" argb="255,245,146,3" value="235" />
+			<entry class="" argb="255,221,140,1" value="236" />
+			<entry class="" argb="255,196,135,0" value="237" />
+			<entry class="" argb="255,171,129,0" value="238" />
+			<entry class="" argb="255,145,123,0" value="239" />
+			<entry class="" argb="255,120,117,2" value="240" />
+			<entry class="" argb="255,95,111,5" value="241" />
+			<entry class="" argb="255,70,104,8" value="242" />
+			<entry class="" argb="255,46,98,12" value="243" />
+			<entry class="" argb="255,23,91,18" value="244" />
+			<entry class="" argb="255,1,85,24" value="245" />
+			<entry class="" argb="255,19,78,30" value="246" />
+			<entry class="" argb="255,39,71,38" value="247" />
+			<entry class="" argb="255,57,64,46" value="248" />
+			<entry class="" argb="255,74,57,55" value="249" />
+			<entry class="" argb="255,89,50,64" value="250" />
+			<entry class="" argb="255,102,44,74" value="251" />
+			<entry class="" argb="255,112,37,84" value="252" />
+			<entry class="" argb="255,121,30,94" value="253" />
+			<entry class="" argb="255,127,23,105" value="254" />
+			<entry class="" argb="255,127,23,105" value="255" />
+		</table>
+	</palette>
+
+	<palette name="haze" interpolate="false">
+		<table>
+			<entry class="" argb="255,167,112,255" value="0" />
+			<entry class="" argb="255,167,112,255" value="1" />
+			<entry class="" argb="255,255,213,254" value="2" />
+			<entry class="" argb="255,254,212,251" value="3" />
+			<entry class="" argb="255,249,210,250" value="4" />
+			<entry class="" argb="255,247,209,249" value="5" />
+			<entry class="" argb="255,245,208,248" value="6" />
+			<entry class="" argb="255,243,206,247" value="7" />
+			<entry class="" argb="255,242,205,246" value="8" />
+			<entry class="" argb="255,240,203,245" value="9" />
+			<entry class="" argb="255,238,202,244" value="10" />
+			<entry class="" argb="255,236,200,243" value="11" />
+			<entry class="" argb="255,234,199,242" value="12" />
+			<entry class="" argb="255,232,198,241" value="13" />
+			<entry class="" argb="255,230,196,240" value="14" />
+			<entry class="" argb="255,228,195,239" value="15" />
+			<entry class="" argb="255,226,193,238" value="16" />
+			<entry class="" argb="255,224,192,237" value="17" />
+			<entry class="" argb="255,222,191,236" value="18" />
+			<entry class="" argb="255,220,189,235" value="19" />
+			<entry class="" argb="255,218,188,234" value="20" />
+			<entry class="" argb="255,216,186,233" value="21" />
+			<entry class="" argb="255,214,185,232" value="22" />
+			<entry class="" argb="255,212,183,231" value="23" />
+			<entry class="" argb="255,210,182,230" value="24" />
+			<entry class="" argb="255,208,181,229" value="25" />
+			<entry class="" argb="255,206,179,228" value="26" />
+			<entry class="" argb="255,204,178,227" value="27" />
+			<entry class="" argb="255,202,176,226" value="28" />
+			<entry class="" argb="255,200,175,225" value="29" />
+			<entry class="" argb="255,198,174,224" value="30" />
+			<entry class="" argb="255,196,172,223" value="31" />
+			<entry class="" argb="255,194,171,222" value="32" />
+			<entry class="" argb="255,192,169,221" value="33" />
+			<entry class="" argb="255,190,168,220" value="34" />
+			<entry class="" argb="255,188,166,219" value="35" />
+			<entry class="" argb="255,186,165,218" value="36" />
+			<entry class="" argb="255,184,164,217" value="37" />
+			<entry class="" argb="255,182,162,216" value="38" />
+			<entry class="" argb="255,180,161,215" value="39" />
+			<entry class="" argb="255,178,159,214" value="40" />
+			<entry class="" argb="255,176,158,213" value="41" />
+			<entry class="" argb="255,174,157,212" value="42" />
+			<entry class="" argb="255,172,155,211" value="43" />
+			<entry class="" argb="255,170,154,210" value="44" />
+			<entry class="" argb="255,168,152,209" value="45" />
+			<entry class="" argb="255,166,151,208" value="46" />
+			<entry class="" argb="255,164,150,207" value="47" />
+			<entry class="" argb="255,162,148,206" value="48" />
+			<entry class="" argb="255,160,147,205" value="49" />
+			<entry class="" argb="255,158,145,204" value="50" />
+			<entry class="" argb="255,156,144,203" value="51" />
+			<entry class="" argb="255,154,142,202" value="52" />
+			<entry class="" argb="255,152,141,201" value="53" />
+			<entry class="" argb="255,150,140,200" value="54" />
+			<entry class="" argb="255,148,138,199" value="55" />
+			<entry class="" argb="255,146,137,198" value="56" />
+			<entry class="" argb="255,144,135,197" value="57" />
+			<entry class="" argb="255,142,134,196" value="58" />
+			<entry class="" argb="255,141,133,195" value="59" />
+			<entry class="" argb="255,139,131,194" value="60" />
+			<entry class="" argb="255,137,130,193" value="61" />
+			<entry class="" argb="255,135,128,192" value="62" />
+			<entry class="" argb="255,133,127,191" value="63" />
+			<entry class="" argb="255,131,125,190" value="64" />
+			<entry class="" argb="255,129,124,189" value="65" />
+			<entry class="" argb="255,127,123,188" value="66" />
+			<entry class="" argb="255,125,121,187" value="67" />
+			<entry class="" argb="255,123,120,186" value="68" />
+			<entry class="" argb="255,121,118,185" value="69" />
+			<entry class="" argb="255,119,117,184" value="70" />
+			<entry class="" argb="255,117,116,183" value="71" />
+			<entry class="" argb="255,115,114,182" value="72" />
+			<entry class="" argb="255,113,113,181" value="73" />
+			<entry class="" argb="255,111,111,180" value="74" />
+			<entry class="" argb="255,109,110,179" value="75" />
+			<entry class="" argb="255,107,109,178" value="76" />
+			<entry class="" argb="255,105,107,177" value="77" />
+			<entry class="" argb="255,103,106,176" value="78" />
+			<entry class="" argb="255,101,104,175" value="79" />
+			<entry class="" argb="255,99,103,174" value="80" />
+			<entry class="" argb="255,97,101,173" value="81" />
+			<entry class="" argb="255,95,100,172" value="82" />
+			<entry class="" argb="255,93,99,171" value="83" />
+			<entry class="" argb="255,91,97,170" value="84" />
+			<entry class="" argb="255,89,96,169" value="85" />
+			<entry class="" argb="255,87,94,168" value="86" />
+			<entry class="" argb="255,85,93,167" value="87" />
+			<entry class="" argb="255,83,92,166" value="88" />
+			<entry class="" argb="255,81,90,165" value="89" />
+			<entry class="" argb="255,79,89,164" value="90" />
+			<entry class="" argb="255,77,87,163" value="91" />
+			<entry class="" argb="255,75,86,162" value="92" />
+			<entry class="" argb="255,73,84,161" value="93" />
+			<entry class="" argb="255,71,83,160" value="94" />
+			<entry class="" argb="255,69,82,159" value="95" />
+			<entry class="" argb="255,67,80,158" value="96" />
+			<entry class="" argb="255,65,79,157" value="97" />
+			<entry class="" argb="255,63,77,156" value="98" />
+			<entry class="" argb="255,61,76,155" value="99" />
+			<entry class="" argb="255,59,75,154" value="100" />
+			<entry class="" argb="255,57,73,153" value="101" />
+			<entry class="" argb="255,55,72,152" value="102" />
+			<entry class="" argb="255,53,70,151" value="103" />
+			<entry class="" argb="255,51,69,150" value="104" />
+			<entry class="" argb="255,49,68,149" value="105" />
+			<entry class="" argb="255,47,66,148" value="106" />
+			<entry class="" argb="255,45,65,147" value="107" />
+			<entry class="" argb="255,43,63,146" value="108" />
+			<entry class="" argb="255,41,62,145" value="109" />
+			<entry class="" argb="255,40,60,144" value="110" />
+			<entry class="" argb="255,38,59,143" value="111" />
+			<entry class="" argb="255,36,58,142" value="112" />
+			<entry class="" argb="255,34,56,141" value="113" />
+			<entry class="" argb="255,32,55,140" value="114" />
+			<entry class="" argb="255,30,53,139" value="115" />
+			<entry class="" argb="255,28,52,138" value="116" />
+			<entry class="" argb="255,26,51,137" value="117" />
+			<entry class="" argb="255,24,49,136" value="118" />
+			<entry class="" argb="255,22,48,135" value="119" />
+			<entry class="" argb="255,20,46,134" value="120" />
+			<entry class="" argb="255,18,45,133" value="121" />
+			<entry class="" argb="255,16,43,132" value="122" />
+			<entry class="" argb="255,14,42,131" value="123" />
+			<entry class="" argb="255,12,41,130" value="124" />
+			<entry class="" argb="255,13,39,129" value="125" />
+			<entry class="" argb="255,8,38,128" value="126" />
+			<entry class="" argb="255,6,36,127" value="127" />
+			<entry class="" argb="255,4,35,126" value="128" />
+			<entry class="" argb="255,4,34,125" value="129" />
+			<entry class="" argb="255,6,32,124" value="130" />
+			<entry class="" argb="255,7,31,123" value="131" />
+			<entry class="" argb="255,9,32,122" value="132" />
+			<entry class="" argb="255,11,33,121" value="133" />
+			<entry class="" argb="255,13,34,120" value="134" />
+			<entry class="" argb="255,15,36,119" value="135" />
+			<entry class="" argb="255,17,37,118" value="136" />
+			<entry class="" argb="255,19,38,117" value="137" />
+			<entry class="" argb="255,21,40,116" value="138" />
+			<entry class="" argb="255,23,41,115" value="139" />
+			<entry class="" argb="255,25,42,114" value="140" />
+			<entry class="" argb="255,27,44,113" value="141" />
+			<entry class="" argb="255,29,45,112" value="142" />
+			<entry class="" argb="255,31,46,111" value="143" />
+			<entry class="" argb="255,33,48,110" value="144" />
+			<entry class="" argb="255,35,49,109" value="145" />
+			<entry class="" argb="255,37,50,108" value="146" />
+			<entry class="" argb="255,39,52,107" value="147" />
+			<entry class="" argb="255,41,53,106" value="148" />
+			<entry class="" argb="255,43,54,105" value="149" />
+			<entry class="" argb="255,45,56,104" value="150" />
+			<entry class="" argb="255,47,57,103" value="151" />
+			<entry class="" argb="255,49,58,102" value="152" />
+			<entry class="" argb="255,51,60,101" value="153" />
+			<entry class="" argb="255,53,61,100" value="154" />
+			<entry class="" argb="255,55,62,99" value="155" />
+			<entry class="" argb="255,57,64,98" value="156" />
+			<entry class="" argb="255,59,65,97" value="157" />
+			<entry class="" argb="255,61,66,96" value="158" />
+			<entry class="" argb="255,63,68,95" value="159" />
+			<entry class="" argb="255,65,69,94" value="160" />
+			<entry class="" argb="255,67,70,93" value="161" />
+			<entry class="" argb="255,69,72,92" value="162" />
+			<entry class="" argb="255,71,73,91" value="163" />
+			<entry class="" argb="255,73,75,90" value="164" />
+			<entry class="" argb="255,75,76,89" value="165" />
+			<entry class="" argb="255,77,77,88" value="166" />
+			<entry class="" argb="255,79,79,87" value="167" />
+			<entry class="" argb="255,81,80,86" value="168" />
+			<entry class="" argb="255,83,81,85" value="169" />
+			<entry class="" argb="255,85,83,84" value="170" />
+			<entry class="" argb="255,87,84,83" value="171" />
+			<entry class="" argb="255,89,85,82" value="172" />
+			<entry class="" argb="255,91,87,81" value="173" />
+			<entry class="" argb="255,93,88,80" value="174" />
+			<entry class="" argb="255,95,89,79" value="175" />
+			<entry class="" argb="255,97,91,78" value="176" />
+			<entry class="" argb="255,99,92,77" value="177" />
+			<entry class="" argb="255,101,93,76" value="178" />
+			<entry class="" argb="255,103,95,75" value="179" />
+			<entry class="" argb="255,105,96,74" value="180" />
+			<entry class="" argb="255,107,97,73" value="181" />
+			<entry class="" argb="255,108,99,72" value="182" />
+			<entry class="" argb="255,110,100,71" value="183" />
+			<entry class="" argb="255,112,101,70" value="184" />
+			<entry class="" argb="255,114,103,69" value="185" />
+			<entry class="" argb="255,116,104,68" value="186" />
+			<entry class="" argb="255,118,105,67" value="187" />
+			<entry class="" argb="255,120,107,66" value="188" />
+			<entry class="" argb="255,122,108,65" value="189" />
+			<entry class="" argb="255,124,109,64" value="190" />
+			<entry class="" argb="255,126,111,63" value="191" />
+			<entry class="" argb="255,128,112,62" value="192" />
+			<entry class="" argb="255,130,113,61" value="193" />
+			<entry class="" argb="255,132,115,60" value="194" />
+			<entry class="" argb="255,134,116,59" value="195" />
+			<entry class="" argb="255,136,117,58" value="196" />
+			<entry class="" argb="255,138,119,57" value="197" />
+			<entry class="" argb="255,140,120,56" value="198" />
+			<entry class="" argb="255,142,121,55" value="199" />
+			<entry class="" argb="255,144,123,54" value="200" />
+			<entry class="" argb="255,146,124,53" value="201" />
+			<entry class="" argb="255,148,125,52" value="202" />
+			<entry class="" argb="255,150,127,51" value="203" />
+			<entry class="" argb="255,152,128,50" value="204" />
+			<entry class="" argb="255,154,129,49" value="205" />
+			<entry class="" argb="255,156,131,48" value="206" />
+			<entry class="" argb="255,158,132,47" value="207" />
+			<entry class="" argb="255,160,133,46" value="208" />
+			<entry class="" argb="255,162,135,45" value="209" />
+			<entry class="" argb="255,164,136,44" value="210" />
+			<entry class="" argb="255,166,137,43" value="211" />
+			<entry class="" argb="255,168,139,42" value="212" />
+			<entry class="" argb="255,170,140,41" value="213" />
+			<entry class="" argb="255,172,141,40" value="214" />
+			<entry class="" argb="255,174,143,39" value="215" />
+			<entry class="" argb="255,176,144,38" value="216" />
+			<entry class="" argb="255,178,145,37" value="217" />
+			<entry class="" argb="255,180,147,36" value="218" />
+			<entry class="" argb="255,182,148,35" value="219" />
+			<entry class="" argb="255,184,149,34" value="220" />
+			<entry class="" argb="255,186,151,33" value="221" />
+			<entry class="" argb="255,188,152,32" value="222" />
+			<entry class="" argb="255,190,153,31" value="223" />
+			<entry class="" argb="255,192,155,30" value="224" />
+			<entry class="" argb="255,194,156,29" value="225" />
+			<entry class="" argb="255,196,157,28" value="226" />
+			<entry class="" argb="255,198,159,27" value="227" />
+			<entry class="" argb="255,200,160,26" value="228" />
+			<entry class="" argb="255,202,161,25" value="229" />
+			<entry class="" argb="255,204,163,24" value="230" />
+			<entry class="" argb="255,206,164,23" value="231" />
+			<entry class="" argb="255,208,165,22" value="232" />
+			<entry class="" argb="255,210,167,21" value="233" />
+			<entry class="" argb="255,211,168,20" value="234" />
+			<entry class="" argb="255,213,169,19" value="235" />
+			<entry class="" argb="255,215,171,18" value="236" />
+			<entry class="" argb="255,217,172,17" value="237" />
+			<entry class="" argb="255,219,173,16" value="238" />
+			<entry class="" argb="255,221,175,15" value="239" />
+			<entry class="" argb="255,223,176,14" value="240" />
+			<entry class="" argb="255,225,177,13" value="241" />
+			<entry class="" argb="255,227,179,12" value="242" />
+			<entry class="" argb="255,229,180,11" value="243" />
+			<entry class="" argb="255,231,181,13" value="244" />
+			<entry class="" argb="255,233,183,9" value="245" />
+			<entry class="" argb="255,235,184,8" value="246" />
+			<entry class="" argb="255,237,185,7" value="247" />
+			<entry class="" argb="255,239,187,6" value="248" />
+			<entry class="" argb="255,241,188,5" value="249" />
+			<entry class="" argb="255,243,189,4" value="250" />
+			<entry class="" argb="255,245,191,3" value="251" />
+			<entry class="" argb="255,247,192,2" value="252" />
+			<entry class="" argb="255,249,193,1" value="253" />
+			<entry class="" argb="255,251,195,0" value="254" />
+			<entry class="" argb="255,251,195,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="mac-style" interpolate="false">
+		<table>
+			<entry class="" argb="255,124,0,255" value="0" />
+			<entry class="" argb="255,124,0,255" value="1" />
+			<entry class="" argb="255,120,0,254" value="2" />
+			<entry class="" argb="255,115,0,255" value="3" />
+			<entry class="" argb="255,111,0,254" value="4" />
+			<entry class="" argb="255,106,0,255" value="5" />
+			<entry class="" argb="255,102,0,254" value="6" />
+			<entry class="" argb="255,97,0,255" value="7" />
+			<entry class="" argb="255,93,0,254" value="8" />
+			<entry class="" argb="255,88,0,255" value="9" />
+			<entry class="" argb="255,84,0,254" value="10" />
+			<entry class="" argb="255,79,0,255" value="11" />
+			<entry class="" argb="255,75,0,254" value="12" />
+			<entry class="" argb="255,70,0,255" value="13" />
+			<entry class="" argb="255,66,0,254" value="14" />
+			<entry class="" argb="255,61,0,255" value="15" />
+			<entry class="" argb="255,57,0,254" value="16" />
+			<entry class="" argb="255,52,0,255" value="17" />
+			<entry class="" argb="255,48,0,254" value="18" />
+			<entry class="" argb="255,43,0,255" value="19" />
+			<entry class="" argb="255,39,0,254" value="20" />
+			<entry class="" argb="255,34,0,255" value="21" />
+			<entry class="" argb="255,30,0,254" value="22" />
+			<entry class="" argb="255,25,0,255" value="23" />
+			<entry class="" argb="255,21,0,254" value="24" />
+			<entry class="" argb="255,16,0,255" value="25" />
+			<entry class="" argb="255,12,0,254" value="26" />
+			<entry class="" argb="255,7,0,255" value="27" />
+			<entry class="" argb="255,3,0,254" value="28" />
+			<entry class="" argb="255,0,2,255" value="29" />
+			<entry class="" argb="255,0,6,254" value="30" />
+			<entry class="" argb="255,0,11,255" value="31" />
+			<entry class="" argb="255,0,15,254" value="32" />
+			<entry class="" argb="255,0,20,255" value="33" />
+			<entry class="" argb="255,0,24,254" value="34" />
+			<entry class="" argb="255,0,29,255" value="35" />
+			<entry class="" argb="255,0,33,254" value="36" />
+			<entry class="" argb="255,0,38,255" value="37" />
+			<entry class="" argb="255,0,42,254" value="38" />
+			<entry class="" argb="255,0,47,255" value="39" />
+			<entry class="" argb="255,0,51,254" value="40" />
+			<entry class="" argb="255,0,56,255" value="41" />
+			<entry class="" argb="255,0,60,254" value="42" />
+			<entry class="" argb="255,0,65,255" value="43" />
+			<entry class="" argb="255,0,69,254" value="44" />
+			<entry class="" argb="255,0,74,255" value="45" />
+			<entry class="" argb="255,0,78,254" value="46" />
+			<entry class="" argb="255,0,83,255" value="47" />
+			<entry class="" argb="255,0,87,254" value="48" />
+			<entry class="" argb="255,0,92,255" value="49" />
+			<entry class="" argb="255,0,96,254" value="50" />
+			<entry class="" argb="255,0,101,255" value="51" />
+			<entry class="" argb="255,0,105,254" value="52" />
+			<entry class="" argb="255,0,110,255" value="53" />
+			<entry class="" argb="255,0,114,254" value="54" />
+			<entry class="" argb="255,0,119,255" value="55" />
+			<entry class="" argb="255,0,122,254" value="56" />
+			<entry class="" argb="255,0,128,255" value="57" />
+			<entry class="" argb="255,0,131,254" value="58" />
+			<entry class="" argb="255,0,137,255" value="59" />
+			<entry class="" argb="255,0,140,254" value="60" />
+			<entry class="" argb="255,0,146,255" value="61" />
+			<entry class="" argb="255,0,149,254" value="62" />
+			<entry class="" argb="255,0,155,255" value="63" />
+			<entry class="" argb="255,0,158,254" value="64" />
+			<entry class="" argb="255,0,164,255" value="65" />
+			<entry class="" argb="255,0,167,254" value="66" />
+			<entry class="" argb="255,0,173,255" value="67" />
+			<entry class="" argb="255,0,176,254" value="68" />
+			<entry class="" argb="255,0,182,255" value="69" />
+			<entry class="" argb="255,0,185,254" value="70" />
+			<entry class="" argb="255,0,191,255" value="71" />
+			<entry class="" argb="255,0,194,254" value="72" />
+			<entry class="" argb="255,0,200,255" value="73" />
+			<entry class="" argb="255,0,203,254" value="74" />
+			<entry class="" argb="255,0,209,255" value="75" />
+			<entry class="" argb="255,0,212,254" value="76" />
+			<entry class="" argb="255,0,218,255" value="77" />
+			<entry class="" argb="255,0,221,254" value="78" />
+			<entry class="" argb="255,0,227,255" value="79" />
+			<entry class="" argb="255,0,230,254" value="80" />
+			<entry class="" argb="255,0,236,255" value="81" />
+			<entry class="" argb="255,0,240,254" value="82" />
+			<entry class="" argb="255,0,245,255" value="83" />
+			<entry class="" argb="255,0,249,254" value="84" />
+			<entry class="" argb="255,0,254,255" value="85" />
+			<entry class="" argb="255,0,254,250" value="86" />
+			<entry class="" argb="255,0,255,247" value="87" />
+			<entry class="" argb="255,0,254,241" value="88" />
+			<entry class="" argb="255,0,255,238" value="89" />
+			<entry class="" argb="255,0,254,232" value="90" />
+			<entry class="" argb="255,0,255,229" value="91" />
+			<entry class="" argb="255,0,254,223" value="92" />
+			<entry class="" argb="255,0,255,220" value="93" />
+			<entry class="" argb="255,0,254,214" value="94" />
+			<entry class="" argb="255,0,255,211" value="95" />
+			<entry class="" argb="255,0,254,205" value="96" />
+			<entry class="" argb="255,0,255,202" value="97" />
+			<entry class="" argb="255,0,254,196" value="98" />
+			<entry class="" argb="255,0,255,193" value="99" />
+			<entry class="" argb="255,0,254,187" value="100" />
+			<entry class="" argb="255,0,255,184" value="101" />
+			<entry class="" argb="255,0,254,178" value="102" />
+			<entry class="" argb="255,0,255,175" value="103" />
+			<entry class="" argb="255,0,254,169" value="104" />
+			<entry class="" argb="255,0,255,166" value="105" />
+			<entry class="" argb="255,0,254,160" value="106" />
+			<entry class="" argb="255,0,255,157" value="107" />
+			<entry class="" argb="255,0,254,151" value="108" />
+			<entry class="" argb="255,0,255,148" value="109" />
+			<entry class="" argb="255,0,254,142" value="110" />
+			<entry class="" argb="255,0,255,139" value="111" />
+			<entry class="" argb="255,0,254,133" value="112" />
+			<entry class="" argb="255,0,255,130" value="113" />
+			<entry class="" argb="255,0,254,125" value="114" />
+			<entry class="" argb="255,0,255,121" value="115" />
+			<entry class="" argb="255,0,254,116" value="116" />
+			<entry class="" argb="255,0,255,112" value="117" />
+			<entry class="" argb="255,0,254,107" value="118" />
+			<entry class="" argb="255,0,255,103" value="119" />
+			<entry class="" argb="255,0,254,98" value="120" />
+			<entry class="" argb="255,0,255,94" value="121" />
+			<entry class="" argb="255,0,254,89" value="122" />
+			<entry class="" argb="255,0,255,85" value="123" />
+			<entry class="" argb="255,0,254,80" value="124" />
+			<entry class="" argb="255,0,255,76" value="125" />
+			<entry class="" argb="255,0,254,71" value="126" />
+			<entry class="" argb="255,0,255,67" value="127" />
+			<entry class="" argb="255,0,254,62" value="128" />
+			<entry class="" argb="255,0,255,58" value="129" />
+			<entry class="" argb="255,0,254,53" value="130" />
+			<entry class="" argb="255,0,255,49" value="131" />
+			<entry class="" argb="255,0,254,44" value="132" />
+			<entry class="" argb="255,0,255,40" value="133" />
+			<entry class="" argb="255,0,254,35" value="134" />
+			<entry class="" argb="255,0,255,31" value="135" />
+			<entry class="" argb="255,0,254,26" value="136" />
+			<entry class="" argb="255,0,255,22" value="137" />
+			<entry class="" argb="255,0,254,17" value="138" />
+			<entry class="" argb="255,0,255,13" value="139" />
+			<entry class="" argb="255,0,254,8" value="140" />
+			<entry class="" argb="255,0,255,4" value="141" />
+			<entry class="" argb="255,1,254,0" value="142" />
+			<entry class="" argb="255,5,255,0" value="143" />
+			<entry class="" argb="255,13,254,0" value="144" />
+			<entry class="" argb="255,14,255,0" value="145" />
+			<entry class="" argb="255,19,254,0" value="146" />
+			<entry class="" argb="255,23,255,0" value="147" />
+			<entry class="" argb="255,28,254,0" value="148" />
+			<entry class="" argb="255,32,255,0" value="149" />
+			<entry class="" argb="255,37,254,0" value="150" />
+			<entry class="" argb="255,41,255,0" value="151" />
+			<entry class="" argb="255,46,254,0" value="152" />
+			<entry class="" argb="255,50,255,0" value="153" />
+			<entry class="" argb="255,55,254,0" value="154" />
+			<entry class="" argb="255,59,255,0" value="155" />
+			<entry class="" argb="255,64,254,0" value="156" />
+			<entry class="" argb="255,68,255,0" value="157" />
+			<entry class="" argb="255,73,254,0" value="158" />
+			<entry class="" argb="255,77,255,0" value="159" />
+			<entry class="" argb="255,82,254,0" value="160" />
+			<entry class="" argb="255,86,255,0" value="161" />
+			<entry class="" argb="255,91,254,0" value="162" />
+			<entry class="" argb="255,95,255,0" value="163" />
+			<entry class="" argb="255,100,254,0" value="164" />
+			<entry class="" argb="255,104,255,0" value="165" />
+			<entry class="" argb="255,109,254,0" value="166" />
+			<entry class="" argb="255,113,255,0" value="167" />
+			<entry class="" argb="255,118,254,0" value="168" />
+			<entry class="" argb="255,123,255,0" value="169" />
+			<entry class="" argb="255,126,254,0" value="170" />
+			<entry class="" argb="255,132,255,0" value="171" />
+			<entry class="" argb="255,135,254,0" value="172" />
+			<entry class="" argb="255,141,255,0" value="173" />
+			<entry class="" argb="255,144,254,0" value="174" />
+			<entry class="" argb="255,150,255,0" value="175" />
+			<entry class="" argb="255,153,254,0" value="176" />
+			<entry class="" argb="255,159,255,0" value="177" />
+			<entry class="" argb="255,162,254,0" value="178" />
+			<entry class="" argb="255,168,255,0" value="179" />
+			<entry class="" argb="255,171,254,0" value="180" />
+			<entry class="" argb="255,177,255,0" value="181" />
+			<entry class="" argb="255,180,254,0" value="182" />
+			<entry class="" argb="255,186,255,0" value="183" />
+			<entry class="" argb="255,189,254,0" value="184" />
+			<entry class="" argb="255,195,255,0" value="185" />
+			<entry class="" argb="255,198,254,0" value="186" />
+			<entry class="" argb="255,204,255,0" value="187" />
+			<entry class="" argb="255,207,254,0" value="188" />
+			<entry class="" argb="255,213,255,0" value="189" />
+			<entry class="" argb="255,216,254,0" value="190" />
+			<entry class="" argb="255,222,255,0" value="191" />
+			<entry class="" argb="255,225,254,0" value="192" />
+			<entry class="" argb="255,231,255,0" value="193" />
+			<entry class="" argb="255,234,254,0" value="194" />
+			<entry class="" argb="255,240,255,0" value="195" />
+			<entry class="" argb="255,243,254,0" value="196" />
+			<entry class="" argb="255,249,255,0" value="197" />
+			<entry class="" argb="255,252,254,0" value="198" />
+			<entry class="" argb="255,255,252,0" value="199" />
+			<entry class="" argb="255,254,247,0" value="200" />
+			<entry class="" argb="255,255,243,0" value="201" />
+			<entry class="" argb="255,254,238,0" value="202" />
+			<entry class="" argb="255,255,234,0" value="203" />
+			<entry class="" argb="255,254,229,0" value="204" />
+			<entry class="" argb="255,255,225,0" value="205" />
+			<entry class="" argb="255,254,220,0" value="206" />
+			<entry class="" argb="255,255,216,0" value="207" />
+			<entry class="" argb="255,254,211,0" value="208" />
+			<entry class="" argb="255,255,207,0" value="209" />
+			<entry class="" argb="255,254,202,0" value="210" />
+			<entry class="" argb="255,255,198,0" value="211" />
+			<entry class="" argb="255,254,193,0" value="212" />
+			<entry class="" argb="255,255,189,0" value="213" />
+			<entry class="" argb="255,254,184,0" value="214" />
+			<entry class="" argb="255,255,180,0" value="215" />
+			<entry class="" argb="255,254,175,0" value="216" />
+			<entry class="" argb="255,255,171,0" value="217" />
+			<entry class="" argb="255,254,166,0" value="218" />
+			<entry class="" argb="255,255,162,0" value="219" />
+			<entry class="" argb="255,254,157,0" value="220" />
+			<entry class="" argb="255,255,153,0" value="221" />
+			<entry class="" argb="255,254,148,0" value="222" />
+			<entry class="" argb="255,255,144,0" value="223" />
+			<entry class="" argb="255,254,139,0" value="224" />
+			<entry class="" argb="255,255,135,0" value="225" />
+			<entry class="" argb="255,254,131,0" value="226" />
+			<entry class="" argb="255,255,126,0" value="227" />
+			<entry class="" argb="255,254,122,0" value="228" />
+			<entry class="" argb="255,255,117,0" value="229" />
+			<entry class="" argb="255,254,113,0" value="230" />
+			<entry class="" argb="255,255,108,0" value="231" />
+			<entry class="" argb="255,254,104,0" value="232" />
+			<entry class="" argb="255,255,99,0" value="233" />
+			<entry class="" argb="255,254,95,0" value="234" />
+			<entry class="" argb="255,255,90,0" value="235" />
+			<entry class="" argb="255,254,86,0" value="236" />
+			<entry class="" argb="255,255,81,0" value="237" />
+			<entry class="" argb="255,254,77,0" value="238" />
+			<entry class="" argb="255,255,72,0" value="239" />
+			<entry class="" argb="255,254,68,0" value="240" />
+			<entry class="" argb="255,255,63,0" value="241" />
+			<entry class="" argb="255,254,59,0" value="242" />
+			<entry class="" argb="255,255,54,0" value="243" />
+			<entry class="" argb="255,254,50,0" value="244" />
+			<entry class="" argb="255,255,45,0" value="245" />
+			<entry class="" argb="255,254,41,0" value="246" />
+			<entry class="" argb="255,255,36,0" value="247" />
+			<entry class="" argb="255,254,32,0" value="248" />
+			<entry class="" argb="255,255,27,0" value="249" />
+			<entry class="" argb="255,254,23,0" value="250" />
+			<entry class="" argb="255,255,18,0" value="251" />
+			<entry class="" argb="255,254,14,0" value="252" />
+			<entry class="" argb="255,255,9,0" value="253" />
+			<entry class="" argb="255,255,5,0" value="254" />
+			<entry class="" argb="255,255,5,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="nature" interpolate="false">
+		<table>
+			<entry class="" argb="255,105,246,234" value="0" />
+			<entry class="" argb="255,105,246,234" value="1" />
+			<entry class="" argb="255,105,246,234" value="2" />
+			<entry class="" argb="255,105,246,234" value="3" />
+			<entry class="" argb="255,105,246,234" value="4" />
+			<entry class="" argb="255,105,246,234" value="5" />
+			<entry class="" argb="255,105,246,234" value="6" />
+			<entry class="" argb="255,105,246,234" value="7" />
+			<entry class="" argb="255,105,246,234" value="8" />
+			<entry class="" argb="255,110,251,222" value="9" />
+			<entry class="" argb="255,114,253,210" value="10" />
+			<entry class="" argb="255,123,244,186" value="11" />
+			<entry class="" argb="255,127,239,175" value="12" />
+			<entry class="" argb="255,131,235,164" value="13" />
+			<entry class="" argb="255,135,231,153" value="14" />
+			<entry class="" argb="255,143,224,132" value="15" />
+			<entry class="" argb="255,147,222,122" value="16" />
+			<entry class="" argb="255,150,219,113" value="17" />
+			<entry class="" argb="255,157,216,95" value="18" />
+			<entry class="" argb="255,160,214,87" value="19" />
+			<entry class="" argb="255,163,214,79" value="20" />
+			<entry class="" argb="255,165,213,72" value="21" />
+			<entry class="" argb="255,170,214,59" value="22" />
+			<entry class="" argb="255,172,215,54" value="23" />
+			<entry class="" argb="255,174,216,49" value="24" />
+			<entry class="" argb="255,176,218,44" value="25" />
+			<entry class="" argb="255,179,223,37" value="26" />
+			<entry class="" argb="255,180,226,34" value="27" />
+			<entry class="" argb="255,180,229,32" value="28" />
+			<entry class="" argb="255,181,237,30" value="29" />
+			<entry class="" argb="255,182,241,29" value="30" />
+			<entry class="" argb="255,181,246,30" value="31" />
+			<entry class="" argb="255,181,251,31" value="32" />
+			<entry class="" argb="255,180,248,34" value="33" />
+			<entry class="" argb="255,179,243,37" value="34" />
+			<entry class="" argb="255,177,237,40" value="35" />
+			<entry class="" argb="255,174,225,49" value="36" />
+			<entry class="" argb="255,172,218,54" value="37" />
+			<entry class="" argb="255,170,212,59" value="38" />
+			<entry class="" argb="255,168,205,66" value="39" />
+			<entry class="" argb="255,163,192,79" value="40" />
+			<entry class="" argb="255,160,186,87" value="41" />
+			<entry class="" argb="255,157,179,95" value="42" />
+			<entry class="" argb="255,154,173,104" value="43" />
+			<entry class="" argb="255,147,160,122" value="44" />
+			<entry class="" argb="255,143,154,132" value="45" />
+			<entry class="" argb="255,139,148,142" value="46" />
+			<entry class="" argb="255,131,137,164" value="47" />
+			<entry class="" argb="255,127,132,175" value="48" />
+			<entry class="" argb="255,123,127,186" value="49" />
+			<entry class="" argb="255,119,122,198" value="50" />
+			<entry class="" argb="255,110,113,222" value="51" />
+			<entry class="" argb="255,105,109,234" value="52" />
+			<entry class="" argb="255,100,105,246" value="53" />
+			<entry class="" argb="255,96,102,251" value="54" />
+			<entry class="" argb="255,87,96,227" value="55" />
+			<entry class="" argb="255,82,94,214" value="56" />
+			<entry class="" argb="255,77,92,202" value="57" />
+			<entry class="" argb="255,68,89,177" value="58" />
+			<entry class="" argb="255,63,88,165" value="59" />
+			<entry class="" argb="255,59,88,153" value="60" />
+			<entry class="" argb="255,54,88,141" value="61" />
+			<entry class="" argb="255,46,88,118" value="62" />
+			<entry class="" argb="255,42,89,107" value="63" />
+			<entry class="" argb="255,38,90,96" value="64" />
+			<entry class="" argb="255,30,93,75" value="65" />
+			<entry class="" argb="255,26,95,65" value="66" />
+			<entry class="" argb="255,23,97,56" value="67" />
+			<entry class="" argb="255,19,99,47" value="68" />
+			<entry class="" argb="255,13,104,30" value="69" />
+			<entry class="" argb="255,13,107,22" value="70" />
+			<entry class="" argb="255,8,110,15" value="71" />
+			<entry class="" argb="255,5,113,9" value="72" />
+			<entry class="" argb="255,1,120,2" value="73" />
+			<entry class="" argb="255,0,124,7" value="74" />
+			<entry class="" argb="255,2,127,12" value="75" />
+			<entry class="" argb="255,5,134,19" value="76" />
+			<entry class="" argb="255,6,138,22" value="77" />
+			<entry class="" argb="255,6,141,24" value="78" />
+			<entry class="" argb="255,7,145,25" value="79" />
+			<entry class="" argb="255,8,152,27" value="80" />
+			<entry class="" argb="255,7,155,26" value="81" />
+			<entry class="" argb="255,7,158,25" value="82" />
+			<entry class="" argb="255,6,164,22" value="83" />
+			<entry class="" argb="255,5,166,19" value="84" />
+			<entry class="" argb="255,3,169,16" value="85" />
+			<entry class="" argb="255,2,171,12" value="86" />
+			<entry class="" argb="255,1,175,2" value="87" />
+			<entry class="" argb="255,3,176,2" value="88" />
+			<entry class="" argb="255,5,178,9" value="89" />
+			<entry class="" argb="255,8,179,15" value="90" />
+			<entry class="" argb="255,13,180,30" value="91" />
+			<entry class="" argb="255,16,180,38" value="92" />
+			<entry class="" argb="255,19,180,47" value="93" />
+			<entry class="" argb="255,26,180,65" value="94" />
+			<entry class="" argb="255,30,179,75" value="95" />
+			<entry class="" argb="255,34,178,85" value="96" />
+			<entry class="" argb="255,38,176,96" value="97" />
+			<entry class="" argb="255,46,173,118" value="98" />
+			<entry class="" argb="255,50,171,129" value="99" />
+			<entry class="" argb="255,54,169,141" value="100" />
+			<entry class="" argb="255,59,166,153" value="101" />
+			<entry class="" argb="255,68,161,177" value="102" />
+			<entry class="" argb="255,73,158,189" value="103" />
+			<entry class="" argb="255,77,154,202" value="104" />
+			<entry class="" argb="255,86,148,226" value="105" />
+			<entry class="" argb="255,91,144,239" value="106" />
+			<entry class="" argb="255,96,140,251" value="107" />
+			<entry class="" argb="255,100,136,246" value="108" />
+			<entry class="" argb="255,110,128,222" value="109" />
+			<entry class="" argb="255,114,124,210" value="110" />
+			<entry class="" argb="255,119,120,198" value="111" />
+			<entry class="" argb="255,127,112,175" value="112" />
+			<entry class="" argb="255,131,108,164" value="113" />
+			<entry class="" argb="255,135,104,153" value="114" />
+			<entry class="" argb="255,139,100,142" value="115" />
+			<entry class="" argb="255,147,92,122" value="116" />
+			<entry class="" argb="255,150,88,113" value="117" />
+			<entry class="" argb="255,154,85,104" value="118" />
+			<entry class="" argb="255,157,81,95" value="119" />
+			<entry class="" argb="255,163,74,79" value="120" />
+			<entry class="" argb="255,165,71,72" value="121" />
+			<entry class="" argb="255,168,68,66" value="122" />
+			<entry class="" argb="255,172,62,54" value="123" />
+			<entry class="" argb="255,174,60,49" value="124" />
+			<entry class="" argb="255,176,57,44" value="125" />
+			<entry class="" argb="255,177,55,40" value="126" />
+			<entry class="" argb="255,180,51,34" value="127" />
+			<entry class="" argb="255,180,50,32" value="128" />
+			<entry class="" argb="255,181,48,31" value="129" />
+			<entry class="" argb="255,182,46,29" value="130" />
+			<entry class="" argb="255,181,45,30" value="131" />
+			<entry class="" argb="255,181,44,31" value="132" />
+			<entry class="" argb="255,180,44,32" value="133" />
+			<entry class="" argb="255,179,43,37" value="134" />
+			<entry class="" argb="255,177,43,40" value="135" />
+			<entry class="" argb="255,176,43,44" value="136" />
+			<entry class="" argb="255,174,44,49" value="137" />
+			<entry class="" argb="255,170,44,59" value="138" />
+			<entry class="" argb="255,168,45,66" value="139" />
+			<entry class="" argb="255,165,46,72" value="140" />
+			<entry class="" argb="255,160,47,87" value="141" />
+			<entry class="" argb="255,157,48,95" value="142" />
+			<entry class="" argb="255,154,49,104" value="143" />
+			<entry class="" argb="255,150,51,113" value="144" />
+			<entry class="" argb="255,143,53,132" value="145" />
+			<entry class="" argb="255,139,54,142" value="146" />
+			<entry class="" argb="255,135,55,153" value="147" />
+			<entry class="" argb="255,127,57,175" value="148" />
+			<entry class="" argb="255,123,59,186" value="149" />
+			<entry class="" argb="255,119,60,198" value="150" />
+			<entry class="" argb="255,114,61,210" value="151" />
+			<entry class="" argb="255,105,63,234" value="152" />
+			<entry class="" argb="255,100,64,246" value="153" />
+			<entry class="" argb="255,96,64,251" value="154" />
+			<entry class="" argb="255,91,65,239" value="155" />
+			<entry class="" argb="255,82,66,214" value="156" />
+			<entry class="" argb="255,77,67,202" value="157" />
+			<entry class="" argb="255,73,67,189" value="158" />
+			<entry class="" argb="255,63,67,165" value="159" />
+			<entry class="" argb="255,59,67,153" value="160" />
+			<entry class="" argb="255,54,67,141" value="161" />
+			<entry class="" argb="255,50,67,129" value="162" />
+			<entry class="" argb="255,42,66,107" value="163" />
+			<entry class="" argb="255,38,66,96" value="164" />
+			<entry class="" argb="255,34,65,85" value="165" />
+			<entry class="" argb="255,30,64,75" value="166" />
+			<entry class="" argb="255,23,62,56" value="167" />
+			<entry class="" argb="255,19,61,47" value="168" />
+			<entry class="" argb="255,16,60,38" value="169" />
+			<entry class="" argb="255,13,58,22" value="170" />
+			<entry class="" argb="255,8,56,15" value="171" />
+			<entry class="" argb="255,5,55,9" value="172" />
+			<entry class="" argb="255,3,53,2" value="173" />
+			<entry class="" argb="255,0,50,7" value="174" />
+			<entry class="" argb="255,2,48,12" value="175" />
+			<entry class="" argb="255,3,46,16" value="176" />
+			<entry class="" argb="255,6,43,22" value="177" />
+			<entry class="" argb="255,6,41,24" value="178" />
+			<entry class="" argb="255,7,39,25" value="179" />
+			<entry class="" argb="255,7,37,26" value="180" />
+			<entry class="" argb="255,7,34,26" value="181" />
+			<entry class="" argb="255,7,32,25" value="182" />
+			<entry class="" argb="255,6,30,24" value="183" />
+			<entry class="" argb="255,6,28,22" value="184" />
+			<entry class="" argb="255,3,25,16" value="185" />
+			<entry class="" argb="255,2,23,12" value="186" />
+			<entry class="" argb="255,0,22,7" value="187" />
+			<entry class="" argb="255,3,19,2" value="188" />
+			<entry class="" argb="255,5,17,9" value="189" />
+			<entry class="" argb="255,8,16,15" value="190" />
+			<entry class="" argb="255,13,15,22" value="191" />
+			<entry class="" argb="255,16,12,38" value="192" />
+			<entry class="" argb="255,19,11,47" value="193" />
+			<entry class="" argb="255,23,13,56" value="194" />
+			<entry class="" argb="255,30,8,75" value="195" />
+			<entry class="" argb="255,34,7,85" value="196" />
+			<entry class="" argb="255,38,6,96" value="197" />
+			<entry class="" argb="255,42,6,107" value="198" />
+			<entry class="" argb="255,50,4,129" value="199" />
+			<entry class="" argb="255,54,4,141" value="200" />
+			<entry class="" argb="255,59,3,153" value="201" />
+			<entry class="" argb="255,63,2,165" value="202" />
+			<entry class="" argb="255,73,1,189" value="203" />
+			<entry class="" argb="255,77,1,202" value="204" />
+			<entry class="" argb="255,82,0,214" value="205" />
+			<entry class="" argb="255,82,0,214" value="206" />
+			<entry class="" argb="255,82,0,214" value="207" />
+			<entry class="" argb="255,82,0,214" value="208" />
+			<entry class="" argb="255,82,0,214" value="209" />
+			<entry class="" argb="255,82,0,214" value="210" />
+			<entry class="" argb="255,82,0,214" value="211" />
+			<entry class="" argb="255,82,0,214" value="212" />
+			<entry class="" argb="255,82,0,214" value="213" />
+			<entry class="" argb="255,82,0,214" value="214" />
+			<entry class="" argb="255,82,0,214" value="215" />
+			<entry class="" argb="255,82,0,214" value="216" />
+			<entry class="" argb="255,82,0,214" value="217" />
+			<entry class="" argb="255,82,0,214" value="218" />
+			<entry class="" argb="255,82,0,214" value="219" />
+			<entry class="" argb="255,82,0,214" value="220" />
+			<entry class="" argb="255,82,0,214" value="221" />
+			<entry class="" argb="255,82,0,214" value="222" />
+			<entry class="" argb="255,82,0,214" value="223" />
+			<entry class="" argb="255,82,0,214" value="224" />
+			<entry class="" argb="255,82,0,214" value="225" />
+			<entry class="" argb="255,82,0,214" value="226" />
+			<entry class="" argb="255,82,0,214" value="227" />
+			<entry class="" argb="255,82,0,214" value="228" />
+			<entry class="" argb="255,82,0,214" value="229" />
+			<entry class="" argb="255,82,0,214" value="230" />
+			<entry class="" argb="255,82,0,214" value="231" />
+			<entry class="" argb="255,82,0,214" value="232" />
+			<entry class="" argb="255,82,0,214" value="233" />
+			<entry class="" argb="255,82,0,214" value="234" />
+			<entry class="" argb="255,82,0,214" value="235" />
+			<entry class="" argb="255,82,0,214" value="236" />
+			<entry class="" argb="255,82,0,214" value="237" />
+			<entry class="" argb="255,82,0,214" value="238" />
+			<entry class="" argb="255,82,0,214" value="239" />
+			<entry class="" argb="255,82,0,214" value="240" />
+			<entry class="" argb="255,82,0,214" value="241" />
+			<entry class="" argb="255,82,0,214" value="242" />
+			<entry class="" argb="255,82,0,214" value="243" />
+			<entry class="" argb="255,82,0,214" value="244" />
+			<entry class="" argb="255,82,0,214" value="245" />
+			<entry class="" argb="255,82,0,214" value="246" />
+			<entry class="" argb="255,82,0,214" value="247" />
+			<entry class="" argb="255,82,0,214" value="248" />
+			<entry class="" argb="255,82,0,214" value="249" />
+			<entry class="" argb="255,82,0,214" value="250" />
+			<entry class="" argb="255,82,0,214" value="251" />
+			<entry class="" argb="255,82,0,214" value="252" />
+			<entry class="" argb="255,0,0,0" value="253" />
+			<entry class="" argb="255,255,255,255" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="pastels" interpolate="false">
+		<table>
+			<entry class="" argb="255,255,0,72" value="0" />
+			<entry class="" argb="255,255,0,72" value="1" />
+			<entry class="" argb="255,255,0,74" value="2" />
+			<entry class="" argb="255,255,0,76" value="3" />
+			<entry class="" argb="255,255,0,78" value="4" />
+			<entry class="" argb="255,255,0,80" value="5" />
+			<entry class="" argb="255,255,0,82" value="6" />
+			<entry class="" argb="255,255,0,84" value="7" />
+			<entry class="" argb="255,255,0,86" value="8" />
+			<entry class="" argb="255,255,0,88" value="9" />
+			<entry class="" argb="255,255,0,90" value="10" />
+			<entry class="" argb="255,255,0,91" value="11" />
+			<entry class="" argb="255,255,0,93" value="12" />
+			<entry class="" argb="255,255,0,95" value="13" />
+			<entry class="" argb="255,255,0,97" value="14" />
+			<entry class="" argb="255,255,0,99" value="15" />
+			<entry class="" argb="255,255,0,101" value="16" />
+			<entry class="" argb="255,255,0,103" value="17" />
+			<entry class="" argb="255,255,0,105" value="18" />
+			<entry class="" argb="255,255,0,107" value="19" />
+			<entry class="" argb="255,255,0,109" value="20" />
+			<entry class="" argb="255,255,0,111" value="21" />
+			<entry class="" argb="255,255,0,113" value="22" />
+			<entry class="" argb="255,255,0,115" value="23" />
+			<entry class="" argb="255,255,0,117" value="24" />
+			<entry class="" argb="255,255,0,119" value="25" />
+			<entry class="" argb="255,255,0,121" value="26" />
+			<entry class="" argb="255,255,0,123" value="27" />
+			<entry class="" argb="255,255,0,125" value="28" />
+			<entry class="" argb="255,255,0,127" value="29" />
+			<entry class="" argb="255,255,0,129" value="30" />
+			<entry class="" argb="255,255,0,131" value="31" />
+			<entry class="" argb="255,255,0,133" value="32" />
+			<entry class="" argb="255,255,0,135" value="33" />
+			<entry class="" argb="255,255,0,137" value="34" />
+			<entry class="" argb="255,255,0,139" value="35" />
+			<entry class="" argb="255,255,0,141" value="36" />
+			<entry class="" argb="255,255,0,142" value="37" />
+			<entry class="" argb="255,255,0,144" value="38" />
+			<entry class="" argb="255,255,0,146" value="39" />
+			<entry class="" argb="255,255,0,148" value="40" />
+			<entry class="" argb="255,255,0,150" value="41" />
+			<entry class="" argb="255,255,0,152" value="42" />
+			<entry class="" argb="255,255,0,154" value="43" />
+			<entry class="" argb="255,255,0,156" value="44" />
+			<entry class="" argb="255,255,0,158" value="45" />
+			<entry class="" argb="255,255,0,160" value="46" />
+			<entry class="" argb="255,255,0,162" value="47" />
+			<entry class="" argb="255,255,0,164" value="48" />
+			<entry class="" argb="255,255,0,166" value="49" />
+			<entry class="" argb="255,255,0,168" value="50" />
+			<entry class="" argb="255,255,0,170" value="51" />
+			<entry class="" argb="255,255,0,172" value="52" />
+			<entry class="" argb="255,255,0,174" value="53" />
+			<entry class="" argb="255,255,0,176" value="54" />
+			<entry class="" argb="255,255,0,178" value="55" />
+			<entry class="" argb="255,255,0,180" value="56" />
+			<entry class="" argb="255,255,0,182" value="57" />
+			<entry class="" argb="255,255,0,184" value="58" />
+			<entry class="" argb="255,255,0,186" value="59" />
+			<entry class="" argb="255,255,0,188" value="60" />
+			<entry class="" argb="255,255,0,190" value="61" />
+			<entry class="" argb="255,255,0,191" value="62" />
+			<entry class="" argb="255,255,0,193" value="63" />
+			<entry class="" argb="255,255,0,195" value="64" />
+			<entry class="" argb="255,255,0,197" value="65" />
+			<entry class="" argb="255,255,0,199" value="66" />
+			<entry class="" argb="255,255,0,201" value="67" />
+			<entry class="" argb="255,255,0,203" value="68" />
+			<entry class="" argb="255,255,0,205" value="69" />
+			<entry class="" argb="255,255,0,207" value="70" />
+			<entry class="" argb="255,255,0,209" value="71" />
+			<entry class="" argb="255,255,0,211" value="72" />
+			<entry class="" argb="255,255,0,213" value="73" />
+			<entry class="" argb="255,255,0,215" value="74" />
+			<entry class="" argb="255,255,0,217" value="75" />
+			<entry class="" argb="255,255,0,219" value="76" />
+			<entry class="" argb="255,255,0,221" value="77" />
+			<entry class="" argb="255,255,0,223" value="78" />
+			<entry class="" argb="255,255,0,225" value="79" />
+			<entry class="" argb="255,255,0,227" value="80" />
+			<entry class="" argb="255,255,0,229" value="81" />
+			<entry class="" argb="255,255,0,231" value="82" />
+			<entry class="" argb="255,255,0,233" value="83" />
+			<entry class="" argb="255,255,0,235" value="84" />
+			<entry class="" argb="255,255,0,237" value="85" />
+			<entry class="" argb="255,255,0,239" value="86" />
+			<entry class="" argb="255,255,0,241" value="87" />
+			<entry class="" argb="255,255,0,242" value="88" />
+			<entry class="" argb="255,255,0,244" value="89" />
+			<entry class="" argb="255,255,0,246" value="90" />
+			<entry class="" argb="255,255,0,248" value="91" />
+			<entry class="" argb="255,255,0,250" value="92" />
+			<entry class="" argb="255,255,0,252" value="93" />
+			<entry class="" argb="255,255,0,254" value="94" />
+			<entry class="" argb="255,253,0,255" value="95" />
+			<entry class="" argb="255,251,0,255" value="96" />
+			<entry class="" argb="255,249,0,255" value="97" />
+			<entry class="" argb="255,247,0,255" value="98" />
+			<entry class="" argb="255,245,0,255" value="99" />
+			<entry class="" argb="255,243,0,255" value="100" />
+			<entry class="" argb="255,241,0,255" value="101" />
+			<entry class="" argb="255,239,0,255" value="102" />
+			<entry class="" argb="255,237,0,255" value="103" />
+			<entry class="" argb="255,235,0,255" value="104" />
+			<entry class="" argb="255,233,0,255" value="105" />
+			<entry class="" argb="255,231,0,255" value="106" />
+			<entry class="" argb="255,229,0,255" value="107" />
+			<entry class="" argb="255,227,0,255" value="108" />
+			<entry class="" argb="255,225,0,255" value="109" />
+			<entry class="" argb="255,223,0,255" value="110" />
+			<entry class="" argb="255,221,0,255" value="111" />
+			<entry class="" argb="255,219,0,255" value="112" />
+			<entry class="" argb="255,217,0,255" value="113" />
+			<entry class="" argb="255,216,0,255" value="114" />
+			<entry class="" argb="255,214,0,255" value="115" />
+			<entry class="" argb="255,212,0,255" value="116" />
+			<entry class="" argb="255,210,0,255" value="117" />
+			<entry class="" argb="255,208,0,255" value="118" />
+			<entry class="" argb="255,206,0,255" value="119" />
+			<entry class="" argb="255,204,0,255" value="120" />
+			<entry class="" argb="255,202,0,255" value="121" />
+			<entry class="" argb="255,200,0,255" value="122" />
+			<entry class="" argb="255,198,0,255" value="123" />
+			<entry class="" argb="255,196,0,255" value="124" />
+			<entry class="" argb="255,194,0,255" value="125" />
+			<entry class="" argb="255,192,0,255" value="126" />
+			<entry class="" argb="255,190,0,255" value="127" />
+			<entry class="" argb="255,188,0,255" value="128" />
+			<entry class="" argb="255,186,0,255" value="129" />
+			<entry class="" argb="255,0,140,255" value="130" />
+			<entry class="" argb="255,0,146,255" value="131" />
+			<entry class="" argb="255,0,152,255" value="132" />
+			<entry class="" argb="255,0,157,255" value="133" />
+			<entry class="" argb="255,0,163,255" value="134" />
+			<entry class="" argb="255,0,169,255" value="135" />
+			<entry class="" argb="255,0,174,255" value="136" />
+			<entry class="" argb="255,0,180,255" value="137" />
+			<entry class="" argb="255,0,186,255" value="138" />
+			<entry class="" argb="255,0,192,255" value="139" />
+			<entry class="" argb="255,0,197,255" value="140" />
+			<entry class="" argb="255,0,203,255" value="141" />
+			<entry class="" argb="255,0,209,255" value="142" />
+			<entry class="" argb="255,0,214,255" value="143" />
+			<entry class="" argb="255,0,220,255" value="144" />
+			<entry class="" argb="255,0,226,255" value="145" />
+			<entry class="" argb="255,0,232,255" value="146" />
+			<entry class="" argb="255,0,237,255" value="147" />
+			<entry class="" argb="255,0,243,255" value="148" />
+			<entry class="" argb="255,0,249,255" value="149" />
+			<entry class="" argb="255,0,255,255" value="150" />
+			<entry class="" argb="255,0,255,249" value="151" />
+			<entry class="" argb="255,0,255,243" value="152" />
+			<entry class="" argb="255,0,255,237" value="153" />
+			<entry class="" argb="255,0,255,232" value="154" />
+			<entry class="" argb="255,0,255,226" value="155" />
+			<entry class="" argb="255,0,255,220" value="156" />
+			<entry class="" argb="255,0,255,214" value="157" />
+			<entry class="" argb="255,0,255,209" value="158" />
+			<entry class="" argb="255,0,255,203" value="159" />
+			<entry class="" argb="255,0,255,197" value="160" />
+			<entry class="" argb="255,0,255,192" value="161" />
+			<entry class="" argb="255,0,255,186" value="162" />
+			<entry class="" argb="255,0,255,180" value="163" />
+			<entry class="" argb="255,0,255,174" value="164" />
+			<entry class="" argb="255,0,255,169" value="165" />
+			<entry class="" argb="255,0,255,163" value="166" />
+			<entry class="" argb="255,0,255,157" value="167" />
+			<entry class="" argb="255,0,255,152" value="168" />
+			<entry class="" argb="255,0,255,146" value="169" />
+			<entry class="" argb="255,0,255,140" value="170" />
+			<entry class="" argb="255,0,255,134" value="171" />
+			<entry class="" argb="255,0,255,129" value="172" />
+			<entry class="" argb="255,0,255,123" value="173" />
+			<entry class="" argb="255,0,255,117" value="174" />
+			<entry class="" argb="255,0,255,112" value="175" />
+			<entry class="" argb="255,0,255,106" value="176" />
+			<entry class="" argb="255,0,255,100" value="177" />
+			<entry class="" argb="255,0,255,94" value="178" />
+			<entry class="" argb="255,0,255,89" value="179" />
+			<entry class="" argb="255,0,255,83" value="180" />
+			<entry class="" argb="255,0,255,77" value="181" />
+			<entry class="" argb="255,0,255,71" value="182" />
+			<entry class="" argb="255,0,255,66" value="183" />
+			<entry class="" argb="255,0,255,60" value="184" />
+			<entry class="" argb="255,0,255,54" value="185" />
+			<entry class="" argb="255,0,255,49" value="186" />
+			<entry class="" argb="255,0,255,43" value="187" />
+			<entry class="" argb="255,0,255,37" value="188" />
+			<entry class="" argb="255,0,255,31" value="189" />
+			<entry class="" argb="255,0,255,26" value="190" />
+			<entry class="" argb="255,0,255,20" value="191" />
+			<entry class="" argb="255,0,255,14" value="192" />
+			<entry class="" argb="255,0,255,9" value="193" />
+			<entry class="" argb="255,0,255,3" value="194" />
+			<entry class="" argb="255,2,255,0" value="195" />
+			<entry class="" argb="255,8,255,0" value="196" />
+			<entry class="" argb="255,13,255,0" value="197" />
+			<entry class="" argb="255,19,255,0" value="198" />
+			<entry class="" argb="255,25,255,0" value="199" />
+			<entry class="" argb="255,30,255,0" value="200" />
+			<entry class="" argb="255,36,255,0" value="201" />
+			<entry class="" argb="255,42,255,0" value="202" />
+			<entry class="" argb="255,48,255,0" value="203" />
+			<entry class="" argb="255,53,255,0" value="204" />
+			<entry class="" argb="255,59,255,0" value="205" />
+			<entry class="" argb="255,65,255,0" value="206" />
+			<entry class="" argb="255,71,255,0" value="207" />
+			<entry class="" argb="255,76,255,0" value="208" />
+			<entry class="" argb="255,82,255,0" value="209" />
+			<entry class="" argb="255,88,255,0" value="210" />
+			<entry class="" argb="255,93,255,0" value="211" />
+			<entry class="" argb="255,99,255,0" value="212" />
+			<entry class="" argb="255,105,255,0" value="213" />
+			<entry class="" argb="255,111,255,0" value="214" />
+			<entry class="" argb="255,116,255,0" value="215" />
+			<entry class="" argb="255,122,255,0" value="216" />
+			<entry class="" argb="255,128,255,0" value="217" />
+			<entry class="" argb="255,133,255,0" value="218" />
+			<entry class="" argb="255,139,255,0" value="219" />
+			<entry class="" argb="255,145,255,0" value="220" />
+			<entry class="" argb="255,151,255,0" value="221" />
+			<entry class="" argb="255,156,255,0" value="222" />
+			<entry class="" argb="255,162,255,0" value="223" />
+			<entry class="" argb="255,168,255,0" value="224" />
+			<entry class="" argb="255,173,255,0" value="225" />
+			<entry class="" argb="255,179,255,0" value="226" />
+			<entry class="" argb="255,185,255,0" value="227" />
+			<entry class="" argb="255,191,255,0" value="228" />
+			<entry class="" argb="255,196,255,0" value="229" />
+			<entry class="" argb="255,202,255,0" value="230" />
+			<entry class="" argb="255,208,255,0" value="231" />
+			<entry class="" argb="255,214,255,0" value="232" />
+			<entry class="" argb="255,219,255,0" value="233" />
+			<entry class="" argb="255,225,255,0" value="234" />
+			<entry class="" argb="255,231,255,0" value="235" />
+			<entry class="" argb="255,236,255,0" value="236" />
+			<entry class="" argb="255,242,255,0" value="237" />
+			<entry class="" argb="255,248,255,0" value="238" />
+			<entry class="" argb="255,254,255,0" value="239" />
+			<entry class="" argb="255,255,250,0" value="240" />
+			<entry class="" argb="255,255,244,0" value="241" />
+			<entry class="" argb="255,255,238,0" value="242" />
+			<entry class="" argb="255,255,233,0" value="243" />
+			<entry class="" argb="255,255,227,0" value="244" />
+			<entry class="" argb="255,255,221,0" value="245" />
+			<entry class="" argb="255,255,215,0" value="246" />
+			<entry class="" argb="255,255,210,0" value="247" />
+			<entry class="" argb="255,255,204,0" value="248" />
+			<entry class="" argb="255,255,198,0" value="249" />
+			<entry class="" argb="255,255,193,0" value="250" />
+			<entry class="" argb="255,255,187,0" value="251" />
+			<entry class="" argb="255,255,181,0" value="252" />
+			<entry class="" argb="255,255,175,0" value="253" />
+			<entry class="" argb="255,255,170,0" value="254" />
+			<entry class="" argb="255,255,170,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="plasma" interpolate="false">
+		<table>
+			<entry class="" argb="255,2,19,7" value="0" />
+			<entry class="" argb="255,2,19,7" value="1" />
+			<entry class="" argb="255,3,20,11" value="2" />
+			<entry class="" argb="255,4,22,15" value="3" />
+			<entry class="" argb="255,5,25,19" value="4" />
+			<entry class="" argb="255,6,29,22" value="5" />
+			<entry class="" argb="255,7,33,26" value="6" />
+			<entry class="" argb="255,8,38,30" value="7" />
+			<entry class="" argb="255,9,44,34" value="8" />
+			<entry class="" argb="255,13,51,39" value="9" />
+			<entry class="" argb="255,11,58,43" value="10" />
+			<entry class="" argb="255,13,65,47" value="11" />
+			<entry class="" argb="255,14,73,51" value="12" />
+			<entry class="" argb="255,15,81,55" value="13" />
+			<entry class="" argb="255,16,89,59" value="14" />
+			<entry class="" argb="255,17,98,63" value="15" />
+			<entry class="" argb="255,18,106,67" value="16" />
+			<entry class="" argb="255,19,115,71" value="17" />
+			<entry class="" argb="255,21,124,75" value="18" />
+			<entry class="" argb="255,22,132,78" value="19" />
+			<entry class="" argb="255,23,140,82" value="20" />
+			<entry class="" argb="255,24,148,86" value="21" />
+			<entry class="" argb="255,25,155,90" value="22" />
+			<entry class="" argb="255,26,162,93" value="23" />
+			<entry class="" argb="255,27,169,97" value="24" />
+			<entry class="" argb="255,28,175,100" value="25" />
+			<entry class="" argb="255,30,180,103" value="26" />
+			<entry class="" argb="255,31,184,107" value="27" />
+			<entry class="" argb="255,32,188,110" value="28" />
+			<entry class="" argb="255,33,191,113" value="29" />
+			<entry class="" argb="255,34,193,116" value="30" />
+			<entry class="" argb="255,35,194,119" value="31" />
+			<entry class="" argb="255,36,195,122" value="32" />
+			<entry class="" argb="255,37,194,125" value="33" />
+			<entry class="" argb="255,38,193,128" value="34" />
+			<entry class="" argb="255,39,191,130" value="35" />
+			<entry class="" argb="255,39,188,133" value="36" />
+			<entry class="" argb="255,40,184,136" value="37" />
+			<entry class="" argb="255,41,180,139" value="38" />
+			<entry class="" argb="255,42,175,141" value="39" />
+			<entry class="" argb="255,43,169,144" value="40" />
+			<entry class="" argb="255,44,162,147" value="41" />
+			<entry class="" argb="255,45,155,150" value="42" />
+			<entry class="" argb="255,46,148,153" value="43" />
+			<entry class="" argb="255,46,140,156" value="44" />
+			<entry class="" argb="255,47,132,159" value="45" />
+			<entry class="" argb="255,48,124,162" value="46" />
+			<entry class="" argb="255,49,115,165" value="47" />
+			<entry class="" argb="255,50,107,169" value="48" />
+			<entry class="" argb="255,51,98,172" value="49" />
+			<entry class="" argb="255,52,89,176" value="50" />
+			<entry class="" argb="255,53,81,180" value="51" />
+			<entry class="" argb="255,54,73,184" value="52" />
+			<entry class="" argb="255,55,65,188" value="53" />
+			<entry class="" argb="255,56,58,192" value="54" />
+			<entry class="" argb="255,57,51,196" value="55" />
+			<entry class="" argb="255,58,44,201" value="56" />
+			<entry class="" argb="255,59,38,205" value="57" />
+			<entry class="" argb="255,60,33,210" value="58" />
+			<entry class="" argb="255,61,29,215" value="59" />
+			<entry class="" argb="255,62,25,220" value="60" />
+			<entry class="" argb="255,63,22,225" value="61" />
+			<entry class="" argb="255,65,20,230" value="62" />
+			<entry class="" argb="255,66,19,235" value="63" />
+			<entry class="" argb="255,67,19,241" value="64" />
+			<entry class="" argb="255,68,19,246" value="65" />
+			<entry class="" argb="255,70,20,251" value="66" />
+			<entry class="" argb="255,71,22,253" value="67" />
+			<entry class="" argb="255,72,25,248" value="68" />
+			<entry class="" argb="255,74,29,243" value="69" />
+			<entry class="" argb="255,75,33,237" value="70" />
+			<entry class="" argb="255,77,38,232" value="71" />
+			<entry class="" argb="255,78,44,227" value="72" />
+			<entry class="" argb="255,79,51,222" value="73" />
+			<entry class="" argb="255,81,58,217" value="74" />
+			<entry class="" argb="255,82,65,212" value="75" />
+			<entry class="" argb="255,84,73,207" value="76" />
+			<entry class="" argb="255,85,81,202" value="77" />
+			<entry class="" argb="255,86,89,198" value="78" />
+			<entry class="" argb="255,88,98,194" value="79" />
+			<entry class="" argb="255,89,107,190" value="80" />
+			<entry class="" argb="255,90,115,186" value="81" />
+			<entry class="" argb="255,92,124,182" value="82" />
+			<entry class="" argb="255,93,132,179" value="83" />
+			<entry class="" argb="255,94,140,176" value="84" />
+			<entry class="" argb="255,95,148,172" value="85" />
+			<entry class="" argb="255,97,155,170" value="86" />
+			<entry class="" argb="255,98,162,167" value="87" />
+			<entry class="" argb="255,99,169,165" value="88" />
+			<entry class="" argb="255,100,175,162" value="89" />
+			<entry class="" argb="255,101,180,160" value="90" />
+			<entry class="" argb="255,102,184,158" value="91" />
+			<entry class="" argb="255,103,188,157" value="92" />
+			<entry class="" argb="255,103,191,155" value="93" />
+			<entry class="" argb="255,104,193,154" value="94" />
+			<entry class="" argb="255,105,194,152" value="95" />
+			<entry class="" argb="255,106,195,151" value="96" />
+			<entry class="" argb="255,107,194,150" value="97" />
+			<entry class="" argb="255,107,193,148" value="98" />
+			<entry class="" argb="255,108,191,147" value="99" />
+			<entry class="" argb="255,108,188,146" value="100" />
+			<entry class="" argb="255,109,184,144" value="101" />
+			<entry class="" argb="255,110,180,143" value="102" />
+			<entry class="" argb="255,110,175,141" value="103" />
+			<entry class="" argb="255,111,169,140" value="104" />
+			<entry class="" argb="255,111,162,138" value="105" />
+			<entry class="" argb="255,112,155,136" value="106" />
+			<entry class="" argb="255,113,148,134" value="107" />
+			<entry class="" argb="255,113,140,132" value="108" />
+			<entry class="" argb="255,114,132,129" value="109" />
+			<entry class="" argb="255,114,124,126" value="110" />
+			<entry class="" argb="255,115,115,123" value="111" />
+			<entry class="" argb="255,116,106,120" value="112" />
+			<entry class="" argb="255,117,98,116" value="113" />
+			<entry class="" argb="255,117,89,113" value="114" />
+			<entry class="" argb="255,118,81,108" value="115" />
+			<entry class="" argb="255,119,73,104" value="116" />
+			<entry class="" argb="255,120,65,99" value="117" />
+			<entry class="" argb="255,121,58,94" value="118" />
+			<entry class="" argb="255,122,51,89" value="119" />
+			<entry class="" argb="255,123,44,83" value="120" />
+			<entry class="" argb="255,124,38,78" value="121" />
+			<entry class="" argb="255,125,33,72" value="122" />
+			<entry class="" argb="255,127,29,65" value="123" />
+			<entry class="" argb="255,128,25,59" value="124" />
+			<entry class="" argb="255,129,22,53" value="125" />
+			<entry class="" argb="255,131,20,46" value="126" />
+			<entry class="" argb="255,132,19,39" value="127" />
+			<entry class="" argb="255,134,19,32" value="128" />
+			<entry class="" argb="255,135,19,25" value="129" />
+			<entry class="" argb="255,137,20,18" value="130" />
+			<entry class="" argb="255,138,22,11" value="131" />
+			<entry class="" argb="255,140,25,5" value="132" />
+			<entry class="" argb="255,142,29,253" value="133" />
+			<entry class="" argb="255,143,33,246" value="134" />
+			<entry class="" argb="255,145,38,239" value="135" />
+			<entry class="" argb="255,147,44,233" value="136" />
+			<entry class="" argb="255,149,51,227" value="137" />
+			<entry class="" argb="255,150,58,221" value="138" />
+			<entry class="" argb="255,152,65,215" value="139" />
+			<entry class="" argb="255,154,73,210" value="140" />
+			<entry class="" argb="255,155,81,205" value="141" />
+			<entry class="" argb="255,157,89,200" value="142" />
+			<entry class="" argb="255,158,98,195" value="143" />
+			<entry class="" argb="255,160,107,191" value="144" />
+			<entry class="" argb="255,161,115,188" value="145" />
+			<entry class="" argb="255,163,124,184" value="146" />
+			<entry class="" argb="255,164,132,181" value="147" />
+			<entry class="" argb="255,166,140,178" value="148" />
+			<entry class="" argb="255,167,148,176" value="149" />
+			<entry class="" argb="255,168,155,174" value="150" />
+			<entry class="" argb="255,169,162,172" value="151" />
+			<entry class="" argb="255,170,169,171" value="152" />
+			<entry class="" argb="255,171,175,170" value="153" />
+			<entry class="" argb="255,172,180,169" value="154" />
+			<entry class="" argb="255,173,184,169" value="155" />
+			<entry class="" argb="255,174,188,168" value="156" />
+			<entry class="" argb="255,174,191,168" value="157" />
+			<entry class="" argb="255,175,193,168" value="158" />
+			<entry class="" argb="255,175,194,168" value="159" />
+			<entry class="" argb="255,176,195,169" value="160" />
+			<entry class="" argb="255,176,194,169" value="161" />
+			<entry class="" argb="255,177,193,169" value="162" />
+			<entry class="" argb="255,177,191,169" value="163" />
+			<entry class="" argb="255,178,188,170" value="164" />
+			<entry class="" argb="255,178,184,170" value="165" />
+			<entry class="" argb="255,178,180,170" value="166" />
+			<entry class="" argb="255,178,175,169" value="167" />
+			<entry class="" argb="255,179,169,169" value="168" />
+			<entry class="" argb="255,179,162,168" value="169" />
+			<entry class="" argb="255,179,155,167" value="170" />
+			<entry class="" argb="255,180,148,166" value="171" />
+			<entry class="" argb="255,180,140,164" value="172" />
+			<entry class="" argb="255,180,132,162" value="173" />
+			<entry class="" argb="255,181,124,160" value="174" />
+			<entry class="" argb="255,181,115,157" value="175" />
+			<entry class="" argb="255,182,106,154" value="176" />
+			<entry class="" argb="255,182,98,150" value="177" />
+			<entry class="" argb="255,183,89,146" value="178" />
+			<entry class="" argb="255,184,81,141" value="179" />
+			<entry class="" argb="255,184,73,136" value="180" />
+			<entry class="" argb="255,185,65,131" value="181" />
+			<entry class="" argb="255,186,58,125" value="182" />
+			<entry class="" argb="255,187,51,119" value="183" />
+			<entry class="" argb="255,188,44,112" value="184" />
+			<entry class="" argb="255,190,38,106" value="185" />
+			<entry class="" argb="255,191,33,98" value="186" />
+			<entry class="" argb="255,192,29,91" value="187" />
+			<entry class="" argb="255,194,25,83" value="188" />
+			<entry class="" argb="255,195,22,75" value="189" />
+			<entry class="" argb="255,197,20,67" value="190" />
+			<entry class="" argb="255,198,19,58" value="191" />
+			<entry class="" argb="255,200,19,50" value="192" />
+			<entry class="" argb="255,202,19,41" value="193" />
+			<entry class="" argb="255,204,20,33" value="194" />
+			<entry class="" argb="255,206,22,24" value="195" />
+			<entry class="" argb="255,208,25,16" value="196" />
+			<entry class="" argb="255,210,29,8" value="197" />
+			<entry class="" argb="255,212,33,255" value="198" />
+			<entry class="" argb="255,214,38,247" value="199" />
+			<entry class="" argb="255,216,44,239" value="200" />
+			<entry class="" argb="255,218,51,232" value="201" />
+			<entry class="" argb="255,220,58,225" value="202" />
+			<entry class="" argb="255,222,65,219" value="203" />
+			<entry class="" argb="255,224,73,213" value="204" />
+			<entry class="" argb="255,225,81,207" value="205" />
+			<entry class="" argb="255,227,89,202" value="206" />
+			<entry class="" argb="255,229,98,197" value="207" />
+			<entry class="" argb="255,231,107,193" value="208" />
+			<entry class="" argb="255,232,115,189" value="209" />
+			<entry class="" argb="255,234,124,186" value="210" />
+			<entry class="" argb="255,236,132,183" value="211" />
+			<entry class="" argb="255,237,140,181" value="212" />
+			<entry class="" argb="255,238,148,179" value="213" />
+			<entry class="" argb="255,239,155,178" value="214" />
+			<entry class="" argb="255,241,162,177" value="215" />
+			<entry class="" argb="255,242,169,177" value="216" />
+			<entry class="" argb="255,242,175,177" value="217" />
+			<entry class="" argb="255,243,180,178" value="218" />
+			<entry class="" argb="255,244,184,179" value="219" />
+			<entry class="" argb="255,245,188,180" value="220" />
+			<entry class="" argb="255,245,191,181" value="221" />
+			<entry class="" argb="255,246,193,183" value="222" />
+			<entry class="" argb="255,246,194,184" value="223" />
+			<entry class="" argb="255,246,195,186" value="224" />
+			<entry class="" argb="255,246,194,188" value="225" />
+			<entry class="" argb="255,246,193,190" value="226" />
+			<entry class="" argb="255,247,191,192" value="227" />
+			<entry class="" argb="255,247,188,193" value="228" />
+			<entry class="" argb="255,247,184,195" value="229" />
+			<entry class="" argb="255,247,180,196" value="230" />
+			<entry class="" argb="255,247,175,197" value="231" />
+			<entry class="" argb="255,247,169,198" value="232" />
+			<entry class="" argb="255,247,162,198" value="233" />
+			<entry class="" argb="255,247,155,198" value="234" />
+			<entry class="" argb="255,247,148,198" value="235" />
+			<entry class="" argb="255,247,140,197" value="236" />
+			<entry class="" argb="255,247,132,195" value="237" />
+			<entry class="" argb="255,247,124,193" value="238" />
+			<entry class="" argb="255,247,115,191" value="239" />
+			<entry class="" argb="255,248,106,188" value="240" />
+			<entry class="" argb="255,248,98,184" value="241" />
+			<entry class="" argb="255,248,89,180" value="242" />
+			<entry class="" argb="255,249,81,175" value="243" />
+			<entry class="" argb="255,250,73,169" value="244" />
+			<entry class="" argb="255,251,65,163" value="245" />
+			<entry class="" argb="255,251,58,156" value="246" />
+			<entry class="" argb="255,252,51,149" value="247" />
+			<entry class="" argb="255,254,44,142" value="248" />
+			<entry class="" argb="255,255,38,133" value="249" />
+			<entry class="" argb="255,254,33,125" value="250" />
+			<entry class="" argb="255,252,29,116" value="251" />
+			<entry class="" argb="255,251,25,107" value="252" />
+			<entry class="" argb="255,249,22,97" value="253" />
+			<entry class="" argb="255,247,20,87" value="254" />
+			<entry class="" argb="255,247,20,87" value="255" />
+		</table>
+	</palette>
+
+	<palette name="prism" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,3,0,0" value="1" />
+			<entry class="" argb="255,7,0,0" value="2" />
+			<entry class="" argb="255,11,0,0" value="3" />
+			<entry class="" argb="255,15,0,0" value="4" />
+			<entry class="" argb="255,19,0,0" value="5" />
+			<entry class="" argb="255,22,0,0" value="6" />
+			<entry class="" argb="255,26,0,0" value="7" />
+			<entry class="" argb="255,30,0,0" value="8" />
+			<entry class="" argb="255,34,0,0" value="9" />
+			<entry class="" argb="255,38,0,0" value="10" />
+			<entry class="" argb="255,41,0,0" value="11" />
+			<entry class="" argb="255,45,0,0" value="12" />
+			<entry class="" argb="255,49,0,0" value="13" />
+			<entry class="" argb="255,53,0,0" value="14" />
+			<entry class="" argb="255,57,0,0" value="15" />
+			<entry class="" argb="255,60,0,0" value="16" />
+			<entry class="" argb="255,64,0,0" value="17" />
+			<entry class="" argb="255,68,0,0" value="18" />
+			<entry class="" argb="255,72,0,0" value="19" />
+			<entry class="" argb="255,76,0,0" value="20" />
+			<entry class="" argb="255,79,0,0" value="21" />
+			<entry class="" argb="255,83,0,0" value="22" />
+			<entry class="" argb="255,87,0,0" value="23" />
+			<entry class="" argb="255,91,0,0" value="24" />
+			<entry class="" argb="255,95,0,0" value="25" />
+			<entry class="" argb="255,98,0,0" value="26" />
+			<entry class="" argb="255,102,0,0" value="27" />
+			<entry class="" argb="255,106,0,0" value="28" />
+			<entry class="" argb="255,110,0,0" value="29" />
+			<entry class="" argb="255,114,0,0" value="30" />
+			<entry class="" argb="255,117,0,0" value="31" />
+			<entry class="" argb="255,121,0,0" value="32" />
+			<entry class="" argb="255,125,0,0" value="33" />
+			<entry class="" argb="255,129,0,0" value="34" />
+			<entry class="" argb="255,133,0,0" value="35" />
+			<entry class="" argb="255,137,0,0" value="36" />
+			<entry class="" argb="255,140,0,0" value="37" />
+			<entry class="" argb="255,144,0,0" value="38" />
+			<entry class="" argb="255,148,0,0" value="39" />
+			<entry class="" argb="255,152,0,0" value="40" />
+			<entry class="" argb="255,156,0,0" value="41" />
+			<entry class="" argb="255,159,0,0" value="42" />
+			<entry class="" argb="255,163,0,0" value="43" />
+			<entry class="" argb="255,167,0,0" value="44" />
+			<entry class="" argb="255,171,0,0" value="45" />
+			<entry class="" argb="255,175,0,0" value="46" />
+			<entry class="" argb="255,178,0,0" value="47" />
+			<entry class="" argb="255,182,0,0" value="48" />
+			<entry class="" argb="255,186,0,0" value="49" />
+			<entry class="" argb="255,190,0,0" value="50" />
+			<entry class="" argb="255,194,0,0" value="51" />
+			<entry class="" argb="255,197,0,0" value="52" />
+			<entry class="" argb="255,201,0,0" value="53" />
+			<entry class="" argb="255,205,0,0" value="54" />
+			<entry class="" argb="255,209,0,0" value="55" />
+			<entry class="" argb="255,213,0,0" value="56" />
+			<entry class="" argb="255,216,0,0" value="57" />
+			<entry class="" argb="255,220,0,0" value="58" />
+			<entry class="" argb="255,224,0,0" value="59" />
+			<entry class="" argb="255,228,0,0" value="60" />
+			<entry class="" argb="255,232,0,0" value="61" />
+			<entry class="" argb="255,235,0,0" value="62" />
+			<entry class="" argb="255,239,0,0" value="63" />
+			<entry class="" argb="255,243,0,0" value="64" />
+			<entry class="" argb="255,247,3,0" value="65" />
+			<entry class="" argb="255,251,7,0" value="66" />
+			<entry class="" argb="255,255,11,0" value="67" />
+			<entry class="" argb="255,251,15,0" value="68" />
+			<entry class="" argb="255,247,19,0" value="69" />
+			<entry class="" argb="255,243,23,0" value="70" />
+			<entry class="" argb="255,239,27,0" value="71" />
+			<entry class="" argb="255,235,31,0" value="72" />
+			<entry class="" argb="255,230,35,0" value="73" />
+			<entry class="" argb="255,226,39,0" value="74" />
+			<entry class="" argb="255,222,43,0" value="75" />
+			<entry class="" argb="255,218,47,0" value="76" />
+			<entry class="" argb="255,214,51,0" value="77" />
+			<entry class="" argb="255,210,55,0" value="78" />
+			<entry class="" argb="255,205,59,0" value="79" />
+			<entry class="" argb="255,201,63,0" value="80" />
+			<entry class="" argb="255,197,67,0" value="81" />
+			<entry class="" argb="255,193,71,0" value="82" />
+			<entry class="" argb="255,189,75,0" value="83" />
+			<entry class="" argb="255,184,79,0" value="84" />
+			<entry class="" argb="255,180,83,0" value="85" />
+			<entry class="" argb="255,176,87,0" value="86" />
+			<entry class="" argb="255,172,91,0" value="87" />
+			<entry class="" argb="255,168,95,0" value="88" />
+			<entry class="" argb="255,164,99,0" value="89" />
+			<entry class="" argb="255,159,103,0" value="90" />
+			<entry class="" argb="255,155,107,0" value="91" />
+			<entry class="" argb="255,151,111,0" value="92" />
+			<entry class="" argb="255,147,115,0" value="93" />
+			<entry class="" argb="255,143,119,0" value="94" />
+			<entry class="" argb="255,138,123,0" value="95" />
+			<entry class="" argb="255,134,127,0" value="96" />
+			<entry class="" argb="255,130,131,0" value="97" />
+			<entry class="" argb="255,126,135,0" value="98" />
+			<entry class="" argb="255,122,139,0" value="99" />
+			<entry class="" argb="255,118,143,0" value="100" />
+			<entry class="" argb="255,113,147,0" value="101" />
+			<entry class="" argb="255,109,151,0" value="102" />
+			<entry class="" argb="255,105,155,0" value="103" />
+			<entry class="" argb="255,101,159,0" value="104" />
+			<entry class="" argb="255,97,163,0" value="105" />
+			<entry class="" argb="255,92,167,0" value="106" />
+			<entry class="" argb="255,88,171,0" value="107" />
+			<entry class="" argb="255,84,175,0" value="108" />
+			<entry class="" argb="255,80,179,0" value="109" />
+			<entry class="" argb="255,76,183,0" value="110" />
+			<entry class="" argb="255,72,187,0" value="111" />
+			<entry class="" argb="255,67,191,0" value="112" />
+			<entry class="" argb="255,63,195,0" value="113" />
+			<entry class="" argb="255,59,199,0" value="114" />
+			<entry class="" argb="255,55,203,0" value="115" />
+			<entry class="" argb="255,51,207,0" value="116" />
+			<entry class="" argb="255,46,211,0" value="117" />
+			<entry class="" argb="255,42,215,0" value="118" />
+			<entry class="" argb="255,38,219,0" value="119" />
+			<entry class="" argb="255,34,223,0" value="120" />
+			<entry class="" argb="255,30,227,0" value="121" />
+			<entry class="" argb="255,26,231,0" value="122" />
+			<entry class="" argb="255,21,235,0" value="123" />
+			<entry class="" argb="255,17,239,0" value="124" />
+			<entry class="" argb="255,13,243,0" value="125" />
+			<entry class="" argb="255,9,247,0" value="126" />
+			<entry class="" argb="255,5,251,3" value="127" />
+			<entry class="" argb="255,0,255,7" value="128" />
+			<entry class="" argb="255,0,251,11" value="129" />
+			<entry class="" argb="255,0,247,15" value="130" />
+			<entry class="" argb="255,0,243,19" value="131" />
+			<entry class="" argb="255,0,239,23" value="132" />
+			<entry class="" argb="255,0,235,27" value="133" />
+			<entry class="" argb="255,0,231,30" value="134" />
+			<entry class="" argb="255,0,227,34" value="135" />
+			<entry class="" argb="255,0,223,38" value="136" />
+			<entry class="" argb="255,0,219,42" value="137" />
+			<entry class="" argb="255,0,215,46" value="138" />
+			<entry class="" argb="255,0,211,50" value="139" />
+			<entry class="" argb="255,0,207,54" value="140" />
+			<entry class="" argb="255,0,203,57" value="141" />
+			<entry class="" argb="255,0,199,61" value="142" />
+			<entry class="" argb="255,0,195,65" value="143" />
+			<entry class="" argb="255,0,191,69" value="144" />
+			<entry class="" argb="255,0,187,73" value="145" />
+			<entry class="" argb="255,0,183,77" value="146" />
+			<entry class="" argb="255,0,179,81" value="147" />
+			<entry class="" argb="255,0,175,85" value="148" />
+			<entry class="" argb="255,0,170,88" value="149" />
+			<entry class="" argb="255,0,166,92" value="150" />
+			<entry class="" argb="255,0,162,96" value="151" />
+			<entry class="" argb="255,0,158,100" value="152" />
+			<entry class="" argb="255,0,154,104" value="153" />
+			<entry class="" argb="255,0,150,108" value="154" />
+			<entry class="" argb="255,0,146,112" value="155" />
+			<entry class="" argb="255,0,142,115" value="156" />
+			<entry class="" argb="255,0,138,119" value="157" />
+			<entry class="" argb="255,0,134,123" value="158" />
+			<entry class="" argb="255,0,130,127" value="159" />
+			<entry class="" argb="255,0,126,131" value="160" />
+			<entry class="" argb="255,0,122,135" value="161" />
+			<entry class="" argb="255,0,118,139" value="162" />
+			<entry class="" argb="255,0,114,142" value="163" />
+			<entry class="" argb="255,0,110,146" value="164" />
+			<entry class="" argb="255,0,106,150" value="165" />
+			<entry class="" argb="255,0,102,154" value="166" />
+			<entry class="" argb="255,0,98,158" value="167" />
+			<entry class="" argb="255,0,94,162" value="168" />
+			<entry class="" argb="255,0,90,166" value="169" />
+			<entry class="" argb="255,0,85,170" value="170" />
+			<entry class="" argb="255,0,81,173" value="171" />
+			<entry class="" argb="255,0,77,177" value="172" />
+			<entry class="" argb="255,0,73,181" value="173" />
+			<entry class="" argb="255,0,69,185" value="174" />
+			<entry class="" argb="255,0,65,189" value="175" />
+			<entry class="" argb="255,0,61,193" value="176" />
+			<entry class="" argb="255,0,57,197" value="177" />
+			<entry class="" argb="255,0,53,200" value="178" />
+			<entry class="" argb="255,0,49,204" value="179" />
+			<entry class="" argb="255,0,45,208" value="180" />
+			<entry class="" argb="255,0,41,212" value="181" />
+			<entry class="" argb="255,0,37,216" value="182" />
+			<entry class="" argb="255,0,33,220" value="183" />
+			<entry class="" argb="255,0,29,224" value="184" />
+			<entry class="" argb="255,0,25,227" value="185" />
+			<entry class="" argb="255,0,21,231" value="186" />
+			<entry class="" argb="255,0,17,235" value="187" />
+			<entry class="" argb="255,0,13,239" value="188" />
+			<entry class="" argb="255,0,9,243" value="189" />
+			<entry class="" argb="255,0,5,247" value="190" />
+			<entry class="" argb="255,0,0,251" value="191" />
+			<entry class="" argb="255,0,0,255" value="192" />
+			<entry class="" argb="255,0,0,251" value="193" />
+			<entry class="" argb="255,0,0,247" value="194" />
+			<entry class="" argb="255,0,0,243" value="195" />
+			<entry class="" argb="255,0,0,239" value="196" />
+			<entry class="" argb="255,0,0,235" value="197" />
+			<entry class="" argb="255,0,0,231" value="198" />
+			<entry class="" argb="255,0,0,227" value="199" />
+			<entry class="" argb="255,0,0,223" value="200" />
+			<entry class="" argb="255,0,0,219" value="201" />
+			<entry class="" argb="255,0,0,215" value="202" />
+			<entry class="" argb="255,0,0,211" value="203" />
+			<entry class="" argb="255,0,0,207" value="204" />
+			<entry class="" argb="255,0,0,203" value="205" />
+			<entry class="" argb="255,0,0,199" value="206" />
+			<entry class="" argb="255,0,0,195" value="207" />
+			<entry class="" argb="255,0,0,191" value="208" />
+			<entry class="" argb="255,0,0,187" value="209" />
+			<entry class="" argb="255,0,0,183" value="210" />
+			<entry class="" argb="255,0,0,179" value="211" />
+			<entry class="" argb="255,0,0,175" value="212" />
+			<entry class="" argb="255,0,0,170" value="213" />
+			<entry class="" argb="255,0,0,166" value="214" />
+			<entry class="" argb="255,0,0,162" value="215" />
+			<entry class="" argb="255,0,0,158" value="216" />
+			<entry class="" argb="255,0,0,154" value="217" />
+			<entry class="" argb="255,0,0,150" value="218" />
+			<entry class="" argb="255,0,0,146" value="219" />
+			<entry class="" argb="255,0,0,142" value="220" />
+			<entry class="" argb="255,0,0,138" value="221" />
+			<entry class="" argb="255,0,0,134" value="222" />
+			<entry class="" argb="255,0,0,130" value="223" />
+			<entry class="" argb="255,0,0,126" value="224" />
+			<entry class="" argb="255,0,0,122" value="225" />
+			<entry class="" argb="255,0,0,118" value="226" />
+			<entry class="" argb="255,0,0,114" value="227" />
+			<entry class="" argb="255,0,0,110" value="228" />
+			<entry class="" argb="255,0,0,106" value="229" />
+			<entry class="" argb="255,0,0,102" value="230" />
+			<entry class="" argb="255,0,0,98" value="231" />
+			<entry class="" argb="255,0,0,94" value="232" />
+			<entry class="" argb="255,0,0,90" value="233" />
+			<entry class="" argb="255,0,0,85" value="234" />
+			<entry class="" argb="255,0,0,81" value="235" />
+			<entry class="" argb="255,0,0,77" value="236" />
+			<entry class="" argb="255,0,0,73" value="237" />
+			<entry class="" argb="255,0,0,69" value="238" />
+			<entry class="" argb="255,0,0,65" value="239" />
+			<entry class="" argb="255,0,0,61" value="240" />
+			<entry class="" argb="255,0,0,57" value="241" />
+			<entry class="" argb="255,0,0,53" value="242" />
+			<entry class="" argb="255,0,0,49" value="243" />
+			<entry class="" argb="255,0,0,45" value="244" />
+			<entry class="" argb="255,0,0,41" value="245" />
+			<entry class="" argb="255,0,0,37" value="246" />
+			<entry class="" argb="255,0,0,33" value="247" />
+			<entry class="" argb="255,0,0,29" value="248" />
+			<entry class="" argb="255,0,0,25" value="249" />
+			<entry class="" argb="255,0,0,21" value="250" />
+			<entry class="" argb="255,0,0,17" value="251" />
+			<entry class="" argb="255,0,0,13" value="252" />
+			<entry class="" argb="255,0,0,9" value="253" />
+			<entry class="" argb="255,0,0,5" value="254" />
+			<entry class="" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="rainbow" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,4,0,3" value="1" />
+			<entry class="" argb="255,9,0,7" value="2" />
+			<entry class="" argb="255,13,0,10" value="3" />
+			<entry class="" argb="255,18,0,14" value="4" />
+			<entry class="" argb="255,22,0,19" value="5" />
+			<entry class="" argb="255,27,0,23" value="6" />
+			<entry class="" argb="255,31,0,28" value="7" />
+			<entry class="" argb="255,36,0,32" value="8" />
+			<entry class="" argb="255,40,0,38" value="9" />
+			<entry class="" argb="255,45,0,43" value="10" />
+			<entry class="" argb="255,50,0,48" value="11" />
+			<entry class="" argb="255,54,0,53" value="12" />
+			<entry class="" argb="255,58,0,59" value="13" />
+			<entry class="" argb="255,61,0,63" value="14" />
+			<entry class="" argb="255,64,0,68" value="15" />
+			<entry class="" argb="255,68,0,72" value="16" />
+			<entry class="" argb="255,69,0,77" value="17" />
+			<entry class="" argb="255,72,0,81" value="18" />
+			<entry class="" argb="255,74,0,86" value="19" />
+			<entry class="" argb="255,77,0,91" value="20" />
+			<entry class="" argb="255,79,0,95" value="21" />
+			<entry class="" argb="255,80,0,100" value="22" />
+			<entry class="" argb="255,82,0,104" value="23" />
+			<entry class="" argb="255,83,0,109" value="24" />
+			<entry class="" argb="255,85,0,113" value="25" />
+			<entry class="" argb="255,84,0,118" value="26" />
+			<entry class="" argb="255,86,0,122" value="27" />
+			<entry class="" argb="255,87,0,127" value="28" />
+			<entry class="" argb="255,88,0,132" value="29" />
+			<entry class="" argb="255,86,0,136" value="30" />
+			<entry class="" argb="255,87,0,141" value="31" />
+			<entry class="" argb="255,87,0,145" value="32" />
+			<entry class="" argb="255,87,0,150" value="33" />
+			<entry class="" argb="255,85,0,154" value="34" />
+			<entry class="" argb="255,84,0,159" value="35" />
+			<entry class="" argb="255,84,0,163" value="36" />
+			<entry class="" argb="255,84,0,168" value="37" />
+			<entry class="" argb="255,83,0,173" value="38" />
+			<entry class="" argb="255,79,0,177" value="39" />
+			<entry class="" argb="255,78,0,182" value="40" />
+			<entry class="" argb="255,77,0,186" value="41" />
+			<entry class="" argb="255,76,0,191" value="42" />
+			<entry class="" argb="255,71,0,195" value="43" />
+			<entry class="" argb="255,70,0,200" value="44" />
+			<entry class="" argb="255,68,0,204" value="45" />
+			<entry class="" argb="255,66,0,209" value="46" />
+			<entry class="" argb="255,60,0,214" value="47" />
+			<entry class="" argb="255,58,0,218" value="48" />
+			<entry class="" argb="255,55,0,223" value="49" />
+			<entry class="" argb="255,53,0,227" value="50" />
+			<entry class="" argb="255,46,0,232" value="51" />
+			<entry class="" argb="255,43,0,236" value="52" />
+			<entry class="" argb="255,40,0,241" value="53" />
+			<entry class="" argb="255,36,0,245" value="54" />
+			<entry class="" argb="255,33,0,250" value="55" />
+			<entry class="" argb="255,25,0,255" value="56" />
+			<entry class="" argb="255,21,0,255" value="57" />
+			<entry class="" argb="255,16,0,255" value="58" />
+			<entry class="" argb="255,12,0,255" value="59" />
+			<entry class="" argb="255,4,0,255" value="60" />
+			<entry class="" argb="255,0,0,255" value="61" />
+			<entry class="" argb="255,0,4,255" value="62" />
+			<entry class="" argb="255,0,8,255" value="63" />
+			<entry class="" argb="255,0,16,255" value="64" />
+			<entry class="" argb="255,0,21,255" value="65" />
+			<entry class="" argb="255,0,25,255" value="66" />
+			<entry class="" argb="255,0,29,255" value="67" />
+			<entry class="" argb="255,0,38,255" value="68" />
+			<entry class="" argb="255,0,42,255" value="69" />
+			<entry class="" argb="255,0,46,255" value="70" />
+			<entry class="" argb="255,0,51,255" value="71" />
+			<entry class="" argb="255,0,55,255" value="72" />
+			<entry class="" argb="255,0,63,255" value="73" />
+			<entry class="" argb="255,0,67,255" value="74" />
+			<entry class="" argb="255,0,72,255" value="75" />
+			<entry class="" argb="255,0,76,255" value="76" />
+			<entry class="" argb="255,0,84,255" value="77" />
+			<entry class="" argb="255,0,89,255" value="78" />
+			<entry class="" argb="255,0,93,255" value="79" />
+			<entry class="" argb="255,0,97,255" value="80" />
+			<entry class="" argb="255,0,106,255" value="81" />
+			<entry class="" argb="255,0,110,255" value="82" />
+			<entry class="" argb="255,0,114,255" value="83" />
+			<entry class="" argb="255,0,119,255" value="84" />
+			<entry class="" argb="255,0,127,255" value="85" />
+			<entry class="" argb="255,0,131,255" value="86" />
+			<entry class="" argb="255,0,135,255" value="87" />
+			<entry class="" argb="255,0,140,255" value="88" />
+			<entry class="" argb="255,0,144,255" value="89" />
+			<entry class="" argb="255,0,152,255" value="90" />
+			<entry class="" argb="255,0,157,255" value="91" />
+			<entry class="" argb="255,0,161,255" value="92" />
+			<entry class="" argb="255,0,165,255" value="93" />
+			<entry class="" argb="255,0,174,255" value="94" />
+			<entry class="" argb="255,0,178,255" value="95" />
+			<entry class="" argb="255,0,182,255" value="96" />
+			<entry class="" argb="255,0,187,255" value="97" />
+			<entry class="" argb="255,0,195,255" value="98" />
+			<entry class="" argb="255,0,199,255" value="99" />
+			<entry class="" argb="255,0,203,255" value="100" />
+			<entry class="" argb="255,0,208,255" value="101" />
+			<entry class="" argb="255,0,216,255" value="102" />
+			<entry class="" argb="255,0,220,255" value="103" />
+			<entry class="" argb="255,0,225,255" value="104" />
+			<entry class="" argb="255,0,229,255" value="105" />
+			<entry class="" argb="255,0,233,255" value="106" />
+			<entry class="" argb="255,0,242,255" value="107" />
+			<entry class="" argb="255,0,246,255" value="108" />
+			<entry class="" argb="255,0,250,255" value="109" />
+			<entry class="" argb="255,0,255,255" value="110" />
+			<entry class="" argb="255,0,255,246" value="111" />
+			<entry class="" argb="255,0,255,242" value="112" />
+			<entry class="" argb="255,0,255,238" value="113" />
+			<entry class="" argb="255,0,255,233" value="114" />
+			<entry class="" argb="255,0,255,225" value="115" />
+			<entry class="" argb="255,0,255,220" value="116" />
+			<entry class="" argb="255,0,255,216" value="117" />
+			<entry class="" argb="255,0,255,212" value="118" />
+			<entry class="" argb="255,0,255,203" value="119" />
+			<entry class="" argb="255,0,255,199" value="120" />
+			<entry class="" argb="255,0,255,195" value="121" />
+			<entry class="" argb="255,0,255,191" value="122" />
+			<entry class="" argb="255,0,255,187" value="123" />
+			<entry class="" argb="255,0,255,178" value="124" />
+			<entry class="" argb="255,0,255,174" value="125" />
+			<entry class="" argb="255,0,255,170" value="126" />
+			<entry class="" argb="255,0,255,165" value="127" />
+			<entry class="" argb="255,0,255,157" value="128" />
+			<entry class="" argb="255,0,255,152" value="129" />
+			<entry class="" argb="255,0,255,148" value="130" />
+			<entry class="" argb="255,0,255,144" value="131" />
+			<entry class="" argb="255,0,255,135" value="132" />
+			<entry class="" argb="255,0,255,131" value="133" />
+			<entry class="" argb="255,0,255,127" value="134" />
+			<entry class="" argb="255,0,255,123" value="135" />
+			<entry class="" argb="255,0,255,114" value="136" />
+			<entry class="" argb="255,0,255,110" value="137" />
+			<entry class="" argb="255,0,255,106" value="138" />
+			<entry class="" argb="255,0,255,102" value="139" />
+			<entry class="" argb="255,0,255,97" value="140" />
+			<entry class="" argb="255,0,255,89" value="141" />
+			<entry class="" argb="255,0,255,84" value="142" />
+			<entry class="" argb="255,0,255,80" value="143" />
+			<entry class="" argb="255,0,255,76" value="144" />
+			<entry class="" argb="255,0,255,67" value="145" />
+			<entry class="" argb="255,0,255,63" value="146" />
+			<entry class="" argb="255,0,255,59" value="147" />
+			<entry class="" argb="255,0,255,55" value="148" />
+			<entry class="" argb="255,0,255,46" value="149" />
+			<entry class="" argb="255,0,255,42" value="150" />
+			<entry class="" argb="255,0,255,38" value="151" />
+			<entry class="" argb="255,0,255,34" value="152" />
+			<entry class="" argb="255,0,255,25" value="153" />
+			<entry class="" argb="255,0,255,21" value="154" />
+			<entry class="" argb="255,0,255,16" value="155" />
+			<entry class="" argb="255,0,255,12" value="156" />
+			<entry class="" argb="255,0,255,8" value="157" />
+			<entry class="" argb="255,0,255,0" value="158" />
+			<entry class="" argb="255,4,255,0" value="159" />
+			<entry class="" argb="255,8,255,0" value="160" />
+			<entry class="" argb="255,12,255,0" value="161" />
+			<entry class="" argb="255,21,255,0" value="162" />
+			<entry class="" argb="255,25,255,0" value="163" />
+			<entry class="" argb="255,29,255,0" value="164" />
+			<entry class="" argb="255,33,255,0" value="165" />
+			<entry class="" argb="255,42,255,0" value="166" />
+			<entry class="" argb="255,46,255,0" value="167" />
+			<entry class="" argb="255,51,255,0" value="168" />
+			<entry class="" argb="255,55,255,0" value="169" />
+			<entry class="" argb="255,63,255,0" value="170" />
+			<entry class="" argb="255,67,255,0" value="171" />
+			<entry class="" argb="255,72,255,0" value="172" />
+			<entry class="" argb="255,76,255,0" value="173" />
+			<entry class="" argb="255,80,255,0" value="174" />
+			<entry class="" argb="255,89,255,0" value="175" />
+			<entry class="" argb="255,93,255,0" value="176" />
+			<entry class="" argb="255,97,255,0" value="177" />
+			<entry class="" argb="255,101,255,0" value="178" />
+			<entry class="" argb="255,110,255,0" value="179" />
+			<entry class="" argb="255,114,255,0" value="180" />
+			<entry class="" argb="255,119,255,0" value="181" />
+			<entry class="" argb="255,123,255,0" value="182" />
+			<entry class="" argb="255,131,255,0" value="183" />
+			<entry class="" argb="255,135,255,0" value="184" />
+			<entry class="" argb="255,140,255,0" value="185" />
+			<entry class="" argb="255,144,255,0" value="186" />
+			<entry class="" argb="255,153,255,0" value="187" />
+			<entry class="" argb="255,157,255,0" value="188" />
+			<entry class="" argb="255,161,255,0" value="189" />
+			<entry class="" argb="255,165,255,0" value="190" />
+			<entry class="" argb="255,169,255,0" value="191" />
+			<entry class="" argb="255,178,255,0" value="192" />
+			<entry class="" argb="255,182,255,0" value="193" />
+			<entry class="" argb="255,187,255,0" value="194" />
+			<entry class="" argb="255,191,255,0" value="195" />
+			<entry class="" argb="255,199,255,0" value="196" />
+			<entry class="" argb="255,203,255,0" value="197" />
+			<entry class="" argb="255,208,255,0" value="198" />
+			<entry class="" argb="255,212,255,0" value="199" />
+			<entry class="" argb="255,221,255,0" value="200" />
+			<entry class="" argb="255,225,255,0" value="201" />
+			<entry class="" argb="255,229,255,0" value="202" />
+			<entry class="" argb="255,233,255,0" value="203" />
+			<entry class="" argb="255,242,255,0" value="204" />
+			<entry class="" argb="255,246,255,0" value="205" />
+			<entry class="" argb="255,250,255,0" value="206" />
+			<entry class="" argb="255,255,255,0" value="207" />
+			<entry class="" argb="255,255,250,0" value="208" />
+			<entry class="" argb="255,255,242,0" value="209" />
+			<entry class="" argb="255,255,238,0" value="210" />
+			<entry class="" argb="255,255,233,0" value="211" />
+			<entry class="" argb="255,255,229,0" value="212" />
+			<entry class="" argb="255,255,221,0" value="213" />
+			<entry class="" argb="255,255,216,0" value="214" />
+			<entry class="" argb="255,255,212,0" value="215" />
+			<entry class="" argb="255,255,208,0" value="216" />
+			<entry class="" argb="255,255,199,0" value="217" />
+			<entry class="" argb="255,255,195,0" value="218" />
+			<entry class="" argb="255,255,191,0" value="219" />
+			<entry class="" argb="255,255,187,0" value="220" />
+			<entry class="" argb="255,255,178,0" value="221" />
+			<entry class="" argb="255,255,174,0" value="222" />
+			<entry class="" argb="255,255,170,0" value="223" />
+			<entry class="" argb="255,255,165,0" value="224" />
+			<entry class="" argb="255,255,161,0" value="225" />
+			<entry class="" argb="255,255,153,0" value="226" />
+			<entry class="" argb="255,255,148,0" value="227" />
+			<entry class="" argb="255,255,144,0" value="228" />
+			<entry class="" argb="255,255,140,0" value="229" />
+			<entry class="" argb="255,255,131,0" value="230" />
+			<entry class="" argb="255,255,127,0" value="231" />
+			<entry class="" argb="255,255,123,0" value="232" />
+			<entry class="" argb="255,255,119,0" value="233" />
+			<entry class="" argb="255,255,110,0" value="234" />
+			<entry class="" argb="255,255,106,0" value="235" />
+			<entry class="" argb="255,255,102,0" value="236" />
+			<entry class="" argb="255,255,97,0" value="237" />
+			<entry class="" argb="255,255,89,0" value="238" />
+			<entry class="" argb="255,255,85,0" value="239" />
+			<entry class="" argb="255,255,80,0" value="240" />
+			<entry class="" argb="255,255,76,0" value="241" />
+			<entry class="" argb="255,255,72,0" value="242" />
+			<entry class="" argb="255,255,63,0" value="243" />
+			<entry class="" argb="255,255,59,0" value="244" />
+			<entry class="" argb="255,255,55,0" value="245" />
+			<entry class="" argb="255,255,51,0" value="246" />
+			<entry class="" argb="255,255,42,0" value="247" />
+			<entry class="" argb="255,255,38,0" value="248" />
+			<entry class="" argb="255,255,34,0" value="249" />
+			<entry class="" argb="255,255,29,0" value="250" />
+			<entry class="" argb="255,255,21,0" value="251" />
+			<entry class="" argb="255,255,17,0" value="252" />
+			<entry class="" argb="255,255,12,0" value="253" />
+			<entry class="" argb="255,255,8,0" value="254" />
+			<entry class="" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<palette name="red-purple" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,0" value="1" />
+			<entry class="" argb="255,3,0,0" value="2" />
+			<entry class="" argb="255,6,0,0" value="3" />
+			<entry class="" argb="255,10,0,0" value="4" />
+			<entry class="" argb="255,13,0,0" value="5" />
+			<entry class="" argb="255,17,0,0" value="6" />
+			<entry class="" argb="255,20,0,0" value="7" />
+			<entry class="" argb="255,24,0,1" value="8" />
+			<entry class="" argb="255,27,0,1" value="9" />
+			<entry class="" argb="255,30,0,1" value="10" />
+			<entry class="" argb="255,33,0,1" value="11" />
+			<entry class="" argb="255,36,0,2" value="12" />
+			<entry class="" argb="255,39,0,2" value="13" />
+			<entry class="" argb="255,42,0,2" value="14" />
+			<entry class="" argb="255,45,0,2" value="15" />
+			<entry class="" argb="255,48,0,2" value="16" />
+			<entry class="" argb="255,51,0,2" value="17" />
+			<entry class="" argb="255,54,0,2" value="18" />
+			<entry class="" argb="255,57,0,2" value="19" />
+			<entry class="" argb="255,60,0,3" value="20" />
+			<entry class="" argb="255,63,0,3" value="21" />
+			<entry class="" argb="255,66,0,3" value="22" />
+			<entry class="" argb="255,69,0,3" value="23" />
+			<entry class="" argb="255,72,0,4" value="24" />
+			<entry class="" argb="255,75,0,4" value="25" />
+			<entry class="" argb="255,78,0,4" value="26" />
+			<entry class="" argb="255,81,0,4" value="27" />
+			<entry class="" argb="255,84,0,4" value="28" />
+			<entry class="" argb="255,85,0,5" value="29" />
+			<entry class="" argb="255,86,0,6" value="30" />
+			<entry class="" argb="255,87,0,7" value="31" />
+			<entry class="" argb="255,88,0,9" value="32" />
+			<entry class="" argb="255,90,0,9" value="33" />
+			<entry class="" argb="255,92,0,10" value="34" />
+			<entry class="" argb="255,94,0,11" value="35" />
+			<entry class="" argb="255,96,0,12" value="36" />
+			<entry class="" argb="255,97,0,13" value="37" />
+			<entry class="" argb="255,98,0,14" value="38" />
+			<entry class="" argb="255,99,0,15" value="39" />
+			<entry class="" argb="255,100,0,17" value="40" />
+			<entry class="" argb="255,102,0,17" value="41" />
+			<entry class="" argb="255,104,0,18" value="42" />
+			<entry class="" argb="255,106,0,18" value="43" />
+			<entry class="" argb="255,108,0,19" value="44" />
+			<entry class="" argb="255,109,0,20" value="45" />
+			<entry class="" argb="255,110,0,22" value="46" />
+			<entry class="" argb="255,111,0,23" value="47" />
+			<entry class="" argb="255,112,0,25" value="48" />
+			<entry class="" argb="255,114,0,25" value="49" />
+			<entry class="" argb="255,116,0,26" value="50" />
+			<entry class="" argb="255,118,0,26" value="51" />
+			<entry class="" argb="255,120,0,27" value="52" />
+			<entry class="" argb="255,121,0,28" value="53" />
+			<entry class="" argb="255,122,0,29" value="54" />
+			<entry class="" argb="255,123,0,30" value="55" />
+			<entry class="" argb="255,124,0,32" value="56" />
+			<entry class="" argb="255,126,0,32" value="57" />
+			<entry class="" argb="255,128,0,33" value="58" />
+			<entry class="" argb="255,130,0,33" value="59" />
+			<entry class="" argb="255,132,0,34" value="60" />
+			<entry class="" argb="255,133,0,35" value="61" />
+			<entry class="" argb="255,134,0,36" value="62" />
+			<entry class="" argb="255,135,0,37" value="63" />
+			<entry class="" argb="255,136,0,39" value="64" />
+			<entry class="" argb="255,138,1,39" value="65" />
+			<entry class="" argb="255,140,2,40" value="66" />
+			<entry class="" argb="255,142,3,40" value="67" />
+			<entry class="" argb="255,144,4,41" value="68" />
+			<entry class="" argb="255,145,4,42" value="69" />
+			<entry class="" argb="255,146,4,43" value="70" />
+			<entry class="" argb="255,147,4,44" value="71" />
+			<entry class="" argb="255,148,4,46" value="72" />
+			<entry class="" argb="255,150,4,46" value="73" />
+			<entry class="" argb="255,152,4,47" value="74" />
+			<entry class="" argb="255,154,4,48" value="75" />
+			<entry class="" argb="255,156,4,49" value="76" />
+			<entry class="" argb="255,157,4,50" value="77" />
+			<entry class="" argb="255,158,4,51" value="78" />
+			<entry class="" argb="255,159,4,52" value="79" />
+			<entry class="" argb="255,160,4,54" value="80" />
+			<entry class="" argb="255,162,5,54" value="81" />
+			<entry class="" argb="255,164,6,53" value="82" />
+			<entry class="" argb="255,166,7,53" value="83" />
+			<entry class="" argb="255,168,8,52" value="84" />
+			<entry class="" argb="255,169,8,54" value="85" />
+			<entry class="" argb="255,170,8,56" value="86" />
+			<entry class="" argb="255,171,8,58" value="87" />
+			<entry class="" argb="255,172,8,60" value="88" />
+			<entry class="" argb="255,174,8,60" value="89" />
+			<entry class="" argb="255,176,8,61" value="90" />
+			<entry class="" argb="255,178,8,62" value="91" />
+			<entry class="" argb="255,180,8,63" value="92" />
+			<entry class="" argb="255,181,8,64" value="93" />
+			<entry class="" argb="255,182,8,65" value="94" />
+			<entry class="" argb="255,183,8,66" value="95" />
+			<entry class="" argb="255,184,8,68" value="96" />
+			<entry class="" argb="255,185,8,69" value="97" />
+			<entry class="" argb="255,186,8,70" value="98" />
+			<entry class="" argb="255,187,8,71" value="99" />
+			<entry class="" argb="255,188,8,73" value="100" />
+			<entry class="" argb="255,189,8,74" value="101" />
+			<entry class="" argb="255,190,8,75" value="102" />
+			<entry class="" argb="255,191,8,76" value="103" />
+			<entry class="" argb="255,192,8,77" value="104" />
+			<entry class="" argb="255,193,8,78" value="105" />
+			<entry class="" argb="255,194,8,79" value="106" />
+			<entry class="" argb="255,195,8,80" value="107" />
+			<entry class="" argb="255,196,8,82" value="108" />
+			<entry class="" argb="255,198,9,82" value="109" />
+			<entry class="" argb="255,200,10,83" value="110" />
+			<entry class="" argb="255,202,11,83" value="111" />
+			<entry class="" argb="255,204,12,84" value="112" />
+			<entry class="" argb="255,205,12,85" value="113" />
+			<entry class="" argb="255,206,12,86" value="114" />
+			<entry class="" argb="255,207,12,87" value="115" />
+			<entry class="" argb="255,208,12,89" value="116" />
+			<entry class="" argb="255,209,12,90" value="117" />
+			<entry class="" argb="255,210,12,91" value="118" />
+			<entry class="" argb="255,211,12,92" value="119" />
+			<entry class="" argb="255,212,12,94" value="120" />
+			<entry class="" argb="255,213,12,95" value="121" />
+			<entry class="" argb="255,214,12,96" value="122" />
+			<entry class="" argb="255,215,12,97" value="123" />
+			<entry class="" argb="255,216,12,98" value="124" />
+			<entry class="" argb="255,217,12,99" value="125" />
+			<entry class="" argb="255,218,12,100" value="126" />
+			<entry class="" argb="255,219,12,101" value="127" />
+			<entry class="" argb="255,220,12,103" value="128" />
+			<entry class="" argb="255,222,12,103" value="129" />
+			<entry class="" argb="255,224,12,104" value="130" />
+			<entry class="" argb="255,226,12,105" value="131" />
+			<entry class="" argb="255,228,12,106" value="132" />
+			<entry class="" argb="255,229,13,107" value="133" />
+			<entry class="" argb="255,230,14,108" value="134" />
+			<entry class="" argb="255,231,15,109" value="135" />
+			<entry class="" argb="255,232,16,110" value="136" />
+			<entry class="" argb="255,233,16,111" value="137" />
+			<entry class="" argb="255,234,16,112" value="138" />
+			<entry class="" argb="255,235,16,113" value="139" />
+			<entry class="" argb="255,236,16,115" value="140" />
+			<entry class="" argb="255,237,16,116" value="141" />
+			<entry class="" argb="255,238,16,117" value="142" />
+			<entry class="" argb="255,239,16,118" value="143" />
+			<entry class="" argb="255,240,16,119" value="144" />
+			<entry class="" argb="255,241,16,120" value="145" />
+			<entry class="" argb="255,242,16,121" value="146" />
+			<entry class="" argb="255,243,16,122" value="147" />
+			<entry class="" argb="255,244,16,124" value="148" />
+			<entry class="" argb="255,246,16,124" value="149" />
+			<entry class="" argb="255,248,16,125" value="150" />
+			<entry class="" argb="255,250,16,125" value="151" />
+			<entry class="" argb="255,252,16,126" value="152" />
+			<entry class="" argb="255,252,17,127" value="153" />
+			<entry class="" argb="255,252,18,129" value="154" />
+			<entry class="" argb="255,252,19,131" value="155" />
+			<entry class="" argb="255,252,20,133" value="156" />
+			<entry class="" argb="255,252,20,134" value="157" />
+			<entry class="" argb="255,252,20,136" value="158" />
+			<entry class="" argb="255,252,20,138" value="159" />
+			<entry class="" argb="255,252,20,140" value="160" />
+			<entry class="" argb="255,252,21,141" value="161" />
+			<entry class="" argb="255,252,22,143" value="162" />
+			<entry class="" argb="255,252,23,144" value="163" />
+			<entry class="" argb="255,252,24,146" value="164" />
+			<entry class="" argb="255,252,24,147" value="165" />
+			<entry class="" argb="255,252,24,149" value="166" />
+			<entry class="" argb="255,252,24,151" value="167" />
+			<entry class="" argb="255,252,24,153" value="168" />
+			<entry class="" argb="255,252,25,154" value="169" />
+			<entry class="" argb="255,252,26,156" value="170" />
+			<entry class="" argb="255,252,27,157" value="171" />
+			<entry class="" argb="255,252,28,159" value="172" />
+			<entry class="" argb="255,252,30,160" value="173" />
+			<entry class="" argb="255,252,32,161" value="174" />
+			<entry class="" argb="255,252,34,162" value="175" />
+			<entry class="" argb="255,252,36,164" value="176" />
+			<entry class="" argb="255,252,38,165" value="177" />
+			<entry class="" argb="255,252,40,166" value="178" />
+			<entry class="" argb="255,252,42,167" value="179" />
+			<entry class="" argb="255,252,44,169" value="180" />
+			<entry class="" argb="255,252,46,170" value="181" />
+			<entry class="" argb="255,252,48,172" value="182" />
+			<entry class="" argb="255,252,50,173" value="183" />
+			<entry class="" argb="255,252,52,175" value="184" />
+			<entry class="" argb="255,252,54,176" value="185" />
+			<entry class="" argb="255,252,56,177" value="186" />
+			<entry class="" argb="255,252,58,178" value="187" />
+			<entry class="" argb="255,252,60,180" value="188" />
+			<entry class="" argb="255,252,61,181" value="189" />
+			<entry class="" argb="255,252,62,183" value="190" />
+			<entry class="" argb="255,252,63,184" value="191" />
+			<entry class="" argb="255,252,64,186" value="192" />
+			<entry class="" argb="255,252,66,187" value="193" />
+			<entry class="" argb="255,252,68,188" value="194" />
+			<entry class="" argb="255,252,70,189" value="195" />
+			<entry class="" argb="255,252,72,191" value="196" />
+			<entry class="" argb="255,252,74,192" value="197" />
+			<entry class="" argb="255,252,76,193" value="198" />
+			<entry class="" argb="255,252,78,194" value="199" />
+			<entry class="" argb="255,252,80,196" value="200" />
+			<entry class="" argb="255,252,82,197" value="201" />
+			<entry class="" argb="255,252,84,199" value="202" />
+			<entry class="" argb="255,252,86,200" value="203" />
+			<entry class="" argb="255,252,88,202" value="204" />
+			<entry class="" argb="255,252,90,203" value="205" />
+			<entry class="" argb="255,252,92,204" value="206" />
+			<entry class="" argb="255,252,94,205" value="207" />
+			<entry class="" argb="255,252,96,207" value="208" />
+			<entry class="" argb="255,252,98,208" value="209" />
+			<entry class="" argb="255,252,100,209" value="210" />
+			<entry class="" argb="255,252,102,210" value="211" />
+			<entry class="" argb="255,252,104,212" value="212" />
+			<entry class="" argb="255,252,107,213" value="213" />
+			<entry class="" argb="255,252,110,214" value="214" />
+			<entry class="" argb="255,252,113,215" value="215" />
+			<entry class="" argb="255,252,116,217" value="216" />
+			<entry class="" argb="255,252,119,218" value="217" />
+			<entry class="" argb="255,252,122,219" value="218" />
+			<entry class="" argb="255,252,125,220" value="219" />
+			<entry class="" argb="255,252,128,221" value="220" />
+			<entry class="" argb="255,252,131,222" value="221" />
+			<entry class="" argb="255,252,134,223" value="222" />
+			<entry class="" argb="255,252,137,224" value="223" />
+			<entry class="" argb="255,252,140,226" value="224" />
+			<entry class="" argb="255,252,143,227" value="225" />
+			<entry class="" argb="255,252,146,228" value="226" />
+			<entry class="" argb="255,252,149,229" value="227" />
+			<entry class="" argb="255,252,152,230" value="228" />
+			<entry class="" argb="255,252,155,231" value="229" />
+			<entry class="" argb="255,252,158,232" value="230" />
+			<entry class="" argb="255,252,161,233" value="231" />
+			<entry class="" argb="255,252,164,235" value="232" />
+			<entry class="" argb="255,252,167,236" value="233" />
+			<entry class="" argb="255,252,170,237" value="234" />
+			<entry class="" argb="255,252,173,238" value="235" />
+			<entry class="" argb="255,252,176,239" value="236" />
+			<entry class="" argb="255,252,180,240" value="237" />
+			<entry class="" argb="255,252,184,241" value="238" />
+			<entry class="" argb="255,252,188,242" value="239" />
+			<entry class="" argb="255,252,192,243" value="240" />
+			<entry class="" argb="255,252,197,243" value="241" />
+			<entry class="" argb="255,252,202,244" value="242" />
+			<entry class="" argb="255,252,207,245" value="243" />
+			<entry class="" argb="255,252,212,246" value="244" />
+			<entry class="" argb="255,252,217,246" value="245" />
+			<entry class="" argb="255,252,222,247" value="246" />
+			<entry class="" argb="255,252,227,248" value="247" />
+			<entry class="" argb="255,252,232,249" value="248" />
+			<entry class="" argb="255,252,237,249" value="249" />
+			<entry class="" argb="255,252,242,250" value="250" />
+			<entry class="" argb="255,252,247,251" value="251" />
+			<entry class="" argb="255,252,252,252" value="252" />
+			<entry class="" argb="255,252,252,252" value="253" />
+			<entry class="" argb="255,253,253,253" value="254" />
+			<entry class="" argb="255,254,254,254" value="255" />
+		</table>
+	</palette>
+
+	<palette name="std-gamma-II" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,0,5" value="1" />
+			<entry class="" argb="255,0,0,10" value="2" />
+			<entry class="" argb="255,0,0,15" value="3" />
+			<entry class="" argb="255,0,0,20" value="4" />
+			<entry class="" argb="255,0,0,26" value="5" />
+			<entry class="" argb="255,0,0,31" value="6" />
+			<entry class="" argb="255,0,0,36" value="7" />
+			<entry class="" argb="255,0,0,41" value="8" />
+			<entry class="" argb="255,0,0,46" value="9" />
+			<entry class="" argb="255,0,0,52" value="10" />
+			<entry class="" argb="255,0,0,57" value="11" />
+			<entry class="" argb="255,0,0,62" value="12" />
+			<entry class="" argb="255,0,0,67" value="13" />
+			<entry class="" argb="255,0,0,72" value="14" />
+			<entry class="" argb="255,0,0,78" value="15" />
+			<entry class="" argb="255,0,0,83" value="16" />
+			<entry class="" argb="255,0,0,88" value="17" />
+			<entry class="" argb="255,0,0,93" value="18" />
+			<entry class="" argb="255,0,0,98" value="19" />
+			<entry class="" argb="255,0,0,104" value="20" />
+			<entry class="" argb="255,0,0,109" value="21" />
+			<entry class="" argb="255,0,0,114" value="22" />
+			<entry class="" argb="255,0,0,119" value="23" />
+			<entry class="" argb="255,0,0,124" value="24" />
+			<entry class="" argb="255,0,0,130" value="25" />
+			<entry class="" argb="255,0,0,135" value="26" />
+			<entry class="" argb="255,0,0,140" value="27" />
+			<entry class="" argb="255,0,0,145" value="28" />
+			<entry class="" argb="255,0,0,150" value="29" />
+			<entry class="" argb="255,0,0,156" value="30" />
+			<entry class="" argb="255,0,0,161" value="31" />
+			<entry class="" argb="255,0,0,166" value="32" />
+			<entry class="" argb="255,0,0,171" value="33" />
+			<entry class="" argb="255,0,0,176" value="34" />
+			<entry class="" argb="255,0,0,182" value="35" />
+			<entry class="" argb="255,0,0,187" value="36" />
+			<entry class="" argb="255,0,0,192" value="37" />
+			<entry class="" argb="255,0,0,197" value="38" />
+			<entry class="" argb="255,0,0,202" value="39" />
+			<entry class="" argb="255,0,0,208" value="40" />
+			<entry class="" argb="255,0,0,213" value="41" />
+			<entry class="" argb="255,0,0,218" value="42" />
+			<entry class="" argb="255,0,0,223" value="43" />
+			<entry class="" argb="255,0,0,228" value="44" />
+			<entry class="" argb="255,0,0,234" value="45" />
+			<entry class="" argb="255,0,0,239" value="46" />
+			<entry class="" argb="255,0,0,244" value="47" />
+			<entry class="" argb="255,4,0,249" value="48" />
+			<entry class="" argb="255,9,0,255" value="49" />
+			<entry class="" argb="255,14,0,250" value="50" />
+			<entry class="" argb="255,19,0,245" value="51" />
+			<entry class="" argb="255,23,0,239" value="52" />
+			<entry class="" argb="255,28,0,234" value="53" />
+			<entry class="" argb="255,33,0,228" value="54" />
+			<entry class="" argb="255,38,0,223" value="55" />
+			<entry class="" argb="255,42,0,218" value="56" />
+			<entry class="" argb="255,47,0,212" value="57" />
+			<entry class="" argb="255,52,0,207" value="58" />
+			<entry class="" argb="255,57,0,201" value="59" />
+			<entry class="" argb="255,61,0,196" value="60" />
+			<entry class="" argb="255,66,0,190" value="61" />
+			<entry class="" argb="255,71,0,185" value="62" />
+			<entry class="" argb="255,76,0,180" value="63" />
+			<entry class="" argb="255,81,0,174" value="64" />
+			<entry class="" argb="255,81,0,169" value="65" />
+			<entry class="" argb="255,81,0,163" value="66" />
+			<entry class="" argb="255,81,0,158" value="67" />
+			<entry class="" argb="255,81,0,152" value="68" />
+			<entry class="" argb="255,81,0,147" value="69" />
+			<entry class="" argb="255,81,0,142" value="70" />
+			<entry class="" argb="255,81,0,136" value="71" />
+			<entry class="" argb="255,80,0,131" value="72" />
+			<entry class="" argb="255,80,0,125" value="73" />
+			<entry class="" argb="255,80,0,120" value="74" />
+			<entry class="" argb="255,80,0,114" value="75" />
+			<entry class="" argb="255,80,0,109" value="76" />
+			<entry class="" argb="255,80,0,104" value="77" />
+			<entry class="" argb="255,80,0,98" value="78" />
+			<entry class="" argb="255,79,0,93" value="79" />
+			<entry class="" argb="255,84,0,87" value="80" />
+			<entry class="" argb="255,89,0,82" value="81" />
+			<entry class="" argb="255,94,0,76" value="82" />
+			<entry class="" argb="255,99,0,71" value="83" />
+			<entry class="" argb="255,104,0,66" value="84" />
+			<entry class="" argb="255,109,0,60" value="85" />
+			<entry class="" argb="255,114,0,55" value="86" />
+			<entry class="" argb="255,119,0,49" value="87" />
+			<entry class="" argb="255,124,0,44" value="88" />
+			<entry class="" argb="255,129,0,38" value="89" />
+			<entry class="" argb="255,134,0,33" value="90" />
+			<entry class="" argb="255,139,0,28" value="91" />
+			<entry class="" argb="255,144,0,22" value="92" />
+			<entry class="" argb="255,149,0,17" value="93" />
+			<entry class="" argb="255,154,0,11" value="94" />
+			<entry class="" argb="255,159,0,6" value="95" />
+			<entry class="" argb="255,164,0,0" value="96" />
+			<entry class="" argb="255,169,0,0" value="97" />
+			<entry class="" argb="255,174,0,0" value="98" />
+			<entry class="" argb="255,180,0,0" value="99" />
+			<entry class="" argb="255,185,0,0" value="100" />
+			<entry class="" argb="255,190,0,0" value="101" />
+			<entry class="" argb="255,196,0,0" value="102" />
+			<entry class="" argb="255,201,0,0" value="103" />
+			<entry class="" argb="255,206,0,0" value="104" />
+			<entry class="" argb="255,212,0,0" value="105" />
+			<entry class="" argb="255,217,0,0" value="106" />
+			<entry class="" argb="255,222,0,0" value="107" />
+			<entry class="" argb="255,228,0,0" value="108" />
+			<entry class="" argb="255,233,0,0" value="109" />
+			<entry class="" argb="255,255,0,0" value="110" />
+			<entry class="" argb="255,255,0,0" value="111" />
+			<entry class="" argb="255,255,0,0" value="112" />
+			<entry class="" argb="255,255,0,0" value="113" />
+			<entry class="" argb="255,255,5,0" value="114" />
+			<entry class="" argb="255,255,10,0" value="115" />
+			<entry class="" argb="255,255,16,0" value="116" />
+			<entry class="" argb="255,255,21,0" value="117" />
+			<entry class="" argb="255,255,27,0" value="118" />
+			<entry class="" argb="255,255,32,0" value="119" />
+			<entry class="" argb="255,255,37,0" value="120" />
+			<entry class="" argb="255,255,43,0" value="121" />
+			<entry class="" argb="255,255,48,0" value="122" />
+			<entry class="" argb="255,255,54,0" value="123" />
+			<entry class="" argb="255,255,59,0" value="124" />
+			<entry class="" argb="255,255,64,0" value="125" />
+			<entry class="" argb="255,255,70,0" value="126" />
+			<entry class="" argb="255,255,75,0" value="127" />
+			<entry class="" argb="255,255,81,0" value="128" />
+			<entry class="" argb="255,255,85,4" value="129" />
+			<entry class="" argb="255,255,90,9" value="130" />
+			<entry class="" argb="255,255,95,14" value="131" />
+			<entry class="" argb="255,255,100,19" value="132" />
+			<entry class="" argb="255,255,105,24" value="133" />
+			<entry class="" argb="255,255,109,28" value="134" />
+			<entry class="" argb="255,255,114,33" value="135" />
+			<entry class="" argb="255,255,119,38" value="136" />
+			<entry class="" argb="255,255,124,43" value="137" />
+			<entry class="" argb="255,255,129,48" value="138" />
+			<entry class="" argb="255,255,134,53" value="139" />
+			<entry class="" argb="255,255,138,57" value="140" />
+			<entry class="" argb="255,255,143,62" value="141" />
+			<entry class="" argb="255,255,148,67" value="142" />
+			<entry class="" argb="255,255,153,72" value="143" />
+			<entry class="" argb="255,255,158,77" value="144" />
+			<entry class="" argb="255,255,163,82" value="145" />
+			<entry class="" argb="255,255,163,77" value="146" />
+			<entry class="" argb="255,255,163,71" value="147" />
+			<entry class="" argb="255,255,163,65" value="148" />
+			<entry class="" argb="255,255,163,59" value="149" />
+			<entry class="" argb="255,255,163,53" value="150" />
+			<entry class="" argb="255,255,163,47" value="151" />
+			<entry class="" argb="255,255,163,41" value="152" />
+			<entry class="" argb="255,255,163,36" value="153" />
+			<entry class="" argb="255,255,163,30" value="154" />
+			<entry class="" argb="255,255,163,24" value="155" />
+			<entry class="" argb="255,255,163,18" value="156" />
+			<entry class="" argb="255,255,163,12" value="157" />
+			<entry class="" argb="255,255,163,6" value="158" />
+			<entry class="" argb="255,255,163,0" value="159" />
+			<entry class="" argb="255,255,163,0" value="160" />
+			<entry class="" argb="255,255,163,0" value="161" />
+			<entry class="" argb="255,255,163,0" value="162" />
+			<entry class="" argb="255,248,163,0" value="163" />
+			<entry class="" argb="255,240,163,0" value="164" />
+			<entry class="" argb="255,232,163,0" value="165" />
+			<entry class="" argb="255,225,163,0" value="166" />
+			<entry class="" argb="255,217,163,0" value="167" />
+			<entry class="" argb="255,209,163,0" value="168" />
+			<entry class="" argb="255,202,163,0" value="169" />
+			<entry class="" argb="255,194,163,0" value="170" />
+			<entry class="" argb="255,186,163,0" value="171" />
+			<entry class="" argb="255,179,163,0" value="172" />
+			<entry class="" argb="255,171,163,0" value="173" />
+			<entry class="" argb="255,163,163,0" value="174" />
+			<entry class="" argb="255,168,163,0" value="175" />
+			<entry class="" argb="255,173,163,0" value="176" />
+			<entry class="" argb="255,178,169,3" value="177" />
+			<entry class="" argb="255,183,175,6" value="178" />
+			<entry class="" argb="255,188,181,9" value="179" />
+			<entry class="" argb="255,193,187,12" value="180" />
+			<entry class="" argb="255,198,193,16" value="181" />
+			<entry class="" argb="255,203,199,19" value="182" />
+			<entry class="" argb="255,209,205,22" value="183" />
+			<entry class="" argb="255,214,212,25" value="184" />
+			<entry class="" argb="255,219,218,29" value="185" />
+			<entry class="" argb="255,224,224,32" value="186" />
+			<entry class="" argb="255,229,230,35" value="187" />
+			<entry class="" argb="255,234,236,38" value="188" />
+			<entry class="" argb="255,239,242,41" value="189" />
+			<entry class="" argb="255,244,248,45" value="190" />
+			<entry class="" argb="255,249,255,48" value="191" />
+			<entry class="" argb="255,255,255,51" value="192" />
+			<entry class="" argb="255,255,255,54" value="193" />
+			<entry class="" argb="255,255,255,58" value="194" />
+			<entry class="" argb="255,255,255,61" value="195" />
+			<entry class="" argb="255,255,255,64" value="196" />
+			<entry class="" argb="255,255,255,67" value="197" />
+			<entry class="" argb="255,255,255,71" value="198" />
+			<entry class="" argb="255,255,255,74" value="199" />
+			<entry class="" argb="255,255,255,77" value="200" />
+			<entry class="" argb="255,255,255,80" value="201" />
+			<entry class="" argb="255,255,255,83" value="202" />
+			<entry class="" argb="255,255,255,87" value="203" />
+			<entry class="" argb="255,255,255,90" value="204" />
+			<entry class="" argb="255,255,255,93" value="205" />
+			<entry class="" argb="255,255,255,96" value="206" />
+			<entry class="" argb="255,255,255,100" value="207" />
+			<entry class="" argb="255,255,255,103" value="208" />
+			<entry class="" argb="255,255,255,106" value="209" />
+			<entry class="" argb="255,255,255,109" value="210" />
+			<entry class="" argb="255,255,255,112" value="211" />
+			<entry class="" argb="255,255,255,116" value="212" />
+			<entry class="" argb="255,255,255,119" value="213" />
+			<entry class="" argb="255,255,255,122" value="214" />
+			<entry class="" argb="255,255,255,125" value="215" />
+			<entry class="" argb="255,255,255,129" value="216" />
+			<entry class="" argb="255,255,255,132" value="217" />
+			<entry class="" argb="255,255,255,135" value="218" />
+			<entry class="" argb="255,255,255,138" value="219" />
+			<entry class="" argb="255,255,255,142" value="220" />
+			<entry class="" argb="255,255,255,145" value="221" />
+			<entry class="" argb="255,255,255,148" value="222" />
+			<entry class="" argb="255,255,255,151" value="223" />
+			<entry class="" argb="255,255,255,154" value="224" />
+			<entry class="" argb="255,255,255,158" value="225" />
+			<entry class="" argb="255,255,255,161" value="226" />
+			<entry class="" argb="255,255,255,164" value="227" />
+			<entry class="" argb="255,255,255,167" value="228" />
+			<entry class="" argb="255,255,255,171" value="229" />
+			<entry class="" argb="255,255,255,174" value="230" />
+			<entry class="" argb="255,255,255,177" value="231" />
+			<entry class="" argb="255,255,255,180" value="232" />
+			<entry class="" argb="255,255,255,183" value="233" />
+			<entry class="" argb="255,255,255,187" value="234" />
+			<entry class="" argb="255,255,255,190" value="235" />
+			<entry class="" argb="255,255,255,193" value="236" />
+			<entry class="" argb="255,255,255,196" value="237" />
+			<entry class="" argb="255,255,255,200" value="238" />
+			<entry class="" argb="255,255,255,203" value="239" />
+			<entry class="" argb="255,255,255,206" value="240" />
+			<entry class="" argb="255,255,255,209" value="241" />
+			<entry class="" argb="255,255,255,213" value="242" />
+			<entry class="" argb="255,255,255,216" value="243" />
+			<entry class="" argb="255,255,255,219" value="244" />
+			<entry class="" argb="255,255,255,222" value="245" />
+			<entry class="" argb="255,255,255,225" value="246" />
+			<entry class="" argb="255,255,255,229" value="247" />
+			<entry class="" argb="255,255,255,232" value="248" />
+			<entry class="" argb="255,255,255,235" value="249" />
+			<entry class="" argb="255,255,255,238" value="250" />
+			<entry class="" argb="255,255,255,242" value="251" />
+			<entry class="" argb="255,255,255,245" value="252" />
+			<entry class="" argb="255,255,255,248" value="253" />
+			<entry class="" argb="255,255,255,251" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="steps" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,0,42,0" value="1" />
+			<entry class="" argb="255,0,85,0" value="2" />
+			<entry class="" argb="255,0,127,0" value="3" />
+			<entry class="" argb="255,0,170,0" value="4" />
+			<entry class="" argb="255,0,212,0" value="5" />
+			<entry class="" argb="255,0,255,0" value="6" />
+			<entry class="" argb="255,0,246,0" value="7" />
+			<entry class="" argb="255,0,236,0" value="8" />
+			<entry class="" argb="255,0,226,0" value="9" />
+			<entry class="" argb="255,0,216,0" value="10" />
+			<entry class="" argb="255,0,206,0" value="11" />
+			<entry class="" argb="255,0,197,0" value="12" />
+			<entry class="" argb="255,0,187,0" value="13" />
+			<entry class="" argb="255,0,177,0" value="14" />
+			<entry class="" argb="255,0,167,0" value="15" />
+			<entry class="" argb="255,0,157,0" value="16" />
+			<entry class="" argb="255,0,148,0" value="17" />
+			<entry class="" argb="255,0,138,0" value="18" />
+			<entry class="" argb="255,0,128,0" value="19" />
+			<entry class="" argb="255,0,118,0" value="20" />
+			<entry class="" argb="255,0,108,0" value="21" />
+			<entry class="" argb="255,0,99,0" value="22" />
+			<entry class="" argb="255,0,89,0" value="23" />
+			<entry class="" argb="255,0,79,0" value="24" />
+			<entry class="" argb="255,0,69,0" value="25" />
+			<entry class="" argb="255,0,59,0" value="26" />
+			<entry class="" argb="255,0,50,0" value="27" />
+			<entry class="" argb="255,0,40,0" value="28" />
+			<entry class="" argb="255,0,30,0" value="29" />
+			<entry class="" argb="255,0,20,0" value="30" />
+			<entry class="" argb="255,0,10,0" value="31" />
+			<entry class="" argb="255,0,0,0" value="32" />
+			<entry class="" argb="255,0,0,8" value="33" />
+			<entry class="" argb="255,0,0,16" value="34" />
+			<entry class="" argb="255,0,0,24" value="35" />
+			<entry class="" argb="255,0,0,32" value="36" />
+			<entry class="" argb="255,0,0,41" value="37" />
+			<entry class="" argb="255,0,0,49" value="38" />
+			<entry class="" argb="255,0,0,57" value="39" />
+			<entry class="" argb="255,0,0,65" value="40" />
+			<entry class="" argb="255,0,0,74" value="41" />
+			<entry class="" argb="255,0,0,82" value="42" />
+			<entry class="" argb="255,0,0,90" value="43" />
+			<entry class="" argb="255,0,0,98" value="44" />
+			<entry class="" argb="255,0,0,106" value="45" />
+			<entry class="" argb="255,0,0,115" value="46" />
+			<entry class="" argb="255,0,0,123" value="47" />
+			<entry class="" argb="255,0,0,131" value="48" />
+			<entry class="" argb="255,0,0,139" value="49" />
+			<entry class="" argb="255,0,0,148" value="50" />
+			<entry class="" argb="255,0,0,156" value="51" />
+			<entry class="" argb="255,0,0,164" value="52" />
+			<entry class="" argb="255,0,0,172" value="53" />
+			<entry class="" argb="255,0,0,180" value="54" />
+			<entry class="" argb="255,0,0,189" value="55" />
+			<entry class="" argb="255,0,0,197" value="56" />
+			<entry class="" argb="255,0,0,205" value="57" />
+			<entry class="" argb="255,0,0,213" value="58" />
+			<entry class="" argb="255,0,0,222" value="59" />
+			<entry class="" argb="255,0,0,230" value="60" />
+			<entry class="" argb="255,0,0,238" value="61" />
+			<entry class="" argb="255,0,0,246" value="62" />
+			<entry class="" argb="255,0,0,255" value="63" />
+			<entry class="" argb="255,0,0,0" value="64" />
+			<entry class="" argb="255,7,0,5" value="65" />
+			<entry class="" argb="255,15,0,10" value="66" />
+			<entry class="" argb="255,23,0,15" value="67" />
+			<entry class="" argb="255,31,0,21" value="68" />
+			<entry class="" argb="255,39,0,26" value="69" />
+			<entry class="" argb="255,47,0,31" value="70" />
+			<entry class="" argb="255,55,0,37" value="71" />
+			<entry class="" argb="255,63,0,42" value="72" />
+			<entry class="" argb="255,70,0,47" value="73" />
+			<entry class="" argb="255,78,0,53" value="74" />
+			<entry class="" argb="255,86,0,58" value="75" />
+			<entry class="" argb="255,94,0,63" value="76" />
+			<entry class="" argb="255,102,0,69" value="77" />
+			<entry class="" argb="255,110,0,74" value="78" />
+			<entry class="" argb="255,118,0,79" value="79" />
+			<entry class="" argb="255,126,0,85" value="80" />
+			<entry class="" argb="255,134,0,89" value="81" />
+			<entry class="" argb="255,142,0,94" value="82" />
+			<entry class="" argb="255,151,0,98" value="83" />
+			<entry class="" argb="255,159,0,103" value="84" />
+			<entry class="" argb="255,168,0,108" value="85" />
+			<entry class="" argb="255,176,0,112" value="86" />
+			<entry class="" argb="255,184,0,117" value="87" />
+			<entry class="" argb="255,193,0,121" value="88" />
+			<entry class="" argb="255,201,0,126" value="89" />
+			<entry class="" argb="255,210,0,131" value="90" />
+			<entry class="" argb="255,218,0,135" value="91" />
+			<entry class="" argb="255,226,0,140" value="92" />
+			<entry class="" argb="255,235,0,144" value="93" />
+			<entry class="" argb="255,243,0,149" value="94" />
+			<entry class="" argb="255,252,0,154" value="95" />
+			<entry class="" argb="255,0,0,0" value="96" />
+			<entry class="" argb="255,1,0,0" value="97" />
+			<entry class="" argb="255,2,0,0" value="98" />
+			<entry class="" argb="255,3,0,0" value="99" />
+			<entry class="" argb="255,4,0,0" value="100" />
+			<entry class="" argb="255,5,0,0" value="101" />
+			<entry class="" argb="255,6,0,0" value="102" />
+			<entry class="" argb="255,7,0,0" value="103" />
+			<entry class="" argb="255,8,0,0" value="104" />
+			<entry class="" argb="255,9,0,0" value="105" />
+			<entry class="" argb="255,10,0,0" value="106" />
+			<entry class="" argb="255,11,0,0" value="107" />
+			<entry class="" argb="255,12,0,0" value="108" />
+			<entry class="" argb="255,14,0,0" value="109" />
+			<entry class="" argb="255,16,0,0" value="110" />
+			<entry class="" argb="255,18,0,0" value="111" />
+			<entry class="" argb="255,20,0,0" value="112" />
+			<entry class="" argb="255,23,0,0" value="113" />
+			<entry class="" argb="255,25,0,0" value="114" />
+			<entry class="" argb="255,27,0,0" value="115" />
+			<entry class="" argb="255,29,0,0" value="116" />
+			<entry class="" argb="255,32,0,0" value="117" />
+			<entry class="" argb="255,34,0,0" value="118" />
+			<entry class="" argb="255,36,0,0" value="119" />
+			<entry class="" argb="255,38,0,0" value="120" />
+			<entry class="" argb="255,41,0,0" value="121" />
+			<entry class="" argb="255,44,0,0" value="122" />
+			<entry class="" argb="255,47,0,0" value="123" />
+			<entry class="" argb="255,50,0,0" value="124" />
+			<entry class="" argb="255,53,0,0" value="125" />
+			<entry class="" argb="255,56,0,0" value="126" />
+			<entry class="" argb="255,59,0,0" value="127" />
+			<entry class="" argb="255,63,0,0" value="128" />
+			<entry class="" argb="255,66,0,0" value="129" />
+			<entry class="" argb="255,69,0,0" value="130" />
+			<entry class="" argb="255,72,0,0" value="131" />
+			<entry class="" argb="255,75,0,0" value="132" />
+			<entry class="" argb="255,78,0,0" value="133" />
+			<entry class="" argb="255,82,0,1" value="134" />
+			<entry class="" argb="255,85,0,1" value="135" />
+			<entry class="" argb="255,89,0,1" value="136" />
+			<entry class="" argb="255,93,0,1" value="137" />
+			<entry class="" argb="255,97,0,1" value="138" />
+			<entry class="" argb="255,101,0,1" value="139" />
+			<entry class="" argb="255,105,0,1" value="140" />
+			<entry class="" argb="255,108,0,1" value="141" />
+			<entry class="" argb="255,112,0,1" value="142" />
+			<entry class="" argb="255,116,0,1" value="143" />
+			<entry class="" argb="255,120,0,1" value="144" />
+			<entry class="" argb="255,124,0,1" value="145" />
+			<entry class="" argb="255,128,1,1" value="146" />
+			<entry class="" argb="255,131,1,1" value="147" />
+			<entry class="" argb="255,135,1,1" value="148" />
+			<entry class="" argb="255,139,1,1" value="149" />
+			<entry class="" argb="255,143,1,1" value="150" />
+			<entry class="" argb="255,147,1,1" value="151" />
+			<entry class="" argb="255,151,1,1" value="152" />
+			<entry class="" argb="255,155,1,1" value="153" />
+			<entry class="" argb="255,159,1,1" value="154" />
+			<entry class="" argb="255,163,1,1" value="155" />
+			<entry class="" argb="255,167,1,1" value="156" />
+			<entry class="" argb="255,171,1,1" value="157" />
+			<entry class="" argb="255,175,1,1" value="158" />
+			<entry class="" argb="255,178,1,1" value="159" />
+			<entry class="" argb="255,181,1,1" value="160" />
+			<entry class="" argb="255,185,1,1" value="161" />
+			<entry class="" argb="255,188,1,1" value="162" />
+			<entry class="" argb="255,192,1,1" value="163" />
+			<entry class="" argb="255,195,1,1" value="164" />
+			<entry class="" argb="255,198,1,1" value="165" />
+			<entry class="" argb="255,202,1,1" value="166" />
+			<entry class="" argb="255,205,1,1" value="167" />
+			<entry class="" argb="255,209,1,1" value="168" />
+			<entry class="" argb="255,212,1,1" value="169" />
+			<entry class="" argb="255,216,1,2" value="170" />
+			<entry class="" argb="255,218,1,2" value="171" />
+			<entry class="" argb="255,220,1,2" value="172" />
+			<entry class="" argb="255,223,1,2" value="173" />
+			<entry class="" argb="255,225,1,2" value="174" />
+			<entry class="" argb="255,227,1,2" value="175" />
+			<entry class="" argb="255,230,1,2" value="176" />
+			<entry class="" argb="255,232,1,2" value="177" />
+			<entry class="" argb="255,234,1,2" value="178" />
+			<entry class="" argb="255,237,1,2" value="179" />
+			<entry class="" argb="255,239,1,2" value="180" />
+			<entry class="" argb="255,241,1,2" value="181" />
+			<entry class="" argb="255,244,2,2" value="182" />
+			<entry class="" argb="255,244,2,2" value="183" />
+			<entry class="" argb="255,245,2,2" value="184" />
+			<entry class="" argb="255,246,2,2" value="185" />
+			<entry class="" argb="255,247,2,2" value="186" />
+			<entry class="" argb="255,247,2,2" value="187" />
+			<entry class="" argb="255,248,2,2" value="188" />
+			<entry class="" argb="255,249,2,2" value="189" />
+			<entry class="" argb="255,250,2,2" value="190" />
+			<entry class="" argb="255,250,2,2" value="191" />
+			<entry class="" argb="255,251,2,2" value="192" />
+			<entry class="" argb="255,252,2,2" value="193" />
+			<entry class="" argb="255,253,2,2" value="194" />
+			<entry class="" argb="255,254,1,2" value="195" />
+			<entry class="" argb="255,254,1,2" value="196" />
+			<entry class="" argb="255,254,3,2" value="197" />
+			<entry class="" argb="255,254,5,2" value="198" />
+			<entry class="" argb="255,254,8,2" value="199" />
+			<entry class="" argb="255,254,10,2" value="200" />
+			<entry class="" argb="255,254,12,2" value="201" />
+			<entry class="" argb="255,254,15,2" value="202" />
+			<entry class="" argb="255,254,17,2" value="203" />
+			<entry class="" argb="255,254,19,2" value="204" />
+			<entry class="" argb="255,254,22,2" value="205" />
+			<entry class="" argb="255,254,24,2" value="206" />
+			<entry class="" argb="255,254,26,2" value="207" />
+			<entry class="" argb="255,254,29,2" value="208" />
+			<entry class="" argb="255,254,31,2" value="209" />
+			<entry class="" argb="255,254,33,2" value="210" />
+			<entry class="" argb="255,254,36,2" value="211" />
+			<entry class="" argb="255,254,36,2" value="212" />
+			<entry class="" argb="255,254,38,3" value="213" />
+			<entry class="" argb="255,254,40,4" value="214" />
+			<entry class="" argb="255,254,42,5" value="215" />
+			<entry class="" argb="255,255,45,7" value="216" />
+			<entry class="" argb="255,255,48,9" value="217" />
+			<entry class="" argb="255,255,51,12" value="218" />
+			<entry class="" argb="255,255,54,14" value="219" />
+			<entry class="" argb="255,255,58,17" value="220" />
+			<entry class="" argb="255,255,61,20" value="221" />
+			<entry class="" argb="255,255,64,23" value="222" />
+			<entry class="" argb="255,255,67,27" value="223" />
+			<entry class="" argb="255,255,70,30" value="224" />
+			<entry class="" argb="255,255,73,34" value="225" />
+			<entry class="" argb="255,255,77,39" value="226" />
+			<entry class="" argb="255,255,82,44" value="227" />
+			<entry class="" argb="255,255,87,49" value="228" />
+			<entry class="" argb="255,255,92,55" value="229" />
+			<entry class="" argb="255,255,96,60" value="230" />
+			<entry class="" argb="255,255,100,65" value="231" />
+			<entry class="" argb="255,255,104,71" value="232" />
+			<entry class="" argb="255,255,108,76" value="233" />
+			<entry class="" argb="255,255,113,82" value="234" />
+			<entry class="" argb="255,255,119,89" value="235" />
+			<entry class="" argb="255,255,125,97" value="236" />
+			<entry class="" argb="255,255,131,104" value="237" />
+			<entry class="" argb="255,255,138,112" value="238" />
+			<entry class="" argb="255,255,144,120" value="239" />
+			<entry class="" argb="255,255,151,128" value="240" />
+			<entry class="" argb="255,255,157,136" value="241" />
+			<entry class="" argb="255,255,164,145" value="242" />
+			<entry class="" argb="255,255,171,153" value="243" />
+			<entry class="" argb="255,255,178,162" value="244" />
+			<entry class="" argb="255,255,185,171" value="245" />
+			<entry class="" argb="255,255,193,180" value="246" />
+			<entry class="" argb="255,255,200,189" value="247" />
+			<entry class="" argb="255,255,208,198" value="248" />
+			<entry class="" argb="255,255,215,207" value="249" />
+			<entry class="" argb="255,255,223,217" value="250" />
+			<entry class="" argb="255,255,229,224" value="251" />
+			<entry class="" argb="255,255,235,232" value="252" />
+			<entry class="" argb="255,255,242,239" value="253" />
+			<entry class="" argb="255,255,248,247" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="stern-special" interpolate="false">
+		<table>
+			<entry class="" argb="255,0,0,0" value="0" />
+			<entry class="" argb="255,18,1,1" value="1" />
+			<entry class="" argb="255,36,2,3" value="2" />
+			<entry class="" argb="255,54,3,5" value="3" />
+			<entry class="" argb="255,72,4,7" value="4" />
+			<entry class="" argb="255,90,5,9" value="5" />
+			<entry class="" argb="255,108,6,11" value="6" />
+			<entry class="" argb="255,127,7,13" value="7" />
+			<entry class="" argb="255,145,8,15" value="8" />
+			<entry class="" argb="255,163,9,17" value="9" />
+			<entry class="" argb="255,181,10,19" value="10" />
+			<entry class="" argb="255,199,11,21" value="11" />
+			<entry class="" argb="255,217,12,23" value="12" />
+			<entry class="" argb="255,235,13,25" value="13" />
+			<entry class="" argb="255,254,14,27" value="14" />
+			<entry class="" argb="255,249,15,29" value="15" />
+			<entry class="" argb="255,244,16,31" value="16" />
+			<entry class="" argb="255,239,17,33" value="17" />
+			<entry class="" argb="255,234,18,35" value="18" />
+			<entry class="" argb="255,229,19,37" value="19" />
+			<entry class="" argb="255,223,20,39" value="20" />
+			<entry class="" argb="255,218,21,41" value="21" />
+			<entry class="" argb="255,213,22,43" value="22" />
+			<entry class="" argb="255,208,23,45" value="23" />
+			<entry class="" argb="255,203,24,47" value="24" />
+			<entry class="" argb="255,197,25,49" value="25" />
+			<entry class="" argb="255,192,26,51" value="26" />
+			<entry class="" argb="255,187,27,53" value="27" />
+			<entry class="" argb="255,182,28,55" value="28" />
+			<entry class="" argb="255,177,29,57" value="29" />
+			<entry class="" argb="255,172,30,59" value="30" />
+			<entry class="" argb="255,166,31,61" value="31" />
+			<entry class="" argb="255,161,32,63" value="32" />
+			<entry class="" argb="255,156,33,65" value="33" />
+			<entry class="" argb="255,151,34,67" value="34" />
+			<entry class="" argb="255,146,35,69" value="35" />
+			<entry class="" argb="255,140,36,71" value="36" />
+			<entry class="" argb="255,135,37,73" value="37" />
+			<entry class="" argb="255,130,38,75" value="38" />
+			<entry class="" argb="255,125,39,77" value="39" />
+			<entry class="" argb="255,120,40,79" value="40" />
+			<entry class="" argb="255,115,41,81" value="41" />
+			<entry class="" argb="255,109,42,83" value="42" />
+			<entry class="" argb="255,104,43,85" value="43" />
+			<entry class="" argb="255,99,44,87" value="44" />
+			<entry class="" argb="255,94,45,89" value="45" />
+			<entry class="" argb="255,89,46,91" value="46" />
+			<entry class="" argb="255,83,47,93" value="47" />
+			<entry class="" argb="255,78,48,95" value="48" />
+			<entry class="" argb="255,73,49,97" value="49" />
+			<entry class="" argb="255,68,50,99" value="50" />
+			<entry class="" argb="255,63,51,101" value="51" />
+			<entry class="" argb="255,58,52,103" value="52" />
+			<entry class="" argb="255,52,53,105" value="53" />
+			<entry class="" argb="255,47,54,107" value="54" />
+			<entry class="" argb="255,42,55,109" value="55" />
+			<entry class="" argb="255,37,56,111" value="56" />
+			<entry class="" argb="255,32,57,113" value="57" />
+			<entry class="" argb="255,26,58,115" value="58" />
+			<entry class="" argb="255,21,59,117" value="59" />
+			<entry class="" argb="255,16,60,119" value="60" />
+			<entry class="" argb="255,11,61,121" value="61" />
+			<entry class="" argb="255,6,62,123" value="62" />
+			<entry class="" argb="255,0,63,125" value="63" />
+			<entry class="" argb="255,64,64,127" value="64" />
+			<entry class="" argb="255,65,65,129" value="65" />
+			<entry class="" argb="255,66,66,131" value="66" />
+			<entry class="" argb="255,67,67,133" value="67" />
+			<entry class="" argb="255,68,68,135" value="68" />
+			<entry class="" argb="255,69,69,137" value="69" />
+			<entry class="" argb="255,70,70,139" value="70" />
+			<entry class="" argb="255,71,71,141" value="71" />
+			<entry class="" argb="255,72,72,143" value="72" />
+			<entry class="" argb="255,73,73,145" value="73" />
+			<entry class="" argb="255,74,74,147" value="74" />
+			<entry class="" argb="255,75,75,149" value="75" />
+			<entry class="" argb="255,76,76,151" value="76" />
+			<entry class="" argb="255,77,77,153" value="77" />
+			<entry class="" argb="255,78,78,155" value="78" />
+			<entry class="" argb="255,79,79,157" value="79" />
+			<entry class="" argb="255,80,80,159" value="80" />
+			<entry class="" argb="255,81,81,161" value="81" />
+			<entry class="" argb="255,82,82,163" value="82" />
+			<entry class="" argb="255,83,83,165" value="83" />
+			<entry class="" argb="255,84,84,167" value="84" />
+			<entry class="" argb="255,85,85,169" value="85" />
+			<entry class="" argb="255,86,86,171" value="86" />
+			<entry class="" argb="255,87,87,173" value="87" />
+			<entry class="" argb="255,88,88,175" value="88" />
+			<entry class="" argb="255,89,89,177" value="89" />
+			<entry class="" argb="255,90,90,179" value="90" />
+			<entry class="" argb="255,91,91,181" value="91" />
+			<entry class="" argb="255,92,92,183" value="92" />
+			<entry class="" argb="255,93,93,185" value="93" />
+			<entry class="" argb="255,94,94,187" value="94" />
+			<entry class="" argb="255,95,95,189" value="95" />
+			<entry class="" argb="255,96,96,191" value="96" />
+			<entry class="" argb="255,97,97,193" value="97" />
+			<entry class="" argb="255,98,98,195" value="98" />
+			<entry class="" argb="255,99,99,197" value="99" />
+			<entry class="" argb="255,100,100,199" value="100" />
+			<entry class="" argb="255,101,101,201" value="101" />
+			<entry class="" argb="255,102,102,203" value="102" />
+			<entry class="" argb="255,103,103,205" value="103" />
+			<entry class="" argb="255,104,104,207" value="104" />
+			<entry class="" argb="255,105,105,209" value="105" />
+			<entry class="" argb="255,106,106,211" value="106" />
+			<entry class="" argb="255,107,107,213" value="107" />
+			<entry class="" argb="255,108,108,215" value="108" />
+			<entry class="" argb="255,109,109,217" value="109" />
+			<entry class="" argb="255,110,110,219" value="110" />
+			<entry class="" argb="255,111,111,221" value="111" />
+			<entry class="" argb="255,112,112,223" value="112" />
+			<entry class="" argb="255,113,113,225" value="113" />
+			<entry class="" argb="255,114,114,227" value="114" />
+			<entry class="" argb="255,115,115,229" value="115" />
+			<entry class="" argb="255,116,116,231" value="116" />
+			<entry class="" argb="255,117,117,233" value="117" />
+			<entry class="" argb="255,118,118,235" value="118" />
+			<entry class="" argb="255,119,119,237" value="119" />
+			<entry class="" argb="255,120,120,239" value="120" />
+			<entry class="" argb="255,121,121,241" value="121" />
+			<entry class="" argb="255,122,122,243" value="122" />
+			<entry class="" argb="255,123,123,245" value="123" />
+			<entry class="" argb="255,124,124,247" value="124" />
+			<entry class="" argb="255,125,125,249" value="125" />
+			<entry class="" argb="255,126,126,251" value="126" />
+			<entry class="" argb="255,127,127,253" value="127" />
+			<entry class="" argb="255,128,128,255" value="128" />
+			<entry class="" argb="255,129,129,251" value="129" />
+			<entry class="" argb="255,130,130,247" value="130" />
+			<entry class="" argb="255,131,131,243" value="131" />
+			<entry class="" argb="255,132,132,238" value="132" />
+			<entry class="" argb="255,133,133,234" value="133" />
+			<entry class="" argb="255,134,134,230" value="134" />
+			<entry class="" argb="255,135,135,226" value="135" />
+			<entry class="" argb="255,136,136,221" value="136" />
+			<entry class="" argb="255,137,137,217" value="137" />
+			<entry class="" argb="255,138,138,213" value="138" />
+			<entry class="" argb="255,139,139,209" value="139" />
+			<entry class="" argb="255,140,140,204" value="140" />
+			<entry class="" argb="255,141,141,200" value="141" />
+			<entry class="" argb="255,142,142,196" value="142" />
+			<entry class="" argb="255,143,143,192" value="143" />
+			<entry class="" argb="255,144,144,187" value="144" />
+			<entry class="" argb="255,145,145,183" value="145" />
+			<entry class="" argb="255,146,146,179" value="146" />
+			<entry class="" argb="255,147,147,175" value="147" />
+			<entry class="" argb="255,148,148,170" value="148" />
+			<entry class="" argb="255,149,149,166" value="149" />
+			<entry class="" argb="255,150,150,162" value="150" />
+			<entry class="" argb="255,151,151,158" value="151" />
+			<entry class="" argb="255,152,152,153" value="152" />
+			<entry class="" argb="255,153,153,149" value="153" />
+			<entry class="" argb="255,154,154,145" value="154" />
+			<entry class="" argb="255,155,155,141" value="155" />
+			<entry class="" argb="255,156,156,136" value="156" />
+			<entry class="" argb="255,157,157,132" value="157" />
+			<entry class="" argb="255,158,158,128" value="158" />
+			<entry class="" argb="255,159,159,124" value="159" />
+			<entry class="" argb="255,160,160,119" value="160" />
+			<entry class="" argb="255,161,161,115" value="161" />
+			<entry class="" argb="255,162,162,111" value="162" />
+			<entry class="" argb="255,163,163,107" value="163" />
+			<entry class="" argb="255,164,164,102" value="164" />
+			<entry class="" argb="255,165,165,98" value="165" />
+			<entry class="" argb="255,166,166,94" value="166" />
+			<entry class="" argb="255,167,167,90" value="167" />
+			<entry class="" argb="255,168,168,85" value="168" />
+			<entry class="" argb="255,169,169,81" value="169" />
+			<entry class="" argb="255,170,170,77" value="170" />
+			<entry class="" argb="255,171,171,73" value="171" />
+			<entry class="" argb="255,172,172,68" value="172" />
+			<entry class="" argb="255,173,173,64" value="173" />
+			<entry class="" argb="255,174,174,60" value="174" />
+			<entry class="" argb="255,175,175,56" value="175" />
+			<entry class="" argb="255,176,176,51" value="176" />
+			<entry class="" argb="255,177,177,47" value="177" />
+			<entry class="" argb="255,178,178,43" value="178" />
+			<entry class="" argb="255,179,179,39" value="179" />
+			<entry class="" argb="255,180,180,34" value="180" />
+			<entry class="" argb="255,181,181,30" value="181" />
+			<entry class="" argb="255,182,182,26" value="182" />
+			<entry class="" argb="255,183,183,22" value="183" />
+			<entry class="" argb="255,184,184,17" value="184" />
+			<entry class="" argb="255,185,185,13" value="185" />
+			<entry class="" argb="255,186,186,9" value="186" />
+			<entry class="" argb="255,187,187,5" value="187" />
+			<entry class="" argb="255,188,188,0" value="188" />
+			<entry class="" argb="255,189,189,3" value="189" />
+			<entry class="" argb="255,190,190,7" value="190" />
+			<entry class="" argb="255,191,191,11" value="191" />
+			<entry class="" argb="255,192,192,15" value="192" />
+			<entry class="" argb="255,193,193,19" value="193" />
+			<entry class="" argb="255,194,194,22" value="194" />
+			<entry class="" argb="255,195,195,26" value="195" />
+			<entry class="" argb="255,196,196,30" value="196" />
+			<entry class="" argb="255,197,197,34" value="197" />
+			<entry class="" argb="255,198,198,38" value="198" />
+			<entry class="" argb="255,199,199,41" value="199" />
+			<entry class="" argb="255,200,200,45" value="200" />
+			<entry class="" argb="255,201,201,49" value="201" />
+			<entry class="" argb="255,202,202,53" value="202" />
+			<entry class="" argb="255,203,203,57" value="203" />
+			<entry class="" argb="255,204,204,60" value="204" />
+			<entry class="" argb="255,205,205,64" value="205" />
+			<entry class="" argb="255,206,206,68" value="206" />
+			<entry class="" argb="255,207,207,72" value="207" />
+			<entry class="" argb="255,208,208,76" value="208" />
+			<entry class="" argb="255,209,209,79" value="209" />
+			<entry class="" argb="255,210,210,83" value="210" />
+			<entry class="" argb="255,211,211,87" value="211" />
+			<entry class="" argb="255,212,212,91" value="212" />
+			<entry class="" argb="255,213,213,95" value="213" />
+			<entry class="" argb="255,214,214,98" value="214" />
+			<entry class="" argb="255,215,215,102" value="215" />
+			<entry class="" argb="255,216,216,106" value="216" />
+			<entry class="" argb="255,217,217,110" value="217" />
+			<entry class="" argb="255,218,218,114" value="218" />
+			<entry class="" argb="255,219,219,117" value="219" />
+			<entry class="" argb="255,220,220,121" value="220" />
+			<entry class="" argb="255,221,221,125" value="221" />
+			<entry class="" argb="255,222,222,129" value="222" />
+			<entry class="" argb="255,223,223,133" value="223" />
+			<entry class="" argb="255,224,224,137" value="224" />
+			<entry class="" argb="255,225,225,140" value="225" />
+			<entry class="" argb="255,226,226,144" value="226" />
+			<entry class="" argb="255,227,227,148" value="227" />
+			<entry class="" argb="255,228,228,152" value="228" />
+			<entry class="" argb="255,229,229,156" value="229" />
+			<entry class="" argb="255,230,230,159" value="230" />
+			<entry class="" argb="255,231,231,163" value="231" />
+			<entry class="" argb="255,232,232,167" value="232" />
+			<entry class="" argb="255,233,233,171" value="233" />
+			<entry class="" argb="255,234,234,175" value="234" />
+			<entry class="" argb="255,235,235,178" value="235" />
+			<entry class="" argb="255,236,236,182" value="236" />
+			<entry class="" argb="255,237,237,186" value="237" />
+			<entry class="" argb="255,238,238,190" value="238" />
+			<entry class="" argb="255,239,239,194" value="239" />
+			<entry class="" argb="255,240,240,197" value="240" />
+			<entry class="" argb="255,241,241,201" value="241" />
+			<entry class="" argb="255,242,242,205" value="242" />
+			<entry class="" argb="255,243,243,209" value="243" />
+			<entry class="" argb="255,244,244,213" value="244" />
+			<entry class="" argb="255,245,245,216" value="245" />
+			<entry class="" argb="255,246,246,220" value="246" />
+			<entry class="" argb="255,247,247,224" value="247" />
+			<entry class="" argb="255,248,248,228" value="248" />
+			<entry class="" argb="255,249,249,232" value="249" />
+			<entry class="" argb="255,250,250,235" value="250" />
+			<entry class="" argb="255,251,251,239" value="251" />
+			<entry class="" argb="255,252,252,243" value="252" />
+			<entry class="" argb="255,253,253,247" value="253" />
+			<entry class="" argb="255,254,254,251" value="254" />
+			<entry class="" argb="255,255,255,255" value="255" />
+		</table>
+	</palette>
+
+	<palette name="MDT1" interpolate="false">
+		<table>
+			<entry class="C21" argb="255,255,255,255" value="6000" />
+			<entry class="C20" argb="255,226,246,246" value="5000" />
+			<entry class="C19" argb="255,201,232,232" value="4000" />
+			<entry class="C10" argb="255,179,231,217" value="3500" />
+			<entry class="C9" argb="255,179,227,205" value="3000" />
+			<entry class="C8" argb="255,173,221,193" value="2500" />
+			<entry class="C7" argb="255,96,214,136" value="2000" />
+			<entry class="C6" argb="255,54,198,24" value="1500" />
+			<entry class="C5" argb="255,110,213,37" value="1000" />
+			<entry class="C4" argb="255,138,138,11" value="500" />
+			<entry class="C17" argb="255,163,163,10" value="250" />
+			<entry class="C11" argb="255,0,204,255" value="0" />
+			<entry class="C18" argb="255,0,204,255" value="-250" />
+			<entry class="C3" argb="255,0,153,255" value="-500" />
+			<entry class="C2" argb="255,0,51,255" value="-1000" />
+			<entry class="C1" argb="255,51,0,255" value="-1500" />
+			<entry class="C0" argb="255,0,0,204" value="-2000" />
+			<entry class="C12" argb="255,0,51,153" value="-2500" />
+			<entry class="C13" argb="255,0,0,102" value="-3000" />
+			<entry class="C16" argb="255,6,6,73" value="-3500" />
+			<entry class="C15" argb="255,4,22,40" value="-4000" />
+			<entry class="C14" argb="255,0,0,0" value="-10896" />
+		</table>
+	</palette>
+
+	<palette name="MDT2" interpolate="false">
+		<table>
+			<entry class="C21" argb="255,255,255,255" value="6000" />
+			<entry class="C20" argb="255,226,246,246" value="5000" />
+			<entry class="C19" argb="255,201,232,232" value="4000" />
+			<entry class="C10" argb="255,179,231,217" value="3500" />
+			<entry class="C9" argb="255,179,227,205" value="3000" />
+			<entry class="C8" argb="255,173,221,193" value="2500" />
+			<entry class="C7" argb="255,96,214,136" value="2000" />
+			<entry class="C6" argb="255,32,175,83" value="1500" />
+			<entry class="C5" argb="255,90,199,14" value="1000" />
+			<entry class="C4" argb="255,110,138,11" value="500" />
+			<entry class="C17" argb="255,147,163,10" value="250" />
+			<entry class="C11" argb="255,0,204,255" value="0" />
+			<entry class="C18" argb="255,0,204,255" value="-250" />
+			<entry class="C3" argb="255,0,153,255" value="-500" />
+			<entry class="C2" argb="255,30,74,251" value="-1000" />
+			<entry class="C1" argb="255,51,0,255" value="-1500" />
+			<entry class="C0" argb="255,0,0,219" value="-2000" />
+			<entry class="C12" argb="255,15,15,168" value="-2500" />
+			<entry class="C13" argb="255,15,15,153" value="-3000" />
+			<entry class="C16" argb="255,17,17,128" value="-3500" />
+			<entry class="C15" argb="255,14,16,108" value="-4000" />
+			<entry class="C22" argb="255,4,6,78" value="-5000" />
+			<entry class="C23" argb="255,0,0,68" value="-6000" />
+			<entry class="C24" argb="255,0,0,58" value="-7000" />
+			<entry class="C14" argb="255,0,0,0" value="-8000" />
+		</table>
+	</palette>
+
+	<palette name="CLASIFICACION" interpolate="false">
+		<table>
+			<entry class="C18" argb="255,0,102,255" value="18" />
+			<entry class="C17" argb="255,153,0,255" value="17" />
+			<entry class="C16" argb="255,153,0,153" value="16" />
+			<entry class="C15" argb="255,204,153,255" value="15" />
+			<entry class="C14" argb="255,204,80,17" value="14" />
+			<entry class="C13" argb="255,255,175,0" value="13" />
+			<entry class="C12" argb="255,255,153,102" value="12" />
+			<entry class="C11" argb="255,204,255,51" value="11" />
+			<entry class="C10" argb="255,204,204,0" value="10" />
+			<entry class="C9" argb="255,153,153,0" value="9" />
+			<entry class="C8" argb="255,204,0,102" value="8" />
+			<entry class="C7" argb="255,0,153,51" value="7" />
+			<entry class="C6" argb="255,51,204,0" value="6" />
+			<entry class="C5" argb="255,231,231,12" value="5" />
+			<entry class="C4" argb="255,12,118,119" value="4" />
+			<entry class="C3" argb="255,174,177,7" value="3" />
+			<entry class="C2" argb="255,67,97,69" value="2" />
+			<entry class="C1" argb="255,4,126,4" value="1" />
+		</table>
+	</palette>
+	<!-- Gradient, HSV(120,90,48) to HSV(60,70,100) to HSV(20,84,42) -->
+	<palette name="1  Forest - Soil  (100)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,12,122,12" value="0" />
+			<entry class="2" argb="255,14,124,12" value="1" />
+			<entry class="3" argb="255,17,126,13" value="2" />
+			<entry class="4" argb="255,19,129,14" value="3" />
+			<entry class="5" argb="255,22,131,14" value="4" />
+			<entry class="6" argb="255,25,133,15" value="5" />
+			<entry class="7" argb="255,28,135,16" value="6" />
+			<entry class="8" argb="255,31,137,17" value="7" />
+			<entry class="9" argb="255,34,140,17" value="8" />
+			<entry class="10" argb="255,37,142,18" value="9" />
+			<entry class="11" argb="255,40,144,19" value="10" />
+			<entry class="12" argb="255,43,146,20" value="11" />
+			<entry class="13" argb="255,46,148,20" value="12" />
+			<entry class="14" argb="255,49,151,21" value="13" />
+			<entry class="15" argb="255,53,153,22" value="14" />
+			<entry class="16" argb="255,56,155,23" value="15" />
+			<entry class="17" argb="255,59,157,24" value="16" />
+			<entry class="18" argb="255,63,159,25" value="17" />
+			<entry class="19" argb="255,66,162,25" value="18" />
+			<entry class="20" argb="255,70,164,26" value="19" />
+			<entry class="21" argb="255,74,166,27" value="20" />
+			<entry class="22" argb="255,77,168,28" value="21" />
+			<entry class="23" argb="255,81,171,29" value="22" />
+			<entry class="24" argb="255,85,173,30" value="23" />
+			<entry class="25" argb="255,89,175,31" value="24" />
+			<entry class="26" argb="255,93,177,32" value="25" />
+			<entry class="27" argb="255,96,179,33" value="26" />
+			<entry class="28" argb="255,100,182,34" value="27" />
+			<entry class="29" argb="255,104,184,35" value="28" />
+			<entry class="30" argb="255,109,186,36" value="29" />
+			<entry class="31" argb="255,113,188,37" value="30" />
+			<entry class="32" argb="255,117,190,38" value="31" />
+			<entry class="33" argb="255,121,193,39" value="32" />
+			<entry class="34" argb="255,125,195,41" value="33" />
+			<entry class="35" argb="255,130,197,42" value="34" />
+			<entry class="36" argb="255,134,199,43" value="35" />
+			<entry class="37" argb="255,138,201,44" value="36" />
+			<entry class="38" argb="255,143,204,45" value="37" />
+			<entry class="39" argb="255,147,206,46" value="38" />
+			<entry class="40" argb="255,152,208,47" value="39" />
+			<entry class="41" argb="255,156,210,49" value="40" />
+			<entry class="42" argb="255,161,213,50" value="41" />
+			<entry class="43" argb="255,166,215,51" value="42" />
+			<entry class="44" argb="255,170,217,52" value="43" />
+			<entry class="45" argb="255,175,219,54" value="44" />
+			<entry class="46" argb="255,180,221,55" value="45" />
+			<entry class="47" argb="255,185,224,56" value="46" />
+			<entry class="48" argb="255,189,226,58" value="47" />
+			<entry class="49" argb="255,194,228,59" value="48" />
+			<entry class="50" argb="255,199,230,60" value="49" />
+			<entry class="51" argb="255,204,232,62" value="50" />
+			<entry class="52" argb="255,209,235,63" value="51" />
+			<entry class="53" argb="255,214,237,64" value="52" />
+			<entry class="54" argb="255,219,239,66" value="53" />
+			<entry class="55" argb="255,224,241,67" value="54" />
+			<entry class="56" argb="255,229,243,69" value="55" />
+			<entry class="57" argb="255,234,246,70" value="56" />
+			<entry class="58" argb="255,239,248,72" value="57" />
+			<entry class="59" argb="255,244,250,73" value="58" />
+			<entry class="60" argb="255,249,252,74" value="59" />
+			<entry class="61" argb="255,255,255,76" value="60" />
+			<entry class="62" argb="255,251,248,74" value="61" />
+			<entry class="63" argb="255,247,241,72" value="62" />
+			<entry class="64" argb="255,243,235,70" value="63" />
+			<entry class="65" argb="255,240,228,68" value="64" />
+			<entry class="66" argb="255,236,222,66" value="65" />
+			<entry class="67" argb="255,232,216,64" value="66" />
+			<entry class="68" argb="255,229,209,63" value="67" />
+			<entry class="69" argb="255,225,203,61" value="68" />
+			<entry class="70" argb="255,221,197,59" value="69" />
+			<entry class="71" argb="255,218,191,57" value="70" />
+			<entry class="72" argb="255,214,185,56" value="71" />
+			<entry class="73" argb="255,210,179,54" value="72" />
+			<entry class="74" argb="255,206,173,52" value="73" />
+			<entry class="75" argb="255,203,167,51" value="74" />
+			<entry class="76" argb="255,199,161,49" value="75" />
+			<entry class="77" argb="255,195,156,47" value="76" />
+			<entry class="78" argb="255,192,150,46" value="77" />
+			<entry class="79" argb="255,188,145,44" value="78" />
+			<entry class="80" argb="255,184,139,43" value="79" />
+			<entry class="81" argb="255,181,134,41" value="80" />
+			<entry class="82" argb="255,177,129,40" value="81" />
+			<entry class="83" argb="255,173,124,38" value="82" />
+			<entry class="84" argb="255,169,119,37" value="83" />
+			<entry class="85" argb="255,166,114,35" value="84" />
+			<entry class="86" argb="255,162,109,34" value="85" />
+			<entry class="87" argb="255,158,104,33" value="86" />
+			<entry class="88" argb="255,155,99,31" value="87" />
+			<entry class="89" argb="255,151,95,30" value="88" />
+			<entry class="90" argb="255,147,90,29" value="89" />
+			<entry class="91" argb="255,144,86,28" value="90" />
+			<entry class="92" argb="255,140,81,26" value="91" />
+			<entry class="93" argb="255,136,77,25" value="92" />
+			<entry class="94" argb="255,132,73,24" value="93" />
+			<entry class="95" argb="255,129,69,23" value="94" />
+			<entry class="96" argb="255,125,65,22" value="95" />
+			<entry class="97" argb="255,121,61,21" value="96" />
+			<entry class="98" argb="255,118,57,20" value="97" />
+			<entry class="99" argb="255,114,54,19" value="98" />
+			<entry class="100" argb="255,110,50,18" value="99" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(20,84,42) to HSV(60,70,100) to HSV(120,90,48) -->
+	<palette name="1  Soil - Forest  (100)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,107,47,17" value="0" />
+			<entry class="2" argb="255,110,50,18" value="1" />
+			<entry class="3" argb="255,114,54,19" value="2" />
+			<entry class="4" argb="255,118,57,20" value="3" />
+			<entry class="5" argb="255,121,61,21" value="4" />
+			<entry class="6" argb="255,125,65,22" value="5" />
+			<entry class="7" argb="255,129,69,23" value="6" />
+			<entry class="8" argb="255,132,73,24" value="7" />
+			<entry class="9" argb="255,136,77,25" value="8" />
+			<entry class="10" argb="255,140,81,26" value="9" />
+			<entry class="11" argb="255,144,86,28" value="10" />
+			<entry class="12" argb="255,147,90,29" value="11" />
+			<entry class="13" argb="255,151,95,30" value="12" />
+			<entry class="14" argb="255,155,99,31" value="13" />
+			<entry class="15" argb="255,158,104,33" value="14" />
+			<entry class="16" argb="255,162,109,34" value="15" />
+			<entry class="17" argb="255,166,114,35" value="16" />
+			<entry class="18" argb="255,169,119,37" value="17" />
+			<entry class="19" argb="255,173,124,38" value="18" />
+			<entry class="20" argb="255,177,129,40" value="19" />
+			<entry class="21" argb="255,181,134,41" value="20" />
+			<entry class="22" argb="255,184,139,43" value="21" />
+			<entry class="23" argb="255,188,145,44" value="22" />
+			<entry class="24" argb="255,192,150,46" value="23" />
+			<entry class="25" argb="255,195,156,47" value="24" />
+			<entry class="26" argb="255,199,161,49" value="25" />
+			<entry class="27" argb="255,203,167,51" value="26" />
+			<entry class="28" argb="255,206,173,52" value="27" />
+			<entry class="29" argb="255,210,179,54" value="28" />
+			<entry class="30" argb="255,214,185,56" value="29" />
+			<entry class="31" argb="255,218,191,57" value="30" />
+			<entry class="32" argb="255,221,197,59" value="31" />
+			<entry class="33" argb="255,225,203,61" value="32" />
+			<entry class="34" argb="255,229,209,63" value="33" />
+			<entry class="35" argb="255,232,216,64" value="34" />
+			<entry class="36" argb="255,236,222,66" value="35" />
+			<entry class="37" argb="255,240,228,68" value="36" />
+			<entry class="38" argb="255,243,235,70" value="37" />
+			<entry class="39" argb="255,247,241,72" value="38" />
+			<entry class="40" argb="255,251,248,74" value="39" />
+			<entry class="41" argb="255,255,255,76" value="40" />
+			<entry class="42" argb="255,249,252,74" value="41" />
+			<entry class="43" argb="255,244,250,73" value="42" />
+			<entry class="44" argb="255,239,248,72" value="43" />
+			<entry class="45" argb="255,234,246,70" value="44" />
+			<entry class="46" argb="255,229,243,69" value="45" />
+			<entry class="47" argb="255,224,241,67" value="46" />
+			<entry class="48" argb="255,219,239,66" value="47" />
+			<entry class="49" argb="255,214,237,64" value="48" />
+			<entry class="50" argb="255,209,235,63" value="49" />
+			<entry class="51" argb="255,204,232,62" value="50" />
+			<entry class="52" argb="255,199,230,60" value="51" />
+			<entry class="53" argb="255,194,228,59" value="52" />
+			<entry class="54" argb="255,189,226,58" value="53" />
+			<entry class="55" argb="255,185,224,56" value="54" />
+			<entry class="56" argb="255,180,221,55" value="55" />
+			<entry class="57" argb="255,175,219,54" value="56" />
+			<entry class="58" argb="255,170,217,52" value="57" />
+			<entry class="59" argb="255,166,215,51" value="58" />
+			<entry class="60" argb="255,161,213,50" value="59" />
+			<entry class="61" argb="255,156,210,49" value="60" />
+			<entry class="62" argb="255,152,208,47" value="61" />
+			<entry class="63" argb="255,147,206,46" value="62" />
+			<entry class="64" argb="255,143,204,45" value="63" />
+			<entry class="65" argb="255,138,201,44" value="64" />
+			<entry class="66" argb="255,134,199,43" value="65" />
+			<entry class="67" argb="255,130,197,42" value="66" />
+			<entry class="68" argb="255,125,195,41" value="67" />
+			<entry class="69" argb="255,121,193,39" value="68" />
+			<entry class="70" argb="255,117,190,38" value="69" />
+			<entry class="71" argb="255,113,188,37" value="70" />
+			<entry class="72" argb="255,109,186,36" value="71" />
+			<entry class="73" argb="255,104,184,35" value="72" />
+			<entry class="74" argb="255,100,182,34" value="73" />
+			<entry class="75" argb="255,96,179,33" value="74" />
+			<entry class="76" argb="255,93,177,32" value="75" />
+			<entry class="77" argb="255,89,175,31" value="76" />
+			<entry class="78" argb="255,85,173,30" value="77" />
+			<entry class="79" argb="255,81,171,29" value="78" />
+			<entry class="80" argb="255,77,168,28" value="79" />
+			<entry class="81" argb="255,74,166,27" value="80" />
+			<entry class="82" argb="255,70,164,26" value="81" />
+			<entry class="83" argb="255,66,162,25" value="82" />
+			<entry class="84" argb="255,63,159,25" value="83" />
+			<entry class="85" argb="255,59,157,24" value="84" />
+			<entry class="86" argb="255,56,155,23" value="85" />
+			<entry class="87" argb="255,53,153,22" value="86" />
+			<entry class="88" argb="255,49,151,21" value="87" />
+			<entry class="89" argb="255,46,148,20" value="88" />
+			<entry class="90" argb="255,43,146,20" value="89" />
+			<entry class="91" argb="255,40,144,19" value="90" />
+			<entry class="92" argb="255,37,142,18" value="91" />
+			<entry class="93" argb="255,34,140,17" value="92" />
+			<entry class="94" argb="255,31,137,17" value="93" />
+			<entry class="95" argb="255,28,135,16" value="94" />
+			<entry class="96" argb="255,25,133,15" value="95" />
+			<entry class="97" argb="255,22,131,14" value="96" />
+			<entry class="98" argb="255,19,129,14" value="97" />
+			<entry class="99" argb="255,17,126,13" value="98" />
+			<entry class="100" argb="255,14,124,12" value="99" />
+		</table>
+	</palette>
+	
+	<palette name="2  Blues  (35)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,85" value="0" />
+			<entry class="2" argb="255,0,0,95" value="1" />
+			<entry class="3" argb="255,0,0,105" value="2" />
+			<entry class="4" argb="255,0,0,115" value="3" />
+			<entry class="5" argb="255,0,0,125" value="4" />
+			<entry class="6" argb="255,0,0,135" value="5" />
+			<entry class="7" argb="255,0,0,145" value="6" />
+			<entry class="8" argb="255,0,0,155" value="7" />
+			<entry class="9" argb="255,0,0,165" value="8" />
+			<entry class="10" argb="255,0,0,175" value="9" />
+			<entry class="11" argb="255,0,0,185" value="10" />
+			<entry class="12" argb="255,0,0,195" value="11" />
+			<entry class="13" argb="255,0,0,205" value="12" />
+			<entry class="14" argb="255,0,0,215" value="13" />
+			<entry class="15" argb="255,0,0,225" value="14" />
+			<entry class="16" argb="255,0,0,235" value="15" />
+			<entry class="17" argb="255,0,0,245" value="16" />
+			<entry class="18" argb="255,0,0,255" value="17" />
+			<entry class="19" argb="255,10,10,255" value="18" />
+			<entry class="20" argb="255,20,20,255" value="19" />
+			<entry class="21" argb="255,30,30,255" value="20" />
+			<entry class="22" argb="255,40,40,255" value="21" />
+			<entry class="23" argb="255,50,50,255" value="22" />
+			<entry class="24" argb="255,60,60,255" value="23" />
+			<entry class="25" argb="255,70,70,255" value="24" />
+			<entry class="26" argb="255,80,80,255" value="25" />
+			<entry class="27" argb="255,90,90,255" value="26" />
+			<entry class="28" argb="255,100,100,255" value="27" />
+			<entry class="29" argb="255,110,110,255" value="28" />
+			<entry class="30" argb="255,120,120,255" value="29" />
+			<entry class="31" argb="255,130,130,255" value="30" />
+			<entry class="32" argb="255,140,140,255" value="31" />
+			<entry class="33" argb="255,150,150,255" value="32" />
+			<entry class="34" argb="255,160,160,255" value="33" />
+			<entry class="35" argb="255,170,170,255" value="34" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(242,96,60) to HSV(192,96,96) to HSV(142,96,60) -->
+	<palette name="2  Cool  (100)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,11,6,153" value="0" />
+			<entry class="2" argb="255,8,6,154" value="1" />
+			<entry class="3" argb="255,6,6,156" value="2" />
+			<entry class="4" argb="255,6,8,158" value="3" />
+			<entry class="5" argb="255,6,11,160" value="4" />
+			<entry class="6" argb="255,6,14,162" value="5" />
+			<entry class="7" argb="255,6,17,164" value="6" />
+			<entry class="8" argb="255,6,19,165" value="7" />
+			<entry class="9" argb="255,6,22,167" value="8" />
+			<entry class="10" argb="255,6,25,169" value="9" />
+			<entry class="11" argb="255,6,28,171" value="10" />
+			<entry class="12" argb="255,6,31,173" value="11" />
+			<entry class="13" argb="255,7,35,175" value="12" />
+			<entry class="14" argb="255,7,38,176" value="13" />
+			<entry class="15" argb="255,7,41,178" value="14" />
+			<entry class="16" argb="255,7,44,180" value="15" />
+			<entry class="17" argb="255,7,48,182" value="16" />
+			<entry class="18" argb="255,7,51,184" value="17" />
+			<entry class="19" argb="255,7,55,186" value="18" />
+			<entry class="20" argb="255,7,58,187" value="19" />
+			<entry class="21" argb="255,7,62,189" value="20" />
+			<entry class="22" argb="255,7,65,191" value="21" />
+			<entry class="23" argb="255,7,69,193" value="22" />
+			<entry class="24" argb="255,7,73,195" value="23" />
+			<entry class="25" argb="255,7,77,197" value="24" />
+			<entry class="26" argb="255,7,81,198" value="25" />
+			<entry class="27" argb="255,8,85,200" value="26" />
+			<entry class="28" argb="255,8,89,202" value="27" />
+			<entry class="29" argb="255,8,93,204" value="28" />
+			<entry class="30" argb="255,8,97,206" value="29" />
+			<entry class="31" argb="255,8,101,208" value="30" />
+			<entry class="32" argb="255,8,105,209" value="31" />
+			<entry class="33" argb="255,8,110,211" value="32" />
+			<entry class="34" argb="255,8,114,213" value="33" />
+			<entry class="35" argb="255,8,118,215" value="34" />
+			<entry class="36" argb="255,8,123,217" value="35" />
+			<entry class="37" argb="255,8,127,219" value="36" />
+			<entry class="38" argb="255,8,132,220" value="37" />
+			<entry class="39" argb="255,8,137,222" value="38" />
+			<entry class="40" argb="255,8,141,224" value="39" />
+			<entry class="41" argb="255,9,146,226" value="40" />
+			<entry class="42" argb="255,9,151,228" value="41" />
+			<entry class="43" argb="255,9,156,230" value="42" />
+			<entry class="44" argb="255,9,161,231" value="43" />
+			<entry class="45" argb="255,9,166,233" value="44" />
+			<entry class="46" argb="255,9,171,235" value="45" />
+			<entry class="47" argb="255,9,176,237" value="46" />
+			<entry class="48" argb="255,9,181,239" value="47" />
+			<entry class="49" argb="255,9,187,241" value="48" />
+			<entry class="50" argb="255,9,192,242" value="49" />
+			<entry class="51" argb="255,9,197,244" value="50" />
+			<entry class="52" argb="255,9,200,242" value="51" />
+			<entry class="53" argb="255,9,202,241" value="52" />
+			<entry class="54" argb="255,9,204,239" value="53" />
+			<entry class="55" argb="255,9,207,237" value="54" />
+			<entry class="56" argb="255,9,209,235" value="55" />
+			<entry class="57" argb="255,9,211,233" value="56" />
+			<entry class="58" argb="255,9,213,231" value="57" />
+			<entry class="59" argb="255,9,215,230" value="58" />
+			<entry class="60" argb="255,9,217,228" value="59" />
+			<entry class="61" argb="255,9,219,226" value="60" />
+			<entry class="62" argb="255,8,221,224" value="61" />
+			<entry class="63" argb="255,8,222,222" value="62" />
+			<entry class="64" argb="255,8,220,217" value="63" />
+			<entry class="65" argb="255,8,219,212" value="64" />
+			<entry class="66" argb="255,8,217,206" value="65" />
+			<entry class="67" argb="255,8,215,201" value="66" />
+			<entry class="68" argb="255,8,213,196" value="67" />
+			<entry class="69" argb="255,8,211,191" value="68" />
+			<entry class="70" argb="255,8,209,186" value="69" />
+			<entry class="71" argb="255,8,208,181" value="70" />
+			<entry class="72" argb="255,8,206,176" value="71" />
+			<entry class="73" argb="255,8,204,171" value="72" />
+			<entry class="74" argb="255,8,202,166" value="73" />
+			<entry class="75" argb="255,8,200,162" value="74" />
+			<entry class="76" argb="255,7,198,157" value="75" />
+			<entry class="77" argb="255,7,197,152" value="76" />
+			<entry class="78" argb="255,7,195,148" value="77" />
+			<entry class="79" argb="255,7,193,143" value="78" />
+			<entry class="80" argb="255,7,191,139" value="79" />
+			<entry class="81" argb="255,7,189,135" value="80" />
+			<entry class="82" argb="255,7,187,130" value="81" />
+			<entry class="83" argb="255,7,186,126" value="82" />
+			<entry class="84" argb="255,7,184,122" value="83" />
+			<entry class="85" argb="255,7,182,118" value="84" />
+			<entry class="86" argb="255,7,180,114" value="85" />
+			<entry class="87" argb="255,7,178,110" value="86" />
+			<entry class="88" argb="255,7,176,106" value="87" />
+			<entry class="89" argb="255,7,175,102" value="88" />
+			<entry class="90" argb="255,6,173,98" value="89" />
+			<entry class="91" argb="255,6,171,94" value="90" />
+			<entry class="92" argb="255,6,169,90" value="91" />
+			<entry class="93" argb="255,6,167,87" value="92" />
+			<entry class="94" argb="255,6,165,83" value="93" />
+			<entry class="95" argb="255,6,164,80" value="94" />
+			<entry class="96" argb="255,6,162,76" value="95" />
+			<entry class="97" argb="255,6,160,73" value="96" />
+			<entry class="98" argb="255,6,158,69" value="97" />
+			<entry class="99" argb="255,6,156,66" value="98" />
+			<entry class="100" argb="255,6,154,63" value="99" />
+		</table>
+	</palette>
+	
+	<palette name="2  Greens  (35)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,0,85,0" value="0" />
+			<entry class="2" argb="255,0,95,0" value="1" />
+			<entry class="3" argb="255,0,105,0" value="2" />
+			<entry class="4" argb="255,0,115,0" value="3" />
+			<entry class="5" argb="255,0,125,0" value="4" />
+			<entry class="6" argb="255,0,135,0" value="5" />
+			<entry class="7" argb="255,0,145,0" value="6" />
+			<entry class="8" argb="255,0,155,0" value="7" />
+			<entry class="9" argb="255,0,165,0" value="8" />
+			<entry class="10" argb="255,0,175,0" value="9" />
+			<entry class="11" argb="255,0,185,0" value="10" />
+			<entry class="12" argb="255,0,195,0" value="11" />
+			<entry class="13" argb="255,0,205,0" value="12" />
+			<entry class="14" argb="255,0,215,0" value="13" />
+			<entry class="15" argb="255,0,225,0" value="14" />
+			<entry class="16" argb="255,0,235,0" value="15" />
+			<entry class="17" argb="255,0,245,0" value="16" />
+			<entry class="18" argb="255,0,255,0" value="17" />
+			<entry class="19" argb="255,10,255,10" value="18" />
+			<entry class="20" argb="255,20,255,20" value="19" />
+			<entry class="21" argb="255,30,255,30" value="20" />
+			<entry class="22" argb="255,40,255,40" value="21" />
+			<entry class="23" argb="255,50,255,50" value="22" />
+			<entry class="24" argb="255,60,255,60" value="23" />
+			<entry class="25" argb="255,70,255,70" value="24" />
+			<entry class="26" argb="255,80,255,80" value="25" />
+			<entry class="27" argb="255,90,255,90" value="26" />
+			<entry class="28" argb="255,100,255,100" value="27" />
+			<entry class="29" argb="255,110,255,110" value="28" />
+			<entry class="30" argb="255,120,255,120" value="29" />
+			<entry class="31" argb="255,130,255,130" value="30" />
+			<entry class="32" argb="255,140,255,140" value="31" />
+			<entry class="33" argb="255,150,255,150" value="32" />
+			<entry class="34" argb="255,160,255,160" value="33" />
+			<entry class="35" argb="255,170,255,170" value="34" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(165,95,36) to HSV(165,36,100) -->
+	<palette name="2  Marine  (24)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,4,91,69" value="0" />
+			<entry class="2" argb="255,7,98,75" value="1" />
+			<entry class="3" argb="255,10,105,81" value="2" />
+			<entry class="4" argb="255,13,112,87" value="3" />
+			<entry class="5" argb="255,17,119,93" value="4" />
+			<entry class="6" argb="255,21,125,99" value="5" />
+			<entry class="7" argb="255,26,132,105" value="6" />
+			<entry class="8" argb="255,30,139,112" value="7" />
+			<entry class="9" argb="255,36,146,118" value="8" />
+			<entry class="10" argb="255,41,152,125" value="9" />
+			<entry class="11" argb="255,47,159,131" value="10" />
+			<entry class="12" argb="255,53,166,138" value="11" />
+			<entry class="13" argb="255,59,173,145" value="12" />
+			<entry class="14" argb="255,66,180,151" value="13" />
+			<entry class="15" argb="255,73,186,158" value="14" />
+			<entry class="16" argb="255,81,193,165" value="15" />
+			<entry class="17" argb="255,88,200,172" value="16" />
+			<entry class="18" argb="255,97,207,179" value="17" />
+			<entry class="19" argb="255,105,214,187" value="18" />
+			<entry class="20" argb="255,114,220,194" value="19" />
+			<entry class="21" argb="255,123,227,201" value="20" />
+			<entry class="22" argb="255,132,234,209" value="21" />
+			<entry class="23" argb="255,142,241,216" value="22" />
+			<entry class="24" argb="255,152,248,224" value="23" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(30,100,100) to HSV(30,100,30) -->
+	<palette name="2  Pumpkin  (24)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,127,0" value="0" />
+			<entry class="2" argb="255,247,123,0" value="1" />
+			<entry class="3" argb="255,240,120,0" value="2" />
+			<entry class="4" argb="255,232,116,0" value="3" />
+			<entry class="5" argb="255,225,112,0" value="4" />
+			<entry class="6" argb="255,217,108,0" value="5" />
+			<entry class="7" argb="255,210,105,0" value="6" />
+			<entry class="8" argb="255,202,101,0" value="7" />
+			<entry class="9" argb="255,195,97,0" value="8" />
+			<entry class="10" argb="255,188,94,0" value="9" />
+			<entry class="11" argb="255,180,90,0" value="10" />
+			<entry class="12" argb="255,173,86,0" value="11" />
+			<entry class="13" argb="255,165,82,0" value="12" />
+			<entry class="14" argb="255,158,79,0" value="13" />
+			<entry class="15" argb="255,150,75,0" value="14" />
+			<entry class="16" argb="255,143,71,0" value="15" />
+			<entry class="17" argb="255,135,67,0" value="16" />
+			<entry class="18" argb="255,128,64,0" value="17" />
+			<entry class="19" argb="255,121,60,0" value="18" />
+			<entry class="20" argb="255,113,56,0" value="19" />
+			<entry class="21" argb="255,106,53,0" value="20" />
+			<entry class="22" argb="255,98,49,0" value="21" />
+			<entry class="23" argb="255,91,45,0" value="22" />
+			<entry class="24" argb="255,83,41,0" value="23" />
+		</table>
+	</palette>
+
+	<palette name="2  Reds  (35)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,85,0,0" value="0" />
+			<entry class="2" argb="255,95,0,0" value="1" />
+			<entry class="3" argb="255,105,0,0" value="2" />
+			<entry class="4" argb="255,115,0,0" value="3" />
+			<entry class="5" argb="255,125,0,0" value="4" />
+			<entry class="6" argb="255,135,0,0" value="5" />
+			<entry class="7" argb="255,145,0,0" value="6" />
+			<entry class="8" argb="255,155,0,0" value="7" />
+			<entry class="9" argb="255,165,0,0" value="8" />
+			<entry class="10" argb="255,175,0,0" value="9" />
+			<entry class="11" argb="255,185,0,0" value="10" />
+			<entry class="12" argb="255,195,0,0" value="11" />
+			<entry class="13" argb="255,205,0,0" value="12" />
+			<entry class="14" argb="255,215,0,0" value="13" />
+			<entry class="15" argb="255,225,0,0" value="14" />
+			<entry class="16" argb="255,235,0,0" value="15" />
+			<entry class="17" argb="255,245,0,0" value="16" />
+			<entry class="18" argb="255,255,0,0" value="17" />
+			<entry class="19" argb="255,255,10,10" value="18" />
+			<entry class="20" argb="255,255,20,20" value="19" />
+			<entry class="21" argb="255,255,30,30" value="20" />
+			<entry class="22" argb="255,255,40,40" value="21" />
+			<entry class="23" argb="255,255,50,50" value="22" />
+			<entry class="24" argb="255,255,60,60" value="23" />
+			<entry class="25" argb="255,255,70,70" value="24" />
+			<entry class="26" argb="255,255,80,80" value="25" />
+			<entry class="27" argb="255,255,90,90" value="26" />
+			<entry class="28" argb="255,255,100,100" value="27" />
+			<entry class="29" argb="255,255,110,110" value="28" />
+			<entry class="30" argb="255,255,120,120" value="29" />
+			<entry class="31" argb="255,255,130,130" value="30" />
+			<entry class="32" argb="255,255,140,140" value="31" />
+			<entry class="33" argb="255,255,150,150" value="32" />
+			<entry class="34" argb="255,255,160,160" value="33" />
+			<entry class="35" argb="255,255,170,170" value="34" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(50,38,98) to HSV(50,100,98) -->
+	<palette name="2  Sand  (24)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,249,234,154" value="0" />
+			<entry class="2" argb="255,249,232,148" value="1" />
+			<entry class="3" argb="255,249,231,142" value="2" />
+			<entry class="4" argb="255,249,230,135" value="3" />
+			<entry class="5" argb="255,249,229,129" value="4" />
+			<entry class="6" argb="255,249,228,122" value="5" />
+			<entry class="7" argb="255,249,227,116" value="6" />
+			<entry class="8" argb="255,249,226,109" value="7" />
+			<entry class="9" argb="255,249,225,103" value="8" />
+			<entry class="10" argb="255,249,224,96" value="9" />
+			<entry class="11" argb="255,249,223,90" value="10" />
+			<entry class="12" argb="255,249,222,83" value="11" />
+			<entry class="13" argb="255,249,221,77" value="12" />
+			<entry class="14" argb="255,249,220,71" value="13" />
+			<entry class="15" argb="255,249,219,64" value="14" />
+			<entry class="16" argb="255,249,217,58" value="15" />
+			<entry class="17" argb="255,249,216,51" value="16" />
+			<entry class="18" argb="255,249,215,45" value="17" />
+			<entry class="19" argb="255,249,214,38" value="18" />
+			<entry class="20" argb="255,249,213,32" value="19" />
+			<entry class="21" argb="255,249,212,25" value="20" />
+			<entry class="22" argb="255,249,211,19" value="21" />
+			<entry class="23" argb="255,249,210,12" value="22" />
+			<entry class="24" argb="255,249,209,6" value="23" />
+		</table>
+	</palette>	
+
+	<!-- Gradient, HSV(0,96,96) to HSV(32,96,96) to HSV(64,70,100) -->
+	<palette name="2  Warm  (64)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,244,9,9" value="0" />
+			<entry class="2" argb="255,244,13,9" value="1" />
+			<entry class="3" argb="255,244,17,9" value="2" />
+			<entry class="4" argb="255,244,21,9" value="3" />
+			<entry class="5" argb="255,244,25,9" value="4" />
+			<entry class="6" argb="255,244,29,9" value="5" />
+			<entry class="7" argb="255,244,33,9" value="6" />
+			<entry class="8" argb="255,244,37,9" value="7" />
+			<entry class="9" argb="255,244,41,9" value="8" />
+			<entry class="10" argb="255,244,45,9" value="9" />
+			<entry class="11" argb="255,244,48,9" value="10" />
+			<entry class="12" argb="255,244,52,9" value="11" />
+			<entry class="13" argb="255,244,56,9" value="12" />
+			<entry class="14" argb="255,244,60,9" value="13" />
+			<entry class="15" argb="255,244,64,9" value="14" />
+			<entry class="16" argb="255,244,68,9" value="15" />
+			<entry class="17" argb="255,244,72,9" value="16" />
+			<entry class="18" argb="255,244,76,9" value="17" />
+			<entry class="19" argb="255,244,80,9" value="18" />
+			<entry class="20" argb="255,244,84,9" value="19" />
+			<entry class="21" argb="255,244,88,9" value="20" />
+			<entry class="22" argb="255,244,92,9" value="21" />
+			<entry class="23" argb="255,244,95,9" value="22" />
+			<entry class="24" argb="255,244,99,9" value="23" />
+			<entry class="25" argb="255,244,103,9" value="24" />
+			<entry class="26" argb="255,244,107,9" value="25" />
+			<entry class="27" argb="255,244,111,9" value="26" />
+			<entry class="28" argb="255,244,115,9" value="27" />
+			<entry class="29" argb="255,244,119,9" value="28" />
+			<entry class="30" argb="255,244,123,9" value="29" />
+			<entry class="31" argb="255,244,127,9" value="30" />
+			<entry class="32" argb="255,244,131,9" value="31" />
+			<entry class="33" argb="255,244,135,9" value="32" />
+			<entry class="34" argb="255,245,140,11" value="33" />
+			<entry class="35" argb="255,245,145,13" value="34" />
+			<entry class="36" argb="255,245,149,15" value="35" />
+			<entry class="37" argb="255,246,154,17" value="36" />
+			<entry class="38" argb="255,246,159,19" value="37" />
+			<entry class="39" argb="255,246,164,21" value="38" />
+			<entry class="40" argb="255,247,168,23" value="39" />
+			<entry class="41" argb="255,247,173,25" value="40" />
+			<entry class="42" argb="255,247,178,28" value="41" />
+			<entry class="43" argb="255,247,182,30" value="42" />
+			<entry class="44" argb="255,248,187,32" value="43" />
+			<entry class="45" argb="255,248,191,34" value="44" />
+			<entry class="46" argb="255,248,195,36" value="45" />
+			<entry class="47" argb="255,249,200,38" value="46" />
+			<entry class="48" argb="255,249,204,40" value="47" />
+			<entry class="49" argb="255,249,208,42" value="48" />
+			<entry class="50" argb="255,250,212,44" value="49" />
+			<entry class="51" argb="255,250,216,46" value="50" />
+			<entry class="52" argb="255,250,220,48" value="51" />
+			<entry class="53" argb="255,251,224,50" value="52" />
+			<entry class="54" argb="255,251,228,52" value="53" />
+			<entry class="55" argb="255,251,232,55" value="54" />
+			<entry class="56" argb="255,252,235,57" value="55" />
+			<entry class="57" argb="255,252,239,59" value="56" />
+			<entry class="58" argb="255,252,243,61" value="57" />
+			<entry class="59" argb="255,253,246,63" value="58" />
+			<entry class="60" argb="255,253,250,65" value="59" />
+			<entry class="61" argb="255,253,253,67" value="60" />
+			<entry class="62" argb="255,250,254,70" value="61" />
+			<entry class="63" argb="255,248,254,72" value="62" />
+			<entry class="64" argb="255,245,254,74" value="63" />
+		</table>
+	</palette>
+
+<!-- Agave Split complements, 1st color then on second color again and again.  Then ordered by color wheel -->
+	<palette name="Candy  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,51,173" value="0" />
+			<entry class="2" argb="255,255,92,51" value="1" />
+			<entry class="3" argb="255,255,255,51" value="2" />
+			<entry class="4" argb="255,214,255,51" value="3" />
+			<entry class="5" argb="255,51,255,51" value="4" />
+			<entry class="6" argb="255,51,255,214" value="5" />
+			<entry class="7" argb="255,51,133,255" value="6" />
+			<entry class="8" argb="255,133,51,255" value="7" />
+			<entry class="9" argb="255,173,51,255" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 4, 95%, 95%) Degrees between hues 10-->
+	<palette name="Color Wheel Long  (36)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,27,12" value="0" />
+			<entry class="2" argb="255,242,65,12" value="1" />
+			<entry class="3" argb="255,242,104,12" value="2" />
+			<entry class="4" argb="255,242,142,12" value="3" />
+			<entry class="5" argb="255,242,180,12" value="4" />
+			<entry class="6" argb="255,242,219,12" value="5" />
+			<entry class="7" argb="255,226,242,12" value="6" />
+			<entry class="8" argb="255,188,242,12" value="7" />
+			<entry class="9" argb="255,150,242,12" value="8" />
+			<entry class="10" argb="255,111,242,12" value="9" />
+			<entry class="11" argb="255,73,242,12" value="10" />
+			<entry class="12" argb="255,35,242,12" value="11" />
+			<entry class="13" argb="255,12,242,27" value="12" />
+			<entry class="14" argb="255,12,242,65" value="13" />
+			<entry class="15" argb="255,12,242,104" value="14" />
+			<entry class="16" argb="255,12,242,142" value="15" />
+			<entry class="17" argb="255,12,242,180" value="16" />
+			<entry class="18" argb="255,12,242,219" value="17" />
+			<entry class="19" argb="255,12,226,242" value="18" />
+			<entry class="20" argb="255,12,188,242" value="19" />
+			<entry class="21" argb="255,12,150,242" value="20" />
+			<entry class="22" argb="255,12,111,242" value="21" />
+			<entry class="23" argb="255,12,73,242" value="22" />
+			<entry class="24" argb="255,12,35,242" value="23" />
+			<entry class="25" argb="255,27,12,242" value="24" />
+			<entry class="26" argb="255,65,12,242" value="25" />
+			<entry class="27" argb="255,104,12,242" value="26" />
+			<entry class="28" argb="255,142,12,242" value="27" />
+			<entry class="29" argb="255,180,12,242" value="28" />
+			<entry class="30" argb="255,219,12,242" value="29" />
+			<entry class="31" argb="255,242,12,226" value="30" />
+			<entry class="32" argb="255,242,12,188" value="31" />
+			<entry class="33" argb="255,242,12,150" value="32" />
+			<entry class="34" argb="255,242,12,111" value="33" />
+			<entry class="35" argb="255,242,12,73" value="34" />
+			<entry class="36" argb="255,242,12,35" value="35" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 4, 95%, 95%) Degrees between hues 40-->
+	<palette name="Color Wheel Short  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,27,12" value="0" />
+			<entry class="2" argb="255,242,180,12" value="1" />
+			<entry class="3" argb="255,150,242,12" value="2" />
+			<entry class="4" argb="255,12,242,27" value="3" />
+			<entry class="5" argb="255,12,242,180" value="4" />
+			<entry class="6" argb="255,12,150,242" value="5" />
+			<entry class="7" argb="255,27,12,242" value="6" />
+			<entry class="8" argb="255,180,12,242" value="7" />
+			<entry class="9" argb="255,242,12,150" value="8" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(210,100,100) to HSV(210,100,0) -->
+	<palette name="Deep Azure  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,127,255" value="0" />
+			<entry class="2" argb="255,0,127,254" value="1" />
+			<entry class="3" argb="255,0,126,253" value="2" />
+			<entry class="4" argb="255,0,126,252" value="3" />
+			<entry class="5" argb="255,0,125,251" value="4" />
+			<entry class="6" argb="255,0,125,250" value="5" />
+			<entry class="7" argb="255,0,124,249" value="6" />
+			<entry class="8" argb="255,0,124,248" value="7" />
+			<entry class="9" argb="255,0,123,247" value="8" />
+			<entry class="10" argb="255,0,123,246" value="9" />
+			<entry class="11" argb="255,0,122,245" value="10" />
+			<entry class="12" argb="255,0,122,244" value="11" />
+			<entry class="13" argb="255,0,121,243" value="12" />
+			<entry class="14" argb="255,0,121,242" value="13" />
+			<entry class="15" argb="255,0,120,241" value="14" />
+			<entry class="16" argb="255,0,120,240" value="15" />
+			<entry class="17" argb="255,0,119,239" value="16" />
+			<entry class="18" argb="255,0,119,238" value="17" />
+			<entry class="19" argb="255,0,118,237" value="18" />
+			<entry class="20" argb="255,0,118,236" value="19" />
+			<entry class="21" argb="255,0,117,235" value="20" />
+			<entry class="22" argb="255,0,117,234" value="21" />
+			<entry class="23" argb="255,0,116,233" value="22" />
+			<entry class="24" argb="255,0,116,232" value="23" />
+			<entry class="25" argb="255,0,115,231" value="24" />
+			<entry class="26" argb="255,0,115,230" value="25" />
+			<entry class="27" argb="255,0,114,229" value="26" />
+			<entry class="28" argb="255,0,114,228" value="27" />
+			<entry class="29" argb="255,0,113,227" value="28" />
+			<entry class="30" argb="255,0,113,226" value="29" />
+			<entry class="31" argb="255,0,112,225" value="30" />
+			<entry class="32" argb="255,0,112,224" value="31" />
+			<entry class="33" argb="255,0,111,223" value="32" />
+			<entry class="34" argb="255,0,111,222" value="33" />
+			<entry class="35" argb="255,0,110,221" value="34" />
+			<entry class="36" argb="255,0,110,220" value="35" />
+			<entry class="37" argb="255,0,109,219" value="36" />
+			<entry class="38" argb="255,0,109,218" value="37" />
+			<entry class="39" argb="255,0,108,217" value="38" />
+			<entry class="40" argb="255,0,108,216" value="39" />
+			<entry class="41" argb="255,0,107,215" value="40" />
+			<entry class="42" argb="255,0,107,214" value="41" />
+			<entry class="43" argb="255,0,106,213" value="42" />
+			<entry class="44" argb="255,0,106,212" value="43" />
+			<entry class="45" argb="255,0,105,211" value="44" />
+			<entry class="46" argb="255,0,105,210" value="45" />
+			<entry class="47" argb="255,0,104,209" value="46" />
+			<entry class="48" argb="255,0,104,208" value="47" />
+			<entry class="49" argb="255,0,103,207" value="48" />
+			<entry class="50" argb="255,0,103,206" value="49" />
+			<entry class="51" argb="255,0,102,205" value="50" />
+			<entry class="52" argb="255,0,102,204" value="51" />
+			<entry class="53" argb="255,0,101,203" value="52" />
+			<entry class="54" argb="255,0,101,202" value="53" />
+			<entry class="55" argb="255,0,100,201" value="54" />
+			<entry class="56" argb="255,0,100,200" value="55" />
+			<entry class="57" argb="255,0,99,199" value="56" />
+			<entry class="58" argb="255,0,99,198" value="57" />
+			<entry class="59" argb="255,0,98,197" value="58" />
+			<entry class="60" argb="255,0,98,196" value="59" />
+			<entry class="61" argb="255,0,97,195" value="60" />
+			<entry class="62" argb="255,0,97,194" value="61" />
+			<entry class="63" argb="255,0,96,193" value="62" />
+			<entry class="64" argb="255,0,96,192" value="63" />
+			<entry class="65" argb="255,0,95,191" value="64" />
+			<entry class="66" argb="255,0,95,190" value="65" />
+			<entry class="67" argb="255,0,94,189" value="66" />
+			<entry class="68" argb="255,0,94,188" value="67" />
+			<entry class="69" argb="255,0,93,187" value="68" />
+			<entry class="70" argb="255,0,93,186" value="69" />
+			<entry class="71" argb="255,0,92,185" value="70" />
+			<entry class="72" argb="255,0,92,184" value="71" />
+			<entry class="73" argb="255,0,91,183" value="72" />
+			<entry class="74" argb="255,0,91,182" value="73" />
+			<entry class="75" argb="255,0,90,181" value="74" />
+			<entry class="76" argb="255,0,90,180" value="75" />
+			<entry class="77" argb="255,0,89,179" value="76" />
+			<entry class="78" argb="255,0,89,178" value="77" />
+			<entry class="79" argb="255,0,88,177" value="78" />
+			<entry class="80" argb="255,0,88,176" value="79" />
+			<entry class="81" argb="255,0,87,175" value="80" />
+			<entry class="82" argb="255,0,87,174" value="81" />
+			<entry class="83" argb="255,0,86,173" value="82" />
+			<entry class="84" argb="255,0,86,172" value="83" />
+			<entry class="85" argb="255,0,85,171" value="84" />
+			<entry class="86" argb="255,0,85,170" value="85" />
+			<entry class="87" argb="255,0,84,169" value="86" />
+			<entry class="88" argb="255,0,84,168" value="87" />
+			<entry class="89" argb="255,0,83,167" value="88" />
+			<entry class="90" argb="255,0,83,166" value="89" />
+			<entry class="91" argb="255,0,82,165" value="90" />
+			<entry class="92" argb="255,0,82,164" value="91" />
+			<entry class="93" argb="255,0,81,163" value="92" />
+			<entry class="94" argb="255,0,81,162" value="93" />
+			<entry class="95" argb="255,0,80,161" value="94" />
+			<entry class="96" argb="255,0,80,160" value="95" />
+			<entry class="97" argb="255,0,79,159" value="96" />
+			<entry class="98" argb="255,0,79,158" value="97" />
+			<entry class="99" argb="255,0,78,157" value="98" />
+			<entry class="100" argb="255,0,78,156" value="99" />
+			<entry class="101" argb="255,0,77,155" value="100" />
+			<entry class="102" argb="255,0,77,154" value="101" />
+			<entry class="103" argb="255,0,76,153" value="102" />
+			<entry class="104" argb="255,0,76,152" value="103" />
+			<entry class="105" argb="255,0,75,151" value="104" />
+			<entry class="106" argb="255,0,75,150" value="105" />
+			<entry class="107" argb="255,0,74,149" value="106" />
+			<entry class="108" argb="255,0,74,148" value="107" />
+			<entry class="109" argb="255,0,73,147" value="108" />
+			<entry class="110" argb="255,0,73,146" value="109" />
+			<entry class="111" argb="255,0,72,145" value="110" />
+			<entry class="112" argb="255,0,72,144" value="111" />
+			<entry class="113" argb="255,0,71,143" value="112" />
+			<entry class="114" argb="255,0,71,142" value="113" />
+			<entry class="115" argb="255,0,70,141" value="114" />
+			<entry class="116" argb="255,0,70,140" value="115" />
+			<entry class="117" argb="255,0,69,139" value="116" />
+			<entry class="118" argb="255,0,69,138" value="117" />
+			<entry class="119" argb="255,0,68,137" value="118" />
+			<entry class="120" argb="255,0,68,136" value="119" />
+			<entry class="121" argb="255,0,67,135" value="120" />
+			<entry class="122" argb="255,0,67,134" value="121" />
+			<entry class="123" argb="255,0,66,133" value="122" />
+			<entry class="124" argb="255,0,66,132" value="123" />
+			<entry class="125" argb="255,0,65,131" value="124" />
+			<entry class="126" argb="255,0,65,130" value="125" />
+			<entry class="127" argb="255,0,64,129" value="126" />
+			<entry class="128" argb="255,0,64,128" value="127" />
+			<entry class="129" argb="255,0,63,127" value="128" />
+			<entry class="130" argb="255,0,63,126" value="129" />
+			<entry class="131" argb="255,0,62,125" value="130" />
+			<entry class="132" argb="255,0,62,124" value="131" />
+			<entry class="133" argb="255,0,61,123" value="132" />
+			<entry class="134" argb="255,0,61,122" value="133" />
+			<entry class="135" argb="255,0,60,121" value="134" />
+			<entry class="136" argb="255,0,60,120" value="135" />
+			<entry class="137" argb="255,0,59,119" value="136" />
+			<entry class="138" argb="255,0,59,118" value="137" />
+			<entry class="139" argb="255,0,58,117" value="138" />
+			<entry class="140" argb="255,0,58,116" value="139" />
+			<entry class="141" argb="255,0,57,115" value="140" />
+			<entry class="142" argb="255,0,57,114" value="141" />
+			<entry class="143" argb="255,0,56,113" value="142" />
+			<entry class="144" argb="255,0,56,112" value="143" />
+			<entry class="145" argb="255,0,55,111" value="144" />
+			<entry class="146" argb="255,0,55,110" value="145" />
+			<entry class="147" argb="255,0,54,109" value="146" />
+			<entry class="148" argb="255,0,54,108" value="147" />
+			<entry class="149" argb="255,0,53,107" value="148" />
+			<entry class="150" argb="255,0,53,106" value="149" />
+			<entry class="151" argb="255,0,52,105" value="150" />
+			<entry class="152" argb="255,0,52,104" value="151" />
+			<entry class="153" argb="255,0,51,103" value="152" />
+			<entry class="154" argb="255,0,51,102" value="153" />
+			<entry class="155" argb="255,0,50,101" value="154" />
+			<entry class="156" argb="255,0,50,100" value="155" />
+			<entry class="157" argb="255,0,49,99" value="156" />
+			<entry class="158" argb="255,0,49,98" value="157" />
+			<entry class="159" argb="255,0,48,97" value="158" />
+			<entry class="160" argb="255,0,48,96" value="159" />
+			<entry class="161" argb="255,0,47,95" value="160" />
+			<entry class="162" argb="255,0,47,94" value="161" />
+			<entry class="163" argb="255,0,46,93" value="162" />
+			<entry class="164" argb="255,0,46,92" value="163" />
+			<entry class="165" argb="255,0,45,91" value="164" />
+			<entry class="166" argb="255,0,45,90" value="165" />
+			<entry class="167" argb="255,0,44,89" value="166" />
+			<entry class="168" argb="255,0,44,88" value="167" />
+			<entry class="169" argb="255,0,43,87" value="168" />
+			<entry class="170" argb="255,0,43,86" value="169" />
+			<entry class="171" argb="255,0,42,85" value="170" />
+			<entry class="172" argb="255,0,42,84" value="171" />
+			<entry class="173" argb="255,0,41,83" value="172" />
+			<entry class="174" argb="255,0,41,82" value="173" />
+			<entry class="175" argb="255,0,40,81" value="174" />
+			<entry class="176" argb="255,0,40,80" value="175" />
+			<entry class="177" argb="255,0,39,79" value="176" />
+			<entry class="178" argb="255,0,39,78" value="177" />
+			<entry class="179" argb="255,0,38,77" value="178" />
+			<entry class="180" argb="255,0,38,76" value="179" />
+			<entry class="181" argb="255,0,37,75" value="180" />
+			<entry class="182" argb="255,0,37,74" value="181" />
+			<entry class="183" argb="255,0,36,73" value="182" />
+			<entry class="184" argb="255,0,36,72" value="183" />
+			<entry class="185" argb="255,0,35,71" value="184" />
+			<entry class="186" argb="255,0,35,70" value="185" />
+			<entry class="187" argb="255,0,34,69" value="186" />
+			<entry class="188" argb="255,0,34,68" value="187" />
+			<entry class="189" argb="255,0,33,67" value="188" />
+			<entry class="190" argb="255,0,33,66" value="189" />
+			<entry class="191" argb="255,0,32,65" value="190" />
+			<entry class="192" argb="255,0,32,64" value="191" />
+			<entry class="193" argb="255,0,31,63" value="192" />
+			<entry class="194" argb="255,0,31,62" value="193" />
+			<entry class="195" argb="255,0,30,61" value="194" />
+			<entry class="196" argb="255,0,30,60" value="195" />
+			<entry class="197" argb="255,0,29,59" value="196" />
+			<entry class="198" argb="255,0,29,58" value="197" />
+			<entry class="199" argb="255,0,28,57" value="198" />
+			<entry class="200" argb="255,0,28,56" value="199" />
+			<entry class="201" argb="255,0,27,55" value="200" />
+			<entry class="202" argb="255,0,27,54" value="201" />
+			<entry class="203" argb="255,0,26,53" value="202" />
+			<entry class="204" argb="255,0,26,52" value="203" />
+			<entry class="205" argb="255,0,25,51" value="204" />
+			<entry class="206" argb="255,0,25,50" value="205" />
+			<entry class="207" argb="255,0,24,49" value="206" />
+			<entry class="208" argb="255,0,24,48" value="207" />
+			<entry class="209" argb="255,0,23,47" value="208" />
+			<entry class="210" argb="255,0,23,46" value="209" />
+			<entry class="211" argb="255,0,22,45" value="210" />
+			<entry class="212" argb="255,0,22,44" value="211" />
+			<entry class="213" argb="255,0,21,43" value="212" />
+			<entry class="214" argb="255,0,21,42" value="213" />
+			<entry class="215" argb="255,0,20,41" value="214" />
+			<entry class="216" argb="255,0,20,40" value="215" />
+			<entry class="217" argb="255,0,19,39" value="216" />
+			<entry class="218" argb="255,0,19,38" value="217" />
+			<entry class="219" argb="255,0,18,37" value="218" />
+			<entry class="220" argb="255,0,18,36" value="219" />
+			<entry class="221" argb="255,0,17,35" value="220" />
+			<entry class="222" argb="255,0,17,34" value="221" />
+			<entry class="223" argb="255,0,16,33" value="222" />
+			<entry class="224" argb="255,0,16,32" value="223" />
+			<entry class="225" argb="255,0,15,31" value="224" />
+			<entry class="226" argb="255,0,15,30" value="225" />
+			<entry class="227" argb="255,0,14,29" value="226" />
+			<entry class="228" argb="255,0,14,28" value="227" />
+			<entry class="229" argb="255,0,13,27" value="228" />
+			<entry class="230" argb="255,0,13,26" value="229" />
+			<entry class="231" argb="255,0,12,25" value="230" />
+			<entry class="232" argb="255,0,12,24" value="231" />
+			<entry class="233" argb="255,0,11,23" value="232" />
+			<entry class="234" argb="255,0,11,22" value="233" />
+			<entry class="235" argb="255,0,10,21" value="234" />
+			<entry class="236" argb="255,0,10,20" value="235" />
+			<entry class="237" argb="255,0,9,19" value="236" />
+			<entry class="238" argb="255,0,9,18" value="237" />
+			<entry class="239" argb="255,0,8,17" value="238" />
+			<entry class="240" argb="255,0,8,16" value="239" />
+			<entry class="241" argb="255,0,7,15" value="240" />
+			<entry class="242" argb="255,0,7,14" value="241" />
+			<entry class="243" argb="255,0,6,13" value="242" />
+			<entry class="244" argb="255,0,6,12" value="243" />
+			<entry class="245" argb="255,0,5,11" value="244" />
+			<entry class="246" argb="255,0,5,10" value="245" />
+			<entry class="247" argb="255,0,4,9" value="246" />
+			<entry class="248" argb="255,0,4,8" value="247" />
+			<entry class="249" argb="255,0,3,7" value="248" />
+			<entry class="250" argb="255,0,3,6" value="249" />
+			<entry class="251" argb="255,0,2,5" value="250" />
+			<entry class="252" argb="255,0,2,4" value="251" />
+			<entry class="253" argb="255,0,1,3" value="252" />
+			<entry class="254" argb="255,0,1,2" value="253" />
+			<entry class="255" argb="255,0,0,1" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+	
+	<!-- Gradient, HSV(240,100,0) to HSV(240,100,100) -->
+	<palette name="Deep Blue  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,0,1" value="1" />
+			<entry class="3" argb="255,0,0,2" value="2" />
+			<entry class="4" argb="255,0,0,3" value="3" />
+			<entry class="5" argb="255,0,0,4" value="4" />
+			<entry class="6" argb="255,0,0,5" value="5" />
+			<entry class="7" argb="255,0,0,6" value="6" />
+			<entry class="8" argb="255,0,0,7" value="7" />
+			<entry class="9" argb="255,0,0,8" value="8" />
+			<entry class="10" argb="255,0,0,9" value="9" />
+			<entry class="11" argb="255,0,0,10" value="10" />
+			<entry class="12" argb="255,0,0,11" value="11" />
+			<entry class="13" argb="255,0,0,12" value="12" />
+			<entry class="14" argb="255,0,0,13" value="13" />
+			<entry class="15" argb="255,0,0,14" value="14" />
+			<entry class="16" argb="255,0,0,15" value="15" />
+			<entry class="17" argb="255,0,0,16" value="16" />
+			<entry class="18" argb="255,0,0,17" value="17" />
+			<entry class="19" argb="255,0,0,18" value="18" />
+			<entry class="20" argb="255,0,0,19" value="19" />
+			<entry class="21" argb="255,0,0,20" value="20" />
+			<entry class="22" argb="255,0,0,21" value="21" />
+			<entry class="23" argb="255,0,0,22" value="22" />
+			<entry class="24" argb="255,0,0,23" value="23" />
+			<entry class="25" argb="255,0,0,24" value="24" />
+			<entry class="26" argb="255,0,0,25" value="25" />
+			<entry class="27" argb="255,0,0,26" value="26" />
+			<entry class="28" argb="255,0,0,27" value="27" />
+			<entry class="29" argb="255,0,0,28" value="28" />
+			<entry class="30" argb="255,0,0,29" value="29" />
+			<entry class="31" argb="255,0,0,30" value="30" />
+			<entry class="32" argb="255,0,0,31" value="31" />
+			<entry class="33" argb="255,0,0,32" value="32" />
+			<entry class="34" argb="255,0,0,33" value="33" />
+			<entry class="35" argb="255,0,0,34" value="34" />
+			<entry class="36" argb="255,0,0,35" value="35" />
+			<entry class="37" argb="255,0,0,36" value="36" />
+			<entry class="38" argb="255,0,0,37" value="37" />
+			<entry class="39" argb="255,0,0,38" value="38" />
+			<entry class="40" argb="255,0,0,39" value="39" />
+			<entry class="41" argb="255,0,0,40" value="40" />
+			<entry class="42" argb="255,0,0,41" value="41" />
+			<entry class="43" argb="255,0,0,42" value="42" />
+			<entry class="44" argb="255,0,0,43" value="43" />
+			<entry class="45" argb="255,0,0,44" value="44" />
+			<entry class="46" argb="255,0,0,45" value="45" />
+			<entry class="47" argb="255,0,0,46" value="46" />
+			<entry class="48" argb="255,0,0,47" value="47" />
+			<entry class="49" argb="255,0,0,48" value="48" />
+			<entry class="50" argb="255,0,0,49" value="49" />
+			<entry class="51" argb="255,0,0,50" value="50" />
+			<entry class="52" argb="255,0,0,51" value="51" />
+			<entry class="53" argb="255,0,0,52" value="52" />
+			<entry class="54" argb="255,0,0,53" value="53" />
+			<entry class="55" argb="255,0,0,54" value="54" />
+			<entry class="56" argb="255,0,0,55" value="55" />
+			<entry class="57" argb="255,0,0,56" value="56" />
+			<entry class="58" argb="255,0,0,57" value="57" />
+			<entry class="59" argb="255,0,0,58" value="58" />
+			<entry class="60" argb="255,0,0,59" value="59" />
+			<entry class="61" argb="255,0,0,60" value="60" />
+			<entry class="62" argb="255,0,0,61" value="61" />
+			<entry class="63" argb="255,0,0,62" value="62" />
+			<entry class="64" argb="255,0,0,63" value="63" />
+			<entry class="65" argb="255,0,0,64" value="64" />
+			<entry class="66" argb="255,0,0,65" value="65" />
+			<entry class="67" argb="255,0,0,66" value="66" />
+			<entry class="68" argb="255,0,0,67" value="67" />
+			<entry class="69" argb="255,0,0,68" value="68" />
+			<entry class="70" argb="255,0,0,69" value="69" />
+			<entry class="71" argb="255,0,0,70" value="70" />
+			<entry class="72" argb="255,0,0,71" value="71" />
+			<entry class="73" argb="255,0,0,72" value="72" />
+			<entry class="74" argb="255,0,0,73" value="73" />
+			<entry class="75" argb="255,0,0,74" value="74" />
+			<entry class="76" argb="255,0,0,75" value="75" />
+			<entry class="77" argb="255,0,0,76" value="76" />
+			<entry class="78" argb="255,0,0,77" value="77" />
+			<entry class="79" argb="255,0,0,78" value="78" />
+			<entry class="80" argb="255,0,0,79" value="79" />
+			<entry class="81" argb="255,0,0,80" value="80" />
+			<entry class="82" argb="255,0,0,81" value="81" />
+			<entry class="83" argb="255,0,0,82" value="82" />
+			<entry class="84" argb="255,0,0,83" value="83" />
+			<entry class="85" argb="255,0,0,84" value="84" />
+			<entry class="86" argb="255,0,0,85" value="85" />
+			<entry class="87" argb="255,0,0,86" value="86" />
+			<entry class="88" argb="255,0,0,87" value="87" />
+			<entry class="89" argb="255,0,0,88" value="88" />
+			<entry class="90" argb="255,0,0,89" value="89" />
+			<entry class="91" argb="255,0,0,90" value="90" />
+			<entry class="92" argb="255,0,0,91" value="91" />
+			<entry class="93" argb="255,0,0,92" value="92" />
+			<entry class="94" argb="255,0,0,93" value="93" />
+			<entry class="95" argb="255,0,0,94" value="94" />
+			<entry class="96" argb="255,0,0,95" value="95" />
+			<entry class="97" argb="255,0,0,96" value="96" />
+			<entry class="98" argb="255,0,0,97" value="97" />
+			<entry class="99" argb="255,0,0,98" value="98" />
+			<entry class="100" argb="255,0,0,99" value="99" />
+			<entry class="101" argb="255,0,0,100" value="100" />
+			<entry class="102" argb="255,0,0,101" value="101" />
+			<entry class="103" argb="255,0,0,102" value="102" />
+			<entry class="104" argb="255,0,0,103" value="103" />
+			<entry class="105" argb="255,0,0,104" value="104" />
+			<entry class="106" argb="255,0,0,105" value="105" />
+			<entry class="107" argb="255,0,0,106" value="106" />
+			<entry class="108" argb="255,0,0,107" value="107" />
+			<entry class="109" argb="255,0,0,108" value="108" />
+			<entry class="110" argb="255,0,0,109" value="109" />
+			<entry class="111" argb="255,0,0,110" value="110" />
+			<entry class="112" argb="255,0,0,111" value="111" />
+			<entry class="113" argb="255,0,0,112" value="112" />
+			<entry class="114" argb="255,0,0,113" value="113" />
+			<entry class="115" argb="255,0,0,114" value="114" />
+			<entry class="116" argb="255,0,0,115" value="115" />
+			<entry class="117" argb="255,0,0,116" value="116" />
+			<entry class="118" argb="255,0,0,117" value="117" />
+			<entry class="119" argb="255,0,0,118" value="118" />
+			<entry class="120" argb="255,0,0,119" value="119" />
+			<entry class="121" argb="255,0,0,120" value="120" />
+			<entry class="122" argb="255,0,0,121" value="121" />
+			<entry class="123" argb="255,0,0,122" value="122" />
+			<entry class="124" argb="255,0,0,123" value="123" />
+			<entry class="125" argb="255,0,0,124" value="124" />
+			<entry class="126" argb="255,0,0,125" value="125" />
+			<entry class="127" argb="255,0,0,126" value="126" />
+			<entry class="128" argb="255,0,0,127" value="127" />
+			<entry class="129" argb="255,0,0,128" value="128" />
+			<entry class="130" argb="255,0,0,129" value="129" />
+			<entry class="131" argb="255,0,0,130" value="130" />
+			<entry class="132" argb="255,0,0,131" value="131" />
+			<entry class="133" argb="255,0,0,132" value="132" />
+			<entry class="134" argb="255,0,0,133" value="133" />
+			<entry class="135" argb="255,0,0,134" value="134" />
+			<entry class="136" argb="255,0,0,135" value="135" />
+			<entry class="137" argb="255,0,0,136" value="136" />
+			<entry class="138" argb="255,0,0,137" value="137" />
+			<entry class="139" argb="255,0,0,138" value="138" />
+			<entry class="140" argb="255,0,0,139" value="139" />
+			<entry class="141" argb="255,0,0,140" value="140" />
+			<entry class="142" argb="255,0,0,141" value="141" />
+			<entry class="143" argb="255,0,0,142" value="142" />
+			<entry class="144" argb="255,0,0,143" value="143" />
+			<entry class="145" argb="255,0,0,144" value="144" />
+			<entry class="146" argb="255,0,0,145" value="145" />
+			<entry class="147" argb="255,0,0,146" value="146" />
+			<entry class="148" argb="255,0,0,147" value="147" />
+			<entry class="149" argb="255,0,0,148" value="148" />
+			<entry class="150" argb="255,0,0,149" value="149" />
+			<entry class="151" argb="255,0,0,150" value="150" />
+			<entry class="152" argb="255,0,0,151" value="151" />
+			<entry class="153" argb="255,0,0,152" value="152" />
+			<entry class="154" argb="255,0,0,153" value="153" />
+			<entry class="155" argb="255,0,0,154" value="154" />
+			<entry class="156" argb="255,0,0,155" value="155" />
+			<entry class="157" argb="255,0,0,156" value="156" />
+			<entry class="158" argb="255,0,0,157" value="157" />
+			<entry class="159" argb="255,0,0,158" value="158" />
+			<entry class="160" argb="255,0,0,159" value="159" />
+			<entry class="161" argb="255,0,0,160" value="160" />
+			<entry class="162" argb="255,0,0,161" value="161" />
+			<entry class="163" argb="255,0,0,162" value="162" />
+			<entry class="164" argb="255,0,0,163" value="163" />
+			<entry class="165" argb="255,0,0,164" value="164" />
+			<entry class="166" argb="255,0,0,165" value="165" />
+			<entry class="167" argb="255,0,0,166" value="166" />
+			<entry class="168" argb="255,0,0,167" value="167" />
+			<entry class="169" argb="255,0,0,168" value="168" />
+			<entry class="170" argb="255,0,0,169" value="169" />
+			<entry class="171" argb="255,0,0,170" value="170" />
+			<entry class="172" argb="255,0,0,171" value="171" />
+			<entry class="173" argb="255,0,0,172" value="172" />
+			<entry class="174" argb="255,0,0,173" value="173" />
+			<entry class="175" argb="255,0,0,174" value="174" />
+			<entry class="176" argb="255,0,0,175" value="175" />
+			<entry class="177" argb="255,0,0,176" value="176" />
+			<entry class="178" argb="255,0,0,177" value="177" />
+			<entry class="179" argb="255,0,0,178" value="178" />
+			<entry class="180" argb="255,0,0,179" value="179" />
+			<entry class="181" argb="255,0,0,180" value="180" />
+			<entry class="182" argb="255,0,0,181" value="181" />
+			<entry class="183" argb="255,0,0,182" value="182" />
+			<entry class="184" argb="255,0,0,183" value="183" />
+			<entry class="185" argb="255,0,0,184" value="184" />
+			<entry class="186" argb="255,0,0,185" value="185" />
+			<entry class="187" argb="255,0,0,186" value="186" />
+			<entry class="188" argb="255,0,0,187" value="187" />
+			<entry class="189" argb="255,0,0,188" value="188" />
+			<entry class="190" argb="255,0,0,189" value="189" />
+			<entry class="191" argb="255,0,0,190" value="190" />
+			<entry class="192" argb="255,0,0,191" value="191" />
+			<entry class="193" argb="255,0,0,192" value="192" />
+			<entry class="194" argb="255,0,0,193" value="193" />
+			<entry class="195" argb="255,0,0,194" value="194" />
+			<entry class="196" argb="255,0,0,195" value="195" />
+			<entry class="197" argb="255,0,0,196" value="196" />
+			<entry class="198" argb="255,0,0,197" value="197" />
+			<entry class="199" argb="255,0,0,198" value="198" />
+			<entry class="200" argb="255,0,0,199" value="199" />
+			<entry class="201" argb="255,0,0,200" value="200" />
+			<entry class="202" argb="255,0,0,201" value="201" />
+			<entry class="203" argb="255,0,0,202" value="202" />
+			<entry class="204" argb="255,0,0,203" value="203" />
+			<entry class="205" argb="255,0,0,204" value="204" />
+			<entry class="206" argb="255,0,0,205" value="205" />
+			<entry class="207" argb="255,0,0,206" value="206" />
+			<entry class="208" argb="255,0,0,207" value="207" />
+			<entry class="209" argb="255,0,0,208" value="208" />
+			<entry class="210" argb="255,0,0,209" value="209" />
+			<entry class="211" argb="255,0,0,210" value="210" />
+			<entry class="212" argb="255,0,0,211" value="211" />
+			<entry class="213" argb="255,0,0,212" value="212" />
+			<entry class="214" argb="255,0,0,213" value="213" />
+			<entry class="215" argb="255,0,0,214" value="214" />
+			<entry class="216" argb="255,0,0,215" value="215" />
+			<entry class="217" argb="255,0,0,216" value="216" />
+			<entry class="218" argb="255,0,0,217" value="217" />
+			<entry class="219" argb="255,0,0,218" value="218" />
+			<entry class="220" argb="255,0,0,219" value="219" />
+			<entry class="221" argb="255,0,0,220" value="220" />
+			<entry class="222" argb="255,0,0,221" value="221" />
+			<entry class="223" argb="255,0,0,222" value="222" />
+			<entry class="224" argb="255,0,0,223" value="223" />
+			<entry class="225" argb="255,0,0,224" value="224" />
+			<entry class="226" argb="255,0,0,225" value="225" />
+			<entry class="227" argb="255,0,0,226" value="226" />
+			<entry class="228" argb="255,0,0,227" value="227" />
+			<entry class="229" argb="255,0,0,228" value="228" />
+			<entry class="230" argb="255,0,0,229" value="229" />
+			<entry class="231" argb="255,0,0,230" value="230" />
+			<entry class="232" argb="255,0,0,231" value="231" />
+			<entry class="233" argb="255,0,0,232" value="232" />
+			<entry class="234" argb="255,0,0,233" value="233" />
+			<entry class="235" argb="255,0,0,234" value="234" />
+			<entry class="236" argb="255,0,0,235" value="235" />
+			<entry class="237" argb="255,0,0,236" value="236" />
+			<entry class="238" argb="255,0,0,237" value="237" />
+			<entry class="239" argb="255,0,0,238" value="238" />
+			<entry class="240" argb="255,0,0,239" value="239" />
+			<entry class="241" argb="255,0,0,240" value="240" />
+			<entry class="242" argb="255,0,0,241" value="241" />
+			<entry class="243" argb="255,0,0,242" value="242" />
+			<entry class="244" argb="255,0,0,243" value="243" />
+			<entry class="245" argb="255,0,0,244" value="244" />
+			<entry class="246" argb="255,0,0,245" value="245" />
+			<entry class="247" argb="255,0,0,246" value="246" />
+			<entry class="248" argb="255,0,0,247" value="247" />
+			<entry class="249" argb="255,0,0,248" value="248" />
+			<entry class="250" argb="255,0,0,249" value="249" />
+			<entry class="251" argb="255,0,0,250" value="250" />
+			<entry class="252" argb="255,0,0,251" value="251" />
+			<entry class="253" argb="255,0,0,252" value="252" />
+			<entry class="254" argb="255,0,0,253" value="253" />
+			<entry class="255" argb="255,0,0,254" value="254" />
+			<entry class="256" argb="255,0,0,255" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(90,100,100) to HSV(90,100,0) -->
+	<palette name="Deep Chartreuse  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,127,255,0" value="0" />
+			<entry class="2" argb="255,127,254,0" value="1" />
+			<entry class="3" argb="255,126,253,0" value="2" />
+			<entry class="4" argb="255,126,252,0" value="3" />
+			<entry class="5" argb="255,125,251,0" value="4" />
+			<entry class="6" argb="255,125,250,0" value="5" />
+			<entry class="7" argb="255,124,249,0" value="6" />
+			<entry class="8" argb="255,124,248,0" value="7" />
+			<entry class="9" argb="255,123,247,0" value="8" />
+			<entry class="10" argb="255,123,246,0" value="9" />
+			<entry class="11" argb="255,122,245,0" value="10" />
+			<entry class="12" argb="255,122,244,0" value="11" />
+			<entry class="13" argb="255,121,243,0" value="12" />
+			<entry class="14" argb="255,121,242,0" value="13" />
+			<entry class="15" argb="255,120,241,0" value="14" />
+			<entry class="16" argb="255,120,240,0" value="15" />
+			<entry class="17" argb="255,119,239,0" value="16" />
+			<entry class="18" argb="255,119,238,0" value="17" />
+			<entry class="19" argb="255,118,237,0" value="18" />
+			<entry class="20" argb="255,118,236,0" value="19" />
+			<entry class="21" argb="255,117,235,0" value="20" />
+			<entry class="22" argb="255,117,234,0" value="21" />
+			<entry class="23" argb="255,116,233,0" value="22" />
+			<entry class="24" argb="255,116,232,0" value="23" />
+			<entry class="25" argb="255,115,231,0" value="24" />
+			<entry class="26" argb="255,115,230,0" value="25" />
+			<entry class="27" argb="255,114,229,0" value="26" />
+			<entry class="28" argb="255,114,228,0" value="27" />
+			<entry class="29" argb="255,113,227,0" value="28" />
+			<entry class="30" argb="255,113,226,0" value="29" />
+			<entry class="31" argb="255,112,225,0" value="30" />
+			<entry class="32" argb="255,112,224,0" value="31" />
+			<entry class="33" argb="255,111,223,0" value="32" />
+			<entry class="34" argb="255,111,222,0" value="33" />
+			<entry class="35" argb="255,110,221,0" value="34" />
+			<entry class="36" argb="255,110,220,0" value="35" />
+			<entry class="37" argb="255,109,219,0" value="36" />
+			<entry class="38" argb="255,109,218,0" value="37" />
+			<entry class="39" argb="255,108,217,0" value="38" />
+			<entry class="40" argb="255,108,216,0" value="39" />
+			<entry class="41" argb="255,107,215,0" value="40" />
+			<entry class="42" argb="255,107,214,0" value="41" />
+			<entry class="43" argb="255,106,213,0" value="42" />
+			<entry class="44" argb="255,106,212,0" value="43" />
+			<entry class="45" argb="255,105,211,0" value="44" />
+			<entry class="46" argb="255,105,210,0" value="45" />
+			<entry class="47" argb="255,104,209,0" value="46" />
+			<entry class="48" argb="255,104,208,0" value="47" />
+			<entry class="49" argb="255,103,207,0" value="48" />
+			<entry class="50" argb="255,103,206,0" value="49" />
+			<entry class="51" argb="255,102,205,0" value="50" />
+			<entry class="52" argb="255,102,204,0" value="51" />
+			<entry class="53" argb="255,101,203,0" value="52" />
+			<entry class="54" argb="255,101,202,0" value="53" />
+			<entry class="55" argb="255,100,201,0" value="54" />
+			<entry class="56" argb="255,100,200,0" value="55" />
+			<entry class="57" argb="255,99,199,0" value="56" />
+			<entry class="58" argb="255,99,198,0" value="57" />
+			<entry class="59" argb="255,98,197,0" value="58" />
+			<entry class="60" argb="255,98,196,0" value="59" />
+			<entry class="61" argb="255,97,195,0" value="60" />
+			<entry class="62" argb="255,97,194,0" value="61" />
+			<entry class="63" argb="255,96,193,0" value="62" />
+			<entry class="64" argb="255,96,192,0" value="63" />
+			<entry class="65" argb="255,95,191,0" value="64" />
+			<entry class="66" argb="255,95,190,0" value="65" />
+			<entry class="67" argb="255,94,189,0" value="66" />
+			<entry class="68" argb="255,94,188,0" value="67" />
+			<entry class="69" argb="255,93,187,0" value="68" />
+			<entry class="70" argb="255,93,186,0" value="69" />
+			<entry class="71" argb="255,92,185,0" value="70" />
+			<entry class="72" argb="255,92,184,0" value="71" />
+			<entry class="73" argb="255,91,183,0" value="72" />
+			<entry class="74" argb="255,91,182,0" value="73" />
+			<entry class="75" argb="255,90,181,0" value="74" />
+			<entry class="76" argb="255,90,180,0" value="75" />
+			<entry class="77" argb="255,89,179,0" value="76" />
+			<entry class="78" argb="255,89,178,0" value="77" />
+			<entry class="79" argb="255,88,177,0" value="78" />
+			<entry class="80" argb="255,88,176,0" value="79" />
+			<entry class="81" argb="255,87,175,0" value="80" />
+			<entry class="82" argb="255,87,174,0" value="81" />
+			<entry class="83" argb="255,86,173,0" value="82" />
+			<entry class="84" argb="255,86,172,0" value="83" />
+			<entry class="85" argb="255,85,171,0" value="84" />
+			<entry class="86" argb="255,85,170,0" value="85" />
+			<entry class="87" argb="255,84,169,0" value="86" />
+			<entry class="88" argb="255,84,168,0" value="87" />
+			<entry class="89" argb="255,83,167,0" value="88" />
+			<entry class="90" argb="255,83,166,0" value="89" />
+			<entry class="91" argb="255,82,165,0" value="90" />
+			<entry class="92" argb="255,82,164,0" value="91" />
+			<entry class="93" argb="255,81,163,0" value="92" />
+			<entry class="94" argb="255,81,162,0" value="93" />
+			<entry class="95" argb="255,80,161,0" value="94" />
+			<entry class="96" argb="255,80,160,0" value="95" />
+			<entry class="97" argb="255,79,159,0" value="96" />
+			<entry class="98" argb="255,79,158,0" value="97" />
+			<entry class="99" argb="255,78,157,0" value="98" />
+			<entry class="100" argb="255,78,156,0" value="99" />
+			<entry class="101" argb="255,77,155,0" value="100" />
+			<entry class="102" argb="255,77,154,0" value="101" />
+			<entry class="103" argb="255,76,153,0" value="102" />
+			<entry class="104" argb="255,76,152,0" value="103" />
+			<entry class="105" argb="255,75,151,0" value="104" />
+			<entry class="106" argb="255,75,150,0" value="105" />
+			<entry class="107" argb="255,74,149,0" value="106" />
+			<entry class="108" argb="255,74,148,0" value="107" />
+			<entry class="109" argb="255,73,147,0" value="108" />
+			<entry class="110" argb="255,73,146,0" value="109" />
+			<entry class="111" argb="255,72,145,0" value="110" />
+			<entry class="112" argb="255,72,144,0" value="111" />
+			<entry class="113" argb="255,71,143,0" value="112" />
+			<entry class="114" argb="255,71,142,0" value="113" />
+			<entry class="115" argb="255,70,141,0" value="114" />
+			<entry class="116" argb="255,70,140,0" value="115" />
+			<entry class="117" argb="255,69,139,0" value="116" />
+			<entry class="118" argb="255,69,138,0" value="117" />
+			<entry class="119" argb="255,68,137,0" value="118" />
+			<entry class="120" argb="255,68,136,0" value="119" />
+			<entry class="121" argb="255,67,135,0" value="120" />
+			<entry class="122" argb="255,67,134,0" value="121" />
+			<entry class="123" argb="255,66,133,0" value="122" />
+			<entry class="124" argb="255,66,132,0" value="123" />
+			<entry class="125" argb="255,65,131,0" value="124" />
+			<entry class="126" argb="255,65,130,0" value="125" />
+			<entry class="127" argb="255,64,129,0" value="126" />
+			<entry class="128" argb="255,64,128,0" value="127" />
+			<entry class="129" argb="255,63,127,0" value="128" />
+			<entry class="130" argb="255,63,126,0" value="129" />
+			<entry class="131" argb="255,62,125,0" value="130" />
+			<entry class="132" argb="255,62,124,0" value="131" />
+			<entry class="133" argb="255,61,123,0" value="132" />
+			<entry class="134" argb="255,61,122,0" value="133" />
+			<entry class="135" argb="255,60,121,0" value="134" />
+			<entry class="136" argb="255,60,120,0" value="135" />
+			<entry class="137" argb="255,59,119,0" value="136" />
+			<entry class="138" argb="255,59,118,0" value="137" />
+			<entry class="139" argb="255,58,117,0" value="138" />
+			<entry class="140" argb="255,58,116,0" value="139" />
+			<entry class="141" argb="255,57,115,0" value="140" />
+			<entry class="142" argb="255,57,114,0" value="141" />
+			<entry class="143" argb="255,56,113,0" value="142" />
+			<entry class="144" argb="255,56,112,0" value="143" />
+			<entry class="145" argb="255,55,111,0" value="144" />
+			<entry class="146" argb="255,55,110,0" value="145" />
+			<entry class="147" argb="255,54,109,0" value="146" />
+			<entry class="148" argb="255,54,108,0" value="147" />
+			<entry class="149" argb="255,53,107,0" value="148" />
+			<entry class="150" argb="255,53,106,0" value="149" />
+			<entry class="151" argb="255,52,105,0" value="150" />
+			<entry class="152" argb="255,52,104,0" value="151" />
+			<entry class="153" argb="255,51,103,0" value="152" />
+			<entry class="154" argb="255,51,102,0" value="153" />
+			<entry class="155" argb="255,50,101,0" value="154" />
+			<entry class="156" argb="255,50,100,0" value="155" />
+			<entry class="157" argb="255,49,99,0" value="156" />
+			<entry class="158" argb="255,49,98,0" value="157" />
+			<entry class="159" argb="255,48,97,0" value="158" />
+			<entry class="160" argb="255,48,96,0" value="159" />
+			<entry class="161" argb="255,47,95,0" value="160" />
+			<entry class="162" argb="255,47,94,0" value="161" />
+			<entry class="163" argb="255,46,93,0" value="162" />
+			<entry class="164" argb="255,46,92,0" value="163" />
+			<entry class="165" argb="255,45,91,0" value="164" />
+			<entry class="166" argb="255,45,90,0" value="165" />
+			<entry class="167" argb="255,44,89,0" value="166" />
+			<entry class="168" argb="255,44,88,0" value="167" />
+			<entry class="169" argb="255,43,87,0" value="168" />
+			<entry class="170" argb="255,43,86,0" value="169" />
+			<entry class="171" argb="255,42,85,0" value="170" />
+			<entry class="172" argb="255,42,84,0" value="171" />
+			<entry class="173" argb="255,41,83,0" value="172" />
+			<entry class="174" argb="255,41,82,0" value="173" />
+			<entry class="175" argb="255,40,81,0" value="174" />
+			<entry class="176" argb="255,40,80,0" value="175" />
+			<entry class="177" argb="255,39,79,0" value="176" />
+			<entry class="178" argb="255,39,78,0" value="177" />
+			<entry class="179" argb="255,38,77,0" value="178" />
+			<entry class="180" argb="255,38,76,0" value="179" />
+			<entry class="181" argb="255,37,75,0" value="180" />
+			<entry class="182" argb="255,37,74,0" value="181" />
+			<entry class="183" argb="255,36,73,0" value="182" />
+			<entry class="184" argb="255,36,72,0" value="183" />
+			<entry class="185" argb="255,35,71,0" value="184" />
+			<entry class="186" argb="255,35,70,0" value="185" />
+			<entry class="187" argb="255,34,69,0" value="186" />
+			<entry class="188" argb="255,34,68,0" value="187" />
+			<entry class="189" argb="255,33,67,0" value="188" />
+			<entry class="190" argb="255,33,66,0" value="189" />
+			<entry class="191" argb="255,32,65,0" value="190" />
+			<entry class="192" argb="255,32,64,0" value="191" />
+			<entry class="193" argb="255,31,63,0" value="192" />
+			<entry class="194" argb="255,31,62,0" value="193" />
+			<entry class="195" argb="255,30,61,0" value="194" />
+			<entry class="196" argb="255,30,60,0" value="195" />
+			<entry class="197" argb="255,29,59,0" value="196" />
+			<entry class="198" argb="255,29,58,0" value="197" />
+			<entry class="199" argb="255,28,57,0" value="198" />
+			<entry class="200" argb="255,28,56,0" value="199" />
+			<entry class="201" argb="255,27,55,0" value="200" />
+			<entry class="202" argb="255,27,54,0" value="201" />
+			<entry class="203" argb="255,26,53,0" value="202" />
+			<entry class="204" argb="255,26,52,0" value="203" />
+			<entry class="205" argb="255,25,51,0" value="204" />
+			<entry class="206" argb="255,25,50,0" value="205" />
+			<entry class="207" argb="255,24,49,0" value="206" />
+			<entry class="208" argb="255,24,48,0" value="207" />
+			<entry class="209" argb="255,23,47,0" value="208" />
+			<entry class="210" argb="255,23,46,0" value="209" />
+			<entry class="211" argb="255,22,45,0" value="210" />
+			<entry class="212" argb="255,22,44,0" value="211" />
+			<entry class="213" argb="255,21,43,0" value="212" />
+			<entry class="214" argb="255,21,42,0" value="213" />
+			<entry class="215" argb="255,20,41,0" value="214" />
+			<entry class="216" argb="255,20,40,0" value="215" />
+			<entry class="217" argb="255,19,39,0" value="216" />
+			<entry class="218" argb="255,19,38,0" value="217" />
+			<entry class="219" argb="255,18,37,0" value="218" />
+			<entry class="220" argb="255,18,36,0" value="219" />
+			<entry class="221" argb="255,17,35,0" value="220" />
+			<entry class="222" argb="255,17,34,0" value="221" />
+			<entry class="223" argb="255,16,33,0" value="222" />
+			<entry class="224" argb="255,16,32,0" value="223" />
+			<entry class="225" argb="255,15,31,0" value="224" />
+			<entry class="226" argb="255,15,30,0" value="225" />
+			<entry class="227" argb="255,14,29,0" value="226" />
+			<entry class="228" argb="255,14,28,0" value="227" />
+			<entry class="229" argb="255,13,27,0" value="228" />
+			<entry class="230" argb="255,13,26,0" value="229" />
+			<entry class="231" argb="255,12,25,0" value="230" />
+			<entry class="232" argb="255,12,24,0" value="231" />
+			<entry class="233" argb="255,11,23,0" value="232" />
+			<entry class="234" argb="255,11,22,0" value="233" />
+			<entry class="235" argb="255,10,21,0" value="234" />
+			<entry class="236" argb="255,10,20,0" value="235" />
+			<entry class="237" argb="255,9,19,0" value="236" />
+			<entry class="238" argb="255,9,18,0" value="237" />
+			<entry class="239" argb="255,8,17,0" value="238" />
+			<entry class="240" argb="255,8,16,0" value="239" />
+			<entry class="241" argb="255,7,15,0" value="240" />
+			<entry class="242" argb="255,7,14,0" value="241" />
+			<entry class="243" argb="255,6,13,0" value="242" />
+			<entry class="244" argb="255,6,12,0" value="243" />
+			<entry class="245" argb="255,5,11,0" value="244" />
+			<entry class="246" argb="255,5,10,0" value="245" />
+			<entry class="247" argb="255,4,9,0" value="246" />
+			<entry class="248" argb="255,4,8,0" value="247" />
+			<entry class="249" argb="255,3,7,0" value="248" />
+			<entry class="250" argb="255,3,6,0" value="249" />
+			<entry class="251" argb="255,2,5,0" value="250" />
+			<entry class="252" argb="255,2,4,0" value="251" />
+			<entry class="253" argb="255,1,3,0" value="252" />
+			<entry class="254" argb="255,1,2,0" value="253" />
+			<entry class="255" argb="255,0,1,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(180,100,0) to HSV(180,100,100) -->
+	<palette name="Deep Cyan  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,1,1" value="1" />
+			<entry class="3" argb="255,0,2,2" value="2" />
+			<entry class="4" argb="255,0,3,3" value="3" />
+			<entry class="5" argb="255,0,4,4" value="4" />
+			<entry class="6" argb="255,0,5,5" value="5" />
+			<entry class="7" argb="255,0,6,6" value="6" />
+			<entry class="8" argb="255,0,7,7" value="7" />
+			<entry class="9" argb="255,0,8,8" value="8" />
+			<entry class="10" argb="255,0,9,9" value="9" />
+			<entry class="11" argb="255,0,10,10" value="10" />
+			<entry class="12" argb="255,0,11,11" value="11" />
+			<entry class="13" argb="255,0,12,12" value="12" />
+			<entry class="14" argb="255,0,13,13" value="13" />
+			<entry class="15" argb="255,0,14,14" value="14" />
+			<entry class="16" argb="255,0,15,15" value="15" />
+			<entry class="17" argb="255,0,16,16" value="16" />
+			<entry class="18" argb="255,0,17,17" value="17" />
+			<entry class="19" argb="255,0,18,18" value="18" />
+			<entry class="20" argb="255,0,19,19" value="19" />
+			<entry class="21" argb="255,0,20,20" value="20" />
+			<entry class="22" argb="255,0,21,21" value="21" />
+			<entry class="23" argb="255,0,22,22" value="22" />
+			<entry class="24" argb="255,0,23,23" value="23" />
+			<entry class="25" argb="255,0,24,24" value="24" />
+			<entry class="26" argb="255,0,25,25" value="25" />
+			<entry class="27" argb="255,0,26,26" value="26" />
+			<entry class="28" argb="255,0,27,27" value="27" />
+			<entry class="29" argb="255,0,28,28" value="28" />
+			<entry class="30" argb="255,0,29,29" value="29" />
+			<entry class="31" argb="255,0,30,30" value="30" />
+			<entry class="32" argb="255,0,31,31" value="31" />
+			<entry class="33" argb="255,0,32,32" value="32" />
+			<entry class="34" argb="255,0,33,33" value="33" />
+			<entry class="35" argb="255,0,34,34" value="34" />
+			<entry class="36" argb="255,0,35,35" value="35" />
+			<entry class="37" argb="255,0,36,36" value="36" />
+			<entry class="38" argb="255,0,37,37" value="37" />
+			<entry class="39" argb="255,0,38,38" value="38" />
+			<entry class="40" argb="255,0,39,39" value="39" />
+			<entry class="41" argb="255,0,40,40" value="40" />
+			<entry class="42" argb="255,0,41,41" value="41" />
+			<entry class="43" argb="255,0,42,42" value="42" />
+			<entry class="44" argb="255,0,43,43" value="43" />
+			<entry class="45" argb="255,0,44,44" value="44" />
+			<entry class="46" argb="255,0,45,45" value="45" />
+			<entry class="47" argb="255,0,46,46" value="46" />
+			<entry class="48" argb="255,0,47,47" value="47" />
+			<entry class="49" argb="255,0,48,48" value="48" />
+			<entry class="50" argb="255,0,49,49" value="49" />
+			<entry class="51" argb="255,0,50,50" value="50" />
+			<entry class="52" argb="255,0,51,51" value="51" />
+			<entry class="53" argb="255,0,52,52" value="52" />
+			<entry class="54" argb="255,0,53,53" value="53" />
+			<entry class="55" argb="255,0,54,54" value="54" />
+			<entry class="56" argb="255,0,55,55" value="55" />
+			<entry class="57" argb="255,0,56,56" value="56" />
+			<entry class="58" argb="255,0,57,57" value="57" />
+			<entry class="59" argb="255,0,58,58" value="58" />
+			<entry class="60" argb="255,0,59,59" value="59" />
+			<entry class="61" argb="255,0,60,60" value="60" />
+			<entry class="62" argb="255,0,61,61" value="61" />
+			<entry class="63" argb="255,0,62,62" value="62" />
+			<entry class="64" argb="255,0,63,63" value="63" />
+			<entry class="65" argb="255,0,64,64" value="64" />
+			<entry class="66" argb="255,0,65,65" value="65" />
+			<entry class="67" argb="255,0,66,66" value="66" />
+			<entry class="68" argb="255,0,67,67" value="67" />
+			<entry class="69" argb="255,0,68,68" value="68" />
+			<entry class="70" argb="255,0,69,69" value="69" />
+			<entry class="71" argb="255,0,70,70" value="70" />
+			<entry class="72" argb="255,0,71,71" value="71" />
+			<entry class="73" argb="255,0,72,72" value="72" />
+			<entry class="74" argb="255,0,73,73" value="73" />
+			<entry class="75" argb="255,0,74,74" value="74" />
+			<entry class="76" argb="255,0,75,75" value="75" />
+			<entry class="77" argb="255,0,76,76" value="76" />
+			<entry class="78" argb="255,0,77,77" value="77" />
+			<entry class="79" argb="255,0,78,78" value="78" />
+			<entry class="80" argb="255,0,79,79" value="79" />
+			<entry class="81" argb="255,0,80,80" value="80" />
+			<entry class="82" argb="255,0,81,81" value="81" />
+			<entry class="83" argb="255,0,82,82" value="82" />
+			<entry class="84" argb="255,0,83,83" value="83" />
+			<entry class="85" argb="255,0,84,84" value="84" />
+			<entry class="86" argb="255,0,85,85" value="85" />
+			<entry class="87" argb="255,0,86,86" value="86" />
+			<entry class="88" argb="255,0,87,87" value="87" />
+			<entry class="89" argb="255,0,88,88" value="88" />
+			<entry class="90" argb="255,0,89,89" value="89" />
+			<entry class="91" argb="255,0,90,90" value="90" />
+			<entry class="92" argb="255,0,91,91" value="91" />
+			<entry class="93" argb="255,0,92,92" value="92" />
+			<entry class="94" argb="255,0,93,93" value="93" />
+			<entry class="95" argb="255,0,94,94" value="94" />
+			<entry class="96" argb="255,0,95,95" value="95" />
+			<entry class="97" argb="255,0,96,96" value="96" />
+			<entry class="98" argb="255,0,97,97" value="97" />
+			<entry class="99" argb="255,0,98,98" value="98" />
+			<entry class="100" argb="255,0,99,99" value="99" />
+			<entry class="101" argb="255,0,100,100" value="100" />
+			<entry class="102" argb="255,0,101,101" value="101" />
+			<entry class="103" argb="255,0,102,102" value="102" />
+			<entry class="104" argb="255,0,103,103" value="103" />
+			<entry class="105" argb="255,0,104,104" value="104" />
+			<entry class="106" argb="255,0,105,105" value="105" />
+			<entry class="107" argb="255,0,106,106" value="106" />
+			<entry class="108" argb="255,0,107,107" value="107" />
+			<entry class="109" argb="255,0,108,108" value="108" />
+			<entry class="110" argb="255,0,109,109" value="109" />
+			<entry class="111" argb="255,0,110,110" value="110" />
+			<entry class="112" argb="255,0,111,111" value="111" />
+			<entry class="113" argb="255,0,112,112" value="112" />
+			<entry class="114" argb="255,0,113,113" value="113" />
+			<entry class="115" argb="255,0,114,114" value="114" />
+			<entry class="116" argb="255,0,115,115" value="115" />
+			<entry class="117" argb="255,0,116,116" value="116" />
+			<entry class="118" argb="255,0,117,117" value="117" />
+			<entry class="119" argb="255,0,118,118" value="118" />
+			<entry class="120" argb="255,0,119,119" value="119" />
+			<entry class="121" argb="255,0,120,120" value="120" />
+			<entry class="122" argb="255,0,121,121" value="121" />
+			<entry class="123" argb="255,0,122,122" value="122" />
+			<entry class="124" argb="255,0,123,123" value="123" />
+			<entry class="125" argb="255,0,124,124" value="124" />
+			<entry class="126" argb="255,0,125,125" value="125" />
+			<entry class="127" argb="255,0,126,126" value="126" />
+			<entry class="128" argb="255,0,127,127" value="127" />
+			<entry class="129" argb="255,0,128,128" value="128" />
+			<entry class="130" argb="255,0,129,129" value="129" />
+			<entry class="131" argb="255,0,130,130" value="130" />
+			<entry class="132" argb="255,0,131,131" value="131" />
+			<entry class="133" argb="255,0,132,132" value="132" />
+			<entry class="134" argb="255,0,133,133" value="133" />
+			<entry class="135" argb="255,0,134,134" value="134" />
+			<entry class="136" argb="255,0,135,135" value="135" />
+			<entry class="137" argb="255,0,136,136" value="136" />
+			<entry class="138" argb="255,0,137,137" value="137" />
+			<entry class="139" argb="255,0,138,138" value="138" />
+			<entry class="140" argb="255,0,139,139" value="139" />
+			<entry class="141" argb="255,0,140,140" value="140" />
+			<entry class="142" argb="255,0,141,141" value="141" />
+			<entry class="143" argb="255,0,142,142" value="142" />
+			<entry class="144" argb="255,0,143,143" value="143" />
+			<entry class="145" argb="255,0,144,144" value="144" />
+			<entry class="146" argb="255,0,145,145" value="145" />
+			<entry class="147" argb="255,0,146,146" value="146" />
+			<entry class="148" argb="255,0,147,147" value="147" />
+			<entry class="149" argb="255,0,148,148" value="148" />
+			<entry class="150" argb="255,0,149,149" value="149" />
+			<entry class="151" argb="255,0,150,150" value="150" />
+			<entry class="152" argb="255,0,151,151" value="151" />
+			<entry class="153" argb="255,0,152,152" value="152" />
+			<entry class="154" argb="255,0,153,153" value="153" />
+			<entry class="155" argb="255,0,154,154" value="154" />
+			<entry class="156" argb="255,0,155,155" value="155" />
+			<entry class="157" argb="255,0,156,156" value="156" />
+			<entry class="158" argb="255,0,157,157" value="157" />
+			<entry class="159" argb="255,0,158,158" value="158" />
+			<entry class="160" argb="255,0,159,159" value="159" />
+			<entry class="161" argb="255,0,160,160" value="160" />
+			<entry class="162" argb="255,0,161,161" value="161" />
+			<entry class="163" argb="255,0,162,162" value="162" />
+			<entry class="164" argb="255,0,163,163" value="163" />
+			<entry class="165" argb="255,0,164,164" value="164" />
+			<entry class="166" argb="255,0,165,165" value="165" />
+			<entry class="167" argb="255,0,166,166" value="166" />
+			<entry class="168" argb="255,0,167,167" value="167" />
+			<entry class="169" argb="255,0,168,168" value="168" />
+			<entry class="170" argb="255,0,169,169" value="169" />
+			<entry class="171" argb="255,0,170,170" value="170" />
+			<entry class="172" argb="255,0,171,171" value="171" />
+			<entry class="173" argb="255,0,172,172" value="172" />
+			<entry class="174" argb="255,0,173,173" value="173" />
+			<entry class="175" argb="255,0,174,174" value="174" />
+			<entry class="176" argb="255,0,175,175" value="175" />
+			<entry class="177" argb="255,0,176,176" value="176" />
+			<entry class="178" argb="255,0,177,177" value="177" />
+			<entry class="179" argb="255,0,178,178" value="178" />
+			<entry class="180" argb="255,0,179,179" value="179" />
+			<entry class="181" argb="255,0,180,180" value="180" />
+			<entry class="182" argb="255,0,181,181" value="181" />
+			<entry class="183" argb="255,0,182,182" value="182" />
+			<entry class="184" argb="255,0,183,183" value="183" />
+			<entry class="185" argb="255,0,184,184" value="184" />
+			<entry class="186" argb="255,0,185,185" value="185" />
+			<entry class="187" argb="255,0,186,186" value="186" />
+			<entry class="188" argb="255,0,187,187" value="187" />
+			<entry class="189" argb="255,0,188,188" value="188" />
+			<entry class="190" argb="255,0,189,189" value="189" />
+			<entry class="191" argb="255,0,190,190" value="190" />
+			<entry class="192" argb="255,0,191,191" value="191" />
+			<entry class="193" argb="255,0,192,192" value="192" />
+			<entry class="194" argb="255,0,193,193" value="193" />
+			<entry class="195" argb="255,0,194,194" value="194" />
+			<entry class="196" argb="255,0,195,195" value="195" />
+			<entry class="197" argb="255,0,196,196" value="196" />
+			<entry class="198" argb="255,0,197,197" value="197" />
+			<entry class="199" argb="255,0,198,198" value="198" />
+			<entry class="200" argb="255,0,199,199" value="199" />
+			<entry class="201" argb="255,0,200,200" value="200" />
+			<entry class="202" argb="255,0,201,201" value="201" />
+			<entry class="203" argb="255,0,202,202" value="202" />
+			<entry class="204" argb="255,0,203,203" value="203" />
+			<entry class="205" argb="255,0,204,204" value="204" />
+			<entry class="206" argb="255,0,205,205" value="205" />
+			<entry class="207" argb="255,0,206,206" value="206" />
+			<entry class="208" argb="255,0,207,207" value="207" />
+			<entry class="209" argb="255,0,208,208" value="208" />
+			<entry class="210" argb="255,0,209,209" value="209" />
+			<entry class="211" argb="255,0,210,210" value="210" />
+			<entry class="212" argb="255,0,211,211" value="211" />
+			<entry class="213" argb="255,0,212,212" value="212" />
+			<entry class="214" argb="255,0,213,213" value="213" />
+			<entry class="215" argb="255,0,214,214" value="214" />
+			<entry class="216" argb="255,0,215,215" value="215" />
+			<entry class="217" argb="255,0,216,216" value="216" />
+			<entry class="218" argb="255,0,217,217" value="217" />
+			<entry class="219" argb="255,0,218,218" value="218" />
+			<entry class="220" argb="255,0,219,219" value="219" />
+			<entry class="221" argb="255,0,220,220" value="220" />
+			<entry class="222" argb="255,0,221,221" value="221" />
+			<entry class="223" argb="255,0,222,222" value="222" />
+			<entry class="224" argb="255,0,223,223" value="223" />
+			<entry class="225" argb="255,0,224,224" value="224" />
+			<entry class="226" argb="255,0,225,225" value="225" />
+			<entry class="227" argb="255,0,226,226" value="226" />
+			<entry class="228" argb="255,0,227,227" value="227" />
+			<entry class="229" argb="255,0,228,228" value="228" />
+			<entry class="230" argb="255,0,229,229" value="229" />
+			<entry class="231" argb="255,0,230,230" value="230" />
+			<entry class="232" argb="255,0,231,231" value="231" />
+			<entry class="233" argb="255,0,232,232" value="232" />
+			<entry class="234" argb="255,0,233,233" value="233" />
+			<entry class="235" argb="255,0,234,234" value="234" />
+			<entry class="236" argb="255,0,235,235" value="235" />
+			<entry class="237" argb="255,0,236,236" value="236" />
+			<entry class="238" argb="255,0,237,237" value="237" />
+			<entry class="239" argb="255,0,238,238" value="238" />
+			<entry class="240" argb="255,0,239,239" value="239" />
+			<entry class="241" argb="255,0,240,240" value="240" />
+			<entry class="242" argb="255,0,241,241" value="241" />
+			<entry class="243" argb="255,0,242,242" value="242" />
+			<entry class="244" argb="255,0,243,243" value="243" />
+			<entry class="245" argb="255,0,244,244" value="244" />
+			<entry class="246" argb="255,0,245,245" value="245" />
+			<entry class="247" argb="255,0,246,246" value="246" />
+			<entry class="248" argb="255,0,247,247" value="247" />
+			<entry class="249" argb="255,0,248,248" value="248" />
+			<entry class="250" argb="255,0,249,249" value="249" />
+			<entry class="251" argb="255,0,250,250" value="250" />
+			<entry class="252" argb="255,0,251,251" value="251" />
+			<entry class="253" argb="255,0,252,252" value="252" />
+			<entry class="254" argb="255,0,253,253" value="253" />
+			<entry class="255" argb="255,0,254,254" value="254" />
+			<entry class="256" argb="255,0,255,255" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(120,100,0) to HSV(120,100,100) -->
+	<palette name="Deep Green  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,1,0" value="1" />
+			<entry class="3" argb="255,0,2,0" value="2" />
+			<entry class="4" argb="255,0,3,0" value="3" />
+			<entry class="5" argb="255,0,4,0" value="4" />
+			<entry class="6" argb="255,0,5,0" value="5" />
+			<entry class="7" argb="255,0,6,0" value="6" />
+			<entry class="8" argb="255,0,7,0" value="7" />
+			<entry class="9" argb="255,0,8,0" value="8" />
+			<entry class="10" argb="255,0,9,0" value="9" />
+			<entry class="11" argb="255,0,10,0" value="10" />
+			<entry class="12" argb="255,0,11,0" value="11" />
+			<entry class="13" argb="255,0,12,0" value="12" />
+			<entry class="14" argb="255,0,13,0" value="13" />
+			<entry class="15" argb="255,0,14,0" value="14" />
+			<entry class="16" argb="255,0,15,0" value="15" />
+			<entry class="17" argb="255,0,16,0" value="16" />
+			<entry class="18" argb="255,0,17,0" value="17" />
+			<entry class="19" argb="255,0,18,0" value="18" />
+			<entry class="20" argb="255,0,19,0" value="19" />
+			<entry class="21" argb="255,0,20,0" value="20" />
+			<entry class="22" argb="255,0,21,0" value="21" />
+			<entry class="23" argb="255,0,22,0" value="22" />
+			<entry class="24" argb="255,0,23,0" value="23" />
+			<entry class="25" argb="255,0,24,0" value="24" />
+			<entry class="26" argb="255,0,25,0" value="25" />
+			<entry class="27" argb="255,0,26,0" value="26" />
+			<entry class="28" argb="255,0,27,0" value="27" />
+			<entry class="29" argb="255,0,28,0" value="28" />
+			<entry class="30" argb="255,0,29,0" value="29" />
+			<entry class="31" argb="255,0,30,0" value="30" />
+			<entry class="32" argb="255,0,31,0" value="31" />
+			<entry class="33" argb="255,0,32,0" value="32" />
+			<entry class="34" argb="255,0,33,0" value="33" />
+			<entry class="35" argb="255,0,34,0" value="34" />
+			<entry class="36" argb="255,0,35,0" value="35" />
+			<entry class="37" argb="255,0,36,0" value="36" />
+			<entry class="38" argb="255,0,37,0" value="37" />
+			<entry class="39" argb="255,0,38,0" value="38" />
+			<entry class="40" argb="255,0,39,0" value="39" />
+			<entry class="41" argb="255,0,40,0" value="40" />
+			<entry class="42" argb="255,0,41,0" value="41" />
+			<entry class="43" argb="255,0,42,0" value="42" />
+			<entry class="44" argb="255,0,43,0" value="43" />
+			<entry class="45" argb="255,0,44,0" value="44" />
+			<entry class="46" argb="255,0,45,0" value="45" />
+			<entry class="47" argb="255,0,46,0" value="46" />
+			<entry class="48" argb="255,0,47,0" value="47" />
+			<entry class="49" argb="255,0,48,0" value="48" />
+			<entry class="50" argb="255,0,49,0" value="49" />
+			<entry class="51" argb="255,0,50,0" value="50" />
+			<entry class="52" argb="255,0,51,0" value="51" />
+			<entry class="53" argb="255,0,52,0" value="52" />
+			<entry class="54" argb="255,0,53,0" value="53" />
+			<entry class="55" argb="255,0,54,0" value="54" />
+			<entry class="56" argb="255,0,55,0" value="55" />
+			<entry class="57" argb="255,0,56,0" value="56" />
+			<entry class="58" argb="255,0,57,0" value="57" />
+			<entry class="59" argb="255,0,58,0" value="58" />
+			<entry class="60" argb="255,0,59,0" value="59" />
+			<entry class="61" argb="255,0,60,0" value="60" />
+			<entry class="62" argb="255,0,61,0" value="61" />
+			<entry class="63" argb="255,0,62,0" value="62" />
+			<entry class="64" argb="255,0,63,0" value="63" />
+			<entry class="65" argb="255,0,64,0" value="64" />
+			<entry class="66" argb="255,0,65,0" value="65" />
+			<entry class="67" argb="255,0,66,0" value="66" />
+			<entry class="68" argb="255,0,67,0" value="67" />
+			<entry class="69" argb="255,0,68,0" value="68" />
+			<entry class="70" argb="255,0,69,0" value="69" />
+			<entry class="71" argb="255,0,70,0" value="70" />
+			<entry class="72" argb="255,0,71,0" value="71" />
+			<entry class="73" argb="255,0,72,0" value="72" />
+			<entry class="74" argb="255,0,73,0" value="73" />
+			<entry class="75" argb="255,0,74,0" value="74" />
+			<entry class="76" argb="255,0,75,0" value="75" />
+			<entry class="77" argb="255,0,76,0" value="76" />
+			<entry class="78" argb="255,0,77,0" value="77" />
+			<entry class="79" argb="255,0,78,0" value="78" />
+			<entry class="80" argb="255,0,79,0" value="79" />
+			<entry class="81" argb="255,0,80,0" value="80" />
+			<entry class="82" argb="255,0,81,0" value="81" />
+			<entry class="83" argb="255,0,82,0" value="82" />
+			<entry class="84" argb="255,0,83,0" value="83" />
+			<entry class="85" argb="255,0,84,0" value="84" />
+			<entry class="86" argb="255,0,85,0" value="85" />
+			<entry class="87" argb="255,0,86,0" value="86" />
+			<entry class="88" argb="255,0,87,0" value="87" />
+			<entry class="89" argb="255,0,88,0" value="88" />
+			<entry class="90" argb="255,0,89,0" value="89" />
+			<entry class="91" argb="255,0,90,0" value="90" />
+			<entry class="92" argb="255,0,91,0" value="91" />
+			<entry class="93" argb="255,0,92,0" value="92" />
+			<entry class="94" argb="255,0,93,0" value="93" />
+			<entry class="95" argb="255,0,94,0" value="94" />
+			<entry class="96" argb="255,0,95,0" value="95" />
+			<entry class="97" argb="255,0,96,0" value="96" />
+			<entry class="98" argb="255,0,97,0" value="97" />
+			<entry class="99" argb="255,0,98,0" value="98" />
+			<entry class="100" argb="255,0,99,0" value="99" />
+			<entry class="101" argb="255,0,100,0" value="100" />
+			<entry class="102" argb="255,0,101,0" value="101" />
+			<entry class="103" argb="255,0,102,0" value="102" />
+			<entry class="104" argb="255,0,103,0" value="103" />
+			<entry class="105" argb="255,0,104,0" value="104" />
+			<entry class="106" argb="255,0,105,0" value="105" />
+			<entry class="107" argb="255,0,106,0" value="106" />
+			<entry class="108" argb="255,0,107,0" value="107" />
+			<entry class="109" argb="255,0,108,0" value="108" />
+			<entry class="110" argb="255,0,109,0" value="109" />
+			<entry class="111" argb="255,0,110,0" value="110" />
+			<entry class="112" argb="255,0,111,0" value="111" />
+			<entry class="113" argb="255,0,112,0" value="112" />
+			<entry class="114" argb="255,0,113,0" value="113" />
+			<entry class="115" argb="255,0,114,0" value="114" />
+			<entry class="116" argb="255,0,115,0" value="115" />
+			<entry class="117" argb="255,0,116,0" value="116" />
+			<entry class="118" argb="255,0,117,0" value="117" />
+			<entry class="119" argb="255,0,118,0" value="118" />
+			<entry class="120" argb="255,0,119,0" value="119" />
+			<entry class="121" argb="255,0,120,0" value="120" />
+			<entry class="122" argb="255,0,121,0" value="121" />
+			<entry class="123" argb="255,0,122,0" value="122" />
+			<entry class="124" argb="255,0,123,0" value="123" />
+			<entry class="125" argb="255,0,124,0" value="124" />
+			<entry class="126" argb="255,0,125,0" value="125" />
+			<entry class="127" argb="255,0,126,0" value="126" />
+			<entry class="128" argb="255,0,127,0" value="127" />
+			<entry class="129" argb="255,0,128,0" value="128" />
+			<entry class="130" argb="255,0,129,0" value="129" />
+			<entry class="131" argb="255,0,130,0" value="130" />
+			<entry class="132" argb="255,0,131,0" value="131" />
+			<entry class="133" argb="255,0,132,0" value="132" />
+			<entry class="134" argb="255,0,133,0" value="133" />
+			<entry class="135" argb="255,0,134,0" value="134" />
+			<entry class="136" argb="255,0,135,0" value="135" />
+			<entry class="137" argb="255,0,136,0" value="136" />
+			<entry class="138" argb="255,0,137,0" value="137" />
+			<entry class="139" argb="255,0,138,0" value="138" />
+			<entry class="140" argb="255,0,139,0" value="139" />
+			<entry class="141" argb="255,0,140,0" value="140" />
+			<entry class="142" argb="255,0,141,0" value="141" />
+			<entry class="143" argb="255,0,142,0" value="142" />
+			<entry class="144" argb="255,0,143,0" value="143" />
+			<entry class="145" argb="255,0,144,0" value="144" />
+			<entry class="146" argb="255,0,145,0" value="145" />
+			<entry class="147" argb="255,0,146,0" value="146" />
+			<entry class="148" argb="255,0,147,0" value="147" />
+			<entry class="149" argb="255,0,148,0" value="148" />
+			<entry class="150" argb="255,0,149,0" value="149" />
+			<entry class="151" argb="255,0,150,0" value="150" />
+			<entry class="152" argb="255,0,151,0" value="151" />
+			<entry class="153" argb="255,0,152,0" value="152" />
+			<entry class="154" argb="255,0,153,0" value="153" />
+			<entry class="155" argb="255,0,154,0" value="154" />
+			<entry class="156" argb="255,0,155,0" value="155" />
+			<entry class="157" argb="255,0,156,0" value="156" />
+			<entry class="158" argb="255,0,157,0" value="157" />
+			<entry class="159" argb="255,0,158,0" value="158" />
+			<entry class="160" argb="255,0,159,0" value="159" />
+			<entry class="161" argb="255,0,160,0" value="160" />
+			<entry class="162" argb="255,0,161,0" value="161" />
+			<entry class="163" argb="255,0,162,0" value="162" />
+			<entry class="164" argb="255,0,163,0" value="163" />
+			<entry class="165" argb="255,0,164,0" value="164" />
+			<entry class="166" argb="255,0,165,0" value="165" />
+			<entry class="167" argb="255,0,166,0" value="166" />
+			<entry class="168" argb="255,0,167,0" value="167" />
+			<entry class="169" argb="255,0,168,0" value="168" />
+			<entry class="170" argb="255,0,169,0" value="169" />
+			<entry class="171" argb="255,0,170,0" value="170" />
+			<entry class="172" argb="255,0,171,0" value="171" />
+			<entry class="173" argb="255,0,172,0" value="172" />
+			<entry class="174" argb="255,0,173,0" value="173" />
+			<entry class="175" argb="255,0,174,0" value="174" />
+			<entry class="176" argb="255,0,175,0" value="175" />
+			<entry class="177" argb="255,0,176,0" value="176" />
+			<entry class="178" argb="255,0,177,0" value="177" />
+			<entry class="179" argb="255,0,178,0" value="178" />
+			<entry class="180" argb="255,0,179,0" value="179" />
+			<entry class="181" argb="255,0,180,0" value="180" />
+			<entry class="182" argb="255,0,181,0" value="181" />
+			<entry class="183" argb="255,0,182,0" value="182" />
+			<entry class="184" argb="255,0,183,0" value="183" />
+			<entry class="185" argb="255,0,184,0" value="184" />
+			<entry class="186" argb="255,0,185,0" value="185" />
+			<entry class="187" argb="255,0,186,0" value="186" />
+			<entry class="188" argb="255,0,187,0" value="187" />
+			<entry class="189" argb="255,0,188,0" value="188" />
+			<entry class="190" argb="255,0,189,0" value="189" />
+			<entry class="191" argb="255,0,190,0" value="190" />
+			<entry class="192" argb="255,0,191,0" value="191" />
+			<entry class="193" argb="255,0,192,0" value="192" />
+			<entry class="194" argb="255,0,193,0" value="193" />
+			<entry class="195" argb="255,0,194,0" value="194" />
+			<entry class="196" argb="255,0,195,0" value="195" />
+			<entry class="197" argb="255,0,196,0" value="196" />
+			<entry class="198" argb="255,0,197,0" value="197" />
+			<entry class="199" argb="255,0,198,0" value="198" />
+			<entry class="200" argb="255,0,199,0" value="199" />
+			<entry class="201" argb="255,0,200,0" value="200" />
+			<entry class="202" argb="255,0,201,0" value="201" />
+			<entry class="203" argb="255,0,202,0" value="202" />
+			<entry class="204" argb="255,0,203,0" value="203" />
+			<entry class="205" argb="255,0,204,0" value="204" />
+			<entry class="206" argb="255,0,205,0" value="205" />
+			<entry class="207" argb="255,0,206,0" value="206" />
+			<entry class="208" argb="255,0,207,0" value="207" />
+			<entry class="209" argb="255,0,208,0" value="208" />
+			<entry class="210" argb="255,0,209,0" value="209" />
+			<entry class="211" argb="255,0,210,0" value="210" />
+			<entry class="212" argb="255,0,211,0" value="211" />
+			<entry class="213" argb="255,0,212,0" value="212" />
+			<entry class="214" argb="255,0,213,0" value="213" />
+			<entry class="215" argb="255,0,214,0" value="214" />
+			<entry class="216" argb="255,0,215,0" value="215" />
+			<entry class="217" argb="255,0,216,0" value="216" />
+			<entry class="218" argb="255,0,217,0" value="217" />
+			<entry class="219" argb="255,0,218,0" value="218" />
+			<entry class="220" argb="255,0,219,0" value="219" />
+			<entry class="221" argb="255,0,220,0" value="220" />
+			<entry class="222" argb="255,0,221,0" value="221" />
+			<entry class="223" argb="255,0,222,0" value="222" />
+			<entry class="224" argb="255,0,223,0" value="223" />
+			<entry class="225" argb="255,0,224,0" value="224" />
+			<entry class="226" argb="255,0,225,0" value="225" />
+			<entry class="227" argb="255,0,226,0" value="226" />
+			<entry class="228" argb="255,0,227,0" value="227" />
+			<entry class="229" argb="255,0,228,0" value="228" />
+			<entry class="230" argb="255,0,229,0" value="229" />
+			<entry class="231" argb="255,0,230,0" value="230" />
+			<entry class="232" argb="255,0,231,0" value="231" />
+			<entry class="233" argb="255,0,232,0" value="232" />
+			<entry class="234" argb="255,0,233,0" value="233" />
+			<entry class="235" argb="255,0,234,0" value="234" />
+			<entry class="236" argb="255,0,235,0" value="235" />
+			<entry class="237" argb="255,0,236,0" value="236" />
+			<entry class="238" argb="255,0,237,0" value="237" />
+			<entry class="239" argb="255,0,238,0" value="238" />
+			<entry class="240" argb="255,0,239,0" value="239" />
+			<entry class="241" argb="255,0,240,0" value="240" />
+			<entry class="242" argb="255,0,241,0" value="241" />
+			<entry class="243" argb="255,0,242,0" value="242" />
+			<entry class="244" argb="255,0,243,0" value="243" />
+			<entry class="245" argb="255,0,244,0" value="244" />
+			<entry class="246" argb="255,0,245,0" value="245" />
+			<entry class="247" argb="255,0,246,0" value="246" />
+			<entry class="248" argb="255,0,247,0" value="247" />
+			<entry class="249" argb="255,0,248,0" value="248" />
+			<entry class="250" argb="255,0,249,0" value="249" />
+			<entry class="251" argb="255,0,250,0" value="250" />
+			<entry class="252" argb="255,0,251,0" value="251" />
+			<entry class="253" argb="255,0,252,0" value="252" />
+			<entry class="254" argb="255,0,253,0" value="253" />
+			<entry class="255" argb="255,0,254,0" value="254" />
+			<entry class="256" argb="255,0,255,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(300,100,0) to HSV(300,100,100) -->
+	<palette name="Deep Magenta  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,1,0,1" value="1" />
+			<entry class="3" argb="255,2,0,2" value="2" />
+			<entry class="4" argb="255,3,0,3" value="3" />
+			<entry class="5" argb="255,4,0,4" value="4" />
+			<entry class="6" argb="255,5,0,5" value="5" />
+			<entry class="7" argb="255,6,0,6" value="6" />
+			<entry class="8" argb="255,7,0,7" value="7" />
+			<entry class="9" argb="255,8,0,8" value="8" />
+			<entry class="10" argb="255,9,0,9" value="9" />
+			<entry class="11" argb="255,10,0,10" value="10" />
+			<entry class="12" argb="255,11,0,11" value="11" />
+			<entry class="13" argb="255,12,0,12" value="12" />
+			<entry class="14" argb="255,13,0,13" value="13" />
+			<entry class="15" argb="255,14,0,14" value="14" />
+			<entry class="16" argb="255,15,0,15" value="15" />
+			<entry class="17" argb="255,16,0,16" value="16" />
+			<entry class="18" argb="255,17,0,17" value="17" />
+			<entry class="19" argb="255,18,0,18" value="18" />
+			<entry class="20" argb="255,19,0,19" value="19" />
+			<entry class="21" argb="255,20,0,20" value="20" />
+			<entry class="22" argb="255,21,0,21" value="21" />
+			<entry class="23" argb="255,22,0,22" value="22" />
+			<entry class="24" argb="255,23,0,23" value="23" />
+			<entry class="25" argb="255,24,0,24" value="24" />
+			<entry class="26" argb="255,25,0,25" value="25" />
+			<entry class="27" argb="255,26,0,26" value="26" />
+			<entry class="28" argb="255,27,0,27" value="27" />
+			<entry class="29" argb="255,28,0,28" value="28" />
+			<entry class="30" argb="255,29,0,29" value="29" />
+			<entry class="31" argb="255,30,0,30" value="30" />
+			<entry class="32" argb="255,31,0,31" value="31" />
+			<entry class="33" argb="255,32,0,32" value="32" />
+			<entry class="34" argb="255,33,0,33" value="33" />
+			<entry class="35" argb="255,34,0,34" value="34" />
+			<entry class="36" argb="255,35,0,35" value="35" />
+			<entry class="37" argb="255,36,0,36" value="36" />
+			<entry class="38" argb="255,37,0,37" value="37" />
+			<entry class="39" argb="255,38,0,38" value="38" />
+			<entry class="40" argb="255,39,0,39" value="39" />
+			<entry class="41" argb="255,40,0,40" value="40" />
+			<entry class="42" argb="255,41,0,41" value="41" />
+			<entry class="43" argb="255,42,0,42" value="42" />
+			<entry class="44" argb="255,43,0,43" value="43" />
+			<entry class="45" argb="255,44,0,44" value="44" />
+			<entry class="46" argb="255,45,0,45" value="45" />
+			<entry class="47" argb="255,46,0,46" value="46" />
+			<entry class="48" argb="255,47,0,47" value="47" />
+			<entry class="49" argb="255,48,0,48" value="48" />
+			<entry class="50" argb="255,49,0,49" value="49" />
+			<entry class="51" argb="255,50,0,50" value="50" />
+			<entry class="52" argb="255,51,0,51" value="51" />
+			<entry class="53" argb="255,52,0,52" value="52" />
+			<entry class="54" argb="255,53,0,53" value="53" />
+			<entry class="55" argb="255,54,0,54" value="54" />
+			<entry class="56" argb="255,55,0,55" value="55" />
+			<entry class="57" argb="255,56,0,56" value="56" />
+			<entry class="58" argb="255,57,0,57" value="57" />
+			<entry class="59" argb="255,58,0,58" value="58" />
+			<entry class="60" argb="255,59,0,59" value="59" />
+			<entry class="61" argb="255,60,0,60" value="60" />
+			<entry class="62" argb="255,61,0,61" value="61" />
+			<entry class="63" argb="255,62,0,62" value="62" />
+			<entry class="64" argb="255,63,0,63" value="63" />
+			<entry class="65" argb="255,64,0,64" value="64" />
+			<entry class="66" argb="255,65,0,65" value="65" />
+			<entry class="67" argb="255,66,0,66" value="66" />
+			<entry class="68" argb="255,67,0,67" value="67" />
+			<entry class="69" argb="255,68,0,68" value="68" />
+			<entry class="70" argb="255,69,0,69" value="69" />
+			<entry class="71" argb="255,70,0,70" value="70" />
+			<entry class="72" argb="255,71,0,71" value="71" />
+			<entry class="73" argb="255,72,0,72" value="72" />
+			<entry class="74" argb="255,73,0,73" value="73" />
+			<entry class="75" argb="255,74,0,74" value="74" />
+			<entry class="76" argb="255,75,0,75" value="75" />
+			<entry class="77" argb="255,76,0,76" value="76" />
+			<entry class="78" argb="255,77,0,77" value="77" />
+			<entry class="79" argb="255,78,0,78" value="78" />
+			<entry class="80" argb="255,79,0,79" value="79" />
+			<entry class="81" argb="255,80,0,80" value="80" />
+			<entry class="82" argb="255,81,0,81" value="81" />
+			<entry class="83" argb="255,82,0,82" value="82" />
+			<entry class="84" argb="255,83,0,83" value="83" />
+			<entry class="85" argb="255,84,0,84" value="84" />
+			<entry class="86" argb="255,85,0,85" value="85" />
+			<entry class="87" argb="255,86,0,86" value="86" />
+			<entry class="88" argb="255,87,0,87" value="87" />
+			<entry class="89" argb="255,88,0,88" value="88" />
+			<entry class="90" argb="255,89,0,89" value="89" />
+			<entry class="91" argb="255,90,0,90" value="90" />
+			<entry class="92" argb="255,91,0,91" value="91" />
+			<entry class="93" argb="255,92,0,92" value="92" />
+			<entry class="94" argb="255,93,0,93" value="93" />
+			<entry class="95" argb="255,94,0,94" value="94" />
+			<entry class="96" argb="255,95,0,95" value="95" />
+			<entry class="97" argb="255,96,0,96" value="96" />
+			<entry class="98" argb="255,97,0,97" value="97" />
+			<entry class="99" argb="255,98,0,98" value="98" />
+			<entry class="100" argb="255,99,0,99" value="99" />
+			<entry class="101" argb="255,100,0,100" value="100" />
+			<entry class="102" argb="255,101,0,101" value="101" />
+			<entry class="103" argb="255,102,0,102" value="102" />
+			<entry class="104" argb="255,103,0,103" value="103" />
+			<entry class="105" argb="255,104,0,104" value="104" />
+			<entry class="106" argb="255,105,0,105" value="105" />
+			<entry class="107" argb="255,106,0,106" value="106" />
+			<entry class="108" argb="255,107,0,107" value="107" />
+			<entry class="109" argb="255,108,0,108" value="108" />
+			<entry class="110" argb="255,109,0,109" value="109" />
+			<entry class="111" argb="255,110,0,110" value="110" />
+			<entry class="112" argb="255,111,0,111" value="111" />
+			<entry class="113" argb="255,112,0,112" value="112" />
+			<entry class="114" argb="255,113,0,113" value="113" />
+			<entry class="115" argb="255,114,0,114" value="114" />
+			<entry class="116" argb="255,115,0,115" value="115" />
+			<entry class="117" argb="255,116,0,116" value="116" />
+			<entry class="118" argb="255,117,0,117" value="117" />
+			<entry class="119" argb="255,118,0,118" value="118" />
+			<entry class="120" argb="255,119,0,119" value="119" />
+			<entry class="121" argb="255,120,0,120" value="120" />
+			<entry class="122" argb="255,121,0,121" value="121" />
+			<entry class="123" argb="255,122,0,122" value="122" />
+			<entry class="124" argb="255,123,0,123" value="123" />
+			<entry class="125" argb="255,124,0,124" value="124" />
+			<entry class="126" argb="255,125,0,125" value="125" />
+			<entry class="127" argb="255,126,0,126" value="126" />
+			<entry class="128" argb="255,127,0,127" value="127" />
+			<entry class="129" argb="255,128,0,128" value="128" />
+			<entry class="130" argb="255,129,0,129" value="129" />
+			<entry class="131" argb="255,130,0,130" value="130" />
+			<entry class="132" argb="255,131,0,131" value="131" />
+			<entry class="133" argb="255,132,0,132" value="132" />
+			<entry class="134" argb="255,133,0,133" value="133" />
+			<entry class="135" argb="255,134,0,134" value="134" />
+			<entry class="136" argb="255,135,0,135" value="135" />
+			<entry class="137" argb="255,136,0,136" value="136" />
+			<entry class="138" argb="255,137,0,137" value="137" />
+			<entry class="139" argb="255,138,0,138" value="138" />
+			<entry class="140" argb="255,139,0,139" value="139" />
+			<entry class="141" argb="255,140,0,140" value="140" />
+			<entry class="142" argb="255,141,0,141" value="141" />
+			<entry class="143" argb="255,142,0,142" value="142" />
+			<entry class="144" argb="255,143,0,143" value="143" />
+			<entry class="145" argb="255,144,0,144" value="144" />
+			<entry class="146" argb="255,145,0,145" value="145" />
+			<entry class="147" argb="255,146,0,146" value="146" />
+			<entry class="148" argb="255,147,0,147" value="147" />
+			<entry class="149" argb="255,148,0,148" value="148" />
+			<entry class="150" argb="255,149,0,149" value="149" />
+			<entry class="151" argb="255,150,0,150" value="150" />
+			<entry class="152" argb="255,151,0,151" value="151" />
+			<entry class="153" argb="255,152,0,152" value="152" />
+			<entry class="154" argb="255,153,0,153" value="153" />
+			<entry class="155" argb="255,154,0,154" value="154" />
+			<entry class="156" argb="255,155,0,155" value="155" />
+			<entry class="157" argb="255,156,0,156" value="156" />
+			<entry class="158" argb="255,157,0,157" value="157" />
+			<entry class="159" argb="255,158,0,158" value="158" />
+			<entry class="160" argb="255,159,0,159" value="159" />
+			<entry class="161" argb="255,160,0,160" value="160" />
+			<entry class="162" argb="255,161,0,161" value="161" />
+			<entry class="163" argb="255,162,0,162" value="162" />
+			<entry class="164" argb="255,163,0,163" value="163" />
+			<entry class="165" argb="255,164,0,164" value="164" />
+			<entry class="166" argb="255,165,0,165" value="165" />
+			<entry class="167" argb="255,166,0,166" value="166" />
+			<entry class="168" argb="255,167,0,167" value="167" />
+			<entry class="169" argb="255,168,0,168" value="168" />
+			<entry class="170" argb="255,169,0,169" value="169" />
+			<entry class="171" argb="255,170,0,170" value="170" />
+			<entry class="172" argb="255,171,0,171" value="171" />
+			<entry class="173" argb="255,172,0,172" value="172" />
+			<entry class="174" argb="255,173,0,173" value="173" />
+			<entry class="175" argb="255,174,0,174" value="174" />
+			<entry class="176" argb="255,175,0,175" value="175" />
+			<entry class="177" argb="255,176,0,176" value="176" />
+			<entry class="178" argb="255,177,0,177" value="177" />
+			<entry class="179" argb="255,178,0,178" value="178" />
+			<entry class="180" argb="255,179,0,179" value="179" />
+			<entry class="181" argb="255,180,0,180" value="180" />
+			<entry class="182" argb="255,181,0,181" value="181" />
+			<entry class="183" argb="255,182,0,182" value="182" />
+			<entry class="184" argb="255,183,0,183" value="183" />
+			<entry class="185" argb="255,184,0,184" value="184" />
+			<entry class="186" argb="255,185,0,185" value="185" />
+			<entry class="187" argb="255,186,0,186" value="186" />
+			<entry class="188" argb="255,187,0,187" value="187" />
+			<entry class="189" argb="255,188,0,188" value="188" />
+			<entry class="190" argb="255,189,0,189" value="189" />
+			<entry class="191" argb="255,190,0,190" value="190" />
+			<entry class="192" argb="255,191,0,191" value="191" />
+			<entry class="193" argb="255,192,0,192" value="192" />
+			<entry class="194" argb="255,193,0,193" value="193" />
+			<entry class="195" argb="255,194,0,194" value="194" />
+			<entry class="196" argb="255,195,0,195" value="195" />
+			<entry class="197" argb="255,196,0,196" value="196" />
+			<entry class="198" argb="255,197,0,197" value="197" />
+			<entry class="199" argb="255,198,0,198" value="198" />
+			<entry class="200" argb="255,199,0,199" value="199" />
+			<entry class="201" argb="255,200,0,200" value="200" />
+			<entry class="202" argb="255,201,0,201" value="201" />
+			<entry class="203" argb="255,202,0,202" value="202" />
+			<entry class="204" argb="255,203,0,203" value="203" />
+			<entry class="205" argb="255,204,0,204" value="204" />
+			<entry class="206" argb="255,205,0,205" value="205" />
+			<entry class="207" argb="255,206,0,206" value="206" />
+			<entry class="208" argb="255,207,0,207" value="207" />
+			<entry class="209" argb="255,208,0,208" value="208" />
+			<entry class="210" argb="255,209,0,209" value="209" />
+			<entry class="211" argb="255,210,0,210" value="210" />
+			<entry class="212" argb="255,211,0,211" value="211" />
+			<entry class="213" argb="255,212,0,212" value="212" />
+			<entry class="214" argb="255,213,0,213" value="213" />
+			<entry class="215" argb="255,214,0,214" value="214" />
+			<entry class="216" argb="255,215,0,215" value="215" />
+			<entry class="217" argb="255,216,0,216" value="216" />
+			<entry class="218" argb="255,217,0,217" value="217" />
+			<entry class="219" argb="255,218,0,218" value="218" />
+			<entry class="220" argb="255,219,0,219" value="219" />
+			<entry class="221" argb="255,220,0,220" value="220" />
+			<entry class="222" argb="255,221,0,221" value="221" />
+			<entry class="223" argb="255,222,0,222" value="222" />
+			<entry class="224" argb="255,223,0,223" value="223" />
+			<entry class="225" argb="255,224,0,224" value="224" />
+			<entry class="226" argb="255,225,0,225" value="225" />
+			<entry class="227" argb="255,226,0,226" value="226" />
+			<entry class="228" argb="255,227,0,227" value="227" />
+			<entry class="229" argb="255,228,0,228" value="228" />
+			<entry class="230" argb="255,229,0,229" value="229" />
+			<entry class="231" argb="255,230,0,230" value="230" />
+			<entry class="232" argb="255,231,0,231" value="231" />
+			<entry class="233" argb="255,232,0,232" value="232" />
+			<entry class="234" argb="255,233,0,233" value="233" />
+			<entry class="235" argb="255,234,0,234" value="234" />
+			<entry class="236" argb="255,235,0,235" value="235" />
+			<entry class="237" argb="255,236,0,236" value="236" />
+			<entry class="238" argb="255,237,0,237" value="237" />
+			<entry class="239" argb="255,238,0,238" value="238" />
+			<entry class="240" argb="255,239,0,239" value="239" />
+			<entry class="241" argb="255,240,0,240" value="240" />
+			<entry class="242" argb="255,241,0,241" value="241" />
+			<entry class="243" argb="255,242,0,242" value="242" />
+			<entry class="244" argb="255,243,0,243" value="243" />
+			<entry class="245" argb="255,244,0,244" value="244" />
+			<entry class="246" argb="255,245,0,245" value="245" />
+			<entry class="247" argb="255,246,0,246" value="246" />
+			<entry class="248" argb="255,247,0,247" value="247" />
+			<entry class="249" argb="255,248,0,248" value="248" />
+			<entry class="250" argb="255,249,0,249" value="249" />
+			<entry class="251" argb="255,250,0,250" value="250" />
+			<entry class="252" argb="255,251,0,251" value="251" />
+			<entry class="253" argb="255,252,0,252" value="252" />
+			<entry class="254" argb="255,253,0,253" value="253" />
+			<entry class="255" argb="255,254,0,254" value="254" />
+			<entry class="256" argb="255,255,0,255" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(30,100,100) to HSV(30,100,0) -->
+	<palette name="Deep Orange  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,127,0" value="0" />
+			<entry class="2" argb="255,254,127,0" value="1" />
+			<entry class="3" argb="255,253,126,0" value="2" />
+			<entry class="4" argb="255,252,126,0" value="3" />
+			<entry class="5" argb="255,251,125,0" value="4" />
+			<entry class="6" argb="255,250,125,0" value="5" />
+			<entry class="7" argb="255,249,124,0" value="6" />
+			<entry class="8" argb="255,248,124,0" value="7" />
+			<entry class="9" argb="255,247,123,0" value="8" />
+			<entry class="10" argb="255,246,123,0" value="9" />
+			<entry class="11" argb="255,245,122,0" value="10" />
+			<entry class="12" argb="255,244,122,0" value="11" />
+			<entry class="13" argb="255,243,121,0" value="12" />
+			<entry class="14" argb="255,242,121,0" value="13" />
+			<entry class="15" argb="255,241,120,0" value="14" />
+			<entry class="16" argb="255,240,120,0" value="15" />
+			<entry class="17" argb="255,239,119,0" value="16" />
+			<entry class="18" argb="255,238,119,0" value="17" />
+			<entry class="19" argb="255,237,118,0" value="18" />
+			<entry class="20" argb="255,236,118,0" value="19" />
+			<entry class="21" argb="255,235,117,0" value="20" />
+			<entry class="22" argb="255,234,117,0" value="21" />
+			<entry class="23" argb="255,233,116,0" value="22" />
+			<entry class="24" argb="255,232,116,0" value="23" />
+			<entry class="25" argb="255,231,115,0" value="24" />
+			<entry class="26" argb="255,230,115,0" value="25" />
+			<entry class="27" argb="255,229,114,0" value="26" />
+			<entry class="28" argb="255,228,114,0" value="27" />
+			<entry class="29" argb="255,227,113,0" value="28" />
+			<entry class="30" argb="255,226,113,0" value="29" />
+			<entry class="31" argb="255,225,112,0" value="30" />
+			<entry class="32" argb="255,224,112,0" value="31" />
+			<entry class="33" argb="255,223,111,0" value="32" />
+			<entry class="34" argb="255,222,111,0" value="33" />
+			<entry class="35" argb="255,221,110,0" value="34" />
+			<entry class="36" argb="255,220,110,0" value="35" />
+			<entry class="37" argb="255,219,109,0" value="36" />
+			<entry class="38" argb="255,218,109,0" value="37" />
+			<entry class="39" argb="255,217,108,0" value="38" />
+			<entry class="40" argb="255,216,108,0" value="39" />
+			<entry class="41" argb="255,215,107,0" value="40" />
+			<entry class="42" argb="255,214,107,0" value="41" />
+			<entry class="43" argb="255,213,106,0" value="42" />
+			<entry class="44" argb="255,212,106,0" value="43" />
+			<entry class="45" argb="255,211,105,0" value="44" />
+			<entry class="46" argb="255,210,105,0" value="45" />
+			<entry class="47" argb="255,209,104,0" value="46" />
+			<entry class="48" argb="255,208,104,0" value="47" />
+			<entry class="49" argb="255,207,103,0" value="48" />
+			<entry class="50" argb="255,206,103,0" value="49" />
+			<entry class="51" argb="255,205,102,0" value="50" />
+			<entry class="52" argb="255,204,102,0" value="51" />
+			<entry class="53" argb="255,203,101,0" value="52" />
+			<entry class="54" argb="255,202,101,0" value="53" />
+			<entry class="55" argb="255,201,100,0" value="54" />
+			<entry class="56" argb="255,200,100,0" value="55" />
+			<entry class="57" argb="255,199,99,0" value="56" />
+			<entry class="58" argb="255,198,99,0" value="57" />
+			<entry class="59" argb="255,197,98,0" value="58" />
+			<entry class="60" argb="255,196,98,0" value="59" />
+			<entry class="61" argb="255,195,97,0" value="60" />
+			<entry class="62" argb="255,194,97,0" value="61" />
+			<entry class="63" argb="255,193,96,0" value="62" />
+			<entry class="64" argb="255,192,96,0" value="63" />
+			<entry class="65" argb="255,191,95,0" value="64" />
+			<entry class="66" argb="255,190,95,0" value="65" />
+			<entry class="67" argb="255,189,94,0" value="66" />
+			<entry class="68" argb="255,188,94,0" value="67" />
+			<entry class="69" argb="255,187,93,0" value="68" />
+			<entry class="70" argb="255,186,93,0" value="69" />
+			<entry class="71" argb="255,185,92,0" value="70" />
+			<entry class="72" argb="255,184,92,0" value="71" />
+			<entry class="73" argb="255,183,91,0" value="72" />
+			<entry class="74" argb="255,182,91,0" value="73" />
+			<entry class="75" argb="255,181,90,0" value="74" />
+			<entry class="76" argb="255,180,90,0" value="75" />
+			<entry class="77" argb="255,179,89,0" value="76" />
+			<entry class="78" argb="255,178,89,0" value="77" />
+			<entry class="79" argb="255,177,88,0" value="78" />
+			<entry class="80" argb="255,176,88,0" value="79" />
+			<entry class="81" argb="255,175,87,0" value="80" />
+			<entry class="82" argb="255,174,87,0" value="81" />
+			<entry class="83" argb="255,173,86,0" value="82" />
+			<entry class="84" argb="255,172,86,0" value="83" />
+			<entry class="85" argb="255,171,85,0" value="84" />
+			<entry class="86" argb="255,170,85,0" value="85" />
+			<entry class="87" argb="255,169,84,0" value="86" />
+			<entry class="88" argb="255,168,84,0" value="87" />
+			<entry class="89" argb="255,167,83,0" value="88" />
+			<entry class="90" argb="255,166,83,0" value="89" />
+			<entry class="91" argb="255,165,82,0" value="90" />
+			<entry class="92" argb="255,164,82,0" value="91" />
+			<entry class="93" argb="255,163,81,0" value="92" />
+			<entry class="94" argb="255,162,81,0" value="93" />
+			<entry class="95" argb="255,161,80,0" value="94" />
+			<entry class="96" argb="255,160,80,0" value="95" />
+			<entry class="97" argb="255,159,79,0" value="96" />
+			<entry class="98" argb="255,158,79,0" value="97" />
+			<entry class="99" argb="255,157,78,0" value="98" />
+			<entry class="100" argb="255,156,78,0" value="99" />
+			<entry class="101" argb="255,155,77,0" value="100" />
+			<entry class="102" argb="255,154,77,0" value="101" />
+			<entry class="103" argb="255,153,76,0" value="102" />
+			<entry class="104" argb="255,152,76,0" value="103" />
+			<entry class="105" argb="255,151,75,0" value="104" />
+			<entry class="106" argb="255,150,75,0" value="105" />
+			<entry class="107" argb="255,149,74,0" value="106" />
+			<entry class="108" argb="255,148,74,0" value="107" />
+			<entry class="109" argb="255,147,73,0" value="108" />
+			<entry class="110" argb="255,146,73,0" value="109" />
+			<entry class="111" argb="255,145,72,0" value="110" />
+			<entry class="112" argb="255,144,72,0" value="111" />
+			<entry class="113" argb="255,143,71,0" value="112" />
+			<entry class="114" argb="255,142,71,0" value="113" />
+			<entry class="115" argb="255,141,70,0" value="114" />
+			<entry class="116" argb="255,140,70,0" value="115" />
+			<entry class="117" argb="255,139,69,0" value="116" />
+			<entry class="118" argb="255,138,69,0" value="117" />
+			<entry class="119" argb="255,137,68,0" value="118" />
+			<entry class="120" argb="255,136,68,0" value="119" />
+			<entry class="121" argb="255,135,67,0" value="120" />
+			<entry class="122" argb="255,134,67,0" value="121" />
+			<entry class="123" argb="255,133,66,0" value="122" />
+			<entry class="124" argb="255,132,66,0" value="123" />
+			<entry class="125" argb="255,131,65,0" value="124" />
+			<entry class="126" argb="255,130,65,0" value="125" />
+			<entry class="127" argb="255,129,64,0" value="126" />
+			<entry class="128" argb="255,128,64,0" value="127" />
+			<entry class="129" argb="255,127,63,0" value="128" />
+			<entry class="130" argb="255,126,63,0" value="129" />
+			<entry class="131" argb="255,125,62,0" value="130" />
+			<entry class="132" argb="255,124,62,0" value="131" />
+			<entry class="133" argb="255,123,61,0" value="132" />
+			<entry class="134" argb="255,122,61,0" value="133" />
+			<entry class="135" argb="255,121,60,0" value="134" />
+			<entry class="136" argb="255,120,60,0" value="135" />
+			<entry class="137" argb="255,119,59,0" value="136" />
+			<entry class="138" argb="255,118,59,0" value="137" />
+			<entry class="139" argb="255,117,58,0" value="138" />
+			<entry class="140" argb="255,116,58,0" value="139" />
+			<entry class="141" argb="255,115,57,0" value="140" />
+			<entry class="142" argb="255,114,57,0" value="141" />
+			<entry class="143" argb="255,113,56,0" value="142" />
+			<entry class="144" argb="255,112,56,0" value="143" />
+			<entry class="145" argb="255,111,55,0" value="144" />
+			<entry class="146" argb="255,110,55,0" value="145" />
+			<entry class="147" argb="255,109,54,0" value="146" />
+			<entry class="148" argb="255,108,54,0" value="147" />
+			<entry class="149" argb="255,107,53,0" value="148" />
+			<entry class="150" argb="255,106,53,0" value="149" />
+			<entry class="151" argb="255,105,52,0" value="150" />
+			<entry class="152" argb="255,104,52,0" value="151" />
+			<entry class="153" argb="255,103,51,0" value="152" />
+			<entry class="154" argb="255,102,51,0" value="153" />
+			<entry class="155" argb="255,101,50,0" value="154" />
+			<entry class="156" argb="255,100,50,0" value="155" />
+			<entry class="157" argb="255,99,49,0" value="156" />
+			<entry class="158" argb="255,98,49,0" value="157" />
+			<entry class="159" argb="255,97,48,0" value="158" />
+			<entry class="160" argb="255,96,48,0" value="159" />
+			<entry class="161" argb="255,95,47,0" value="160" />
+			<entry class="162" argb="255,94,47,0" value="161" />
+			<entry class="163" argb="255,93,46,0" value="162" />
+			<entry class="164" argb="255,92,46,0" value="163" />
+			<entry class="165" argb="255,91,45,0" value="164" />
+			<entry class="166" argb="255,90,45,0" value="165" />
+			<entry class="167" argb="255,89,44,0" value="166" />
+			<entry class="168" argb="255,88,44,0" value="167" />
+			<entry class="169" argb="255,87,43,0" value="168" />
+			<entry class="170" argb="255,86,43,0" value="169" />
+			<entry class="171" argb="255,85,42,0" value="170" />
+			<entry class="172" argb="255,84,42,0" value="171" />
+			<entry class="173" argb="255,83,41,0" value="172" />
+			<entry class="174" argb="255,82,41,0" value="173" />
+			<entry class="175" argb="255,81,40,0" value="174" />
+			<entry class="176" argb="255,80,40,0" value="175" />
+			<entry class="177" argb="255,79,39,0" value="176" />
+			<entry class="178" argb="255,78,39,0" value="177" />
+			<entry class="179" argb="255,77,38,0" value="178" />
+			<entry class="180" argb="255,76,38,0" value="179" />
+			<entry class="181" argb="255,75,37,0" value="180" />
+			<entry class="182" argb="255,74,37,0" value="181" />
+			<entry class="183" argb="255,73,36,0" value="182" />
+			<entry class="184" argb="255,72,36,0" value="183" />
+			<entry class="185" argb="255,71,35,0" value="184" />
+			<entry class="186" argb="255,70,35,0" value="185" />
+			<entry class="187" argb="255,69,34,0" value="186" />
+			<entry class="188" argb="255,68,34,0" value="187" />
+			<entry class="189" argb="255,67,33,0" value="188" />
+			<entry class="190" argb="255,66,33,0" value="189" />
+			<entry class="191" argb="255,65,32,0" value="190" />
+			<entry class="192" argb="255,64,32,0" value="191" />
+			<entry class="193" argb="255,63,31,0" value="192" />
+			<entry class="194" argb="255,62,31,0" value="193" />
+			<entry class="195" argb="255,61,30,0" value="194" />
+			<entry class="196" argb="255,60,30,0" value="195" />
+			<entry class="197" argb="255,59,29,0" value="196" />
+			<entry class="198" argb="255,58,29,0" value="197" />
+			<entry class="199" argb="255,57,28,0" value="198" />
+			<entry class="200" argb="255,56,28,0" value="199" />
+			<entry class="201" argb="255,55,27,0" value="200" />
+			<entry class="202" argb="255,54,27,0" value="201" />
+			<entry class="203" argb="255,53,26,0" value="202" />
+			<entry class="204" argb="255,52,26,0" value="203" />
+			<entry class="205" argb="255,51,25,0" value="204" />
+			<entry class="206" argb="255,50,25,0" value="205" />
+			<entry class="207" argb="255,49,24,0" value="206" />
+			<entry class="208" argb="255,48,24,0" value="207" />
+			<entry class="209" argb="255,47,23,0" value="208" />
+			<entry class="210" argb="255,46,23,0" value="209" />
+			<entry class="211" argb="255,45,22,0" value="210" />
+			<entry class="212" argb="255,44,22,0" value="211" />
+			<entry class="213" argb="255,43,21,0" value="212" />
+			<entry class="214" argb="255,42,21,0" value="213" />
+			<entry class="215" argb="255,41,20,0" value="214" />
+			<entry class="216" argb="255,40,20,0" value="215" />
+			<entry class="217" argb="255,39,19,0" value="216" />
+			<entry class="218" argb="255,38,19,0" value="217" />
+			<entry class="219" argb="255,37,18,0" value="218" />
+			<entry class="220" argb="255,36,18,0" value="219" />
+			<entry class="221" argb="255,35,17,0" value="220" />
+			<entry class="222" argb="255,34,17,0" value="221" />
+			<entry class="223" argb="255,33,16,0" value="222" />
+			<entry class="224" argb="255,32,16,0" value="223" />
+			<entry class="225" argb="255,31,15,0" value="224" />
+			<entry class="226" argb="255,30,15,0" value="225" />
+			<entry class="227" argb="255,29,14,0" value="226" />
+			<entry class="228" argb="255,28,14,0" value="227" />
+			<entry class="229" argb="255,27,13,0" value="228" />
+			<entry class="230" argb="255,26,13,0" value="229" />
+			<entry class="231" argb="255,25,12,0" value="230" />
+			<entry class="232" argb="255,24,12,0" value="231" />
+			<entry class="233" argb="255,23,11,0" value="232" />
+			<entry class="234" argb="255,22,11,0" value="233" />
+			<entry class="235" argb="255,21,10,0" value="234" />
+			<entry class="236" argb="255,20,10,0" value="235" />
+			<entry class="237" argb="255,19,9,0" value="236" />
+			<entry class="238" argb="255,18,9,0" value="237" />
+			<entry class="239" argb="255,17,8,0" value="238" />
+			<entry class="240" argb="255,16,8,0" value="239" />
+			<entry class="241" argb="255,15,7,0" value="240" />
+			<entry class="242" argb="255,14,7,0" value="241" />
+			<entry class="243" argb="255,13,6,0" value="242" />
+			<entry class="244" argb="255,12,6,0" value="243" />
+			<entry class="245" argb="255,11,5,0" value="244" />
+			<entry class="246" argb="255,10,5,0" value="245" />
+			<entry class="247" argb="255,9,4,0" value="246" />
+			<entry class="248" argb="255,8,4,0" value="247" />
+			<entry class="249" argb="255,7,3,0" value="248" />
+			<entry class="250" argb="255,6,3,0" value="249" />
+			<entry class="251" argb="255,5,2,0" value="250" />
+			<entry class="252" argb="255,4,2,0" value="251" />
+			<entry class="253" argb="255,3,1,0" value="252" />
+			<entry class="254" argb="255,2,1,0" value="253" />
+			<entry class="255" argb="255,1,0,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(0,100,0) to HSV(0,100,100) -->
+	<palette name="Deep Red  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,1,0,0" value="1" />
+			<entry class="3" argb="255,2,0,0" value="2" />
+			<entry class="4" argb="255,3,0,0" value="3" />
+			<entry class="5" argb="255,4,0,0" value="4" />
+			<entry class="6" argb="255,5,0,0" value="5" />
+			<entry class="7" argb="255,6,0,0" value="6" />
+			<entry class="8" argb="255,7,0,0" value="7" />
+			<entry class="9" argb="255,8,0,0" value="8" />
+			<entry class="10" argb="255,9,0,0" value="9" />
+			<entry class="11" argb="255,10,0,0" value="10" />
+			<entry class="12" argb="255,11,0,0" value="11" />
+			<entry class="13" argb="255,12,0,0" value="12" />
+			<entry class="14" argb="255,13,0,0" value="13" />
+			<entry class="15" argb="255,14,0,0" value="14" />
+			<entry class="16" argb="255,15,0,0" value="15" />
+			<entry class="17" argb="255,16,0,0" value="16" />
+			<entry class="18" argb="255,17,0,0" value="17" />
+			<entry class="19" argb="255,18,0,0" value="18" />
+			<entry class="20" argb="255,19,0,0" value="19" />
+			<entry class="21" argb="255,20,0,0" value="20" />
+			<entry class="22" argb="255,21,0,0" value="21" />
+			<entry class="23" argb="255,22,0,0" value="22" />
+			<entry class="24" argb="255,23,0,0" value="23" />
+			<entry class="25" argb="255,24,0,0" value="24" />
+			<entry class="26" argb="255,25,0,0" value="25" />
+			<entry class="27" argb="255,26,0,0" value="26" />
+			<entry class="28" argb="255,27,0,0" value="27" />
+			<entry class="29" argb="255,28,0,0" value="28" />
+			<entry class="30" argb="255,29,0,0" value="29" />
+			<entry class="31" argb="255,30,0,0" value="30" />
+			<entry class="32" argb="255,31,0,0" value="31" />
+			<entry class="33" argb="255,32,0,0" value="32" />
+			<entry class="34" argb="255,33,0,0" value="33" />
+			<entry class="35" argb="255,34,0,0" value="34" />
+			<entry class="36" argb="255,35,0,0" value="35" />
+			<entry class="37" argb="255,36,0,0" value="36" />
+			<entry class="38" argb="255,37,0,0" value="37" />
+			<entry class="39" argb="255,38,0,0" value="38" />
+			<entry class="40" argb="255,39,0,0" value="39" />
+			<entry class="41" argb="255,40,0,0" value="40" />
+			<entry class="42" argb="255,41,0,0" value="41" />
+			<entry class="43" argb="255,42,0,0" value="42" />
+			<entry class="44" argb="255,43,0,0" value="43" />
+			<entry class="45" argb="255,44,0,0" value="44" />
+			<entry class="46" argb="255,45,0,0" value="45" />
+			<entry class="47" argb="255,46,0,0" value="46" />
+			<entry class="48" argb="255,47,0,0" value="47" />
+			<entry class="49" argb="255,48,0,0" value="48" />
+			<entry class="50" argb="255,49,0,0" value="49" />
+			<entry class="51" argb="255,50,0,0" value="50" />
+			<entry class="52" argb="255,51,0,0" value="51" />
+			<entry class="53" argb="255,52,0,0" value="52" />
+			<entry class="54" argb="255,53,0,0" value="53" />
+			<entry class="55" argb="255,54,0,0" value="54" />
+			<entry class="56" argb="255,55,0,0" value="55" />
+			<entry class="57" argb="255,56,0,0" value="56" />
+			<entry class="58" argb="255,57,0,0" value="57" />
+			<entry class="59" argb="255,58,0,0" value="58" />
+			<entry class="60" argb="255,59,0,0" value="59" />
+			<entry class="61" argb="255,60,0,0" value="60" />
+			<entry class="62" argb="255,61,0,0" value="61" />
+			<entry class="63" argb="255,62,0,0" value="62" />
+			<entry class="64" argb="255,63,0,0" value="63" />
+			<entry class="65" argb="255,64,0,0" value="64" />
+			<entry class="66" argb="255,65,0,0" value="65" />
+			<entry class="67" argb="255,66,0,0" value="66" />
+			<entry class="68" argb="255,67,0,0" value="67" />
+			<entry class="69" argb="255,68,0,0" value="68" />
+			<entry class="70" argb="255,69,0,0" value="69" />
+			<entry class="71" argb="255,70,0,0" value="70" />
+			<entry class="72" argb="255,71,0,0" value="71" />
+			<entry class="73" argb="255,72,0,0" value="72" />
+			<entry class="74" argb="255,73,0,0" value="73" />
+			<entry class="75" argb="255,74,0,0" value="74" />
+			<entry class="76" argb="255,75,0,0" value="75" />
+			<entry class="77" argb="255,76,0,0" value="76" />
+			<entry class="78" argb="255,77,0,0" value="77" />
+			<entry class="79" argb="255,78,0,0" value="78" />
+			<entry class="80" argb="255,79,0,0" value="79" />
+			<entry class="81" argb="255,80,0,0" value="80" />
+			<entry class="82" argb="255,81,0,0" value="81" />
+			<entry class="83" argb="255,82,0,0" value="82" />
+			<entry class="84" argb="255,83,0,0" value="83" />
+			<entry class="85" argb="255,84,0,0" value="84" />
+			<entry class="86" argb="255,85,0,0" value="85" />
+			<entry class="87" argb="255,86,0,0" value="86" />
+			<entry class="88" argb="255,87,0,0" value="87" />
+			<entry class="89" argb="255,88,0,0" value="88" />
+			<entry class="90" argb="255,89,0,0" value="89" />
+			<entry class="91" argb="255,90,0,0" value="90" />
+			<entry class="92" argb="255,91,0,0" value="91" />
+			<entry class="93" argb="255,92,0,0" value="92" />
+			<entry class="94" argb="255,93,0,0" value="93" />
+			<entry class="95" argb="255,94,0,0" value="94" />
+			<entry class="96" argb="255,95,0,0" value="95" />
+			<entry class="97" argb="255,96,0,0" value="96" />
+			<entry class="98" argb="255,97,0,0" value="97" />
+			<entry class="99" argb="255,98,0,0" value="98" />
+			<entry class="100" argb="255,99,0,0" value="99" />
+			<entry class="101" argb="255,100,0,0" value="100" />
+			<entry class="102" argb="255,101,0,0" value="101" />
+			<entry class="103" argb="255,102,0,0" value="102" />
+			<entry class="104" argb="255,103,0,0" value="103" />
+			<entry class="105" argb="255,104,0,0" value="104" />
+			<entry class="106" argb="255,105,0,0" value="105" />
+			<entry class="107" argb="255,106,0,0" value="106" />
+			<entry class="108" argb="255,107,0,0" value="107" />
+			<entry class="109" argb="255,108,0,0" value="108" />
+			<entry class="110" argb="255,109,0,0" value="109" />
+			<entry class="111" argb="255,110,0,0" value="110" />
+			<entry class="112" argb="255,111,0,0" value="111" />
+			<entry class="113" argb="255,112,0,0" value="112" />
+			<entry class="114" argb="255,113,0,0" value="113" />
+			<entry class="115" argb="255,114,0,0" value="114" />
+			<entry class="116" argb="255,115,0,0" value="115" />
+			<entry class="117" argb="255,116,0,0" value="116" />
+			<entry class="118" argb="255,117,0,0" value="117" />
+			<entry class="119" argb="255,118,0,0" value="118" />
+			<entry class="120" argb="255,119,0,0" value="119" />
+			<entry class="121" argb="255,120,0,0" value="120" />
+			<entry class="122" argb="255,121,0,0" value="121" />
+			<entry class="123" argb="255,122,0,0" value="122" />
+			<entry class="124" argb="255,123,0,0" value="123" />
+			<entry class="125" argb="255,124,0,0" value="124" />
+			<entry class="126" argb="255,125,0,0" value="125" />
+			<entry class="127" argb="255,126,0,0" value="126" />
+			<entry class="128" argb="255,127,0,0" value="127" />
+			<entry class="129" argb="255,128,0,0" value="128" />
+			<entry class="130" argb="255,129,0,0" value="129" />
+			<entry class="131" argb="255,130,0,0" value="130" />
+			<entry class="132" argb="255,131,0,0" value="131" />
+			<entry class="133" argb="255,132,0,0" value="132" />
+			<entry class="134" argb="255,133,0,0" value="133" />
+			<entry class="135" argb="255,134,0,0" value="134" />
+			<entry class="136" argb="255,135,0,0" value="135" />
+			<entry class="137" argb="255,136,0,0" value="136" />
+			<entry class="138" argb="255,137,0,0" value="137" />
+			<entry class="139" argb="255,138,0,0" value="138" />
+			<entry class="140" argb="255,139,0,0" value="139" />
+			<entry class="141" argb="255,140,0,0" value="140" />
+			<entry class="142" argb="255,141,0,0" value="141" />
+			<entry class="143" argb="255,142,0,0" value="142" />
+			<entry class="144" argb="255,143,0,0" value="143" />
+			<entry class="145" argb="255,144,0,0" value="144" />
+			<entry class="146" argb="255,145,0,0" value="145" />
+			<entry class="147" argb="255,146,0,0" value="146" />
+			<entry class="148" argb="255,147,0,0" value="147" />
+			<entry class="149" argb="255,148,0,0" value="148" />
+			<entry class="150" argb="255,149,0,0" value="149" />
+			<entry class="151" argb="255,150,0,0" value="150" />
+			<entry class="152" argb="255,151,0,0" value="151" />
+			<entry class="153" argb="255,152,0,0" value="152" />
+			<entry class="154" argb="255,153,0,0" value="153" />
+			<entry class="155" argb="255,154,0,0" value="154" />
+			<entry class="156" argb="255,155,0,0" value="155" />
+			<entry class="157" argb="255,156,0,0" value="156" />
+			<entry class="158" argb="255,157,0,0" value="157" />
+			<entry class="159" argb="255,158,0,0" value="158" />
+			<entry class="160" argb="255,159,0,0" value="159" />
+			<entry class="161" argb="255,160,0,0" value="160" />
+			<entry class="162" argb="255,161,0,0" value="161" />
+			<entry class="163" argb="255,162,0,0" value="162" />
+			<entry class="164" argb="255,163,0,0" value="163" />
+			<entry class="165" argb="255,164,0,0" value="164" />
+			<entry class="166" argb="255,165,0,0" value="165" />
+			<entry class="167" argb="255,166,0,0" value="166" />
+			<entry class="168" argb="255,167,0,0" value="167" />
+			<entry class="169" argb="255,168,0,0" value="168" />
+			<entry class="170" argb="255,169,0,0" value="169" />
+			<entry class="171" argb="255,170,0,0" value="170" />
+			<entry class="172" argb="255,171,0,0" value="171" />
+			<entry class="173" argb="255,172,0,0" value="172" />
+			<entry class="174" argb="255,173,0,0" value="173" />
+			<entry class="175" argb="255,174,0,0" value="174" />
+			<entry class="176" argb="255,175,0,0" value="175" />
+			<entry class="177" argb="255,176,0,0" value="176" />
+			<entry class="178" argb="255,177,0,0" value="177" />
+			<entry class="179" argb="255,178,0,0" value="178" />
+			<entry class="180" argb="255,179,0,0" value="179" />
+			<entry class="181" argb="255,180,0,0" value="180" />
+			<entry class="182" argb="255,181,0,0" value="181" />
+			<entry class="183" argb="255,182,0,0" value="182" />
+			<entry class="184" argb="255,183,0,0" value="183" />
+			<entry class="185" argb="255,184,0,0" value="184" />
+			<entry class="186" argb="255,185,0,0" value="185" />
+			<entry class="187" argb="255,186,0,0" value="186" />
+			<entry class="188" argb="255,187,0,0" value="187" />
+			<entry class="189" argb="255,188,0,0" value="188" />
+			<entry class="190" argb="255,189,0,0" value="189" />
+			<entry class="191" argb="255,190,0,0" value="190" />
+			<entry class="192" argb="255,191,0,0" value="191" />
+			<entry class="193" argb="255,192,0,0" value="192" />
+			<entry class="194" argb="255,193,0,0" value="193" />
+			<entry class="195" argb="255,194,0,0" value="194" />
+			<entry class="196" argb="255,195,0,0" value="195" />
+			<entry class="197" argb="255,196,0,0" value="196" />
+			<entry class="198" argb="255,197,0,0" value="197" />
+			<entry class="199" argb="255,198,0,0" value="198" />
+			<entry class="200" argb="255,199,0,0" value="199" />
+			<entry class="201" argb="255,200,0,0" value="200" />
+			<entry class="202" argb="255,201,0,0" value="201" />
+			<entry class="203" argb="255,202,0,0" value="202" />
+			<entry class="204" argb="255,203,0,0" value="203" />
+			<entry class="205" argb="255,204,0,0" value="204" />
+			<entry class="206" argb="255,205,0,0" value="205" />
+			<entry class="207" argb="255,206,0,0" value="206" />
+			<entry class="208" argb="255,207,0,0" value="207" />
+			<entry class="209" argb="255,208,0,0" value="208" />
+			<entry class="210" argb="255,209,0,0" value="209" />
+			<entry class="211" argb="255,210,0,0" value="210" />
+			<entry class="212" argb="255,211,0,0" value="211" />
+			<entry class="213" argb="255,212,0,0" value="212" />
+			<entry class="214" argb="255,213,0,0" value="213" />
+			<entry class="215" argb="255,214,0,0" value="214" />
+			<entry class="216" argb="255,215,0,0" value="215" />
+			<entry class="217" argb="255,216,0,0" value="216" />
+			<entry class="218" argb="255,217,0,0" value="217" />
+			<entry class="219" argb="255,218,0,0" value="218" />
+			<entry class="220" argb="255,219,0,0" value="219" />
+			<entry class="221" argb="255,220,0,0" value="220" />
+			<entry class="222" argb="255,221,0,0" value="221" />
+			<entry class="223" argb="255,222,0,0" value="222" />
+			<entry class="224" argb="255,223,0,0" value="223" />
+			<entry class="225" argb="255,224,0,0" value="224" />
+			<entry class="226" argb="255,225,0,0" value="225" />
+			<entry class="227" argb="255,226,0,0" value="226" />
+			<entry class="228" argb="255,227,0,0" value="227" />
+			<entry class="229" argb="255,228,0,0" value="228" />
+			<entry class="230" argb="255,229,0,0" value="229" />
+			<entry class="231" argb="255,230,0,0" value="230" />
+			<entry class="232" argb="255,231,0,0" value="231" />
+			<entry class="233" argb="255,232,0,0" value="232" />
+			<entry class="234" argb="255,233,0,0" value="233" />
+			<entry class="235" argb="255,234,0,0" value="234" />
+			<entry class="236" argb="255,235,0,0" value="235" />
+			<entry class="237" argb="255,236,0,0" value="236" />
+			<entry class="238" argb="255,237,0,0" value="237" />
+			<entry class="239" argb="255,238,0,0" value="238" />
+			<entry class="240" argb="255,239,0,0" value="239" />
+			<entry class="241" argb="255,240,0,0" value="240" />
+			<entry class="242" argb="255,241,0,0" value="241" />
+			<entry class="243" argb="255,242,0,0" value="242" />
+			<entry class="244" argb="255,243,0,0" value="243" />
+			<entry class="245" argb="255,244,0,0" value="244" />
+			<entry class="246" argb="255,245,0,0" value="245" />
+			<entry class="247" argb="255,246,0,0" value="246" />
+			<entry class="248" argb="255,247,0,0" value="247" />
+			<entry class="249" argb="255,248,0,0" value="248" />
+			<entry class="250" argb="255,249,0,0" value="249" />
+			<entry class="251" argb="255,250,0,0" value="250" />
+			<entry class="252" argb="255,251,0,0" value="251" />
+			<entry class="253" argb="255,252,0,0" value="252" />
+			<entry class="254" argb="255,253,0,0" value="253" />
+			<entry class="255" argb="255,254,0,0" value="254" />
+			<entry class="256" argb="255,255,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(330,100,100) to HSV(330,100,0) -->
+	<palette name="Deep Rose  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,0,127" value="0" />
+			<entry class="2" argb="255,254,0,127" value="1" />
+			<entry class="3" argb="255,253,0,126" value="2" />
+			<entry class="4" argb="255,252,0,126" value="3" />
+			<entry class="5" argb="255,251,0,125" value="4" />
+			<entry class="6" argb="255,250,0,125" value="5" />
+			<entry class="7" argb="255,249,0,124" value="6" />
+			<entry class="8" argb="255,248,0,124" value="7" />
+			<entry class="9" argb="255,247,0,123" value="8" />
+			<entry class="10" argb="255,246,0,123" value="9" />
+			<entry class="11" argb="255,245,0,122" value="10" />
+			<entry class="12" argb="255,244,0,122" value="11" />
+			<entry class="13" argb="255,243,0,121" value="12" />
+			<entry class="14" argb="255,242,0,121" value="13" />
+			<entry class="15" argb="255,241,0,120" value="14" />
+			<entry class="16" argb="255,240,0,120" value="15" />
+			<entry class="17" argb="255,239,0,119" value="16" />
+			<entry class="18" argb="255,238,0,119" value="17" />
+			<entry class="19" argb="255,237,0,118" value="18" />
+			<entry class="20" argb="255,236,0,118" value="19" />
+			<entry class="21" argb="255,235,0,117" value="20" />
+			<entry class="22" argb="255,234,0,117" value="21" />
+			<entry class="23" argb="255,233,0,116" value="22" />
+			<entry class="24" argb="255,232,0,116" value="23" />
+			<entry class="25" argb="255,231,0,115" value="24" />
+			<entry class="26" argb="255,230,0,115" value="25" />
+			<entry class="27" argb="255,229,0,114" value="26" />
+			<entry class="28" argb="255,228,0,114" value="27" />
+			<entry class="29" argb="255,227,0,113" value="28" />
+			<entry class="30" argb="255,226,0,113" value="29" />
+			<entry class="31" argb="255,225,0,112" value="30" />
+			<entry class="32" argb="255,224,0,112" value="31" />
+			<entry class="33" argb="255,223,0,111" value="32" />
+			<entry class="34" argb="255,222,0,111" value="33" />
+			<entry class="35" argb="255,221,0,110" value="34" />
+			<entry class="36" argb="255,220,0,110" value="35" />
+			<entry class="37" argb="255,219,0,109" value="36" />
+			<entry class="38" argb="255,218,0,109" value="37" />
+			<entry class="39" argb="255,217,0,108" value="38" />
+			<entry class="40" argb="255,216,0,108" value="39" />
+			<entry class="41" argb="255,215,0,107" value="40" />
+			<entry class="42" argb="255,214,0,107" value="41" />
+			<entry class="43" argb="255,213,0,106" value="42" />
+			<entry class="44" argb="255,212,0,106" value="43" />
+			<entry class="45" argb="255,211,0,105" value="44" />
+			<entry class="46" argb="255,210,0,105" value="45" />
+			<entry class="47" argb="255,209,0,104" value="46" />
+			<entry class="48" argb="255,208,0,104" value="47" />
+			<entry class="49" argb="255,207,0,103" value="48" />
+			<entry class="50" argb="255,206,0,103" value="49" />
+			<entry class="51" argb="255,205,0,102" value="50" />
+			<entry class="52" argb="255,204,0,102" value="51" />
+			<entry class="53" argb="255,203,0,101" value="52" />
+			<entry class="54" argb="255,202,0,101" value="53" />
+			<entry class="55" argb="255,201,0,100" value="54" />
+			<entry class="56" argb="255,200,0,100" value="55" />
+			<entry class="57" argb="255,199,0,99" value="56" />
+			<entry class="58" argb="255,198,0,99" value="57" />
+			<entry class="59" argb="255,197,0,98" value="58" />
+			<entry class="60" argb="255,196,0,98" value="59" />
+			<entry class="61" argb="255,195,0,97" value="60" />
+			<entry class="62" argb="255,194,0,97" value="61" />
+			<entry class="63" argb="255,193,0,96" value="62" />
+			<entry class="64" argb="255,192,0,96" value="63" />
+			<entry class="65" argb="255,191,0,95" value="64" />
+			<entry class="66" argb="255,190,0,95" value="65" />
+			<entry class="67" argb="255,189,0,94" value="66" />
+			<entry class="68" argb="255,188,0,94" value="67" />
+			<entry class="69" argb="255,187,0,93" value="68" />
+			<entry class="70" argb="255,186,0,93" value="69" />
+			<entry class="71" argb="255,185,0,92" value="70" />
+			<entry class="72" argb="255,184,0,92" value="71" />
+			<entry class="73" argb="255,183,0,91" value="72" />
+			<entry class="74" argb="255,182,0,91" value="73" />
+			<entry class="75" argb="255,181,0,90" value="74" />
+			<entry class="76" argb="255,180,0,90" value="75" />
+			<entry class="77" argb="255,179,0,89" value="76" />
+			<entry class="78" argb="255,178,0,89" value="77" />
+			<entry class="79" argb="255,177,0,88" value="78" />
+			<entry class="80" argb="255,176,0,88" value="79" />
+			<entry class="81" argb="255,175,0,87" value="80" />
+			<entry class="82" argb="255,174,0,87" value="81" />
+			<entry class="83" argb="255,173,0,86" value="82" />
+			<entry class="84" argb="255,172,0,86" value="83" />
+			<entry class="85" argb="255,171,0,85" value="84" />
+			<entry class="86" argb="255,170,0,85" value="85" />
+			<entry class="87" argb="255,169,0,84" value="86" />
+			<entry class="88" argb="255,168,0,84" value="87" />
+			<entry class="89" argb="255,167,0,83" value="88" />
+			<entry class="90" argb="255,166,0,83" value="89" />
+			<entry class="91" argb="255,165,0,82" value="90" />
+			<entry class="92" argb="255,164,0,82" value="91" />
+			<entry class="93" argb="255,163,0,81" value="92" />
+			<entry class="94" argb="255,162,0,81" value="93" />
+			<entry class="95" argb="255,161,0,80" value="94" />
+			<entry class="96" argb="255,160,0,80" value="95" />
+			<entry class="97" argb="255,159,0,79" value="96" />
+			<entry class="98" argb="255,158,0,79" value="97" />
+			<entry class="99" argb="255,157,0,78" value="98" />
+			<entry class="100" argb="255,156,0,78" value="99" />
+			<entry class="101" argb="255,155,0,77" value="100" />
+			<entry class="102" argb="255,154,0,77" value="101" />
+			<entry class="103" argb="255,153,0,76" value="102" />
+			<entry class="104" argb="255,152,0,76" value="103" />
+			<entry class="105" argb="255,151,0,75" value="104" />
+			<entry class="106" argb="255,150,0,75" value="105" />
+			<entry class="107" argb="255,149,0,74" value="106" />
+			<entry class="108" argb="255,148,0,74" value="107" />
+			<entry class="109" argb="255,147,0,73" value="108" />
+			<entry class="110" argb="255,146,0,73" value="109" />
+			<entry class="111" argb="255,145,0,72" value="110" />
+			<entry class="112" argb="255,144,0,72" value="111" />
+			<entry class="113" argb="255,143,0,71" value="112" />
+			<entry class="114" argb="255,142,0,71" value="113" />
+			<entry class="115" argb="255,141,0,70" value="114" />
+			<entry class="116" argb="255,140,0,70" value="115" />
+			<entry class="117" argb="255,139,0,69" value="116" />
+			<entry class="118" argb="255,138,0,69" value="117" />
+			<entry class="119" argb="255,137,0,68" value="118" />
+			<entry class="120" argb="255,136,0,68" value="119" />
+			<entry class="121" argb="255,135,0,67" value="120" />
+			<entry class="122" argb="255,134,0,67" value="121" />
+			<entry class="123" argb="255,133,0,66" value="122" />
+			<entry class="124" argb="255,132,0,66" value="123" />
+			<entry class="125" argb="255,131,0,65" value="124" />
+			<entry class="126" argb="255,130,0,65" value="125" />
+			<entry class="127" argb="255,129,0,64" value="126" />
+			<entry class="128" argb="255,128,0,64" value="127" />
+			<entry class="129" argb="255,127,0,63" value="128" />
+			<entry class="130" argb="255,126,0,63" value="129" />
+			<entry class="131" argb="255,125,0,62" value="130" />
+			<entry class="132" argb="255,124,0,62" value="131" />
+			<entry class="133" argb="255,123,0,61" value="132" />
+			<entry class="134" argb="255,122,0,61" value="133" />
+			<entry class="135" argb="255,121,0,60" value="134" />
+			<entry class="136" argb="255,120,0,60" value="135" />
+			<entry class="137" argb="255,119,0,59" value="136" />
+			<entry class="138" argb="255,118,0,59" value="137" />
+			<entry class="139" argb="255,117,0,58" value="138" />
+			<entry class="140" argb="255,116,0,58" value="139" />
+			<entry class="141" argb="255,115,0,57" value="140" />
+			<entry class="142" argb="255,114,0,57" value="141" />
+			<entry class="143" argb="255,113,0,56" value="142" />
+			<entry class="144" argb="255,112,0,56" value="143" />
+			<entry class="145" argb="255,111,0,55" value="144" />
+			<entry class="146" argb="255,110,0,55" value="145" />
+			<entry class="147" argb="255,109,0,54" value="146" />
+			<entry class="148" argb="255,108,0,54" value="147" />
+			<entry class="149" argb="255,107,0,53" value="148" />
+			<entry class="150" argb="255,106,0,53" value="149" />
+			<entry class="151" argb="255,105,0,52" value="150" />
+			<entry class="152" argb="255,104,0,52" value="151" />
+			<entry class="153" argb="255,103,0,51" value="152" />
+			<entry class="154" argb="255,102,0,51" value="153" />
+			<entry class="155" argb="255,101,0,50" value="154" />
+			<entry class="156" argb="255,100,0,50" value="155" />
+			<entry class="157" argb="255,99,0,49" value="156" />
+			<entry class="158" argb="255,98,0,49" value="157" />
+			<entry class="159" argb="255,97,0,48" value="158" />
+			<entry class="160" argb="255,96,0,48" value="159" />
+			<entry class="161" argb="255,95,0,47" value="160" />
+			<entry class="162" argb="255,94,0,47" value="161" />
+			<entry class="163" argb="255,93,0,46" value="162" />
+			<entry class="164" argb="255,92,0,46" value="163" />
+			<entry class="165" argb="255,91,0,45" value="164" />
+			<entry class="166" argb="255,90,0,45" value="165" />
+			<entry class="167" argb="255,89,0,44" value="166" />
+			<entry class="168" argb="255,88,0,44" value="167" />
+			<entry class="169" argb="255,87,0,43" value="168" />
+			<entry class="170" argb="255,86,0,43" value="169" />
+			<entry class="171" argb="255,85,0,42" value="170" />
+			<entry class="172" argb="255,84,0,42" value="171" />
+			<entry class="173" argb="255,83,0,41" value="172" />
+			<entry class="174" argb="255,82,0,41" value="173" />
+			<entry class="175" argb="255,81,0,40" value="174" />
+			<entry class="176" argb="255,80,0,40" value="175" />
+			<entry class="177" argb="255,79,0,39" value="176" />
+			<entry class="178" argb="255,78,0,39" value="177" />
+			<entry class="179" argb="255,77,0,38" value="178" />
+			<entry class="180" argb="255,76,0,38" value="179" />
+			<entry class="181" argb="255,75,0,37" value="180" />
+			<entry class="182" argb="255,74,0,37" value="181" />
+			<entry class="183" argb="255,73,0,36" value="182" />
+			<entry class="184" argb="255,72,0,36" value="183" />
+			<entry class="185" argb="255,71,0,35" value="184" />
+			<entry class="186" argb="255,70,0,35" value="185" />
+			<entry class="187" argb="255,69,0,34" value="186" />
+			<entry class="188" argb="255,68,0,34" value="187" />
+			<entry class="189" argb="255,67,0,33" value="188" />
+			<entry class="190" argb="255,66,0,33" value="189" />
+			<entry class="191" argb="255,65,0,32" value="190" />
+			<entry class="192" argb="255,64,0,32" value="191" />
+			<entry class="193" argb="255,63,0,31" value="192" />
+			<entry class="194" argb="255,62,0,31" value="193" />
+			<entry class="195" argb="255,61,0,30" value="194" />
+			<entry class="196" argb="255,60,0,30" value="195" />
+			<entry class="197" argb="255,59,0,29" value="196" />
+			<entry class="198" argb="255,58,0,29" value="197" />
+			<entry class="199" argb="255,57,0,28" value="198" />
+			<entry class="200" argb="255,56,0,28" value="199" />
+			<entry class="201" argb="255,55,0,27" value="200" />
+			<entry class="202" argb="255,54,0,27" value="201" />
+			<entry class="203" argb="255,53,0,26" value="202" />
+			<entry class="204" argb="255,52,0,26" value="203" />
+			<entry class="205" argb="255,51,0,25" value="204" />
+			<entry class="206" argb="255,50,0,25" value="205" />
+			<entry class="207" argb="255,49,0,24" value="206" />
+			<entry class="208" argb="255,48,0,24" value="207" />
+			<entry class="209" argb="255,47,0,23" value="208" />
+			<entry class="210" argb="255,46,0,23" value="209" />
+			<entry class="211" argb="255,45,0,22" value="210" />
+			<entry class="212" argb="255,44,0,22" value="211" />
+			<entry class="213" argb="255,43,0,21" value="212" />
+			<entry class="214" argb="255,42,0,21" value="213" />
+			<entry class="215" argb="255,41,0,20" value="214" />
+			<entry class="216" argb="255,40,0,20" value="215" />
+			<entry class="217" argb="255,39,0,19" value="216" />
+			<entry class="218" argb="255,38,0,19" value="217" />
+			<entry class="219" argb="255,37,0,18" value="218" />
+			<entry class="220" argb="255,36,0,18" value="219" />
+			<entry class="221" argb="255,35,0,17" value="220" />
+			<entry class="222" argb="255,34,0,17" value="221" />
+			<entry class="223" argb="255,33,0,16" value="222" />
+			<entry class="224" argb="255,32,0,16" value="223" />
+			<entry class="225" argb="255,31,0,15" value="224" />
+			<entry class="226" argb="255,30,0,15" value="225" />
+			<entry class="227" argb="255,29,0,14" value="226" />
+			<entry class="228" argb="255,28,0,14" value="227" />
+			<entry class="229" argb="255,27,0,13" value="228" />
+			<entry class="230" argb="255,26,0,13" value="229" />
+			<entry class="231" argb="255,25,0,12" value="230" />
+			<entry class="232" argb="255,24,0,12" value="231" />
+			<entry class="233" argb="255,23,0,11" value="232" />
+			<entry class="234" argb="255,22,0,11" value="233" />
+			<entry class="235" argb="255,21,0,10" value="234" />
+			<entry class="236" argb="255,20,0,10" value="235" />
+			<entry class="237" argb="255,19,0,9" value="236" />
+			<entry class="238" argb="255,18,0,9" value="237" />
+			<entry class="239" argb="255,17,0,8" value="238" />
+			<entry class="240" argb="255,16,0,8" value="239" />
+			<entry class="241" argb="255,15,0,7" value="240" />
+			<entry class="242" argb="255,14,0,7" value="241" />
+			<entry class="243" argb="255,13,0,6" value="242" />
+			<entry class="244" argb="255,12,0,6" value="243" />
+			<entry class="245" argb="255,11,0,5" value="244" />
+			<entry class="246" argb="255,10,0,5" value="245" />
+			<entry class="247" argb="255,9,0,4" value="246" />
+			<entry class="248" argb="255,8,0,4" value="247" />
+			<entry class="249" argb="255,7,0,3" value="248" />
+			<entry class="250" argb="255,6,0,3" value="249" />
+			<entry class="251" argb="255,5,0,2" value="250" />
+			<entry class="252" argb="255,4,0,2" value="251" />
+			<entry class="253" argb="255,3,0,1" value="252" />
+			<entry class="254" argb="255,2,0,1" value="253" />
+			<entry class="255" argb="255,1,0,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(150,100,100) to HSV(150,100,0) -->
+	<palette name="Deep Spring Green  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,255,127" value="0" />
+			<entry class="2" argb="255,0,254,127" value="1" />
+			<entry class="3" argb="255,0,253,126" value="2" />
+			<entry class="4" argb="255,0,252,126" value="3" />
+			<entry class="5" argb="255,0,251,125" value="4" />
+			<entry class="6" argb="255,0,250,125" value="5" />
+			<entry class="7" argb="255,0,249,124" value="6" />
+			<entry class="8" argb="255,0,248,124" value="7" />
+			<entry class="9" argb="255,0,247,123" value="8" />
+			<entry class="10" argb="255,0,246,123" value="9" />
+			<entry class="11" argb="255,0,245,122" value="10" />
+			<entry class="12" argb="255,0,244,122" value="11" />
+			<entry class="13" argb="255,0,243,121" value="12" />
+			<entry class="14" argb="255,0,242,121" value="13" />
+			<entry class="15" argb="255,0,241,120" value="14" />
+			<entry class="16" argb="255,0,240,120" value="15" />
+			<entry class="17" argb="255,0,239,119" value="16" />
+			<entry class="18" argb="255,0,238,119" value="17" />
+			<entry class="19" argb="255,0,237,118" value="18" />
+			<entry class="20" argb="255,0,236,118" value="19" />
+			<entry class="21" argb="255,0,235,117" value="20" />
+			<entry class="22" argb="255,0,234,117" value="21" />
+			<entry class="23" argb="255,0,233,116" value="22" />
+			<entry class="24" argb="255,0,232,116" value="23" />
+			<entry class="25" argb="255,0,231,115" value="24" />
+			<entry class="26" argb="255,0,230,115" value="25" />
+			<entry class="27" argb="255,0,229,114" value="26" />
+			<entry class="28" argb="255,0,228,114" value="27" />
+			<entry class="29" argb="255,0,227,113" value="28" />
+			<entry class="30" argb="255,0,226,113" value="29" />
+			<entry class="31" argb="255,0,225,112" value="30" />
+			<entry class="32" argb="255,0,224,112" value="31" />
+			<entry class="33" argb="255,0,223,111" value="32" />
+			<entry class="34" argb="255,0,222,111" value="33" />
+			<entry class="35" argb="255,0,221,110" value="34" />
+			<entry class="36" argb="255,0,220,110" value="35" />
+			<entry class="37" argb="255,0,219,109" value="36" />
+			<entry class="38" argb="255,0,218,109" value="37" />
+			<entry class="39" argb="255,0,217,108" value="38" />
+			<entry class="40" argb="255,0,216,108" value="39" />
+			<entry class="41" argb="255,0,215,107" value="40" />
+			<entry class="42" argb="255,0,214,107" value="41" />
+			<entry class="43" argb="255,0,213,106" value="42" />
+			<entry class="44" argb="255,0,212,106" value="43" />
+			<entry class="45" argb="255,0,211,105" value="44" />
+			<entry class="46" argb="255,0,210,105" value="45" />
+			<entry class="47" argb="255,0,209,104" value="46" />
+			<entry class="48" argb="255,0,208,104" value="47" />
+			<entry class="49" argb="255,0,207,103" value="48" />
+			<entry class="50" argb="255,0,206,103" value="49" />
+			<entry class="51" argb="255,0,205,102" value="50" />
+			<entry class="52" argb="255,0,204,102" value="51" />
+			<entry class="53" argb="255,0,203,101" value="52" />
+			<entry class="54" argb="255,0,202,101" value="53" />
+			<entry class="55" argb="255,0,201,100" value="54" />
+			<entry class="56" argb="255,0,200,100" value="55" />
+			<entry class="57" argb="255,0,199,99" value="56" />
+			<entry class="58" argb="255,0,198,99" value="57" />
+			<entry class="59" argb="255,0,197,98" value="58" />
+			<entry class="60" argb="255,0,196,98" value="59" />
+			<entry class="61" argb="255,0,195,97" value="60" />
+			<entry class="62" argb="255,0,194,97" value="61" />
+			<entry class="63" argb="255,0,193,96" value="62" />
+			<entry class="64" argb="255,0,192,96" value="63" />
+			<entry class="65" argb="255,0,191,95" value="64" />
+			<entry class="66" argb="255,0,190,95" value="65" />
+			<entry class="67" argb="255,0,189,94" value="66" />
+			<entry class="68" argb="255,0,188,94" value="67" />
+			<entry class="69" argb="255,0,187,93" value="68" />
+			<entry class="70" argb="255,0,186,93" value="69" />
+			<entry class="71" argb="255,0,185,92" value="70" />
+			<entry class="72" argb="255,0,184,92" value="71" />
+			<entry class="73" argb="255,0,183,91" value="72" />
+			<entry class="74" argb="255,0,182,91" value="73" />
+			<entry class="75" argb="255,0,181,90" value="74" />
+			<entry class="76" argb="255,0,180,90" value="75" />
+			<entry class="77" argb="255,0,179,89" value="76" />
+			<entry class="78" argb="255,0,178,89" value="77" />
+			<entry class="79" argb="255,0,177,88" value="78" />
+			<entry class="80" argb="255,0,176,88" value="79" />
+			<entry class="81" argb="255,0,175,87" value="80" />
+			<entry class="82" argb="255,0,174,87" value="81" />
+			<entry class="83" argb="255,0,173,86" value="82" />
+			<entry class="84" argb="255,0,172,86" value="83" />
+			<entry class="85" argb="255,0,171,85" value="84" />
+			<entry class="86" argb="255,0,170,85" value="85" />
+			<entry class="87" argb="255,0,169,84" value="86" />
+			<entry class="88" argb="255,0,168,84" value="87" />
+			<entry class="89" argb="255,0,167,83" value="88" />
+			<entry class="90" argb="255,0,166,83" value="89" />
+			<entry class="91" argb="255,0,165,82" value="90" />
+			<entry class="92" argb="255,0,164,82" value="91" />
+			<entry class="93" argb="255,0,163,81" value="92" />
+			<entry class="94" argb="255,0,162,81" value="93" />
+			<entry class="95" argb="255,0,161,80" value="94" />
+			<entry class="96" argb="255,0,160,80" value="95" />
+			<entry class="97" argb="255,0,159,79" value="96" />
+			<entry class="98" argb="255,0,158,79" value="97" />
+			<entry class="99" argb="255,0,157,78" value="98" />
+			<entry class="100" argb="255,0,156,78" value="99" />
+			<entry class="101" argb="255,0,155,77" value="100" />
+			<entry class="102" argb="255,0,154,77" value="101" />
+			<entry class="103" argb="255,0,153,76" value="102" />
+			<entry class="104" argb="255,0,152,76" value="103" />
+			<entry class="105" argb="255,0,151,75" value="104" />
+			<entry class="106" argb="255,0,150,75" value="105" />
+			<entry class="107" argb="255,0,149,74" value="106" />
+			<entry class="108" argb="255,0,148,74" value="107" />
+			<entry class="109" argb="255,0,147,73" value="108" />
+			<entry class="110" argb="255,0,146,73" value="109" />
+			<entry class="111" argb="255,0,145,72" value="110" />
+			<entry class="112" argb="255,0,144,72" value="111" />
+			<entry class="113" argb="255,0,143,71" value="112" />
+			<entry class="114" argb="255,0,142,71" value="113" />
+			<entry class="115" argb="255,0,141,70" value="114" />
+			<entry class="116" argb="255,0,140,70" value="115" />
+			<entry class="117" argb="255,0,139,69" value="116" />
+			<entry class="118" argb="255,0,138,69" value="117" />
+			<entry class="119" argb="255,0,137,68" value="118" />
+			<entry class="120" argb="255,0,136,68" value="119" />
+			<entry class="121" argb="255,0,135,67" value="120" />
+			<entry class="122" argb="255,0,134,67" value="121" />
+			<entry class="123" argb="255,0,133,66" value="122" />
+			<entry class="124" argb="255,0,132,66" value="123" />
+			<entry class="125" argb="255,0,131,65" value="124" />
+			<entry class="126" argb="255,0,130,65" value="125" />
+			<entry class="127" argb="255,0,129,64" value="126" />
+			<entry class="128" argb="255,0,128,64" value="127" />
+			<entry class="129" argb="255,0,127,63" value="128" />
+			<entry class="130" argb="255,0,126,63" value="129" />
+			<entry class="131" argb="255,0,125,62" value="130" />
+			<entry class="132" argb="255,0,124,62" value="131" />
+			<entry class="133" argb="255,0,123,61" value="132" />
+			<entry class="134" argb="255,0,122,61" value="133" />
+			<entry class="135" argb="255,0,121,60" value="134" />
+			<entry class="136" argb="255,0,120,60" value="135" />
+			<entry class="137" argb="255,0,119,59" value="136" />
+			<entry class="138" argb="255,0,118,59" value="137" />
+			<entry class="139" argb="255,0,117,58" value="138" />
+			<entry class="140" argb="255,0,116,58" value="139" />
+			<entry class="141" argb="255,0,115,57" value="140" />
+			<entry class="142" argb="255,0,114,57" value="141" />
+			<entry class="143" argb="255,0,113,56" value="142" />
+			<entry class="144" argb="255,0,112,56" value="143" />
+			<entry class="145" argb="255,0,111,55" value="144" />
+			<entry class="146" argb="255,0,110,55" value="145" />
+			<entry class="147" argb="255,0,109,54" value="146" />
+			<entry class="148" argb="255,0,108,54" value="147" />
+			<entry class="149" argb="255,0,107,53" value="148" />
+			<entry class="150" argb="255,0,106,53" value="149" />
+			<entry class="151" argb="255,0,105,52" value="150" />
+			<entry class="152" argb="255,0,104,52" value="151" />
+			<entry class="153" argb="255,0,103,51" value="152" />
+			<entry class="154" argb="255,0,102,51" value="153" />
+			<entry class="155" argb="255,0,101,50" value="154" />
+			<entry class="156" argb="255,0,100,50" value="155" />
+			<entry class="157" argb="255,0,99,49" value="156" />
+			<entry class="158" argb="255,0,98,49" value="157" />
+			<entry class="159" argb="255,0,97,48" value="158" />
+			<entry class="160" argb="255,0,96,48" value="159" />
+			<entry class="161" argb="255,0,95,47" value="160" />
+			<entry class="162" argb="255,0,94,47" value="161" />
+			<entry class="163" argb="255,0,93,46" value="162" />
+			<entry class="164" argb="255,0,92,46" value="163" />
+			<entry class="165" argb="255,0,91,45" value="164" />
+			<entry class="166" argb="255,0,90,45" value="165" />
+			<entry class="167" argb="255,0,89,44" value="166" />
+			<entry class="168" argb="255,0,88,44" value="167" />
+			<entry class="169" argb="255,0,87,43" value="168" />
+			<entry class="170" argb="255,0,86,43" value="169" />
+			<entry class="171" argb="255,0,85,42" value="170" />
+			<entry class="172" argb="255,0,84,42" value="171" />
+			<entry class="173" argb="255,0,83,41" value="172" />
+			<entry class="174" argb="255,0,82,41" value="173" />
+			<entry class="175" argb="255,0,81,40" value="174" />
+			<entry class="176" argb="255,0,80,40" value="175" />
+			<entry class="177" argb="255,0,79,39" value="176" />
+			<entry class="178" argb="255,0,78,39" value="177" />
+			<entry class="179" argb="255,0,77,38" value="178" />
+			<entry class="180" argb="255,0,76,38" value="179" />
+			<entry class="181" argb="255,0,75,37" value="180" />
+			<entry class="182" argb="255,0,74,37" value="181" />
+			<entry class="183" argb="255,0,73,36" value="182" />
+			<entry class="184" argb="255,0,72,36" value="183" />
+			<entry class="185" argb="255,0,71,35" value="184" />
+			<entry class="186" argb="255,0,70,35" value="185" />
+			<entry class="187" argb="255,0,69,34" value="186" />
+			<entry class="188" argb="255,0,68,34" value="187" />
+			<entry class="189" argb="255,0,67,33" value="188" />
+			<entry class="190" argb="255,0,66,33" value="189" />
+			<entry class="191" argb="255,0,65,32" value="190" />
+			<entry class="192" argb="255,0,64,32" value="191" />
+			<entry class="193" argb="255,0,63,31" value="192" />
+			<entry class="194" argb="255,0,62,31" value="193" />
+			<entry class="195" argb="255,0,61,30" value="194" />
+			<entry class="196" argb="255,0,60,30" value="195" />
+			<entry class="197" argb="255,0,59,29" value="196" />
+			<entry class="198" argb="255,0,58,29" value="197" />
+			<entry class="199" argb="255,0,57,28" value="198" />
+			<entry class="200" argb="255,0,56,28" value="199" />
+			<entry class="201" argb="255,0,55,27" value="200" />
+			<entry class="202" argb="255,0,54,27" value="201" />
+			<entry class="203" argb="255,0,53,26" value="202" />
+			<entry class="204" argb="255,0,52,26" value="203" />
+			<entry class="205" argb="255,0,51,25" value="204" />
+			<entry class="206" argb="255,0,50,25" value="205" />
+			<entry class="207" argb="255,0,49,24" value="206" />
+			<entry class="208" argb="255,0,48,24" value="207" />
+			<entry class="209" argb="255,0,47,23" value="208" />
+			<entry class="210" argb="255,0,46,23" value="209" />
+			<entry class="211" argb="255,0,45,22" value="210" />
+			<entry class="212" argb="255,0,44,22" value="211" />
+			<entry class="213" argb="255,0,43,21" value="212" />
+			<entry class="214" argb="255,0,42,21" value="213" />
+			<entry class="215" argb="255,0,41,20" value="214" />
+			<entry class="216" argb="255,0,40,20" value="215" />
+			<entry class="217" argb="255,0,39,19" value="216" />
+			<entry class="218" argb="255,0,38,19" value="217" />
+			<entry class="219" argb="255,0,37,18" value="218" />
+			<entry class="220" argb="255,0,36,18" value="219" />
+			<entry class="221" argb="255,0,35,17" value="220" />
+			<entry class="222" argb="255,0,34,17" value="221" />
+			<entry class="223" argb="255,0,33,16" value="222" />
+			<entry class="224" argb="255,0,32,16" value="223" />
+			<entry class="225" argb="255,0,31,15" value="224" />
+			<entry class="226" argb="255,0,30,15" value="225" />
+			<entry class="227" argb="255,0,29,14" value="226" />
+			<entry class="228" argb="255,0,28,14" value="227" />
+			<entry class="229" argb="255,0,27,13" value="228" />
+			<entry class="230" argb="255,0,26,13" value="229" />
+			<entry class="231" argb="255,0,25,12" value="230" />
+			<entry class="232" argb="255,0,24,12" value="231" />
+			<entry class="233" argb="255,0,23,11" value="232" />
+			<entry class="234" argb="255,0,22,11" value="233" />
+			<entry class="235" argb="255,0,21,10" value="234" />
+			<entry class="236" argb="255,0,20,10" value="235" />
+			<entry class="237" argb="255,0,19,9" value="236" />
+			<entry class="238" argb="255,0,18,9" value="237" />
+			<entry class="239" argb="255,0,17,8" value="238" />
+			<entry class="240" argb="255,0,16,8" value="239" />
+			<entry class="241" argb="255,0,15,7" value="240" />
+			<entry class="242" argb="255,0,14,7" value="241" />
+			<entry class="243" argb="255,0,13,6" value="242" />
+			<entry class="244" argb="255,0,12,6" value="243" />
+			<entry class="245" argb="255,0,11,5" value="244" />
+			<entry class="246" argb="255,0,10,5" value="245" />
+			<entry class="247" argb="255,0,9,4" value="246" />
+			<entry class="248" argb="255,0,8,4" value="247" />
+			<entry class="249" argb="255,0,7,3" value="248" />
+			<entry class="250" argb="255,0,6,3" value="249" />
+			<entry class="251" argb="255,0,5,2" value="250" />
+			<entry class="252" argb="255,0,4,2" value="251" />
+			<entry class="253" argb="255,0,3,1" value="252" />
+			<entry class="254" argb="255,0,2,1" value="253" />
+			<entry class="255" argb="255,0,1,0" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+	
+	<!-- Gradient, HSV(270,100,100) to HSV(270,100,0) -->
+	<palette name="Deep Violet  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,127,0,255" value="0" />
+			<entry class="2" argb="255,127,0,254" value="1" />
+			<entry class="3" argb="255,126,0,253" value="2" />
+			<entry class="4" argb="255,126,0,252" value="3" />
+			<entry class="5" argb="255,125,0,251" value="4" />
+			<entry class="6" argb="255,125,0,250" value="5" />
+			<entry class="7" argb="255,124,0,249" value="6" />
+			<entry class="8" argb="255,124,0,248" value="7" />
+			<entry class="9" argb="255,123,0,247" value="8" />
+			<entry class="10" argb="255,123,0,246" value="9" />
+			<entry class="11" argb="255,122,0,245" value="10" />
+			<entry class="12" argb="255,122,0,244" value="11" />
+			<entry class="13" argb="255,121,0,243" value="12" />
+			<entry class="14" argb="255,121,0,242" value="13" />
+			<entry class="15" argb="255,120,0,241" value="14" />
+			<entry class="16" argb="255,120,0,240" value="15" />
+			<entry class="17" argb="255,119,0,239" value="16" />
+			<entry class="18" argb="255,119,0,238" value="17" />
+			<entry class="19" argb="255,118,0,237" value="18" />
+			<entry class="20" argb="255,118,0,236" value="19" />
+			<entry class="21" argb="255,117,0,235" value="20" />
+			<entry class="22" argb="255,117,0,234" value="21" />
+			<entry class="23" argb="255,116,0,233" value="22" />
+			<entry class="24" argb="255,116,0,232" value="23" />
+			<entry class="25" argb="255,115,0,231" value="24" />
+			<entry class="26" argb="255,115,0,230" value="25" />
+			<entry class="27" argb="255,114,0,229" value="26" />
+			<entry class="28" argb="255,114,0,228" value="27" />
+			<entry class="29" argb="255,113,0,227" value="28" />
+			<entry class="30" argb="255,113,0,226" value="29" />
+			<entry class="31" argb="255,112,0,225" value="30" />
+			<entry class="32" argb="255,112,0,224" value="31" />
+			<entry class="33" argb="255,111,0,223" value="32" />
+			<entry class="34" argb="255,111,0,222" value="33" />
+			<entry class="35" argb="255,110,0,221" value="34" />
+			<entry class="36" argb="255,110,0,220" value="35" />
+			<entry class="37" argb="255,109,0,219" value="36" />
+			<entry class="38" argb="255,109,0,218" value="37" />
+			<entry class="39" argb="255,108,0,217" value="38" />
+			<entry class="40" argb="255,108,0,216" value="39" />
+			<entry class="41" argb="255,107,0,215" value="40" />
+			<entry class="42" argb="255,107,0,214" value="41" />
+			<entry class="43" argb="255,106,0,213" value="42" />
+			<entry class="44" argb="255,106,0,212" value="43" />
+			<entry class="45" argb="255,105,0,211" value="44" />
+			<entry class="46" argb="255,105,0,210" value="45" />
+			<entry class="47" argb="255,104,0,209" value="46" />
+			<entry class="48" argb="255,104,0,208" value="47" />
+			<entry class="49" argb="255,103,0,207" value="48" />
+			<entry class="50" argb="255,103,0,206" value="49" />
+			<entry class="51" argb="255,102,0,205" value="50" />
+			<entry class="52" argb="255,102,0,204" value="51" />
+			<entry class="53" argb="255,101,0,203" value="52" />
+			<entry class="54" argb="255,101,0,202" value="53" />
+			<entry class="55" argb="255,100,0,201" value="54" />
+			<entry class="56" argb="255,100,0,200" value="55" />
+			<entry class="57" argb="255,99,0,199" value="56" />
+			<entry class="58" argb="255,99,0,198" value="57" />
+			<entry class="59" argb="255,98,0,197" value="58" />
+			<entry class="60" argb="255,98,0,196" value="59" />
+			<entry class="61" argb="255,97,0,195" value="60" />
+			<entry class="62" argb="255,97,0,194" value="61" />
+			<entry class="63" argb="255,96,0,193" value="62" />
+			<entry class="64" argb="255,96,0,192" value="63" />
+			<entry class="65" argb="255,95,0,191" value="64" />
+			<entry class="66" argb="255,95,0,190" value="65" />
+			<entry class="67" argb="255,94,0,189" value="66" />
+			<entry class="68" argb="255,94,0,188" value="67" />
+			<entry class="69" argb="255,93,0,187" value="68" />
+			<entry class="70" argb="255,93,0,186" value="69" />
+			<entry class="71" argb="255,92,0,185" value="70" />
+			<entry class="72" argb="255,92,0,184" value="71" />
+			<entry class="73" argb="255,91,0,183" value="72" />
+			<entry class="74" argb="255,91,0,182" value="73" />
+			<entry class="75" argb="255,90,0,181" value="74" />
+			<entry class="76" argb="255,90,0,180" value="75" />
+			<entry class="77" argb="255,89,0,179" value="76" />
+			<entry class="78" argb="255,89,0,178" value="77" />
+			<entry class="79" argb="255,88,0,177" value="78" />
+			<entry class="80" argb="255,88,0,176" value="79" />
+			<entry class="81" argb="255,87,0,175" value="80" />
+			<entry class="82" argb="255,87,0,174" value="81" />
+			<entry class="83" argb="255,86,0,173" value="82" />
+			<entry class="84" argb="255,86,0,172" value="83" />
+			<entry class="85" argb="255,85,0,171" value="84" />
+			<entry class="86" argb="255,85,0,170" value="85" />
+			<entry class="87" argb="255,84,0,169" value="86" />
+			<entry class="88" argb="255,84,0,168" value="87" />
+			<entry class="89" argb="255,83,0,167" value="88" />
+			<entry class="90" argb="255,83,0,166" value="89" />
+			<entry class="91" argb="255,82,0,165" value="90" />
+			<entry class="92" argb="255,82,0,164" value="91" />
+			<entry class="93" argb="255,81,0,163" value="92" />
+			<entry class="94" argb="255,81,0,162" value="93" />
+			<entry class="95" argb="255,80,0,161" value="94" />
+			<entry class="96" argb="255,80,0,160" value="95" />
+			<entry class="97" argb="255,79,0,159" value="96" />
+			<entry class="98" argb="255,79,0,158" value="97" />
+			<entry class="99" argb="255,78,0,157" value="98" />
+			<entry class="100" argb="255,78,0,156" value="99" />
+			<entry class="101" argb="255,77,0,155" value="100" />
+			<entry class="102" argb="255,77,0,154" value="101" />
+			<entry class="103" argb="255,76,0,153" value="102" />
+			<entry class="104" argb="255,76,0,152" value="103" />
+			<entry class="105" argb="255,75,0,151" value="104" />
+			<entry class="106" argb="255,75,0,150" value="105" />
+			<entry class="107" argb="255,74,0,149" value="106" />
+			<entry class="108" argb="255,74,0,148" value="107" />
+			<entry class="109" argb="255,73,0,147" value="108" />
+			<entry class="110" argb="255,73,0,146" value="109" />
+			<entry class="111" argb="255,72,0,145" value="110" />
+			<entry class="112" argb="255,72,0,144" value="111" />
+			<entry class="113" argb="255,71,0,143" value="112" />
+			<entry class="114" argb="255,71,0,142" value="113" />
+			<entry class="115" argb="255,70,0,141" value="114" />
+			<entry class="116" argb="255,70,0,140" value="115" />
+			<entry class="117" argb="255,69,0,139" value="116" />
+			<entry class="118" argb="255,69,0,138" value="117" />
+			<entry class="119" argb="255,68,0,137" value="118" />
+			<entry class="120" argb="255,68,0,136" value="119" />
+			<entry class="121" argb="255,67,0,135" value="120" />
+			<entry class="122" argb="255,67,0,134" value="121" />
+			<entry class="123" argb="255,66,0,133" value="122" />
+			<entry class="124" argb="255,66,0,132" value="123" />
+			<entry class="125" argb="255,65,0,131" value="124" />
+			<entry class="126" argb="255,65,0,130" value="125" />
+			<entry class="127" argb="255,64,0,129" value="126" />
+			<entry class="128" argb="255,64,0,128" value="127" />
+			<entry class="129" argb="255,63,0,127" value="128" />
+			<entry class="130" argb="255,63,0,126" value="129" />
+			<entry class="131" argb="255,62,0,125" value="130" />
+			<entry class="132" argb="255,62,0,124" value="131" />
+			<entry class="133" argb="255,61,0,123" value="132" />
+			<entry class="134" argb="255,61,0,122" value="133" />
+			<entry class="135" argb="255,60,0,121" value="134" />
+			<entry class="136" argb="255,60,0,120" value="135" />
+			<entry class="137" argb="255,59,0,119" value="136" />
+			<entry class="138" argb="255,59,0,118" value="137" />
+			<entry class="139" argb="255,58,0,117" value="138" />
+			<entry class="140" argb="255,58,0,116" value="139" />
+			<entry class="141" argb="255,57,0,115" value="140" />
+			<entry class="142" argb="255,57,0,114" value="141" />
+			<entry class="143" argb="255,56,0,113" value="142" />
+			<entry class="144" argb="255,56,0,112" value="143" />
+			<entry class="145" argb="255,55,0,111" value="144" />
+			<entry class="146" argb="255,55,0,110" value="145" />
+			<entry class="147" argb="255,54,0,109" value="146" />
+			<entry class="148" argb="255,54,0,108" value="147" />
+			<entry class="149" argb="255,53,0,107" value="148" />
+			<entry class="150" argb="255,53,0,106" value="149" />
+			<entry class="151" argb="255,52,0,105" value="150" />
+			<entry class="152" argb="255,52,0,104" value="151" />
+			<entry class="153" argb="255,51,0,103" value="152" />
+			<entry class="154" argb="255,51,0,102" value="153" />
+			<entry class="155" argb="255,50,0,101" value="154" />
+			<entry class="156" argb="255,50,0,100" value="155" />
+			<entry class="157" argb="255,49,0,99" value="156" />
+			<entry class="158" argb="255,49,0,98" value="157" />
+			<entry class="159" argb="255,48,0,97" value="158" />
+			<entry class="160" argb="255,48,0,96" value="159" />
+			<entry class="161" argb="255,47,0,95" value="160" />
+			<entry class="162" argb="255,47,0,94" value="161" />
+			<entry class="163" argb="255,46,0,93" value="162" />
+			<entry class="164" argb="255,46,0,92" value="163" />
+			<entry class="165" argb="255,45,0,91" value="164" />
+			<entry class="166" argb="255,45,0,90" value="165" />
+			<entry class="167" argb="255,44,0,89" value="166" />
+			<entry class="168" argb="255,44,0,88" value="167" />
+			<entry class="169" argb="255,43,0,87" value="168" />
+			<entry class="170" argb="255,43,0,86" value="169" />
+			<entry class="171" argb="255,42,0,85" value="170" />
+			<entry class="172" argb="255,42,0,84" value="171" />
+			<entry class="173" argb="255,41,0,83" value="172" />
+			<entry class="174" argb="255,41,0,82" value="173" />
+			<entry class="175" argb="255,40,0,81" value="174" />
+			<entry class="176" argb="255,40,0,80" value="175" />
+			<entry class="177" argb="255,39,0,79" value="176" />
+			<entry class="178" argb="255,39,0,78" value="177" />
+			<entry class="179" argb="255,38,0,77" value="178" />
+			<entry class="180" argb="255,38,0,76" value="179" />
+			<entry class="181" argb="255,37,0,75" value="180" />
+			<entry class="182" argb="255,37,0,74" value="181" />
+			<entry class="183" argb="255,36,0,73" value="182" />
+			<entry class="184" argb="255,36,0,72" value="183" />
+			<entry class="185" argb="255,35,0,71" value="184" />
+			<entry class="186" argb="255,35,0,70" value="185" />
+			<entry class="187" argb="255,34,0,69" value="186" />
+			<entry class="188" argb="255,34,0,68" value="187" />
+			<entry class="189" argb="255,33,0,67" value="188" />
+			<entry class="190" argb="255,33,0,66" value="189" />
+			<entry class="191" argb="255,32,0,65" value="190" />
+			<entry class="192" argb="255,32,0,64" value="191" />
+			<entry class="193" argb="255,31,0,63" value="192" />
+			<entry class="194" argb="255,31,0,62" value="193" />
+			<entry class="195" argb="255,30,0,61" value="194" />
+			<entry class="196" argb="255,30,0,60" value="195" />
+			<entry class="197" argb="255,29,0,59" value="196" />
+			<entry class="198" argb="255,29,0,58" value="197" />
+			<entry class="199" argb="255,28,0,57" value="198" />
+			<entry class="200" argb="255,28,0,56" value="199" />
+			<entry class="201" argb="255,27,0,55" value="200" />
+			<entry class="202" argb="255,27,0,54" value="201" />
+			<entry class="203" argb="255,26,0,53" value="202" />
+			<entry class="204" argb="255,26,0,52" value="203" />
+			<entry class="205" argb="255,25,0,51" value="204" />
+			<entry class="206" argb="255,25,0,50" value="205" />
+			<entry class="207" argb="255,24,0,49" value="206" />
+			<entry class="208" argb="255,24,0,48" value="207" />
+			<entry class="209" argb="255,23,0,47" value="208" />
+			<entry class="210" argb="255,23,0,46" value="209" />
+			<entry class="211" argb="255,22,0,45" value="210" />
+			<entry class="212" argb="255,22,0,44" value="211" />
+			<entry class="213" argb="255,21,0,43" value="212" />
+			<entry class="214" argb="255,21,0,42" value="213" />
+			<entry class="215" argb="255,20,0,41" value="214" />
+			<entry class="216" argb="255,20,0,40" value="215" />
+			<entry class="217" argb="255,19,0,39" value="216" />
+			<entry class="218" argb="255,19,0,38" value="217" />
+			<entry class="219" argb="255,18,0,37" value="218" />
+			<entry class="220" argb="255,18,0,36" value="219" />
+			<entry class="221" argb="255,17,0,35" value="220" />
+			<entry class="222" argb="255,17,0,34" value="221" />
+			<entry class="223" argb="255,16,0,33" value="222" />
+			<entry class="224" argb="255,16,0,32" value="223" />
+			<entry class="225" argb="255,15,0,31" value="224" />
+			<entry class="226" argb="255,15,0,30" value="225" />
+			<entry class="227" argb="255,14,0,29" value="226" />
+			<entry class="228" argb="255,14,0,28" value="227" />
+			<entry class="229" argb="255,13,0,27" value="228" />
+			<entry class="230" argb="255,13,0,26" value="229" />
+			<entry class="231" argb="255,12,0,25" value="230" />
+			<entry class="232" argb="255,12,0,24" value="231" />
+			<entry class="233" argb="255,11,0,23" value="232" />
+			<entry class="234" argb="255,11,0,22" value="233" />
+			<entry class="235" argb="255,10,0,21" value="234" />
+			<entry class="236" argb="255,10,0,20" value="235" />
+			<entry class="237" argb="255,9,0,19" value="236" />
+			<entry class="238" argb="255,9,0,18" value="237" />
+			<entry class="239" argb="255,8,0,17" value="238" />
+			<entry class="240" argb="255,8,0,16" value="239" />
+			<entry class="241" argb="255,7,0,15" value="240" />
+			<entry class="242" argb="255,7,0,14" value="241" />
+			<entry class="243" argb="255,6,0,13" value="242" />
+			<entry class="244" argb="255,6,0,12" value="243" />
+			<entry class="245" argb="255,5,0,11" value="244" />
+			<entry class="246" argb="255,5,0,10" value="245" />
+			<entry class="247" argb="255,4,0,9" value="246" />
+			<entry class="248" argb="255,4,0,8" value="247" />
+			<entry class="249" argb="255,3,0,7" value="248" />
+			<entry class="250" argb="255,3,0,6" value="249" />
+			<entry class="251" argb="255,2,0,5" value="250" />
+			<entry class="252" argb="255,2,0,4" value="251" />
+			<entry class="253" argb="255,1,0,3" value="252" />
+			<entry class="254" argb="255,1,0,2" value="253" />
+			<entry class="255" argb="255,0,0,1" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(60,100,0) to HSV(60,100,100) -->
+	<palette name="Deep Yellow  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,1,1,0" value="1" />
+			<entry class="3" argb="255,2,2,0" value="2" />
+			<entry class="4" argb="255,3,3,0" value="3" />
+			<entry class="5" argb="255,4,4,0" value="4" />
+			<entry class="6" argb="255,5,5,0" value="5" />
+			<entry class="7" argb="255,6,6,0" value="6" />
+			<entry class="8" argb="255,7,7,0" value="7" />
+			<entry class="9" argb="255,8,8,0" value="8" />
+			<entry class="10" argb="255,9,9,0" value="9" />
+			<entry class="11" argb="255,10,10,0" value="10" />
+			<entry class="12" argb="255,11,11,0" value="11" />
+			<entry class="13" argb="255,12,12,0" value="12" />
+			<entry class="14" argb="255,13,13,0" value="13" />
+			<entry class="15" argb="255,14,14,0" value="14" />
+			<entry class="16" argb="255,15,15,0" value="15" />
+			<entry class="17" argb="255,16,16,0" value="16" />
+			<entry class="18" argb="255,17,17,0" value="17" />
+			<entry class="19" argb="255,18,18,0" value="18" />
+			<entry class="20" argb="255,19,19,0" value="19" />
+			<entry class="21" argb="255,20,20,0" value="20" />
+			<entry class="22" argb="255,21,21,0" value="21" />
+			<entry class="23" argb="255,22,22,0" value="22" />
+			<entry class="24" argb="255,23,23,0" value="23" />
+			<entry class="25" argb="255,24,24,0" value="24" />
+			<entry class="26" argb="255,25,25,0" value="25" />
+			<entry class="27" argb="255,26,26,0" value="26" />
+			<entry class="28" argb="255,27,27,0" value="27" />
+			<entry class="29" argb="255,28,28,0" value="28" />
+			<entry class="30" argb="255,29,29,0" value="29" />
+			<entry class="31" argb="255,30,30,0" value="30" />
+			<entry class="32" argb="255,31,31,0" value="31" />
+			<entry class="33" argb="255,32,32,0" value="32" />
+			<entry class="34" argb="255,33,33,0" value="33" />
+			<entry class="35" argb="255,34,34,0" value="34" />
+			<entry class="36" argb="255,35,35,0" value="35" />
+			<entry class="37" argb="255,36,36,0" value="36" />
+			<entry class="38" argb="255,37,37,0" value="37" />
+			<entry class="39" argb="255,38,38,0" value="38" />
+			<entry class="40" argb="255,39,39,0" value="39" />
+			<entry class="41" argb="255,40,40,0" value="40" />
+			<entry class="42" argb="255,41,41,0" value="41" />
+			<entry class="43" argb="255,42,42,0" value="42" />
+			<entry class="44" argb="255,43,43,0" value="43" />
+			<entry class="45" argb="255,44,44,0" value="44" />
+			<entry class="46" argb="255,45,45,0" value="45" />
+			<entry class="47" argb="255,46,46,0" value="46" />
+			<entry class="48" argb="255,47,47,0" value="47" />
+			<entry class="49" argb="255,48,48,0" value="48" />
+			<entry class="50" argb="255,49,49,0" value="49" />
+			<entry class="51" argb="255,50,50,0" value="50" />
+			<entry class="52" argb="255,51,51,0" value="51" />
+			<entry class="53" argb="255,52,52,0" value="52" />
+			<entry class="54" argb="255,53,53,0" value="53" />
+			<entry class="55" argb="255,54,54,0" value="54" />
+			<entry class="56" argb="255,55,55,0" value="55" />
+			<entry class="57" argb="255,56,56,0" value="56" />
+			<entry class="58" argb="255,57,57,0" value="57" />
+			<entry class="59" argb="255,58,58,0" value="58" />
+			<entry class="60" argb="255,59,59,0" value="59" />
+			<entry class="61" argb="255,60,60,0" value="60" />
+			<entry class="62" argb="255,61,61,0" value="61" />
+			<entry class="63" argb="255,62,62,0" value="62" />
+			<entry class="64" argb="255,63,63,0" value="63" />
+			<entry class="65" argb="255,64,64,0" value="64" />
+			<entry class="66" argb="255,65,65,0" value="65" />
+			<entry class="67" argb="255,66,66,0" value="66" />
+			<entry class="68" argb="255,67,67,0" value="67" />
+			<entry class="69" argb="255,68,68,0" value="68" />
+			<entry class="70" argb="255,69,69,0" value="69" />
+			<entry class="71" argb="255,70,70,0" value="70" />
+			<entry class="72" argb="255,71,71,0" value="71" />
+			<entry class="73" argb="255,72,72,0" value="72" />
+			<entry class="74" argb="255,73,73,0" value="73" />
+			<entry class="75" argb="255,74,74,0" value="74" />
+			<entry class="76" argb="255,75,75,0" value="75" />
+			<entry class="77" argb="255,76,76,0" value="76" />
+			<entry class="78" argb="255,77,77,0" value="77" />
+			<entry class="79" argb="255,78,78,0" value="78" />
+			<entry class="80" argb="255,79,79,0" value="79" />
+			<entry class="81" argb="255,80,80,0" value="80" />
+			<entry class="82" argb="255,81,81,0" value="81" />
+			<entry class="83" argb="255,82,82,0" value="82" />
+			<entry class="84" argb="255,83,83,0" value="83" />
+			<entry class="85" argb="255,84,84,0" value="84" />
+			<entry class="86" argb="255,85,85,0" value="85" />
+			<entry class="87" argb="255,86,86,0" value="86" />
+			<entry class="88" argb="255,87,87,0" value="87" />
+			<entry class="89" argb="255,88,88,0" value="88" />
+			<entry class="90" argb="255,89,89,0" value="89" />
+			<entry class="91" argb="255,90,90,0" value="90" />
+			<entry class="92" argb="255,91,91,0" value="91" />
+			<entry class="93" argb="255,92,92,0" value="92" />
+			<entry class="94" argb="255,93,93,0" value="93" />
+			<entry class="95" argb="255,94,94,0" value="94" />
+			<entry class="96" argb="255,95,95,0" value="95" />
+			<entry class="97" argb="255,96,96,0" value="96" />
+			<entry class="98" argb="255,97,97,0" value="97" />
+			<entry class="99" argb="255,98,98,0" value="98" />
+			<entry class="100" argb="255,99,99,0" value="99" />
+			<entry class="101" argb="255,100,100,0" value="100" />
+			<entry class="102" argb="255,101,101,0" value="101" />
+			<entry class="103" argb="255,102,102,0" value="102" />
+			<entry class="104" argb="255,103,103,0" value="103" />
+			<entry class="105" argb="255,104,104,0" value="104" />
+			<entry class="106" argb="255,105,105,0" value="105" />
+			<entry class="107" argb="255,106,106,0" value="106" />
+			<entry class="108" argb="255,107,107,0" value="107" />
+			<entry class="109" argb="255,108,108,0" value="108" />
+			<entry class="110" argb="255,109,109,0" value="109" />
+			<entry class="111" argb="255,110,110,0" value="110" />
+			<entry class="112" argb="255,111,111,0" value="111" />
+			<entry class="113" argb="255,112,112,0" value="112" />
+			<entry class="114" argb="255,113,113,0" value="113" />
+			<entry class="115" argb="255,114,114,0" value="114" />
+			<entry class="116" argb="255,115,115,0" value="115" />
+			<entry class="117" argb="255,116,116,0" value="116" />
+			<entry class="118" argb="255,117,117,0" value="117" />
+			<entry class="119" argb="255,118,118,0" value="118" />
+			<entry class="120" argb="255,119,119,0" value="119" />
+			<entry class="121" argb="255,120,120,0" value="120" />
+			<entry class="122" argb="255,121,121,0" value="121" />
+			<entry class="123" argb="255,122,122,0" value="122" />
+			<entry class="124" argb="255,123,123,0" value="123" />
+			<entry class="125" argb="255,124,124,0" value="124" />
+			<entry class="126" argb="255,125,125,0" value="125" />
+			<entry class="127" argb="255,126,126,0" value="126" />
+			<entry class="128" argb="255,127,127,0" value="127" />
+			<entry class="129" argb="255,128,128,0" value="128" />
+			<entry class="130" argb="255,129,129,0" value="129" />
+			<entry class="131" argb="255,130,130,0" value="130" />
+			<entry class="132" argb="255,131,131,0" value="131" />
+			<entry class="133" argb="255,132,132,0" value="132" />
+			<entry class="134" argb="255,133,133,0" value="133" />
+			<entry class="135" argb="255,134,134,0" value="134" />
+			<entry class="136" argb="255,135,135,0" value="135" />
+			<entry class="137" argb="255,136,136,0" value="136" />
+			<entry class="138" argb="255,137,137,0" value="137" />
+			<entry class="139" argb="255,138,138,0" value="138" />
+			<entry class="140" argb="255,139,139,0" value="139" />
+			<entry class="141" argb="255,140,140,0" value="140" />
+			<entry class="142" argb="255,141,141,0" value="141" />
+			<entry class="143" argb="255,142,142,0" value="142" />
+			<entry class="144" argb="255,143,143,0" value="143" />
+			<entry class="145" argb="255,144,144,0" value="144" />
+			<entry class="146" argb="255,145,145,0" value="145" />
+			<entry class="147" argb="255,146,146,0" value="146" />
+			<entry class="148" argb="255,147,147,0" value="147" />
+			<entry class="149" argb="255,148,148,0" value="148" />
+			<entry class="150" argb="255,149,149,0" value="149" />
+			<entry class="151" argb="255,150,150,0" value="150" />
+			<entry class="152" argb="255,151,151,0" value="151" />
+			<entry class="153" argb="255,152,152,0" value="152" />
+			<entry class="154" argb="255,153,153,0" value="153" />
+			<entry class="155" argb="255,154,154,0" value="154" />
+			<entry class="156" argb="255,155,155,0" value="155" />
+			<entry class="157" argb="255,156,156,0" value="156" />
+			<entry class="158" argb="255,157,157,0" value="157" />
+			<entry class="159" argb="255,158,158,0" value="158" />
+			<entry class="160" argb="255,159,159,0" value="159" />
+			<entry class="161" argb="255,160,160,0" value="160" />
+			<entry class="162" argb="255,161,161,0" value="161" />
+			<entry class="163" argb="255,162,162,0" value="162" />
+			<entry class="164" argb="255,163,163,0" value="163" />
+			<entry class="165" argb="255,164,164,0" value="164" />
+			<entry class="166" argb="255,165,165,0" value="165" />
+			<entry class="167" argb="255,166,166,0" value="166" />
+			<entry class="168" argb="255,167,167,0" value="167" />
+			<entry class="169" argb="255,168,168,0" value="168" />
+			<entry class="170" argb="255,169,169,0" value="169" />
+			<entry class="171" argb="255,170,170,0" value="170" />
+			<entry class="172" argb="255,171,171,0" value="171" />
+			<entry class="173" argb="255,172,172,0" value="172" />
+			<entry class="174" argb="255,173,173,0" value="173" />
+			<entry class="175" argb="255,174,174,0" value="174" />
+			<entry class="176" argb="255,175,175,0" value="175" />
+			<entry class="177" argb="255,176,176,0" value="176" />
+			<entry class="178" argb="255,177,177,0" value="177" />
+			<entry class="179" argb="255,178,178,0" value="178" />
+			<entry class="180" argb="255,179,179,0" value="179" />
+			<entry class="181" argb="255,180,180,0" value="180" />
+			<entry class="182" argb="255,181,181,0" value="181" />
+			<entry class="183" argb="255,182,182,0" value="182" />
+			<entry class="184" argb="255,183,183,0" value="183" />
+			<entry class="185" argb="255,184,184,0" value="184" />
+			<entry class="186" argb="255,185,185,0" value="185" />
+			<entry class="187" argb="255,186,186,0" value="186" />
+			<entry class="188" argb="255,187,187,0" value="187" />
+			<entry class="189" argb="255,188,188,0" value="188" />
+			<entry class="190" argb="255,189,189,0" value="189" />
+			<entry class="191" argb="255,190,190,0" value="190" />
+			<entry class="192" argb="255,191,191,0" value="191" />
+			<entry class="193" argb="255,192,192,0" value="192" />
+			<entry class="194" argb="255,193,193,0" value="193" />
+			<entry class="195" argb="255,194,194,0" value="194" />
+			<entry class="196" argb="255,195,195,0" value="195" />
+			<entry class="197" argb="255,196,196,0" value="196" />
+			<entry class="198" argb="255,197,197,0" value="197" />
+			<entry class="199" argb="255,198,198,0" value="198" />
+			<entry class="200" argb="255,199,199,0" value="199" />
+			<entry class="201" argb="255,200,200,0" value="200" />
+			<entry class="202" argb="255,201,201,0" value="201" />
+			<entry class="203" argb="255,202,202,0" value="202" />
+			<entry class="204" argb="255,203,203,0" value="203" />
+			<entry class="205" argb="255,204,204,0" value="204" />
+			<entry class="206" argb="255,205,205,0" value="205" />
+			<entry class="207" argb="255,206,206,0" value="206" />
+			<entry class="208" argb="255,207,207,0" value="207" />
+			<entry class="209" argb="255,208,208,0" value="208" />
+			<entry class="210" argb="255,209,209,0" value="209" />
+			<entry class="211" argb="255,210,210,0" value="210" />
+			<entry class="212" argb="255,211,211,0" value="211" />
+			<entry class="213" argb="255,212,212,0" value="212" />
+			<entry class="214" argb="255,213,213,0" value="213" />
+			<entry class="215" argb="255,214,214,0" value="214" />
+			<entry class="216" argb="255,215,215,0" value="215" />
+			<entry class="217" argb="255,216,216,0" value="216" />
+			<entry class="218" argb="255,217,217,0" value="217" />
+			<entry class="219" argb="255,218,218,0" value="218" />
+			<entry class="220" argb="255,219,219,0" value="219" />
+			<entry class="221" argb="255,220,220,0" value="220" />
+			<entry class="222" argb="255,221,221,0" value="221" />
+			<entry class="223" argb="255,222,222,0" value="222" />
+			<entry class="224" argb="255,223,223,0" value="223" />
+			<entry class="225" argb="255,224,224,0" value="224" />
+			<entry class="226" argb="255,225,225,0" value="225" />
+			<entry class="227" argb="255,226,226,0" value="226" />
+			<entry class="228" argb="255,227,227,0" value="227" />
+			<entry class="229" argb="255,228,228,0" value="228" />
+			<entry class="230" argb="255,229,229,0" value="229" />
+			<entry class="231" argb="255,230,230,0" value="230" />
+			<entry class="232" argb="255,231,231,0" value="231" />
+			<entry class="233" argb="255,232,232,0" value="232" />
+			<entry class="234" argb="255,233,233,0" value="233" />
+			<entry class="235" argb="255,234,234,0" value="234" />
+			<entry class="236" argb="255,235,235,0" value="235" />
+			<entry class="237" argb="255,236,236,0" value="236" />
+			<entry class="238" argb="255,237,237,0" value="237" />
+			<entry class="239" argb="255,238,238,0" value="238" />
+			<entry class="240" argb="255,239,239,0" value="239" />
+			<entry class="241" argb="255,240,240,0" value="240" />
+			<entry class="242" argb="255,241,241,0" value="241" />
+			<entry class="243" argb="255,242,242,0" value="242" />
+			<entry class="244" argb="255,243,243,0" value="243" />
+			<entry class="245" argb="255,244,244,0" value="244" />
+			<entry class="246" argb="255,245,245,0" value="245" />
+			<entry class="247" argb="255,246,246,0" value="246" />
+			<entry class="248" argb="255,247,247,0" value="247" />
+			<entry class="249" argb="255,248,248,0" value="248" />
+			<entry class="250" argb="255,249,249,0" value="249" />
+			<entry class="251" argb="255,250,250,0" value="250" />
+			<entry class="252" argb="255,251,251,0" value="251" />
+			<entry class="253" argb="255,252,252,0" value="252" />
+			<entry class="254" argb="255,253,253,0" value="253" />
+			<entry class="255" argb="255,254,254,0" value="254" />
+			<entry class="256" argb="255,255,255,0" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(0,0,0) to HSV(0,0,100) -->
+	<!-- Rename "z  Black - White  (256)" if not used as default -->
+	<palette name="Default" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,0" value="0" />
+			<entry class="2" argb="255,0,0,0" value="1" />
+			<entry class="3" argb="255,1,1,1" value="2" />
+			<entry class="4" argb="255,2,2,2" value="3" />
+			<entry class="5" argb="255,3,3,3" value="4" />
+			<entry class="6" argb="255,4,4,4" value="5" />
+			<entry class="7" argb="255,5,5,5" value="6" />
+			<entry class="8" argb="255,6,6,6" value="7" />
+			<entry class="9" argb="255,7,7,7" value="8" />
+			<entry class="10" argb="255,8,8,8" value="9" />
+			<entry class="11" argb="255,9,9,9" value="10" />
+			<entry class="12" argb="255,10,10,10" value="11" />
+			<entry class="13" argb="255,11,11,11" value="12" />
+			<entry class="14" argb="255,12,12,12" value="13" />
+			<entry class="15" argb="255,13,13,13" value="14" />
+			<entry class="16" argb="255,14,14,14" value="15" />
+			<entry class="17" argb="255,15,15,15" value="16" />
+			<entry class="18" argb="255,16,16,16" value="17" />
+			<entry class="19" argb="255,17,17,17" value="18" />
+			<entry class="20" argb="255,18,18,18" value="19" />
+			<entry class="21" argb="255,19,19,19" value="20" />
+			<entry class="22" argb="255,20,20,20" value="21" />
+			<entry class="23" argb="255,21,21,21" value="22" />
+			<entry class="24" argb="255,22,22,22" value="23" />
+			<entry class="25" argb="255,23,23,23" value="24" />
+			<entry class="26" argb="255,24,24,24" value="25" />
+			<entry class="27" argb="255,25,25,25" value="26" />
+			<entry class="28" argb="255,26,26,26" value="27" />
+			<entry class="29" argb="255,27,27,27" value="28" />
+			<entry class="30" argb="255,28,28,28" value="29" />
+			<entry class="31" argb="255,29,29,29" value="30" />
+			<entry class="32" argb="255,30,30,30" value="31" />
+			<entry class="33" argb="255,31,31,31" value="32" />
+			<entry class="34" argb="255,32,32,32" value="33" />
+			<entry class="35" argb="255,33,33,33" value="34" />
+			<entry class="36" argb="255,34,34,34" value="35" />
+			<entry class="37" argb="255,35,35,35" value="36" />
+			<entry class="38" argb="255,36,36,36" value="37" />
+			<entry class="39" argb="255,37,37,37" value="38" />
+			<entry class="40" argb="255,38,38,38" value="39" />
+			<entry class="41" argb="255,39,39,39" value="40" />
+			<entry class="42" argb="255,40,40,40" value="41" />
+			<entry class="43" argb="255,41,41,41" value="42" />
+			<entry class="44" argb="255,42,42,42" value="43" />
+			<entry class="45" argb="255,43,43,43" value="44" />
+			<entry class="46" argb="255,44,44,44" value="45" />
+			<entry class="47" argb="255,45,45,45" value="46" />
+			<entry class="48" argb="255,46,46,46" value="47" />
+			<entry class="49" argb="255,47,47,47" value="48" />
+			<entry class="50" argb="255,48,48,48" value="49" />
+			<entry class="51" argb="255,49,49,49" value="50" />
+			<entry class="52" argb="255,50,50,50" value="51" />
+			<entry class="53" argb="255,51,51,51" value="52" />
+			<entry class="54" argb="255,52,52,52" value="53" />
+			<entry class="55" argb="255,53,53,53" value="54" />
+			<entry class="56" argb="255,54,54,54" value="55" />
+			<entry class="57" argb="255,55,55,55" value="56" />
+			<entry class="58" argb="255,56,56,56" value="57" />
+			<entry class="59" argb="255,57,57,57" value="58" />
+			<entry class="60" argb="255,58,58,58" value="59" />
+			<entry class="61" argb="255,59,59,59" value="60" />
+			<entry class="62" argb="255,60,60,60" value="61" />
+			<entry class="63" argb="255,61,61,61" value="62" />
+			<entry class="64" argb="255,62,62,62" value="63" />
+			<entry class="65" argb="255,63,63,63" value="64" />
+			<entry class="66" argb="255,64,64,64" value="65" />
+			<entry class="67" argb="255,65,65,65" value="66" />
+			<entry class="68" argb="255,66,66,66" value="67" />
+			<entry class="69" argb="255,67,67,67" value="68" />
+			<entry class="70" argb="255,68,68,68" value="69" />
+			<entry class="71" argb="255,69,69,69" value="70" />
+			<entry class="72" argb="255,70,70,70" value="71" />
+			<entry class="73" argb="255,71,71,71" value="72" />
+			<entry class="74" argb="255,72,72,72" value="73" />
+			<entry class="75" argb="255,73,73,73" value="74" />
+			<entry class="76" argb="255,74,74,74" value="75" />
+			<entry class="77" argb="255,75,75,75" value="76" />
+			<entry class="78" argb="255,76,76,76" value="77" />
+			<entry class="79" argb="255,77,77,77" value="78" />
+			<entry class="80" argb="255,78,78,78" value="79" />
+			<entry class="81" argb="255,79,79,79" value="80" />
+			<entry class="82" argb="255,80,80,80" value="81" />
+			<entry class="83" argb="255,81,81,81" value="82" />
+			<entry class="84" argb="255,82,82,82" value="83" />
+			<entry class="85" argb="255,83,83,83" value="84" />
+			<entry class="86" argb="255,84,84,84" value="85" />
+			<entry class="87" argb="255,85,85,85" value="86" />
+			<entry class="88" argb="255,86,86,86" value="87" />
+			<entry class="89" argb="255,87,87,87" value="88" />
+			<entry class="90" argb="255,88,88,88" value="89" />
+			<entry class="91" argb="255,89,89,89" value="90" />
+			<entry class="92" argb="255,90,90,90" value="91" />
+			<entry class="93" argb="255,91,91,91" value="92" />
+			<entry class="94" argb="255,92,92,92" value="93" />
+			<entry class="95" argb="255,93,93,93" value="94" />
+			<entry class="96" argb="255,94,94,94" value="95" />
+			<entry class="97" argb="255,95,95,95" value="96" />
+			<entry class="98" argb="255,96,96,96" value="97" />
+			<entry class="99" argb="255,97,97,97" value="98" />
+			<entry class="100" argb="255,98,98,98" value="99" />
+			<entry class="101" argb="255,99,99,99" value="100" />
+			<entry class="102" argb="255,100,100,100" value="101" />
+			<entry class="103" argb="255,101,101,101" value="102" />
+			<entry class="104" argb="255,102,102,102" value="103" />
+			<entry class="105" argb="255,103,103,103" value="104" />
+			<entry class="106" argb="255,104,104,104" value="105" />
+			<entry class="107" argb="255,105,105,105" value="106" />
+			<entry class="108" argb="255,106,106,106" value="107" />
+			<entry class="109" argb="255,107,107,107" value="108" />
+			<entry class="110" argb="255,108,108,108" value="109" />
+			<entry class="111" argb="255,109,109,109" value="110" />
+			<entry class="112" argb="255,110,110,110" value="111" />
+			<entry class="113" argb="255,111,111,111" value="112" />
+			<entry class="114" argb="255,112,112,112" value="113" />
+			<entry class="115" argb="255,113,113,113" value="114" />
+			<entry class="116" argb="255,114,114,114" value="115" />
+			<entry class="117" argb="255,115,115,115" value="116" />
+			<entry class="118" argb="255,116,116,116" value="117" />
+			<entry class="119" argb="255,117,117,117" value="118" />
+			<entry class="120" argb="255,118,118,118" value="119" />
+			<entry class="121" argb="255,119,119,119" value="120" />
+			<entry class="122" argb="255,120,120,120" value="121" />
+			<entry class="123" argb="255,121,121,121" value="122" />
+			<entry class="124" argb="255,122,122,122" value="123" />
+			<entry class="125" argb="255,123,123,123" value="124" />
+			<entry class="126" argb="255,124,124,124" value="125" />
+			<entry class="127" argb="255,125,125,125" value="126" />
+			<entry class="128" argb="255,126,126,126" value="127" />
+			<entry class="129" argb="255,127,127,127" value="128" />
+			<entry class="130" argb="255,128,128,128" value="129" />
+			<entry class="131" argb="255,129,129,129" value="130" />
+			<entry class="132" argb="255,130,130,130" value="131" />
+			<entry class="133" argb="255,131,131,131" value="132" />
+			<entry class="134" argb="255,132,132,132" value="133" />
+			<entry class="135" argb="255,133,133,133" value="134" />
+			<entry class="136" argb="255,134,134,134" value="135" />
+			<entry class="137" argb="255,135,135,135" value="136" />
+			<entry class="138" argb="255,136,136,136" value="137" />
+			<entry class="139" argb="255,137,137,137" value="138" />
+			<entry class="140" argb="255,138,138,138" value="139" />
+			<entry class="141" argb="255,139,139,139" value="140" />
+			<entry class="142" argb="255,140,140,140" value="141" />
+			<entry class="143" argb="255,141,141,141" value="142" />
+			<entry class="144" argb="255,142,142,142" value="143" />
+			<entry class="145" argb="255,143,143,143" value="144" />
+			<entry class="146" argb="255,144,144,144" value="145" />
+			<entry class="147" argb="255,145,145,145" value="146" />
+			<entry class="148" argb="255,146,146,146" value="147" />
+			<entry class="149" argb="255,147,147,147" value="148" />
+			<entry class="150" argb="255,148,148,148" value="149" />
+			<entry class="151" argb="255,149,149,149" value="150" />
+			<entry class="152" argb="255,150,150,150" value="151" />
+			<entry class="153" argb="255,151,151,151" value="152" />
+			<entry class="154" argb="255,152,152,152" value="153" />
+			<entry class="155" argb="255,153,153,153" value="154" />
+			<entry class="156" argb="255,154,154,154" value="155" />
+			<entry class="157" argb="255,155,155,155" value="156" />
+			<entry class="158" argb="255,156,156,156" value="157" />
+			<entry class="159" argb="255,157,157,157" value="158" />
+			<entry class="160" argb="255,158,158,158" value="159" />
+			<entry class="161" argb="255,159,159,159" value="160" />
+			<entry class="162" argb="255,160,160,160" value="161" />
+			<entry class="163" argb="255,161,161,161" value="162" />
+			<entry class="164" argb="255,162,162,162" value="163" />
+			<entry class="165" argb="255,163,163,163" value="164" />
+			<entry class="166" argb="255,164,164,164" value="165" />
+			<entry class="167" argb="255,165,165,165" value="166" />
+			<entry class="168" argb="255,166,166,166" value="167" />
+			<entry class="169" argb="255,167,167,167" value="168" />
+			<entry class="170" argb="255,168,168,168" value="169" />
+			<entry class="171" argb="255,169,169,169" value="170" />
+			<entry class="172" argb="255,170,170,170" value="171" />
+			<entry class="173" argb="255,171,171,171" value="172" />
+			<entry class="174" argb="255,172,172,172" value="173" />
+			<entry class="175" argb="255,173,173,173" value="174" />
+			<entry class="176" argb="255,174,174,174" value="175" />
+			<entry class="177" argb="255,175,175,175" value="176" />
+			<entry class="178" argb="255,176,176,176" value="177" />
+			<entry class="179" argb="255,177,177,177" value="178" />
+			<entry class="180" argb="255,178,178,178" value="179" />
+			<entry class="181" argb="255,179,179,179" value="180" />
+			<entry class="182" argb="255,180,180,180" value="181" />
+			<entry class="183" argb="255,181,181,181" value="182" />
+			<entry class="184" argb="255,182,182,182" value="183" />
+			<entry class="185" argb="255,183,183,183" value="184" />
+			<entry class="186" argb="255,184,184,184" value="185" />
+			<entry class="187" argb="255,185,185,185" value="186" />
+			<entry class="188" argb="255,186,186,186" value="187" />
+			<entry class="189" argb="255,187,187,187" value="188" />
+			<entry class="190" argb="255,188,188,188" value="189" />
+			<entry class="191" argb="255,189,189,189" value="190" />
+			<entry class="192" argb="255,190,190,190" value="191" />
+			<entry class="193" argb="255,191,191,191" value="192" />
+			<entry class="194" argb="255,192,192,192" value="193" />
+			<entry class="195" argb="255,193,193,193" value="194" />
+			<entry class="196" argb="255,194,194,194" value="195" />
+			<entry class="197" argb="255,195,195,195" value="196" />
+			<entry class="198" argb="255,196,196,196" value="197" />
+			<entry class="199" argb="255,197,197,197" value="198" />
+			<entry class="200" argb="255,198,198,198" value="199" />
+			<entry class="201" argb="255,199,199,199" value="200" />
+			<entry class="202" argb="255,200,200,200" value="201" />
+			<entry class="203" argb="255,201,201,201" value="202" />
+			<entry class="204" argb="255,202,202,202" value="203" />
+			<entry class="205" argb="255,203,203,203" value="204" />
+			<entry class="206" argb="255,204,204,204" value="205" />
+			<entry class="207" argb="255,205,205,205" value="206" />
+			<entry class="208" argb="255,206,206,206" value="207" />
+			<entry class="209" argb="255,207,207,207" value="208" />
+			<entry class="210" argb="255,208,208,208" value="209" />
+			<entry class="211" argb="255,209,209,209" value="210" />
+			<entry class="212" argb="255,210,210,210" value="211" />
+			<entry class="213" argb="255,211,211,211" value="212" />
+			<entry class="214" argb="255,212,212,212" value="213" />
+			<entry class="215" argb="255,213,213,213" value="214" />
+			<entry class="216" argb="255,214,214,214" value="215" />
+			<entry class="217" argb="255,215,215,215" value="216" />
+			<entry class="218" argb="255,216,216,216" value="217" />
+			<entry class="219" argb="255,217,217,217" value="218" />
+			<entry class="220" argb="255,218,218,218" value="219" />
+			<entry class="221" argb="255,219,219,219" value="220" />
+			<entry class="222" argb="255,220,220,220" value="221" />
+			<entry class="223" argb="255,221,221,221" value="222" />
+			<entry class="224" argb="255,222,222,222" value="223" />
+			<entry class="225" argb="255,223,223,223" value="224" />
+			<entry class="226" argb="255,224,224,224" value="225" />
+			<entry class="227" argb="255,225,225,225" value="226" />
+			<entry class="228" argb="255,226,226,226" value="227" />
+			<entry class="229" argb="255,227,227,227" value="228" />
+			<entry class="230" argb="255,228,228,228" value="229" />
+			<entry class="231" argb="255,229,229,229" value="230" />
+			<entry class="232" argb="255,230,230,230" value="231" />
+			<entry class="233" argb="255,231,231,231" value="232" />
+			<entry class="234" argb="255,232,232,232" value="233" />
+			<entry class="235" argb="255,233,233,233" value="234" />
+			<entry class="236" argb="255,234,234,234" value="235" />
+			<entry class="237" argb="255,235,235,235" value="236" />
+			<entry class="238" argb="255,236,236,236" value="237" />
+			<entry class="239" argb="255,237,237,237" value="238" />
+			<entry class="240" argb="255,238,238,238" value="239" />
+			<entry class="241" argb="255,239,239,239" value="240" />
+			<entry class="242" argb="255,240,240,240" value="241" />
+			<entry class="243" argb="255,241,241,241" value="242" />
+			<entry class="244" argb="255,242,242,242" value="243" />
+			<entry class="245" argb="255,243,243,243" value="244" />
+			<entry class="246" argb="255,244,244,244" value="245" />
+			<entry class="247" argb="255,245,245,245" value="246" />
+			<entry class="248" argb="255,246,246,246" value="247" />
+			<entry class="249" argb="255,247,247,247" value="248" />
+			<entry class="250" argb="255,248,248,248" value="249" />
+			<entry class="251" argb="255,249,249,249" value="250" />
+			<entry class="252" argb="255,250,250,250" value="251" />
+			<entry class="253" argb="255,251,251,251" value="252" />
+			<entry class="254" argb="255,252,252,252" value="253" />
+			<entry class="255" argb="255,253,253,253" value="254" />
+			<entry class="256" argb="255,254,254,254" value="255" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(350,90,50) to HSV(300,100,98) to HSV(225,90,50) -->
+	<palette name="Lava Lamp 1  (125)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,127,12,31" value="0" />
+			<entry class="2" argb="255,129,12,34" value="1" />
+			<entry class="3" argb="255,132,12,36" value="2" />
+			<entry class="4" argb="255,134,12,39" value="3" />
+			<entry class="5" argb="255,137,12,41" value="4" />
+			<entry class="6" argb="255,139,12,44" value="5" />
+			<entry class="7" argb="255,142,12,47" value="6" />
+			<entry class="8" argb="255,144,12,49" value="7" />
+			<entry class="9" argb="255,147,12,52" value="8" />
+			<entry class="10" argb="255,149,12,55" value="9" />
+			<entry class="11" argb="255,151,12,58" value="10" />
+			<entry class="12" argb="255,154,12,61" value="11" />
+			<entry class="13" argb="255,156,11,65" value="12" />
+			<entry class="14" argb="255,159,11,68" value="13" />
+			<entry class="15" argb="255,161,11,71" value="14" />
+			<entry class="16" argb="255,164,11,75" value="15" />
+			<entry class="17" argb="255,166,11,78" value="16" />
+			<entry class="18" argb="255,169,11,82" value="17" />
+			<entry class="19" argb="255,171,10,85" value="18" />
+			<entry class="20" argb="255,174,10,89" value="19" />
+			<entry class="21" argb="255,176,10,93" value="20" />
+			<entry class="22" argb="255,178,10,97" value="21" />
+			<entry class="23" argb="255,181,10,101" value="22" />
+			<entry class="24" argb="255,183,9,105" value="23" />
+			<entry class="25" argb="255,186,9,109" value="24" />
+			<entry class="26" argb="255,188,9,114" value="25" />
+			<entry class="27" argb="255,191,9,118" value="26" />
+			<entry class="28" argb="255,193,8,122" value="27" />
+			<entry class="29" argb="255,196,8,127" value="28" />
+			<entry class="30" argb="255,198,8,131" value="29" />
+			<entry class="31" argb="255,200,8,136" value="30" />
+			<entry class="32" argb="255,203,7,141" value="31" />
+			<entry class="33" argb="255,205,7,146" value="32" />
+			<entry class="34" argb="255,208,7,151" value="33" />
+			<entry class="35" argb="255,210,6,156" value="34" />
+			<entry class="36" argb="255,213,6,161" value="35" />
+			<entry class="37" argb="255,215,6,166" value="36" />
+			<entry class="38" argb="255,218,5,172" value="37" />
+			<entry class="39" argb="255,220,5,177" value="38" />
+			<entry class="40" argb="255,222,4,182" value="39" />
+			<entry class="41" argb="255,225,4,188" value="40" />
+			<entry class="42" argb="255,227,4,194" value="41" />
+			<entry class="43" argb="255,230,3,200" value="42" />
+			<entry class="44" argb="255,232,3,205" value="43" />
+			<entry class="45" argb="255,235,2,211" value="44" />
+			<entry class="46" argb="255,237,2,218" value="45" />
+			<entry class="47" argb="255,240,1,224" value="46" />
+			<entry class="48" argb="255,242,1,230" value="47" />
+			<entry class="49" argb="255,245,0,236" value="48" />
+			<entry class="50" argb="255,247,0,243" value="49" />
+			<entry class="51" argb="255,249,0,249" value="50" />
+			<entry class="52" argb="255,244,0,248" value="51" />
+			<entry class="53" argb="255,238,0,246" value="52" />
+			<entry class="54" argb="255,232,0,245" value="53" />
+			<entry class="55" argb="255,227,1,243" value="54" />
+			<entry class="56" argb="255,221,1,241" value="55" />
+			<entry class="57" argb="255,216,1,240" value="56" />
+			<entry class="58" argb="255,210,2,238" value="57" />
+			<entry class="59" argb="255,205,2,236" value="58" />
+			<entry class="60" argb="255,200,2,235" value="59" />
+			<entry class="61" argb="255,195,3,233" value="60" />
+			<entry class="62" argb="255,190,3,231" value="61" />
+			<entry class="63" argb="255,184,3,230" value="62" />
+			<entry class="64" argb="255,179,3,228" value="63" />
+			<entry class="65" argb="255,175,4,227" value="64" />
+			<entry class="66" argb="255,170,4,225" value="65" />
+			<entry class="67" argb="255,165,4,223" value="66" />
+			<entry class="68" argb="255,160,5,222" value="67" />
+			<entry class="69" argb="255,155,5,220" value="68" />
+			<entry class="70" argb="255,151,5,218" value="69" />
+			<entry class="71" argb="255,146,5,217" value="70" />
+			<entry class="72" argb="255,142,6,215" value="71" />
+			<entry class="73" argb="255,137,6,213" value="72" />
+			<entry class="74" argb="255,133,6,212" value="73" />
+			<entry class="75" argb="255,129,6,210" value="74" />
+			<entry class="76" argb="255,124,6,209" value="75" />
+			<entry class="77" argb="255,120,7,207" value="76" />
+			<entry class="78" argb="255,116,7,205" value="77" />
+			<entry class="79" argb="255,112,7,204" value="78" />
+			<entry class="80" argb="255,108,7,202" value="79" />
+			<entry class="81" argb="255,104,8,200" value="80" />
+			<entry class="82" argb="255,100,8,199" value="81" />
+			<entry class="83" argb="255,96,8,197" value="82" />
+			<entry class="84" argb="255,92,8,196" value="83" />
+			<entry class="85" argb="255,89,8,194" value="84" />
+			<entry class="86" argb="255,85,8,192" value="85" />
+			<entry class="87" argb="255,81,9,191" value="86" />
+			<entry class="88" argb="255,78,9,189" value="87" />
+			<entry class="89" argb="255,74,9,187" value="88" />
+			<entry class="90" argb="255,71,9,186" value="89" />
+			<entry class="91" argb="255,68,9,184" value="90" />
+			<entry class="92" argb="255,64,10,182" value="91" />
+			<entry class="93" argb="255,61,10,181" value="92" />
+			<entry class="94" argb="255,58,10,179" value="93" />
+			<entry class="95" argb="255,55,10,178" value="94" />
+			<entry class="96" argb="255,52,10,176" value="95" />
+			<entry class="97" argb="255,49,10,174" value="96" />
+			<entry class="98" argb="255,46,10,173" value="97" />
+			<entry class="99" argb="255,43,10,171" value="98" />
+			<entry class="100" argb="255,40,11,169" value="99" />
+			<entry class="101" argb="255,37,11,168" value="100" />
+			<entry class="102" argb="255,34,11,166" value="101" />
+			<entry class="103" argb="255,31,11,165" value="102" />
+			<entry class="104" argb="255,29,11,163" value="103" />
+			<entry class="105" argb="255,26,11,161" value="104" />
+			<entry class="106" argb="255,24,11,160" value="105" />
+			<entry class="107" argb="255,21,11,158" value="106" />
+			<entry class="108" argb="255,19,11,156" value="107" />
+			<entry class="109" argb="255,16,12,155" value="108" />
+			<entry class="110" argb="255,14,12,153" value="109" />
+			<entry class="111" argb="255,12,12,151" value="110" />
+			<entry class="112" argb="255,12,14,150" value="111" />
+			<entry class="113" argb="255,12,16,148" value="112" />
+			<entry class="114" argb="255,12,19,147" value="113" />
+			<entry class="115" argb="255,12,21,145" value="114" />
+			<entry class="116" argb="255,12,23,143" value="115" />
+			<entry class="117" argb="255,12,25,142" value="116" />
+			<entry class="118" argb="255,12,27,140" value="117" />
+			<entry class="119" argb="255,12,29,138" value="118" />
+			<entry class="120" argb="255,12,31,137" value="119" />
+			<entry class="121" argb="255,12,33,135" value="120" />
+			<entry class="122" argb="255,12,34,134" value="121" />
+			<entry class="123" argb="255,12,36,132" value="122" />
+			<entry class="124" argb="255,12,38,130" value="123" />
+			<entry class="125" argb="255,12,39,129" value="124" />
+		</table>
+	</palette>
+
+	<!-- Gradient, HSV(190,90,50) to HSV(140,100,98) to HSV(65,90,50) -->
+	<palette name="Lava Lamp 2  (125)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,12,108,127" value="0" />
+			<entry class="2" argb="255,12,112,129" value="1" />
+			<entry class="3" argb="255,12,116,132" value="2" />
+			<entry class="4" argb="255,12,120,134" value="3" />
+			<entry class="5" argb="255,12,124,137" value="4" />
+			<entry class="6" argb="255,12,129,139" value="5" />
+			<entry class="7" argb="255,12,133,142" value="6" />
+			<entry class="8" argb="255,12,138,144" value="7" />
+			<entry class="9" argb="255,12,142,147" value="8" />
+			<entry class="10" argb="255,12,147,149" value="9" />
+			<entry class="11" argb="255,12,151,151" value="10" />
+			<entry class="12" argb="255,12,154,152" value="11" />
+			<entry class="13" argb="255,11,156,152" value="12" />
+			<entry class="14" argb="255,11,159,151" value="13" />
+			<entry class="15" argb="255,11,161,151" value="14" />
+			<entry class="16" argb="255,11,164,151" value="15" />
+			<entry class="17" argb="255,11,166,151" value="16" />
+			<entry class="18" argb="255,11,169,150" value="17" />
+			<entry class="19" argb="255,10,171,150" value="18" />
+			<entry class="20" argb="255,10,174,149" value="19" />
+			<entry class="21" argb="255,10,176,148" value="20" />
+			<entry class="22" argb="255,10,178,148" value="21" />
+			<entry class="23" argb="255,10,181,147" value="22" />
+			<entry class="24" argb="255,9,183,146" value="23" />
+			<entry class="25" argb="255,9,186,145" value="24" />
+			<entry class="26" argb="255,9,188,143" value="25" />
+			<entry class="27" argb="255,9,191,142" value="26" />
+			<entry class="28" argb="255,8,193,141" value="27" />
+			<entry class="29" argb="255,8,196,139" value="28" />
+			<entry class="30" argb="255,8,198,138" value="29" />
+			<entry class="31" argb="255,8,200,136" value="30" />
+			<entry class="32" argb="255,7,203,134" value="31" />
+			<entry class="33" argb="255,7,205,133" value="32" />
+			<entry class="34" argb="255,7,208,131" value="33" />
+			<entry class="35" argb="255,6,210,129" value="34" />
+			<entry class="36" argb="255,6,213,127" value="35" />
+			<entry class="37" argb="255,6,215,124" value="36" />
+			<entry class="38" argb="255,5,218,122" value="37" />
+			<entry class="39" argb="255,5,220,120" value="38" />
+			<entry class="40" argb="255,4,222,117" value="39" />
+			<entry class="41" argb="255,4,225,114" value="40" />
+			<entry class="42" argb="255,4,227,112" value="41" />
+			<entry class="43" argb="255,3,230,109" value="42" />
+			<entry class="44" argb="255,3,232,106" value="43" />
+			<entry class="45" argb="255,2,235,103" value="44" />
+			<entry class="46" argb="255,2,237,100" value="45" />
+			<entry class="47" argb="255,1,240,97" value="46" />
+			<entry class="48" argb="255,1,242,93" value="47" />
+			<entry class="49" argb="255,0,245,90" value="48" />
+			<entry class="50" argb="255,0,247,86" value="49" />
+			<entry class="51" argb="255,0,249,83" value="50" />
+			<entry class="52" argb="255,0,248,78" value="51" />
+			<entry class="53" argb="255,0,246,74" value="52" />
+			<entry class="54" argb="255,0,245,70" value="53" />
+			<entry class="55" argb="255,1,243,65" value="54" />
+			<entry class="56" argb="255,1,241,61" value="55" />
+			<entry class="57" argb="255,1,240,57" value="56" />
+			<entry class="58" argb="255,2,238,53" value="57" />
+			<entry class="59" argb="255,2,236,49" value="58" />
+			<entry class="60" argb="255,2,235,45" value="59" />
+			<entry class="61" argb="255,3,233,41" value="60" />
+			<entry class="62" argb="255,3,231,37" value="61" />
+			<entry class="63" argb="255,3,230,33" value="62" />
+			<entry class="64" argb="255,3,228,30" value="63" />
+			<entry class="65" argb="255,4,227,26" value="64" />
+			<entry class="66" argb="255,4,225,22" value="65" />
+			<entry class="67" argb="255,4,223,19" value="66" />
+			<entry class="68" argb="255,5,222,15" value="67" />
+			<entry class="69" argb="255,5,220,12" value="68" />
+			<entry class="70" argb="255,5,218,9" value="69" />
+			<entry class="71" argb="255,5,217,5" value="70" />
+			<entry class="72" argb="255,9,215,6" value="71" />
+			<entry class="73" argb="255,13,213,6" value="72" />
+			<entry class="74" argb="255,16,212,6" value="73" />
+			<entry class="75" argb="255,20,210,6" value="74" />
+			<entry class="76" argb="255,23,209,6" value="75" />
+			<entry class="77" argb="255,27,207,7" value="76" />
+			<entry class="78" argb="255,30,205,7" value="77" />
+			<entry class="79" argb="255,33,204,7" value="78" />
+			<entry class="80" argb="255,37,202,7" value="79" />
+			<entry class="81" argb="255,40,200,8" value="80" />
+			<entry class="82" argb="255,43,199,8" value="81" />
+			<entry class="83" argb="255,46,197,8" value="82" />
+			<entry class="84" argb="255,49,196,8" value="83" />
+			<entry class="85" argb="255,52,194,8" value="84" />
+			<entry class="86" argb="255,54,192,8" value="85" />
+			<entry class="87" argb="255,57,191,9" value="86" />
+			<entry class="88" argb="255,60,189,9" value="87" />
+			<entry class="89" argb="255,63,187,9" value="88" />
+			<entry class="90" argb="255,65,186,9" value="89" />
+			<entry class="91" argb="255,68,184,9" value="90" />
+			<entry class="92" argb="255,70,182,10" value="91" />
+			<entry class="93" argb="255,72,181,10" value="92" />
+			<entry class="94" argb="255,75,179,10" value="93" />
+			<entry class="95" argb="255,77,178,10" value="94" />
+			<entry class="96" argb="255,79,176,10" value="95" />
+			<entry class="97" argb="255,81,174,10" value="96" />
+			<entry class="98" argb="255,83,173,10" value="97" />
+			<entry class="99" argb="255,85,171,10" value="98" />
+			<entry class="100" argb="255,87,169,11" value="99" />
+			<entry class="101" argb="255,89,168,11" value="100" />
+			<entry class="102" argb="255,91,166,11" value="101" />
+			<entry class="103" argb="255,93,165,11" value="102" />
+			<entry class="104" argb="255,95,163,11" value="103" />
+			<entry class="105" argb="255,96,161,11" value="104" />
+			<entry class="106" argb="255,98,160,11" value="105" />
+			<entry class="107" argb="255,99,158,11" value="106" />
+			<entry class="108" argb="255,101,156,11" value="107" />
+			<entry class="109" argb="255,102,155,12" value="108" />
+			<entry class="110" argb="255,104,153,12" value="109" />
+			<entry class="111" argb="255,105,151,12" value="110" />
+			<entry class="112" argb="255,106,150,12" value="111" />
+			<entry class="113" argb="255,107,148,12" value="112" />
+			<entry class="114" argb="255,108,147,12" value="113" />
+			<entry class="115" argb="255,109,145,12" value="114" />
+			<entry class="116" argb="255,110,143,12" value="115" />
+			<entry class="117" argb="255,111,142,12" value="116" />
+			<entry class="118" argb="255,112,140,12" value="117" />
+			<entry class="119" argb="255,113,138,12" value="118" />
+			<entry class="120" argb="255,114,137,12" value="119" />
+			<entry class="121" argb="255,115,135,12" value="120" />
+			<entry class="122" argb="255,115,134,12" value="121" />
+			<entry class="123" argb="255,116,132,12" value="122" />
+			<entry class="124" argb="255,116,130,12" value="123" />
+			<entry class="125" argb="255,117,129,12" value="124" />
+		</table>
+	</palette>
+	
+	<!-- Color Scheme Designer 3, Hue: 30, Tetrad Angle: 20, Scheme: High Contrast -->
+	<palette name="Mosaic 1  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,230,117,23" value="0" />
+			<entry class="2" argb="255,143,99,63" value="1" />
+			<entry class="3" argb="255,109,51,3" value="2" />
+			<entry class="4" argb="255,249,172,109" value="3" />
+			<entry class="5" argb="255,249,209,176" value="4" />
+			<entry class="6" argb="255,230,161,23" value="5" />
+			<entry class="7" argb="255,143,117,63" value="6" />
+			<entry class="8" argb="255,109,74,3" value="7" />
+			<entry class="9" argb="255,249,202,109" value="8" />
+			<entry class="10" argb="255,249,224,176" value="9" />
+			<entry class="11" argb="255,30,67,154" value="10" />
+			<entry class="12" argb="255,48,62,96" value="11" />
+			<entry class="13" argb="255,4,25,73" value="12" />
+			<entry class="14" argb="255,114,149,230" value="13" />
+			<entry class="15" argb="255,170,188,230" value="14" />
+			<entry class="16" argb="255,14,138,138" value="15" />
+			<entry class="17" argb="255,38,86,86" value="16" />
+			<entry class="18" argb="255,2,65,65" value="17" />
+			<entry class="19" argb="255,99,226,226" value="18" />
+			<entry class="20" argb="255,160,226,226" value="19" />
+		</table>
+	</palette>	
+
+	<!-- Color Scheme Designer 3, Hue: 150, Tetrad Angle: 20, Scheme: High Contrast -->
+	<palette name="Mosaic 2  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,150,214,21" value="0" />
+			<entry class="2" argb="255,109,134,59" value="1" />
+			<entry class="3" argb="255,69,102,3" value="2" />
+			<entry class="4" argb="255,199,245,107" value="3" />
+			<entry class="5" argb="255,221,245,173" value="4" />
+			<entry class="6" argb="255,18,184,18" value="5" />
+			<entry class="7" argb="255,50,115,50" value="6" />
+			<entry class="8" argb="255,2,87,2" value="7" />
+			<entry class="9" argb="255,104,237,104" value="8" />
+			<entry class="10" argb="255,168,237,168" value="9" />
+			<entry class="11" argb="255,230,23,23" value="10" />
+			<entry class="12" argb="255,143,63,63" value="11" />
+			<entry class="13" argb="255,109,3,3" value="12" />
+			<entry class="14" argb="255,249,109,109" value="13" />
+			<entry class="15" argb="255,249,176,176" value="14" />
+			<entry class="16" argb="255,184,18,112" value="15" />
+			<entry class="17" argb="255,115,50,87" value="16" />
+			<entry class="18" argb="255,87,2,50" value="17" />
+			<entry class="19" argb="255,237,104,179" value="18" />
+			<entry class="20" argb="255,237,168,207" value="19" />
+		</table>
+	</palette>
+
+	<!-- Color Scheme Designer 3, Hue: 270, Tetrad Angle: 20, Scheme: High Contrast -->	
+	<palette name="Mosaic 3  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,62,32,158" value="0" />
+			<entry class="2" argb="255,61,50,99" value="1" />
+			<entry class="3" argb="255,21,4,75" value="2" />
+			<entry class="4" argb="255,143,116,231" value="3" />
+			<entry class="5" argb="255,185,171,231" value="4" />
+			<entry class="6" argb="255,107,23,153" value="5" />
+			<entry class="7" argb="255,78,45,96" value="6" />
+			<entry class="8" argb="255,48,3,73" value="7" />
+			<entry class="9" argb="255,186,107,230" value="8" />
+			<entry class="10" argb="255,207,166,230" value="9" />
+			<entry class="11" argb="255,230,230,23" value="10" />
+			<entry class="12" argb="255,143,143,63" value="11" />
+			<entry class="13" argb="255,109,109,3" value="12" />
+			<entry class="14" argb="255,249,249,109" value="13" />
+			<entry class="15" argb="255,249,249,176" value="14" />
+			<entry class="16" argb="255,230,194,23" value="15" />
+			<entry class="17" argb="255,143,130,63" value="16" />
+			<entry class="18" argb="255,109,91,3" value="17" />
+			<entry class="19" argb="255,249,225,109" value="18" />
+			<entry class="20" argb="255,249,236,176" value="19" />
+		</table>
+	</palette>
+	
+	<!-- Color Scheme Designer 3, Hue: 90, Tetrad Angle: 20
+           Scheme: Pastels, with lights and shadows upper right (75%) -->
+	<palette name="Mosaic 4  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,223,202,98" value="0" />
+			<entry class="2" argb="255,136,128,90" value="1" />
+			<entry class="3" argb="255,102,86,10" value="2" />
+			<entry class="4" argb="255,249,234,165" value="3" />
+			<entry class="5" argb="255,249,242,209" value="4" />
+			<entry class="6" argb="255,223,215,98" value="5" />
+			<entry class="7" argb="255,136,133,90" value="6" />
+			<entry class="8" argb="255,102,96,10" value="7" />
+			<entry class="9" argb="255,249,243,165" value="8" />
+			<entry class="10" argb="255,249,246,209" value="9" />
+			<entry class="11" argb="255,111,73,151" value="10" />
+			<entry class="12" argb="255,77,63,92" value="11" />
+			<entry class="13" argb="255,38,7,69" value="12" />
+			<entry class="14" argb="255,197,161,234" value="13" />
+			<entry class="15" argb="255,216,199,234" value="14" />
+			<entry class="16" argb="255,95,77,154" value="15" />
+			<entry class="17" argb="255,72,65,94" value="16" />
+			<entry class="18" argb="255,23,8,70" value="17" />
+			<entry class="19" argb="255,181,164,234" value="18" />
+			<entry class="20" argb="255,209,201,234" value="19" />
+		</table>
+	</palette>
+	
+	<!-- Color Scheme Designer 3, Hue: 210, Tetrad Angle: 20
+           Scheme: Pastels, with lights and shadows upper right (75%) -->
+	<palette name="Mosaic 5  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,59,134,134" value="0" />
+			<entry class="2" argb="255,54,82,82" value="1" />
+			<entry class="3" argb="255,6,61,61" value="2" />
+			<entry class="4" argb="255,153,230,230" value="3" />
+			<entry class="5" argb="255,194,230,230" value="4" />
+			<entry class="6" argb="255,71,106,146" value="5" />
+			<entry class="7" argb="255,61,74,89" value="6" />
+			<entry class="8" argb="255,7,35,66" value="7" />
+			<entry class="9" argb="255,161,195,233" value="8" />
+			<entry class="10" argb="255,199,215,233" value="9" />
+			<entry class="11" argb="255,223,174,98" value="10" />
+			<entry class="12" argb="255,136,118,90" value="11" />
+			<entry class="13" argb="255,102,65,10" value="12" />
+			<entry class="14" argb="255,249,215,165" value="13" />
+			<entry class="15" argb="255,249,233,209" value="14" />
+			<entry class="16" argb="255,223,155,98" value="15" />
+			<entry class="17" argb="255,136,111,90" value="16" />
+			<entry class="18" argb="255,102,51,10" value="17" />
+			<entry class="19" argb="255,249,203,165" value="18" />
+			<entry class="20" argb="255,249,227,209" value="19" />
+		</table>
+	</palette>
+
+	<!-- Color Scheme Designer 3, Hue: 330, Tetrad Angle: 20
+           Scheme: Pastels, with lights and shadows upper right (75%) -->
+	<palette name="Mosaic 6  (20)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,179,79,135" value="0" />
+			<entry class="2" argb="255,109,72,93" value="1" />
+			<entry class="3" argb="255,81,8,50" value="2" />
+			<entry class="4" argb="255,240,159,204" value="3" />
+			<entry class="5" argb="255,240,202,223" value="4" />
+			<entry class="6" argb="255,206,91,116" value="5" />
+			<entry class="7" argb="255,126,83,92" value="6" />
+			<entry class="8" argb="255,94,9,27" value="7" />
+			<entry class="9" argb="255,245,162,180" value="8" />
+			<entry class="10" argb="255,245,206,215" value="9" />
+			<entry class="11" argb="255,123,194,85" value="10" />
+			<entry class="12" argb="255,92,119,78" value="11" />
+			<entry class="13" argb="255,36,88,9" value="12" />
+			<entry class="14" argb="255,189,243,161" value="13" />
+			<entry class="15" argb="255,218,243,204" value="14" />
+			<entry class="16" argb="255,169,208,92" value="15" />
+			<entry class="17" argb="255,113,127,84" value="16" />
+			<entry class="18" argb="255,66,95,9" value="17" />
+			<entry class="19" argb="255,218,245,163" value="18" />
+			<entry class="20" argb="255,233,245,207" value="19" />
+		</table>
+	</palette>
+
+	<!-- (HSV 0, 50%, 95%) Degrees between hues 10-->
+	<palette name="Pastels Long  (36)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,121,121" value="0" />
+			<entry class="2" argb="255,242,141,121" value="1" />
+			<entry class="3" argb="255,242,161,121" value="2" />
+			<entry class="4" argb="255,242,181,121" value="3" />
+			<entry class="5" argb="255,242,201,121" value="4" />
+			<entry class="6" argb="255,242,222,121" value="5" />
+			<entry class="7" argb="255,242,242,121" value="6" />
+			<entry class="8" argb="255,222,242,121" value="7" />
+			<entry class="9" argb="255,201,242,121" value="8" />
+			<entry class="10" argb="255,181,242,121" value="9" />
+			<entry class="11" argb="255,161,242,121" value="10" />
+			<entry class="12" argb="255,141,242,121" value="11" />
+			<entry class="13" argb="255,121,242,121" value="12" />
+			<entry class="14" argb="255,121,242,141" value="13" />
+			<entry class="15" argb="255,121,242,161" value="14" />
+			<entry class="16" argb="255,121,242,181" value="15" />
+			<entry class="17" argb="255,121,242,201" value="16" />
+			<entry class="18" argb="255,121,242,222" value="17" />
+			<entry class="19" argb="255,121,242,242" value="18" />
+			<entry class="20" argb="255,121,222,242" value="19" />
+			<entry class="21" argb="255,121,201,242" value="20" />
+			<entry class="22" argb="255,121,181,242" value="21" />
+			<entry class="23" argb="255,121,161,242" value="22" />
+			<entry class="24" argb="255,121,141,242" value="23" />
+			<entry class="25" argb="255,121,121,242" value="24" />
+			<entry class="26" argb="255,141,121,242" value="25" />
+			<entry class="27" argb="255,161,121,242" value="26" />
+			<entry class="28" argb="255,181,121,242" value="27" />
+			<entry class="29" argb="255,201,121,242" value="28" />
+			<entry class="30" argb="255,222,121,242" value="29" />
+			<entry class="31" argb="255,242,121,242" value="30" />
+			<entry class="32" argb="255,242,121,222" value="31" />
+			<entry class="33" argb="255,242,121,201" value="32" />
+			<entry class="34" argb="255,242,121,181" value="33" />
+			<entry class="35" argb="255,242,121,161" value="34" />
+			<entry class="36" argb="255,242,121,141" value="35" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 50%, 95%) Degrees between hues 40-->
+	<palette name="Pastels Short  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,242,121,121" value="0" />
+			<entry class="2" argb="255,242,201,121" value="1" />
+			<entry class="3" argb="255,201,242,121" value="2" />
+			<entry class="4" argb="255,121,242,121" value="3" />
+			<entry class="5" argb="255,121,242,201" value="4" />
+			<entry class="6" argb="255,121,201,242" value="5" />
+			<entry class="7" argb="255,121,121,242" value="6" />
+			<entry class="8" argb="255,201,121,242" value="7" />
+			<entry class="9" argb="255,242,121,201" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 50%, 75%) Degrees between hues 10-->
+	<palette name="Pastels Dark Long  (36)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,191,95,95" value="0" />
+			<entry class="2" argb="255,191,111,95" value="1" />
+			<entry class="3" argb="255,191,127,95" value="2" />
+			<entry class="4" argb="255,191,143,95" value="3" />
+			<entry class="5" argb="255,191,159,95" value="4" />
+			<entry class="6" argb="255,191,175,95" value="5" />
+			<entry class="7" argb="255,191,191,95" value="6" />
+			<entry class="8" argb="255,175,191,95" value="7" />
+			<entry class="9" argb="255,159,191,95" value="8" />
+			<entry class="10" argb="255,143,191,95" value="9" />
+			<entry class="11" argb="255,127,191,95" value="10" />
+			<entry class="12" argb="255,111,191,95" value="11" />
+			<entry class="13" argb="255,95,191,95" value="12" />
+			<entry class="14" argb="255,95,191,111" value="13" />
+			<entry class="15" argb="255,95,191,127" value="14" />
+			<entry class="16" argb="255,95,191,143" value="15" />
+			<entry class="17" argb="255,95,191,159" value="16" />
+			<entry class="18" argb="255,95,191,175" value="17" />
+			<entry class="19" argb="255,95,191,191" value="18" />
+			<entry class="20" argb="255,95,175,191" value="19" />
+			<entry class="21" argb="255,95,159,191" value="20" />
+			<entry class="22" argb="255,95,143,191" value="21" />
+			<entry class="23" argb="255,95,127,191" value="22" />
+			<entry class="24" argb="255,95,111,191" value="23" />
+			<entry class="25" argb="255,95,95,191" value="24" />
+			<entry class="26" argb="255,111,95,191" value="25" />
+			<entry class="27" argb="255,127,95,191" value="26" />
+			<entry class="28" argb="255,143,95,191" value="27" />
+			<entry class="29" argb="255,159,95,191" value="28" />
+			<entry class="30" argb="255,175,95,191" value="29" />
+			<entry class="31" argb="255,191,95,191" value="30" />
+			<entry class="32" argb="255,191,95,175" value="31" />
+			<entry class="33" argb="255,191,95,159" value="32" />
+			<entry class="34" argb="255,191,95,143" value="33" />
+			<entry class="35" argb="255,191,95,127" value="34" />
+			<entry class="36" argb="255,191,95,111" value="35" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 50%, 75%) Degrees between hues 40-->
+	<palette name="Pastels Dark Short  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,191,95,95" value="0" />
+			<entry class="2" argb="255,191,159,95" value="1" />
+			<entry class="3" argb="255,159,191,95" value="2" />
+			<entry class="4" argb="255,95,191,95" value="3" />
+			<entry class="5" argb="255,95,191,159" value="4" />
+			<entry class="6" argb="255,95,159,191" value="5" />
+			<entry class="7" argb="255,95,95,191" value="6" />
+			<entry class="8" argb="255,159,95,191" value="7" />
+			<entry class="9" argb="255,191,95,159" value="8" />
+		</table>
+	</palette>
+
+	<!-- (HSV 243, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Blue  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,127,112,216" value="0" />
+			<entry class="2" argb="255,94,75,216" value="1" />
+			<entry class="3" argb="255,22,7,115" value="2" />
+			<entry class="4" argb="255,58,46,133" value="3" />
+			<entry class="5" argb="255,44,23,177" value="4" />
+			<entry class="6" argb="255,109,135,214" value="5" />
+			<entry class="7" argb="255,71,107,214" value="6" />
+			<entry class="8" argb="255,6,33,112" value="7" />
+			<entry class="9" argb="255,43,65,129" value="8" />
+			<entry class="10" argb="255,19,58,172" value="9" />
+			<entry class="11" argb="255,101,166,209" value="10" />
+			<entry class="12" argb="255,62,151,209" value="11" />
+			<entry class="13" argb="255,3,66,106" value="12" />
+			<entry class="14" argb="255,36,88,122" value="13" />
+			<entry class="15" argb="255,10,103,163" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 171, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Green  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,98,218,154" value="0" />
+			<entry class="2" argb="255,54,218,130" value="1" />
+			<entry class="3" argb="255,0,117,54" value="2" />
+			<entry class="4" argb="255,34,135,81" value="3" />
+			<entry class="5" argb="255,0,180,84" value="4" />
+			<entry class="6" argb="255,149,238,107" value="5" />
+			<entry class="7" argb="255,117,238,59" value="6" />
+			<entry class="8" argb="255,47,143,0" value="7" />
+			<entry class="9" argb="255,82,165,41" value="8" />
+			<entry class="10" argb="255,72,221,0" value="9" />
+			<entry class="11" argb="255,199,246,111" value="10" />
+			<entry class="12" argb="255,182,246,62" value="11" />
+			<entry class="13" argb="255,101,154,0" value="12" />
+			<entry class="14" argb="255,132,178,45" value="13" />
+			<entry class="15" argb="255,155,237,0" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 27, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Orange  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,255,197,115" value="0" />
+			<entry class="2" argb="255,255,176,64" value="1" />
+			<entry class="3" argb="255,166,97,0" value="2" />
+			<entry class="4" argb="255,191,132,48" value="3" />
+			<entry class="5" argb="255,255,149,0" value="4" />
+			<entry class="6" argb="255,255,174,115" value="5" />
+			<entry class="7" argb="255,255,145,64" value="6" />
+			<entry class="8" argb="255,166,70,0" value="7" />
+			<entry class="9" argb="255,191,109,48" value="8" />
+			<entry class="10" argb="255,255,108,0" value="9" />
+			<entry class="11" argb="255,255,137,115" value="10" />
+			<entry class="12" argb="255,255,93,64" value="11" />
+			<entry class="13" argb="255,166,26,0" value="12" />
+			<entry class="14" argb="255,191,70,48" value="13" />
+			<entry class="15" argb="255,255,40,0" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 315, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Purple  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,234,105,166" value="0" />
+			<entry class="2" argb="255,234,58,141" value="1" />
+			<entry class="3" argb="255,138,0,65" value="2" />
+			<entry class="4" argb="255,160,40,96" value="3" />
+			<entry class="5" argb="255,213,0,101" value="4" />
+			<entry class="6" argb="255,210,95,210" value="5" />
+			<entry class="7" argb="255,210,53,210" value="6" />
+			<entry class="8" argb="255,108,0,108" value="7" />
+			<entry class="9" argb="255,124,31,124" value="8" />
+			<entry class="10" argb="255,166,0,166" value="9" />
+			<entry class="11" argb="255,166,104,213" value="10" />
+			<entry class="12" argb="255,148,64,213" value="11" />
+			<entry class="13" argb="255,65,4,111" value="12" />
+			<entry class="14" argb="255,89,38,128" value="13" />
+			<entry class="15" argb="255,102,11,171" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 99, 95%, 95%) Color Scheme Designer 3, Analogic Angle 20 degrees 
+	Used Secondary Color A, Then Primary Color, Then Secondary Color B -->
+	<palette name="Stairsteps Yellow  (15)" interpolate="false">
+		<table>	
+			<entry class="1" argb="255,255,254,115" value="0" />
+			<entry class="2" argb="255,255,254,64" value="1" />
+			<entry class="3" argb="255,166,165,0" value="2" />
+			<entry class="4" argb="255,191,190,48" value="3" />
+			<entry class="5" argb="255,255,253,0" value="4" />
+			<entry class="6" argb="255,255,238,115" value="5" />
+			<entry class="7" argb="255,255,231,64" value="6" />
+			<entry class="8" argb="255,166,145,0" value="7" />
+			<entry class="9" argb="255,191,174,48" value="8" />
+			<entry class="10" argb="255,255,223,0" value="9" />
+			<entry class="11" argb="255,255,223,115" value="10" />
+			<entry class="12" argb="255,255,211,64" value="11" />
+			<entry class="13" argb="255,166,128,0" value="12" />
+			<entry class="14" argb="255,191,158,48" value="13" />
+			<entry class="15" argb="255,255,197,0" value="14" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 240, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 240, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Down Blue  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,0,0,101" value="0" />
+			<entry class="2" argb="255,0,0,140" value="1" />
+			<entry class="3" argb="255,0,0,178" value="2" />
+			<entry class="4" argb="255,0,0,216" value="3" />
+			<entry class="5" argb="255,0,0,255" value="4" />
+			<entry class="6" argb="255,38,38,255" value="5" />
+			<entry class="7" argb="255,76,76,255" value="6" />
+			<entry class="8" argb="255,114,114,255" value="7" />
+			<entry class="9" argb="255,153,153,255" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 120, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 120, 100%, 100%) Five with Value step -0.15 -->	
+	<palette name="Step Down Green  (9)" interpolate="false">
+		<table>
+			<entry class="0" argb="255,0,101,0" value="0" />
+			<entry class="1" argb="255,0,140,0" value="1" />
+			<entry class="2" argb="255,0,178,0" value="2" />
+			<entry class="3" argb="255,0,216,0" value="3" />
+			<entry class="4" argb="255,0,255,0" value="4" />
+			<entry class="5" argb="255,38,255,38" value="5" />
+			<entry class="6" argb="255,76,255,76" value="6" />
+			<entry class="7" argb="255,114,255,114" value="7" />
+			<entry class="8" argb="255,153,255,153" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 0, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 0, 100%, 100%) Five with Value step -0.15 -->
+	<palette name="Step Down Red  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,101,0,0" value="0" />
+			<entry class="2" argb="255,140,0,0" value="1" />
+			<entry class="3" argb="255,178,0,0" value="2" />
+			<entry class="4" argb="255,216,0,0" value="3" />
+			<entry class="5" argb="255,255,0,0" value="4" />
+			<entry class="6" argb="255,255,38,38" value="5" />
+			<entry class="7" argb="255,255,76,76" value="6" />
+			<entry class="8" argb="255,255,114,114" value="7" />
+			<entry class="9" argb="255,255,153,153" value="8" />
+		</table>
+	</palette>
+
+	<!-- (HSV 180, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 180, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Up Cyan  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,153,255,255" value="0" />
+			<entry class="2" argb="255,114,255,255" value="1" />
+			<entry class="3" argb="255,76,255,255" value="2" />
+			<entry class="4" argb="255,38,255,255" value="3" />
+			<entry class="5" argb="255,0,255,255" value="4" />
+			<entry class="6" argb="255,0,216,216" value="5" />
+			<entry class="7" argb="255,0,178,178" value="6" />
+			<entry class="8" argb="255,0,140,140" value="7" />
+			<entry class="9" argb="255,0,101,101" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 300, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 300, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Up Magenta  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,153,255" value="0" />
+			<entry class="2" argb="255,255,114,255" value="1" />
+			<entry class="3" argb="255,255,76,255" value="2" />
+			<entry class="4" argb="255,255,38,255" value="3" />
+			<entry class="5" argb="255,255,0,255" value="4" />
+			<entry class="6" argb="255,216,0,216" value="5" />
+			<entry class="7" argb="255,178,0,178" value="6" />
+			<entry class="8" argb="255,140,0,140" value="7" />
+			<entry class="9" argb="255,101,0,101" value="8" />
+		</table>
+	</palette>
+	
+	<!-- (HSV 60, 40%, 100%) Five with Saturation step 0.15 
+	       (HSV 60, 100%, 100%) Five with Value step -0.15 -->		
+	<palette name="Step Up Yellow  (9)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,255,153" value="0" />
+			<entry class="2" argb="255,255,255,114" value="1" />
+			<entry class="3" argb="255,255,255,76" value="2" />
+			<entry class="4" argb="255,255,255,38" value="3" />
+			<entry class="5" argb="255,255,255,0" value="4" />
+			<entry class="6" argb="255,216,216,0" value="5" />
+			<entry class="7" argb="255,178,178,0" value="6" />
+			<entry class="8" argb="255,140,140,0" value="7" />
+			<entry class="9" argb="255,101,101,0" value="8" />
+		</table>
+	</palette>
+	
+	<!-- Gradient, HSV(0,0,100) to HSV(0,0,0) -->	
+	<palette name="White-Black  (256)" interpolate="false">
+		<table>
+			<entry class="1" argb="255,255,255,255" value="0" />
+			<entry class="2" argb="255,254,254,254" value="1" />
+			<entry class="3" argb="255,253,253,253" value="2" />
+			<entry class="4" argb="255,252,252,252" value="3" />
+			<entry class="5" argb="255,251,251,251" value="4" />
+			<entry class="6" argb="255,250,250,250" value="5" />
+			<entry class="7" argb="255,249,249,249" value="6" />
+			<entry class="8" argb="255,248,248,248" value="7" />
+			<entry class="9" argb="255,247,247,247" value="8" />
+			<entry class="10" argb="255,246,246,246" value="9" />
+			<entry class="11" argb="255,245,245,245" value="10" />
+			<entry class="12" argb="255,244,244,244" value="11" />
+			<entry class="13" argb="255,243,243,243" value="12" />
+			<entry class="14" argb="255,242,242,242" value="13" />
+			<entry class="15" argb="255,241,241,241" value="14" />
+			<entry class="16" argb="255,240,240,240" value="15" />
+			<entry class="17" argb="255,239,239,239" value="16" />
+			<entry class="18" argb="255,238,238,238" value="17" />
+			<entry class="19" argb="255,237,237,237" value="18" />
+			<entry class="20" argb="255,236,236,236" value="19" />
+			<entry class="21" argb="255,235,235,235" value="20" />
+			<entry class="22" argb="255,234,234,234" value="21" />
+			<entry class="23" argb="255,233,233,233" value="22" />
+			<entry class="24" argb="255,232,232,232" value="23" />
+			<entry class="25" argb="255,231,231,231" value="24" />
+			<entry class="26" argb="255,230,230,230" value="25" />
+			<entry class="27" argb="255,229,229,229" value="26" />
+			<entry class="28" argb="255,228,228,228" value="27" />
+			<entry class="29" argb="255,227,227,227" value="28" />
+			<entry class="30" argb="255,226,226,226" value="29" />
+			<entry class="31" argb="255,225,225,225" value="30" />
+			<entry class="32" argb="255,224,224,224" value="31" />
+			<entry class="33" argb="255,223,223,223" value="32" />
+			<entry class="34" argb="255,222,222,222" value="33" />
+			<entry class="35" argb="255,221,221,221" value="34" />
+			<entry class="36" argb="255,220,220,220" value="35" />
+			<entry class="37" argb="255,219,219,219" value="36" />
+			<entry class="38" argb="255,218,218,218" value="37" />
+			<entry class="39" argb="255,217,217,217" value="38" />
+			<entry class="40" argb="255,216,216,216" value="39" />
+			<entry class="41" argb="255,215,215,215" value="40" />
+			<entry class="42" argb="255,214,214,214" value="41" />
+			<entry class="43" argb="255,213,213,213" value="42" />
+			<entry class="44" argb="255,212,212,212" value="43" />
+			<entry class="45" argb="255,211,211,211" value="44" />
+			<entry class="46" argb="255,210,210,210" value="45" />
+			<entry class="47" argb="255,209,209,209" value="46" />
+			<entry class="48" argb="255,208,208,208" value="47" />
+			<entry class="49" argb="255,207,207,207" value="48" />
+			<entry class="50" argb="255,206,206,206" value="49" />
+			<entry class="51" argb="255,205,205,205" value="50" />
+			<entry class="52" argb="255,204,204,204" value="51" />
+			<entry class="53" argb="255,203,203,203" value="52" />
+			<entry class="54" argb="255,202,202,202" value="53" />
+			<entry class="55" argb="255,201,201,201" value="54" />
+			<entry class="56" argb="255,200,200,200" value="55" />
+			<entry class="57" argb="255,199,199,199" value="56" />
+			<entry class="58" argb="255,198,198,198" value="57" />
+			<entry class="59" argb="255,197,197,197" value="58" />
+			<entry class="60" argb="255,196,196,196" value="59" />
+			<entry class="61" argb="255,195,195,195" value="60" />
+			<entry class="62" argb="255,194,194,194" value="61" />
+			<entry class="63" argb="255,193,193,193" value="62" />
+			<entry class="64" argb="255,192,192,192" value="63" />
+			<entry class="65" argb="255,191,191,191" value="64" />
+			<entry class="66" argb="255,190,190,190" value="65" />
+			<entry class="67" argb="255,189,189,189" value="66" />
+			<entry class="68" argb="255,188,188,188" value="67" />
+			<entry class="69" argb="255,187,187,187" value="68" />
+			<entry class="70" argb="255,186,186,186" value="69" />
+			<entry class="71" argb="255,185,185,185" value="70" />
+			<entry class="72" argb="255,184,184,184" value="71" />
+			<entry class="73" argb="255,183,183,183" value="72" />
+			<entry class="74" argb="255,182,182,182" value="73" />
+			<entry class="75" argb="255,181,181,181" value="74" />
+			<entry class="76" argb="255,180,180,180" value="75" />
+			<entry class="77" argb="255,179,179,179" value="76" />
+			<entry class="78" argb="255,178,178,178" value="77" />
+			<entry class="79" argb="255,177,177,177" value="78" />
+			<entry class="80" argb="255,176,176,176" value="79" />
+			<entry class="81" argb="255,175,175,175" value="80" />
+			<entry class="82" argb="255,174,174,174" value="81" />
+			<entry class="83" argb="255,173,173,173" value="82" />
+			<entry class="84" argb="255,172,172,172" value="83" />
+			<entry class="85" argb="255,171,171,171" value="84" />
+			<entry class="86" argb="255,170,170,170" value="85" />
+			<entry class="87" argb="255,169,169,169" value="86" />
+			<entry class="88" argb="255,168,168,168" value="87" />
+			<entry class="89" argb="255,167,167,167" value="88" />
+			<entry class="90" argb="255,166,166,166" value="89" />
+			<entry class="91" argb="255,165,165,165" value="90" />
+			<entry class="92" argb="255,164,164,164" value="91" />
+			<entry class="93" argb="255,163,163,163" value="92" />
+			<entry class="94" argb="255,162,162,162" value="93" />
+			<entry class="95" argb="255,161,161,161" value="94" />
+			<entry class="96" argb="255,160,160,160" value="95" />
+			<entry class="97" argb="255,159,159,159" value="96" />
+			<entry class="98" argb="255,158,158,158" value="97" />
+			<entry class="99" argb="255,157,157,157" value="98" />
+			<entry class="100" argb="255,156,156,156" value="99" />
+			<entry class="101" argb="255,155,155,155" value="100" />
+			<entry class="102" argb="255,154,154,154" value="101" />
+			<entry class="103" argb="255,153,153,153" value="102" />
+			<entry class="104" argb="255,152,152,152" value="103" />
+			<entry class="105" argb="255,151,151,151" value="104" />
+			<entry class="106" argb="255,150,150,150" value="105" />
+			<entry class="107" argb="255,149,149,149" value="106" />
+			<entry class="108" argb="255,148,148,148" value="107" />
+			<entry class="109" argb="255,147,147,147" value="108" />
+			<entry class="110" argb="255,146,146,146" value="109" />
+			<entry class="111" argb="255,145,145,145" value="110" />
+			<entry class="112" argb="255,144,144,144" value="111" />
+			<entry class="113" argb="255,143,143,143" value="112" />
+			<entry class="114" argb="255,142,142,142" value="113" />
+			<entry class="115" argb="255,141,141,141" value="114" />
+			<entry class="116" argb="255,140,140,140" value="115" />
+			<entry class="117" argb="255,139,139,139" value="116" />
+			<entry class="118" argb="255,138,138,138" value="117" />
+			<entry class="119" argb="255,137,137,137" value="118" />
+			<entry class="120" argb="255,136,136,136" value="119" />
+			<entry class="121" argb="255,135,135,135" value="120" />
+			<entry class="122" argb="255,134,134,134" value="121" />
+			<entry class="123" argb="255,133,133,133" value="122" />
+			<entry class="124" argb="255,132,132,132" value="123" />
+			<entry class="125" argb="255,131,131,131" value="124" />
+			<entry class="126" argb="255,130,130,130" value="125" />
+			<entry class="127" argb="255,129,129,129" value="126" />
+			<entry class="128" argb="255,128,128,128" value="127" />
+			<entry class="129" argb="255,127,127,127" value="128" />
+			<entry class="130" argb="255,126,126,126" value="129" />
+			<entry class="131" argb="255,125,125,125" value="130" />
+			<entry class="132" argb="255,124,124,124" value="131" />
+			<entry class="133" argb="255,123,123,123" value="132" />
+			<entry class="134" argb="255,122,122,122" value="133" />
+			<entry class="135" argb="255,121,121,121" value="134" />
+			<entry class="136" argb="255,120,120,120" value="135" />
+			<entry class="137" argb="255,119,119,119" value="136" />
+			<entry class="138" argb="255,118,118,118" value="137" />
+			<entry class="139" argb="255,117,117,117" value="138" />
+			<entry class="140" argb="255,116,116,116" value="139" />
+			<entry class="141" argb="255,115,115,115" value="140" />
+			<entry class="142" argb="255,114,114,114" value="141" />
+			<entry class="143" argb="255,113,113,113" value="142" />
+			<entry class="144" argb="255,112,112,112" value="143" />
+			<entry class="145" argb="255,111,111,111" value="144" />
+			<entry class="146" argb="255,110,110,110" value="145" />
+			<entry class="147" argb="255,109,109,109" value="146" />
+			<entry class="148" argb="255,108,108,108" value="147" />
+			<entry class="149" argb="255,107,107,107" value="148" />
+			<entry class="150" argb="255,106,106,106" value="149" />
+			<entry class="151" argb="255,105,105,105" value="150" />
+			<entry class="152" argb="255,104,104,104" value="151" />
+			<entry class="153" argb="255,103,103,103" value="152" />
+			<entry class="154" argb="255,102,102,102" value="153" />
+			<entry class="155" argb="255,101,101,101" value="154" />
+			<entry class="156" argb="255,100,100,100" value="155" />
+			<entry class="157" argb="255,99,99,99" value="156" />
+			<entry class="158" argb="255,98,98,98" value="157" />
+			<entry class="159" argb="255,97,97,97" value="158" />
+			<entry class="160" argb="255,96,96,96" value="159" />
+			<entry class="161" argb="255,95,95,95" value="160" />
+			<entry class="162" argb="255,94,94,94" value="161" />
+			<entry class="163" argb="255,93,93,93" value="162" />
+			<entry class="164" argb="255,92,92,92" value="163" />
+			<entry class="165" argb="255,91,91,91" value="164" />
+			<entry class="166" argb="255,90,90,90" value="165" />
+			<entry class="167" argb="255,89,89,89" value="166" />
+			<entry class="168" argb="255,88,88,88" value="167" />
+			<entry class="169" argb="255,87,87,87" value="168" />
+			<entry class="170" argb="255,86,86,86" value="169" />
+			<entry class="171" argb="255,85,85,85" value="170" />
+			<entry class="172" argb="255,84,84,84" value="171" />
+			<entry class="173" argb="255,83,83,83" value="172" />
+			<entry class="174" argb="255,82,82,82" value="173" />
+			<entry class="175" argb="255,81,81,81" value="174" />
+			<entry class="176" argb="255,80,80,80" value="175" />
+			<entry class="177" argb="255,79,79,79" value="176" />
+			<entry class="178" argb="255,78,78,78" value="177" />
+			<entry class="179" argb="255,77,77,77" value="178" />
+			<entry class="180" argb="255,76,76,76" value="179" />
+			<entry class="181" argb="255,75,75,75" value="180" />
+			<entry class="182" argb="255,74,74,74" value="181" />
+			<entry class="183" argb="255,73,73,73" value="182" />
+			<entry class="184" argb="255,72,72,72" value="183" />
+			<entry class="185" argb="255,71,71,71" value="184" />
+			<entry class="186" argb="255,70,70,70" value="185" />
+			<entry class="187" argb="255,69,69,69" value="186" />
+			<entry class="188" argb="255,68,68,68" value="187" />
+			<entry class="189" argb="255,67,67,67" value="188" />
+			<entry class="190" argb="255,66,66,66" value="189" />
+			<entry class="191" argb="255,65,65,65" value="190" />
+			<entry class="192" argb="255,64,64,64" value="191" />
+			<entry class="193" argb="255,63,63,63" value="192" />
+			<entry class="194" argb="255,62,62,62" value="193" />
+			<entry class="195" argb="255,61,61,61" value="194" />
+			<entry class="196" argb="255,60,60,60" value="195" />
+			<entry class="197" argb="255,59,59,59" value="196" />
+			<entry class="198" argb="255,58,58,58" value="197" />
+			<entry class="199" argb="255,57,57,57" value="198" />
+			<entry class="200" argb="255,56,56,56" value="199" />
+			<entry class="201" argb="255,55,55,55" value="200" />
+			<entry class="202" argb="255,54,54,54" value="201" />
+			<entry class="203" argb="255,53,53,53" value="202" />
+			<entry class="204" argb="255,52,52,52" value="203" />
+			<entry class="205" argb="255,51,51,51" value="204" />
+			<entry class="206" argb="255,50,50,50" value="205" />
+			<entry class="207" argb="255,49,49,49" value="206" />
+			<entry class="208" argb="255,48,48,48" value="207" />
+			<entry class="209" argb="255,47,47,47" value="208" />
+			<entry class="210" argb="255,46,46,46" value="209" />
+			<entry class="211" argb="255,45,45,45" value="210" />
+			<entry class="212" argb="255,44,44,44" value="211" />
+			<entry class="213" argb="255,43,43,43" value="212" />
+			<entry class="214" argb="255,42,42,42" value="213" />
+			<entry class="215" argb="255,41,41,41" value="214" />
+			<entry class="216" argb="255,40,40,40" value="215" />
+			<entry class="217" argb="255,39,39,39" value="216" />
+			<entry class="218" argb="255,38,38,38" value="217" />
+			<entry class="219" argb="255,37,37,37" value="218" />
+			<entry class="220" argb="255,36,36,36" value="219" />
+			<entry class="221" argb="255,35,35,35" value="220" />
+			<entry class="222" argb="255,34,34,34" value="221" />
+			<entry class="223" argb="255,33,33,33" value="222" />
+			<entry class="224" argb="255,32,32,32" value="223" />
+			<entry class="225" argb="255,31,31,31" value="224" />
+			<entry class="226" argb="255,30,30,30" value="225" />
+			<entry class="227" argb="255,29,29,29" value="226" />
+			<entry class="228" argb="255,28,28,28" value="227" />
+			<entry class="229" argb="255,27,27,27" value="228" />
+			<entry class="230" argb="255,26,26,26" value="229" />
+			<entry class="231" argb="255,25,25,25" value="230" />
+			<entry class="232" argb="255,24,24,24" value="231" />
+			<entry class="233" argb="255,23,23,23" value="232" />
+			<entry class="234" argb="255,22,22,22" value="233" />
+			<entry class="235" argb="255,21,21,21" value="234" />
+			<entry class="236" argb="255,20,20,20" value="235" />
+			<entry class="237" argb="255,19,19,19" value="236" />
+			<entry class="238" argb="255,18,18,18" value="237" />
+			<entry class="239" argb="255,17,17,17" value="238" />
+			<entry class="240" argb="255,16,16,16" value="239" />
+			<entry class="241" argb="255,15,15,15" value="240" />
+			<entry class="242" argb="255,14,14,14" value="241" />
+			<entry class="243" argb="255,13,13,13" value="242" />
+			<entry class="244" argb="255,12,12,12" value="243" />
+			<entry class="245" argb="255,11,11,11" value="244" />
+			<entry class="246" argb="255,10,10,10" value="245" />
+			<entry class="247" argb="255,9,9,9" value="246" />
+			<entry class="248" argb="255,8,8,8" value="247" />
+			<entry class="249" argb="255,7,7,7" value="248" />
+			<entry class="250" argb="255,6,6,6" value="249" />
+			<entry class="251" argb="255,5,5,5" value="250" />
+			<entry class="252" argb="255,4,4,4" value="251" />
+			<entry class="253" argb="255,3,3,3" value="252" />
+			<entry class="254" argb="255,2,2,2" value="253" />
+			<entry class="255" argb="255,1,1,1" value="254" />
+			<entry class="256" argb="255,0,0,0" value="255" />
+		</table>
+	</palette>
+	
+</palettes>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/resources/org/gvsig/raster/impl/datastruct/persistence/xml/palettes.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 15423)
@@ -0,0 +1 @@
+org.gvsig.raster.impl.RasterDefaultImplLibrary
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultFileUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultFileUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultFileUtils.java	(revision 15423)
@@ -0,0 +1,392 @@
+/* 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.util;
+
+import java.awt.geom.AffineTransform;
+import java.io.BufferedOutputStream;
+import java.io.BufferedReader;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+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.URI;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+
+import org.apache.commons.lang3.StringUtils;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.PropertyEvent;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+
+
+/**
+ * Utilities for files, directories and file names
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultFileUtils implements FileUtils {
+
+	public void copyFile(String pathOrig, String pathDst) throws FileNotFoundException, IOException {
+		InputStream in;
+		OutputStream out;
+
+		if (pathOrig == null || pathDst == null) {
+			System.err.println("Error en path");
+			return;
+		}
+
+		File orig = new File(pathOrig);
+		if (!orig.exists() || !orig.isFile() || !orig.canRead()) {
+			System.err.println("Error copying the file:" + pathOrig + " <Source Exists:" + orig.exists() + ", Source is file:" + orig.isFile() + ", Source can be read:" + orig.canRead() + ">");
+			return;
+		}
+
+		File dest = new File(pathDst);
+		String file = new File(pathOrig).getName();
+		if (dest.isDirectory())
+			pathDst += file;
+
+		dest = new File(pathDst);
+		if(!dest.exists())
+			dest.createNewFile();
+
+		in = new FileInputStream(pathOrig);
+		out = new FileOutputStream(pathDst);
+
+		byte[] buf = new byte[1024];
+		int len;
+
+		while ((len = in.read(buf)) > 0)
+			out.write(buf, 0, len);
+
+		in.close();
+		out.close();
+	}
+
+	public void createWorldFile(String fileName, Extent ext, int pxWidth, int pxHeight) throws IOException {
+		File tfw = null;
+
+		String extWorldFile = ".wld";
+		if (fileName.endsWith("tif"))
+			extWorldFile = ".tfw";
+		if (fileName.endsWith("jpg") || fileName.endsWith("jpeg"))
+			extWorldFile = ".jpgw";
+
+		tfw = new File(fileName.substring(0, fileName.lastIndexOf(".")) + extWorldFile);
+
+		// Generamos un world file para gdal
+		DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(tfw)));
+		dos.writeBytes((ext.getMax().getX() - ext.getMin().getX()) / (pxWidth - 1) + "\n");
+		dos.writeBytes("0.0\n");
+		dos.writeBytes("0.0\n");
+		dos.writeBytes((ext.getMin().getY() - ext.getMax().getY()) / (pxHeight - 1) + "\n");
+		dos.writeBytes("" + ext.getMin().getX() + "\n");
+		dos.writeBytes("" + ext.getMax().getY() + "\n");
+		dos.close();
+	}
+
+	public void createWorldFile(String fileName, AffineTransform at, int pxWidth, int pxHeight) throws IOException {
+		File tfw = null;
+
+		String extWorldFile = ".wld";
+		if (fileName.endsWith("tif"))
+			extWorldFile = ".tfw";
+		if (fileName.endsWith("jpg") || fileName.endsWith("jpeg"))
+			extWorldFile = ".jpgw";
+
+		tfw = new File(fileName.substring(0, fileName.lastIndexOf(".")) + extWorldFile);
+
+		// Generamos un world file para gdal
+		DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(tfw)));
+		dos.writeBytes(at.getScaleX() + "\n");
+		dos.writeBytes(at.getShearX() + "\n");
+		dos.writeBytes(at.getShearY() + "\n");
+		dos.writeBytes(at.getScaleY() + "\n");
+		dos.writeBytes("" + at.getTranslateX() + "\n");
+		dos.writeBytes("" + at.getTranslateY() + "\n");
+		dos.close();
+	}
+
+	public String formatFileSize(long size) {
+		double bytes = size;
+		double kBytes = 0.0;
+		double mBytes = 0.0;
+		double gBytes = 0.0;
+		if (bytes >= 1024.0) {
+			kBytes = bytes / 1024.0;
+			if (kBytes >= 1024.0) {
+				mBytes = kBytes / 1024.0;
+				if (mBytes >= 1024.0)
+					gBytes = mBytes / 1024.0;
+			}
+		}
+
+		String texto = "";
+		NumberFormat numberFormat = NumberFormat.getNumberInstance();
+		numberFormat.setMinimumFractionDigits(0);
+
+		do {
+			if (gBytes > 0) {
+				numberFormat.setMaximumFractionDigits(2 - (int) Math.log10(gBytes));
+				texto = numberFormat.format(gBytes) + " GB";
+				break;
+			}
+			if (mBytes > 0) {
+				numberFormat.setMaximumFractionDigits(2 - (int) Math.log10(mBytes));
+				texto = numberFormat.format(mBytes) + " MB";
+				break;
+			}
+			if (kBytes > 0) {
+				numberFormat.setMaximumFractionDigits(2 - (int) Math.log10(kBytes));
+				texto = numberFormat.format(kBytes) + " KB";
+				break;
+			}
+			if (bytes != 0) {
+				numberFormat.setMaximumFractionDigits(0);
+				texto = numberFormat.format(bytes) + " bytes";
+				break;
+			}
+		} while (false);
+
+		numberFormat.setMaximumFractionDigits(0);
+
+		return texto + " (" + numberFormat.format(bytes) + " bytes)";
+	}
+
+	public String getExtensionFromFileName(String file) {
+		return file.substring(file.lastIndexOf(".") + 1).toLowerCase();
+	}
+
+	public String getNameWithoutExtension(String file) {
+		if (file == null)
+			return null;
+
+		int n = file.lastIndexOf(".");
+		if (n != -1)
+			return file.substring(0, n);
+		return file;
+	}
+
+	public String getFileNameFromCanonical(String file) {
+		if (file == null)
+			return null;
+
+		int n = file.lastIndexOf(".");
+		if (n != -1)
+			file = file.substring(0, n);
+
+		n = file.lastIndexOf(File.separator);
+		if(n != -1)
+			file = file.substring(n + 1, file.length());
+
+		return file;
+	}
+
+	public String getLastPart(String string, String pattern) {
+		int n = string.lastIndexOf(pattern);
+		if (n > 0)
+			return string.substring(n + 1, string.length());
+		return string;
+	}
+
+	public String readFileEncoding(String file) {
+		FileReader fr;
+		String encoding = null;
+		try {
+			fr = new FileReader(file);
+			BufferedReader br = new BufferedReader(fr);
+			char[] buffer = new char[100];
+			br.read(buffer);
+			StringBuffer st = new StringBuffer(new String(buffer));
+			String searchText = "encoding=\"";
+			int index = st.indexOf(searchText);
+			if (index > -1) {
+				st.delete(0, index + searchText.length());
+				encoding = st.substring(0, st.indexOf("\""));
+			}
+			fr.close();
+		} catch (FileNotFoundException ex) {
+			ex.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+		return encoding;
+	}
+
+	public String getRMFNameFromFileName(String fileName) {
+		return getNameWithoutExtension(fileName) + ".rmf";
+	}
+
+	/**
+	 * Recursive directory delete.
+	 * @param f
+	 */
+	private void deleteDirectory(File f) {
+		File[] files = f.listFiles();
+		for (int i = 0; i < files.length; i++) {
+			if (files[i].isDirectory())
+				deleteDirectory(files[i]);
+			files[i].delete();
+		}
+	}
+
+	//******* Servicio de directorios temporales **************
+
+	/**
+	 * Directorio temporal para la cach�. Si gastamos el mismo que andami este se ocupar� de gestionar su
+	 * destrucci�n al cerrar gvSIG.
+	 */
+	private String tempCacheDirectoryPath = System.getProperty("java.io.tmpdir")
+			+ File.separator + "tmp-andami";
+
+	public void cleanUpTempFiles() {
+		try {
+			File tempDirectory = new File(tempCacheDirectoryPath);
+
+			File[] files = tempDirectory.listFiles();
+			if (files != null)
+				for (int i = 0; i < files.length; i++) {
+					// s�lo por si en un futuro se necesitan crear directorios temporales
+					if (files[i].isDirectory())
+						deleteDirectory(files[i]);
+					files[i].delete();
+				}
+			tempDirectory.delete();
+		} catch (Exception e) {
+		}
+	}
+
+	public File getTemporalFile() {
+		File tempDirectory = new File(tempCacheDirectoryPath);
+		if (!tempDirectory.exists())
+			tempDirectory.mkdir();
+		return tempDirectory;
+	}
+
+	public String getTemporalPath() {
+		return getTemporalFile().getAbsolutePath();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.FileUtils#getFormatedRasterFileName(java.lang.String)
+	 */
+	public String getFormatedRasterFileName(String name) {
+	    throw new UnsupportedOperationException("Deprecated (name = '"+name+"')");
+
+//		if(name.startsWith("PG:host=")) {
+//			String newName = "";
+//			String schema = null;
+//			String table = null;
+//			int index = name.indexOf(" schema='") + 8;
+//			if(index != -1) {
+//				try {
+//					schema = name.substring(index + 1, name.indexOf("'", index + 1));
+//					newName += schema + ".";
+//				} catch (StringIndexOutOfBoundsException e) {
+//				}
+//			}
+//			index = name.indexOf(" table='") + 7;
+//			if(index != -1) {
+//				try {
+//					table = name.substring(index + 1, name.indexOf("'", index + 1));
+//					newName += table;
+//				} catch (StringIndexOutOfBoundsException e) {
+//				}
+//			}
+//			return newName;
+//		}
+//		return name;
+	}
+
+	public String convertPathToMD5(String path) throws NoSuchAlgorithmException {
+		MessageDigest md = java.security.MessageDigest.getInstance("MD5");
+		md.update(path.getBytes());
+		return convertToHex(md.digest());
+	}
+
+	/**
+	 * Converts an array of bytes to hexadecimal string
+	 * @param data
+	 * @return
+	 */
+	private String convertToHex(byte[] data) {
+        StringBuffer buf = new StringBuffer();
+        for (int i = 0; i < data.length; i++) {
+            int halfbyte = (data[i] >>> 4) & 0x0F;
+            int two_halfs = 0;
+            do {
+                if ((0 <= halfbyte) && (halfbyte <= 9))
+                    buf.append((char) ('0' + halfbyte));
+                else
+                    buf.append((char) ('a' + (halfbyte - 10)));
+                halfbyte = data[i] & 0x0F;
+            } while(two_halfs++ < 1);
+        }
+        return buf.toString();
+    }
+
+	//******* Servicio de nombres de capas �nicos **************
+	/**
+	 * Contador global de las capas generadas para raster. Hay que contar con que esta
+	 * clase es un singleton desde el manager. Si hay varias instanciaciones layerCount
+	 * dar� valores erroneos.
+	 */
+	private int           	layerCount = 1;
+	private ArrayList<PropertyListener>
+									propetiesListeners = new ArrayList<PropertyListener>();
+
+	public String usesOnlyLayerName() {
+		String oldValue = getOnlyLayerName();
+		String newValue = "NewLayer_" + (++layerCount);
+		for (int i = 0; i < propetiesListeners.size(); i++)
+			if(propetiesListeners.get(i) instanceof PropertyListener)
+				((PropertyListener)propetiesListeners.get(i)).actionValueChanged(new PropertyEvent(oldValue, "NewLayer", newValue, oldValue));
+		return newValue;
+	}
+
+	public String getOnlyLayerName() {
+		return "NewLayer_" + layerCount;
+	}
+
+	public void addOnlyLayerNameListener(PropertyListener listener) {
+		if (!propetiesListeners.contains(listener))
+			propetiesListeners.add(listener);
+	}
+
+	public void removeOnlyLayerNameListener(PropertyListener listener) {
+		for (int i = 0; i < propetiesListeners.size(); i++)
+			if(propetiesListeners.get(i) == listener)
+				propetiesListeners.remove(i);
+	}
+
+	//******* End: Servicio de nombres de capas �nicos **************
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultFileUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultHistorical.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultHistorical.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultHistorical.java	(revision 15423)
@@ -0,0 +1,136 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+ *
+ * Copyright (C) 2007 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.util;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.util.Historical;
+
+/**
+ * Mantiene la gesti�n de historicos. Se trata de una lista de objetos la cual nos informa
+ * del actualmente vigente y nos devuelve el siguiente si existe o el anterior.
+ *  
+ * @version 31/07/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class DefaultHistorical implements Historical {
+	private ArrayList<Object>     objectList = null;
+	private int                   position = -1;
+	
+	/**
+	 * Crea un nuevo historico
+	 *
+	 */
+	public DefaultHistorical() {
+		objectList = new ArrayList<Object>();
+		position = -1;
+	}
+	
+	/**
+	 * Obtiene el siguiente elemento.
+	 * @return Siguiente elemento o null si no existe o la lista est� vacia
+	 */
+	public Object getNext() {
+		if(position < 0)
+			return null;
+		if(position == (objectList.size() - 1))
+			return null;
+		return objectList.get(++position);
+	}
+	
+	/**
+	 * A�ade una elemento a la lista
+	 * @param obj
+	 */
+	public void add(Object obj) {
+		objectList.add(++position, obj);
+	}
+	
+	/**
+	 * Obtiene el elemento anterior.
+	 * @return Anterior elemento o null si no existe o la lista est� vacia
+	 */
+	public Object getBack() {
+		if(position < 0)
+			return null;
+		if(position == 0)
+			return null;
+		position --;
+		return objectList.get(position);
+	}
+	
+	/**
+	 * Consulta si existe un elemento anterior al actualmente vigente
+	 * @return true si existe y false si no existe
+	 */
+	public boolean existBack() {
+		if(position == -1 || position == 0)
+			return false;
+		return true;		
+	}
+	
+	/**
+	 * Consulta si existe un elemento posterior al actualmente vigente
+	 * @return true si existe y false si no existe
+	 */
+	public boolean existNext() {
+		if(position == -1 || position == (objectList.size() - 1))
+			return false;
+		return true;		
+	}
+	
+	/**
+	 * Limpia el historico
+	 */
+	public void clear() {
+		objectList.clear();
+		position = -1;
+	}
+	
+	/**
+	 * Obtiene el n�mero de elementos del historico
+	 * @return N�mero de elementos del historico
+	 */
+	public int getElementsCount() {
+		return objectList.size();
+	}
+	
+	/**
+	 * Obtiene el primer elemento del historico
+	 * @return Object
+	 */
+	public Object getFirst() {
+		if(objectList.size() == 0 || position == -1)
+			return null;
+		position = 0;
+		return objectList.get(0);
+	}
+	
+	/**
+	 * Obtiene el �ltimo elemento del historico
+	 * @return Object
+	 */
+	public Object getLast() {
+		if(objectList.size() == 0 || position == -1)
+			return null;
+		position = (objectList.size() - 1);
+		return objectList.get(position);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultHistorical.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultRasterUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultRasterUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultRasterUtils.java	(revision 15423)
@@ -0,0 +1,639 @@
+/* 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.util;
+
+import java.awt.Dimension;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.store.rmf.RmfBlocksManager;
+import org.gvsig.raster.impl.store.serializer.GeoInfoRmfSerializer;
+import org.gvsig.raster.roi.ROI;
+/**
+ * Raster utilities without gvSIG dependencies
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultRasterUtils implements RasterUtils {
+	public static final int MAX_BYTE_BIT_VALUE  = 255;
+	public static final int MAX_SHORT_BIT_VALUE = 65535;
+
+	public boolean loadInMemory(RasterDataStore datasource) {
+		return (datasource.getFileSize() < (RasterLibrary.cacheSize * 1048576));
+	}
+
+	public boolean isBufferTooBig(double[] coords, int bands) {
+		int w = (int)Math.abs(coords[2] - coords[0]);
+		int h = (int)Math.abs(coords[3] - coords[1]);
+
+		long windowSize = w * h * bands;
+		return (windowSize > (RasterLibrary.cacheSize * 1048576));
+	}
+
+	public boolean isBufferTooBig(double[] coords, double resolution, int bands) {
+		double wPx = (coords[0] - coords[2]) / resolution;
+		double hPx = (coords[1] - coords[3]) / resolution;
+		return isBufferTooBig(new double[]{0, 0, wPx, hPx}, bands);
+	}
+
+	// ---------------------------------------------------------------
+	// TIPOS DE DATOS
+
+	public int getRasterBufTypeFromMrSIDType(int mrsidType){
+		switch (mrsidType) {
+			case 0: return Buffer.TYPE_UNDEFINED;// INVALID
+			case 1:// UINT8
+			case 2: return Buffer.TYPE_BYTE;// SINT8
+			case 3:// UINT16
+			case 4: return Buffer.TYPE_SHORT;// SINT16
+			case 5:// UINT32
+			case 6: return Buffer.TYPE_INT;// SINT32
+			case 7: return Buffer.TYPE_FLOAT;// FLOAT32
+			case 8: return Buffer.TYPE_DOUBLE;// FLOAT64
+		}
+		return Buffer.TYPE_UNDEFINED;
+	}
+
+	public int getBytesFromRasterBufType(int rasterBufType) {
+		switch (rasterBufType) {
+			case Buffer.TYPE_BYTE: return 1;
+			case Buffer.TYPE_USHORT:
+			case Buffer.TYPE_SHORT: return 2;
+			case Buffer.TYPE_INT:
+			case Buffer.TYPE_FLOAT:
+			case Buffer.TYPE_IMAGE: return 4;
+			case Buffer.TYPE_DOUBLE: return 8;
+		}
+		return 0; // TYPE_UNDEFINED
+	}
+
+	public long getBytesFromRaster(int width, int height,
+			int rasterType, int nBands) {
+		int typeSize = getBytesFromRasterBufType(rasterType);
+		return (long) width * (long) height * nBands * typeSize;
+	}
+
+	public String typesToString(int type) {
+		switch (type) {
+			case Buffer.TYPE_IMAGE:
+				return new String("Image");
+
+			case Buffer.TYPE_BYTE:
+				return new String("Byte");
+
+			case Buffer.TYPE_DOUBLE:
+				return new String("Double");
+
+			case Buffer.TYPE_FLOAT:
+				return new String("Float");
+
+			case Buffer.TYPE_INT:
+				return new String("Integer");
+
+			case Buffer.TYPE_USHORT:
+			case Buffer.TYPE_SHORT:
+				return new String("Short");
+			case Buffer.TYPE_UNDEFINED:
+				return new String("Undefined");
+		}
+		return null;
+	}
+
+	public String parserGdalProj(String proj) {
+		if (proj == null)
+			return "";
+		String[] list = proj.split(",");
+		int level = 0;
+		for (int i = 0; i < list.length; i++) {
+			if (list[i].indexOf("[") >= 0) {
+				level++;
+				String spaces = "";
+				for (int j = 0; j < level; j++)
+					spaces += "&nbsp;&nbsp;";
+				list[i] = spaces + list[i];
+			}
+			if (list[i].indexOf("]]") >= 0)
+				level = level - 2;
+			else
+				if (list[i].indexOf("]") >= 0)
+					level--;
+		}
+		StringBuffer str = new StringBuffer();
+		for (int i = 0; i < list.length; i++)
+			if (i < list.length)
+				if (i + 1 < list.length && list[i + 1].indexOf("[") >= 0)
+					str.append(list[i] + ",<BR>");
+				else
+					str.append(list[i] + ",");
+		return str.toString();
+	}
+
+	// ---------------------------------------------------------------
+	// CONVERSI�N DE COORDENADAS
+
+	public Rectangle2D getPxRectFromMapRect(Rectangle2D extent, double widthPx, double heightPx, Rectangle2D window) {
+		double widthWC = extent.getWidth();
+		double heightWC = extent.getHeight();
+
+		double wWindowWC = Math.abs(window.getMaxX() - window.getMinX());
+		double hWindowWC = Math.abs(window.getMaxY() - window.getMinY());
+
+		double wWindowPx = ((wWindowWC * widthPx) / widthWC);
+		double hWindowPx = ((hWindowWC * heightPx) / heightWC);
+
+		double initDistanceX = Math.abs(window.getMinX() - extent.getMinX());
+		double initDistanceY = Math.abs(window.getMaxY() - extent.getMaxY());
+
+		double initPxX = ((initDistanceX * widthPx) / widthWC);
+		double initPxY = ((initDistanceY * heightPx) / heightWC);
+
+		Rectangle2D pxRec = new Rectangle2D.Double(initPxX, initPxY, wWindowPx, hWindowPx);
+		return pxRec;
+	}
+
+	public Rectangle2D getMapRectFromPxRect(Rectangle2D extent, double widthPx, double heightPx, Rectangle2D pxWindow) {
+		double wWindowWC = ((pxWindow.getWidth() * extent.getWidth()) / widthPx);
+		double hWindowWC = ((pxWindow.getHeight() * extent.getHeight()) / heightPx);
+
+		double initWCX = extent.getMinX() + ((pxWindow.getMinX() * extent.getWidth()) / widthPx);
+		double initWCY = extent.getMaxY() - ((pxWindow.getMinY() * extent.getHeight()) / heightPx);
+
+		Rectangle2D mapRec = new Rectangle2D.Double(initWCX, initWCY - hWindowWC, wWindowWC, hWindowWC);
+		return mapRec;
+	}
+
+	public Point2D worldPointToRaster(Point2D p, Extent ext, int pxWidth, int pxHeight) {
+		double x = p.getX() - ext.getMin().getX();
+		double y = p.getY() - ext.getMin().getY();
+		int pxX = (int) ((x * pxWidth) / ext.width());
+		int pxY = (int) ((y * pxHeight) / ext.height());
+		return new Point2D.Double(pxX, pxY);
+	}
+
+	public boolean intersects(Extent e1, Extent e2, AffineTransform at) throws NoninvertibleTransformException {
+		Point2D ulPxE1 = new Point2D.Double();
+		Point2D lrPxE1 = new Point2D.Double();
+		Point2D ulPxE2 = new Point2D.Double();
+		Point2D lrPxE2 = new Point2D.Double();
+
+		at.inverseTransform(new Point2D.Double(e1.getULX(), e1.getULY()), ulPxE1);
+		at.inverseTransform(new Point2D.Double(e1.getLRX(), e1.getLRY()), lrPxE1);
+		at.inverseTransform(new Point2D.Double(e2.getULX(), e2.getULY()), ulPxE2);
+		at.inverseTransform(new Point2D.Double(e2.getLRX(), e2.getLRY()), lrPxE2);
+
+			if (((ulPxE1.getX() <= lrPxE2.getX()) && (lrPxE1.getX() >= lrPxE2.getX()) ||
+					 (ulPxE1.getX() <= ulPxE2.getX()) && (lrPxE1.getX() >= ulPxE2.getX()) ||
+					 (ulPxE1.getX() >= ulPxE2.getX()) && (lrPxE1.getX() <= lrPxE2.getX())) &&
+					((ulPxE1.getY() <= lrPxE2.getY()) && (lrPxE1.getY() >= lrPxE2.getY()) ||
+					 (ulPxE1.getY() <= ulPxE2.getY()) && (lrPxE1.getY() >= ulPxE2.getY()) ||
+					 (ulPxE1.getY() >= ulPxE2.getY()) && (lrPxE1.getY() <= lrPxE2.getY())))
+			return true;
+		return false;
+	}
+
+	public Extent intersection(Extent e1, Extent e2) {
+		if( (e1.getMin().getX() > e2.getMax().getX()) ||
+			(e1.getMax().getX() < e2.getMin().getX()) ||
+			(e1.getMin().getY() > e2.getMax().getY()) ||
+			(e1.getMax().getY() < e2.getMin().getY())) {
+			return null;
+		}
+
+		double ulx = Math.max(e1.getULX(), e2.getULX());
+		double uly = Math.min(e1.getULY(), e2.getULY());
+		double lrx = Math.min(e1.getLRX(), e2.getLRX());
+		double lry = Math.max(e1.getLRY(), e2.getLRY());
+
+		return new ExtentImpl(ulx, uly, lrx, lry);
+	}
+
+	public boolean isInside(Point2D p1, Extent e1, AffineTransform at) {
+		// Convertimos los puntos a coordenadas pixel con la matriz de
+		// transformaci�n
+		Point2D p1Px = new Point2D.Double();
+		Point2D ulPx = new Point2D.Double();
+		Point2D lrPx = new Point2D.Double();
+		try {
+			at.inverseTransform(p1, p1Px);
+			at.inverseTransform(new Point2D.Double(e1.getULX(), e1.getULY()), ulPx);
+			at.inverseTransform(new Point2D.Double(e1.getLRX(), e1.getLRY()), lrPx);
+		} catch (NoninvertibleTransformException e) {
+			return false;
+		}
+
+		// Comprobamos si el punto est� dentro
+		return ((p1Px.getX() >= ulPx.getX()) && (p1Px.getX() <= lrPx.getX()) &&
+						(p1Px.getY() >= ulPx.getY()) && (p1Px.getY() <= lrPx.getY()));
+	}
+
+	public boolean isInside(Extent e1, Extent e2) {
+		return ((e1.getMin().getX() >= e2.getMin().getX()) &&
+				(e1.getMin().getY() >= e2.getMin().getY()) &&
+				(e1.getMax().getX() <= e2.getMax().getX()) &&
+				(e1.getMax().getY() <= e2.getMax().getY()));
+	}
+
+	public boolean isInside(Point2D p1, Extent e1) {
+		return ((p1.getX() >= e1.getMin().getX()) && (p1.getX() <= e1.getMax().getX()) && (p1.getY() >= e1.getMin().getY())) && (p1.getY() <= e1.getMax().getY());
+	}
+
+	public boolean isOutside(Extent e1, Extent ref) {
+		return ((e1.getMin().getX() > ref.getMax().getX()) || (e1.getMin().getY() > ref.getMax().getY()) ||
+						(e1.getMax().getX() < ref.getMin().getX()) || (e1.getMax().getY() < ref.getMin().getY()));
+	}
+
+	public boolean compareExtents(Extent e1, Extent e2) {
+		return ((e1.getMin().getX() == e2.getMin().getX()) && (e1.getMin().getY() == e2.getMin().getY()) &&
+						(e1.getMax().getX() == e2.getMax().getX())) && (e1.getMax().getY() == e2.getMax().getY());
+	}
+
+	public double[] cornersToWorldFile(Point2D[] esq, Dimension size) {
+		double a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
+		double x1 = esq[0].getX(), y1 = esq[0].getY();
+		double x2 = esq[1].getX(), y2 = esq[1].getY();
+		double x3 = esq[2].getX(), y3 = esq[2].getY();
+		double x4 = esq[3].getX(), y4 = esq[3].getY();
+		// A: X-scale
+		a = Math.abs(Math.sqrt((x1 - x2) * (x1 - x2) + (y1 - y2) * (y1 - y2)) / size.getWidth());
+
+		// E: negative Y-scale
+		e = -Math.abs(Math.sqrt((x1 - x4) * (x1 - x4) + (y1 - y4) * (y1 - y4)) / size.getHeight());
+
+		// C, F: upper-left coordinates
+		c = x1;
+		f = y1;
+
+		// B & D: rotation parameters
+		b = (a * size.getWidth() + c - x3) / size.getHeight() * -1;
+		d = (e * size.getHeight() + f - y3) / size.getWidth() * -1;
+
+		double[] wf = { a, d, b, e, c, f };
+		return wf;
+	}
+
+	public void adjustToPixelSize(Point2D[] points, Point2D dim) {
+		for (int i = 0; i < points.length; i++) {
+			if (points[i].getX() < 0)
+				points[i].setLocation(0, points[i].getY());
+			if (((int)points[i].getX()) > (dim.getX() - 1))
+				points[i].setLocation(dim.getX() - 1, points[i].getY());
+			if (points[i].getY() < 0)
+				points[i].setLocation(points[i].getX(), 0);
+			if (((int)points[i].getY()) > (dim.getY() - 1))
+				points[i].setLocation(points[i].getX(), dim.getY() - 1);
+		}
+	}
+
+	// ---------------------------------------------------------------
+	// VARIOS
+
+	/**
+	 * Gets the exception trace
+	 * @param e
+	 * @return the exception trace
+	 */
+	public String getTrace(Exception e) {
+		Throwable throwable = e;
+		String r = "";
+		StackTraceElement[] elemList = throwable.getStackTrace();
+		for (int i = 0; i < elemList.length; i++) {
+			r += "   !!!-" + elemList[i].toString() + "\n";
+		}
+
+		while(throwable.getCause() != null) {
+			elemList = throwable.getCause().getStackTrace();
+			for (int i = 0; i < elemList.length; i++) {
+				r += "   !!!-" + elemList[i].toString() + "\n";
+			}
+			throwable = throwable.getCause();
+		}
+		return r;
+	}
+
+	public String formatTime(long time) {
+		int days = 0;
+		int hours = 0;
+		int minuts = 0;
+		int seconds = (int) (time / 1000D);
+		if (seconds >= 60) {
+			minuts = (seconds / 60);
+			seconds = (seconds - (minuts * 60));
+			if (minuts >= 60) {
+				hours = (minuts / 60);
+				minuts = (minuts - (hours * 60));
+				if (hours >= 24) {
+					days = (hours / 24);
+					hours = (hours - (days * 24));
+				}
+			}
+		}
+		StringBuffer s = new StringBuffer();
+		if (days != 0)
+			s.append(days + " d ");
+		if (hours != 0)
+			s.append(hours + " h ");
+		if (minuts != 0)
+			s.append(minuts + " min ");
+		if (seconds != 0)
+			s.append(seconds + " s ");
+		if (s.length() == 0)
+			s.append(" < 1s");
+		return s.toString();
+	}
+
+	public String[] getCoord(double minx, double miny, double maxx, double maxy, int dec) {
+		String[] coordPx = new String[4];
+		int indexPoint = String.valueOf(minx).indexOf('.');
+		try {
+			coordPx[0] = String.valueOf(minx).substring(0, indexPoint + dec);
+		} catch (StringIndexOutOfBoundsException ex) {
+			coordPx[0] = String.valueOf(minx);
+		}
+		indexPoint = String.valueOf(miny).indexOf('.');
+		try {
+			coordPx[1] = String.valueOf(miny).substring(0, indexPoint + dec);
+		} catch (StringIndexOutOfBoundsException ex) {
+			coordPx[1] = String.valueOf(miny);
+		}
+		indexPoint = String.valueOf(maxx).indexOf('.');
+		try {
+			coordPx[2] = String.valueOf(maxx).substring(0, indexPoint + dec);
+		} catch (StringIndexOutOfBoundsException ex) {
+			coordPx[2] = String.valueOf(maxx);
+		}
+		indexPoint = String.valueOf(maxy).indexOf('.');
+		try {
+			coordPx[3] = String.valueOf(maxy).substring(0, indexPoint + dec);
+		} catch (StringIndexOutOfBoundsException ex) {
+			coordPx[3] = String.valueOf(maxy);
+		}
+		return coordPx;
+	}
+
+	public Extent calculateAdjustedView(Extent extToAdj, Extent imgExt) {
+		double vx = extToAdj.minX();
+		double vy = extToAdj.minY();
+		double vx2 = extToAdj.maxX();
+		double vy2 = extToAdj.maxY();
+
+		if (extToAdj.minX() < imgExt.minX())
+			vx = imgExt.minX();
+
+		if (extToAdj.minY() < imgExt.minY())
+			vy = imgExt.minY();
+
+		if (extToAdj.maxX() > imgExt.maxX())
+			vx2 = imgExt.maxX();
+
+		if (extToAdj.maxY() > imgExt.maxY())
+			vy2 = imgExt.maxY();
+
+		return new ExtentImpl(vx, vy, vx2, vy2);
+	}
+
+	public Extent calculateAdjustedView(Extent extToAdj, AffineTransform at, double w, double h) {
+			// Obtenemos los cuatro puntos de la petici�n de origen
+		Point2D src_ul = new Point2D.Double(extToAdj.getULX(), extToAdj.getULY());
+		Point2D src_lr = new Point2D.Double(extToAdj.getLRX(), extToAdj.getLRY());
+        Point2D ul = new Point2D.Double();
+        Point2D lr = new Point2D.Double();
+
+		// Los convertimos a coordenadas pixel con la matriz de transformaci�n
+		try {
+			at.inverseTransform(src_ul, ul);
+			at.inverseTransform(src_lr, lr);
+		} catch (NoninvertibleTransformException e) {
+			return extToAdj;
+		}
+
+		// Ajustamos a la dimensi�n del raster en pixeles
+		if (ul.getX() < 0)
+			ul.setLocation(0, ul.getY());
+		if (ul.getX() >= w)
+			ul.setLocation(w, ul.getY());
+		if (ul.getY() < 0)
+			ul.setLocation(ul.getX(), 0);
+		if (ul.getY() >= h)
+			ul.setLocation(ul.getX(), h);
+
+		if (lr.getX() < 0)
+			lr.setLocation(0, lr.getY());
+		if (lr.getX() >= w)
+			lr.setLocation(w, lr.getY());
+		if (lr.getY() < 0)
+			lr.setLocation(lr.getX(), 0);
+		if (lr.getY() >= h)
+			lr.setLocation(lr.getX(), h);
+
+		// Lo convertimos a coordenadas reales nuevamente
+        Point2D real_ul = new Point2D.Double();
+        Point2D real_lr = new Point2D.Double();
+		at.transform(ul, real_ul);
+		at.transform(lr, real_lr);
+		return new ExtentImpl(real_ul, real_lr);
+	}
+
+	public void saveGeoInfo(String outRmf, AffineTransform at, Point2D dim) throws IOException {
+		RmfBlocksManager manager = new RmfBlocksManager(outRmf + ".rmf");
+		GeoInfoRmfSerializer ser3 = new GeoInfoRmfSerializer(at, dim);
+		manager.addClient(ser3);
+		manager.write();
+	}
+
+	/**
+	 * Obtiene el extent m�ximo de todas las ROIs pasadas por par�metro.
+	 * @param rois Lista de ROIs para calcular la extensi�n m�xima que ocupan
+	 * @return Entent m�ximo
+	 */
+	public Extent getROIsMaximunExtent(List<ROI> rois) {
+		double minx = 0, miny = 0, maxx = 0, maxy = 0;
+		for (int i = 0; i < rois.size(); i++) {
+			Extent ext = rois.get(i).getROIExtent();
+			if(i == 0) {
+				minx = ext.minX();
+				miny = ext.minY();
+				maxx = ext.maxX();
+				maxy = ext.maxY();
+			} else {
+				if(ext.minX() < minx)
+					minx = ext.minX();
+				if(ext.minY() < miny)
+					miny = ext.minY();
+				if(ext.maxX() > maxx)
+					maxx = ext.maxX();
+				if(ext.maxY() > maxy)
+					maxy = ext.maxY();
+			}
+		}
+		return RasterLocator.getManager().getDataStructFactory().createExtent(minx, miny, maxx, maxy);
+	}
+
+
+	/**
+	 * Convierte un histograma al rango de valores de RGB, en pocas palabras
+	 * aplica una operacion 0xff a cada pixel para quitar los numeros negativos
+	 * y desplazarlos a su rango visual.
+	 * @param histogram
+	 */
+	public BufferHistogram convertHistogramToRGB(BufferHistogram histogram) {
+		if (histogram == null || !(histogram instanceof BufferHistogramImpl))
+			return null;
+
+		BufferHistogramImpl histImp = (BufferHistogramImpl)histogram;
+
+		if (histImp.getDataType() != Buffer.TYPE_BYTE)
+			return histogram;
+
+		double min = histImp.getMin(0);
+		double max = histImp.getMax(0);
+
+		long table2[][] = histImp.getTable();
+
+		long newTable[][] = new long[table2.length][table2[0].length];
+
+		// Ponemos a cero todos los valores
+		for (int i = 0; i < table2.length; i++)
+			for (int j = 0; j < table2[i].length; j++)
+				newTable[i][j] = 0;
+
+		// Sumamos en la posicion calculada nueva el valor correspondiente
+		for (int i = 0; i < table2.length; i++) {
+			for (int j = 0; j < table2[i].length; j++) {
+				double val = ((j * (max - min)) / 255) + min;
+				int pos = ((int) val) & 0xff;
+				if (pos < 0)
+					pos = 0;
+				if (pos >= newTable[i].length)
+					pos = newTable[i].length - 1;
+
+				newTable[i][pos] += table2[i][j];
+			}
+		}
+
+		double mins[] = new double[histImp.getNumBands()];
+		double maxs[] = new double[histImp.getNumBands()];
+
+		for (int i = 0; i < mins.length; i++) {
+			mins[i] = 0;
+			maxs[i] = 255;
+		}
+
+		BufferHistogramImpl histogramNew = new BufferHistogramImpl(histImp.getNumBands(), mins, maxs, Buffer.TYPE_BYTE);
+
+		histogramNew.setTable(newTable);
+
+		return histogramNew;
+	}
+
+	public void copyToBuffer(Buffer bufResult, Extent tileExtent,
+			Buffer buf, Extent ex, double rel, boolean hasAlphaBand) {
+		double distx = Math.abs(ex.getULX() - tileExtent.getULX());
+		double disty = Math.abs(ex.getULY() - tileExtent.getULY());
+		int distpxx = (int)Math.round(distx / rel);
+		int distpxy = (int)Math.round(disty / rel);
+		int lastBandNumber = bufResult.getBandCount() - 1;
+
+		//Para BYTE la �ltima banda es de transparencia por lo que en esa banda en las zonas donde hay imagen
+		//hay que ponerle el valor 255 para que aparezcan visibles
+		if(bufResult.getDataType() == Buffer.TYPE_BYTE) {
+			for (int iBand = 0; iBand < lastBandNumber; iBand++) {
+				if(iBand == 0) {
+					for (int i = distpxy; (i < bufResult.getHeight() && (i - distpxy) < buf.getHeight()); i++) {
+						for (int j = distpxx; (j < bufResult.getWidth() && (j - distpxx) < buf.getWidth()); j++) {
+							bufResult.setElem(i, j, iBand, buf.getElemByte(i - distpxy, j - distpxx, iBand));
+							bufResult.setElem(i, j, lastBandNumber, (byte)255);
+						}
+					}
+				} else {
+					for (int i = distpxy; (i < bufResult.getHeight() && (i - distpxy) < buf.getHeight()); i++) {
+						for (int j = distpxx; (j < bufResult.getWidth() && (j - distpxx) < buf.getWidth()); j++) {
+							bufResult.setElem(i, j, iBand, buf.getElemByte(i - distpxy, j - distpxx, iBand));
+						}
+					}
+				}
+			}
+			//Si la imagen original tenia banda de transparencia hay que copiar los valores de transparencia que no son cero
+			if(hasAlphaBand) {
+				for (int i = distpxy; (i < bufResult.getHeight() && (i - distpxy) < buf.getHeight()); i++) {
+					for (int j = distpxx; (j < bufResult.getWidth() && (j - distpxx) < buf.getWidth()); j++) {
+						byte value = buf.getElemByte(i - distpxy, j - distpxx, lastBandNumber);
+						if(value != 255)
+							bufResult.setElem(i, j, lastBandNumber, value);
+					}
+				}
+			}
+		}
+
+		//En el resto de casos no se usa banda de transparencia sino que las zonas del tile fuera de la imagen
+		//se inicializaron previamente a NoData
+
+		if(bufResult.getDataType() == Buffer.TYPE_SHORT) {
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+				for (int i = distpxy; (i < bufResult.getHeight() && (i - distpxy) < buf.getHeight()); i++) {
+					for (int j = distpxx; (j < bufResult.getWidth() && (j - distpxx) < buf.getWidth()); j++) {
+						bufResult.setElem(i, j, iBand, buf.getElemShort(i - distpxy, j - distpxx, iBand));
+					}
+				}
+			}
+		}
+		if(bufResult.getDataType() == Buffer.TYPE_INT) {
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+				for (int i = distpxy; (i < bufResult.getHeight() && (i - distpxy) < buf.getHeight()); i++) {
+					for (int j = distpxx; (j < bufResult.getWidth() && (j - distpxx) < buf.getWidth()); j++) {
+						bufResult.setElem(i, j, iBand, buf.getElemInt(i - distpxy, j - distpxx, iBand));
+					}
+				}
+			}
+		}
+		if(bufResult.getDataType() == Buffer.TYPE_FLOAT) {
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+				for (int i = distpxy; (i < bufResult.getHeight() && (i - distpxy) < buf.getHeight()); i++) {
+					for (int j = distpxx; (j < bufResult.getWidth() && (j - distpxx) < buf.getWidth()); j++) {
+						bufResult.setElem(i, j, iBand, buf.getElemFloat(i - distpxy, j - distpxx, iBand));
+					}
+				}
+			}
+		}
+		if(bufResult.getDataType() == Buffer.TYPE_DOUBLE) {
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+				for (int i = distpxy; (i < bufResult.getHeight() && (i - distpxy) < buf.getHeight()); i++) {
+					for (int j = distpxx; (j < bufResult.getWidth() && (j - distpxx) < buf.getWidth()); j++) {
+						bufResult.setElem(i, j, iBand, buf.getElemDouble(i - distpxy, j - distpxx, iBand));
+					}
+				}
+			}
+		}
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultRasterUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultColorConversion.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultColorConversion.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultColorConversion.java	(revision 15423)
@@ -0,0 +1,480 @@
+/* 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.util;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.util.ColorConversion;
+
+/**
+ * Coversi�n de de colores y valores de pixel aplicando distintos m�todos.
+ * 
+ * 31/10/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class DefaultColorConversion implements ColorConversion {
+
+	public double[] RGBtoHSL(int rojo, int verde, int azul) {
+		double   scaler, scaleg, scaleb;
+		double   sat;
+		double   red, green, blue;
+		double   low, high, intens;
+		double   hue=0.0;
+		double[] res1 = new double[3];
+	
+		scaler = (double) (rojo / 255.0);
+		scaleg = (double) (verde / 255.0);
+		scaleb = (double) (azul / 255.0);
+  	 
+		high = scaler;
+    
+		if (scaleg > high)
+			high = scaleg;
+		if (scaleb > high)
+			high = scaleb;
+		low = scaler;
+		if (scaleg < low)
+			low = scaleg;
+		if (scaleb < low)
+			low = scaleb;
+    
+		intens = ((high + low) / 2.0);
+		if (high == low){
+			sat = 0.0;
+			hue = 0.0;
+			res1[0] = (double) hue;
+			res1[2] = (double) intens;
+			res1[1] = (double) sat;
+		}else if (high != low){
+			if (intens <= 0.5)
+				sat = (high-low)/(high+low);
+			else
+				sat = (high-low)/(2 - high - low);
+			red = (high-scaler)/(high-low);
+			green = (high-scaleg)/(high-low);
+			blue =(high-scaleb)/(high-low);			
+			if (scaler == high)
+				hue = blue - green;
+			else
+				if (scaleg == high)
+					hue = 2 + red - blue;
+				else
+					if (scaleb == high)
+						hue = 4 + green - red;
+			hue *= 60.0;
+			if (hue < 0.0)
+				hue += 360.0;
+		res1[0] = (double) (hue);
+		res1[2] = (double) (intens);
+		res1[1] = (double) (sat);
+		}
+		return res1;
+	}
+	
+	public double[] RGBtoHSV(int rojo, int verde, int azul) {
+		double   scaler, scaleg, scaleb;
+		double   sat;
+		double   red, green, blue;
+		double   low, high, value;
+		double   hue=0.0;
+		double[] res1 = new double[3];
+	
+		scaler = (double) (rojo / 255.0);
+		scaleg = (double) (verde / 255.0);
+		scaleb = (double) (azul / 255.0);
+  	 
+		high = scaler;
+    
+		if (scaleg > high)
+			high = scaleg;
+		if (scaleb > high)
+			high = scaleb;
+		low = scaler;
+		if (scaleg < low)
+			low = scaleg;
+		if (scaleb < low)
+			low = scaleb;
+    
+		value = high;
+		if (high == 0) {
+			sat = 0.0;
+			hue = 0.0;
+			res1[0] = (double) hue;
+			res1[1] = (double) sat;
+			res1[2] = (double) value;
+		} else {
+			sat = (high-low) / high;
+			red = (high-scaler)/(high-low);
+			green = (high-scaleg)/(high-low);
+			blue =(high-scaleb)/(high-low);			
+			if (scaler == high)
+				hue = blue - green;
+			else
+				if (scaleg == high)
+					hue = 2 + red - blue;
+				else
+					if (scaleb == high)
+						hue = 4 + green - red;
+			hue *= 60.0;
+			if (hue < 0.0)
+				hue += 360.0;
+		res1[0] = (double)(hue);
+		res1[1] = (double) (sat);
+		res1[2] = (double) (value);
+		}
+		return res1;
+	}
+	
+	public int[] HSLtoRGB(int h, int s, int i) {
+		/*return HSLtoRGB((360.0 * h / 255.0), 
+						(s / 255.0), 
+						(i / 255.0));*/
+		double   red;                   /* the red band output                       */
+		double   red255;                /* the red band output                       */
+		double   green;                 /* the green band output                     */
+		double   green255;              /* the green band output                     */
+		double   blue;                  /* the blue band output                      */
+		double   blue255;               /* the blue band output                      */
+		double   m1;                    /* value used for determining RGB            */
+		double   m2;                    /* value used for determining RGB            */
+		double   scalei;                /* intensity value                           */
+		double   scales;                /* saturation value                          */
+		double   hue;                   /* hue                                       */
+		double   savehue;               /* save the hue for future processing        */
+		int[]   res = new int[3];
+	 
+		if(h == s && h == 0){
+			res[0] = res[1] = res[2] = i;
+			return res;
+		}
+			
+		red = green = blue = 0.0;
+		scalei = (double) (i / 255.0);
+		scales = (double) (s / 255.0);
+		m2 = 0.0;
+	
+		if (scalei <= 0.50)
+			m2 = scalei * (1.0 + scales);
+		else if (scalei > 0.50)
+			m2 = scalei + scales - (scalei * scales);
+		m1 = 2.0 * scalei - m2;
+	 
+		hue = (double) 360.0 * h / 255.0;
+	
+		if (scales == 0.0){
+			if (hue == -1.0){
+				red = scalei;
+				green = scalei;
+				blue = scalei;
+			}
+		}else{
+			savehue = hue + 120.0;
+			if (savehue > 360.0)
+				savehue -= 360.0;
+			if (savehue < 0.0)
+				savehue += 360.0;
+			if (savehue < 60.0)
+				red = m1 + (m2-m1) * savehue/60.0;
+			else if (savehue < 180.0)
+				red = m2;
+	        else if (savehue < 240.0)
+	          red = m1 + (m2-m1) * (240.0-savehue)/60.0;
+	        else
+	          red = m1;
+	 
+			savehue = hue;
+			if (savehue > 360.0)
+				savehue -= 360.0;
+			if (savehue < 0.0)
+				savehue += 360.0;
+			if (savehue < 60.0)
+				green = m1 + (m2-m1) * savehue/60.0;
+			else if (savehue < 180.0)
+				green = m2;
+			else if (savehue < 240.0)
+				green = m1 + (m2-m1) * (240.0-savehue)/60.0;
+			else
+				green = m1; 
+			savehue = hue - 120.0;
+	   
+			if (savehue > 360.0)
+				savehue -= 360.0;
+			if (savehue < 0.0)
+				savehue += 360.0;
+			if (savehue < 60.0)
+				blue = m1 + (m2-m1) * savehue/60.0;
+			else if (savehue < 180.0)
+				blue = m2;
+			else if (savehue < 240.0)
+				blue = m1 + (m2-m1) * (240.0-savehue)/60.0;
+			else
+				blue = m1;
+		}
+	 
+		red255 = red * 255.0;
+		green255 = green * 255.0;
+		blue255 = blue * 255.0;
+		if (red255 > 255.0)
+			red = 255.0;
+		else
+			red = red255;
+		if (green255 > 255.0)
+			green = 255.0;
+		else
+			green = green255;
+		if (blue255 > 255.0)
+			blue = 255.0;
+		else
+			blue = blue255;
+	 
+		if (red   > 254.5) red   = 254.5;
+		if (red   <   0.0) red   =   0.0;
+		if (green > 254.5) green = 254.5;
+		if (green <   0.0) green =   0.0;
+		if (blue  > 254.5) blue  = 254.5;
+		if (blue  <   0.0) blue  =   0.0;
+	 
+		res[0] = (int) (red + 0.5);
+		res[1] = (int) (green +0.5);
+		res[2] = (int) (blue + 0.5);
+		return res;
+	}
+	
+	public int[] HSLtoRGB(double h, double s, double i) {
+		double   red;                   /* the red band output                       */
+		double   red255;                /* the red band output                       */
+		double   green;                 /* the green band output                     */
+		double   green255;              /* the green band output                     */
+		double   blue;                  /* the blue band output                      */
+		double   blue255;               /* the blue band output                      */
+		double   m1;                    /* value used for determining RGB            */
+		double   m2;                    /* value used for determining RGB            */
+		double   scalei;                /* intensity value                           */
+		double   scales;                /* saturation value                          */
+		double   hue;                   /* hue                                       */
+		double   savehue;               /* save the hue for future processing        */
+		int[]   res = new int[3];
+	 
+		if(h == s && h == 0){
+			res[0] = res[1] = res[2] = (int)(i * 255);
+			return res;
+		}
+			
+		red = green = blue = 0.0;
+		scalei = i;
+		scales = s;
+		m2 = 0.0;
+	
+		if (scalei <= 0.50)
+			m2 = scalei * (1.0 + scales);
+		else if (scalei > 0.50)
+			m2 = scalei + scales - (scalei * scales);
+		m1 = 2.0 * scalei - m2;
+	 
+		hue = h;
+	
+		if (scales == 0.0){
+			if (hue == -1.0){
+				red = scalei;
+				green = scalei;
+				blue = scalei;
+			}
+		}else{
+			savehue = hue + 120.0;
+			if (savehue > 360.0)
+				savehue -= 360.0;
+			if (savehue < 0.0)
+				savehue += 360.0;
+			if (savehue < 60.0)
+				red = m1 + (m2-m1) * savehue/60.0;
+			else if (savehue < 180.0)
+				red = m2;
+	        else if (savehue < 240.0)
+	          red = m1 + (m2-m1) * (240.0-savehue)/60.0;
+	        else
+	          red = m1;
+	 
+			savehue = hue;
+			if (savehue > 360.0)
+				savehue -= 360.0;
+			if (savehue < 0.0)
+				savehue += 360.0;
+			if (savehue < 60.0)
+				green = m1 + (m2-m1) * savehue/60.0;
+			else if (savehue < 180.0)
+				green = m2;
+			else if (savehue < 240.0)
+				green = m1 + (m2-m1) * (240.0-savehue)/60.0;
+			else
+				green = m1; 
+			savehue = hue - 120.0;
+	   
+			if (savehue > 360.0)
+				savehue -= 360.0;
+			if (savehue < 0.0)
+				savehue += 360.0;
+			if (savehue < 60.0)
+				blue = m1 + (m2-m1) * savehue/60.0;
+			else if (savehue < 180.0)
+				blue = m2;
+			else if (savehue < 240.0)
+				blue = m1 + (m2-m1) * (240.0-savehue)/60.0;
+			else
+				blue = m1;
+		}
+	 
+		red255 = red * 255.0;
+		green255 = green * 255.0;
+		blue255 = blue * 255.0;
+		if (red255 > 255.0)
+			red = 255.0;
+		else
+			red = red255;
+		if (green255 > 255.0)
+			green = 255.0;
+		else
+			green = green255;
+		if (blue255 > 255.0)
+			blue = 255.0;
+		else
+			blue = blue255;
+	 
+		if (red   > 254.5) red   = 254.5;
+		if (red   <   0.0) red   =   0.0;
+		if (green > 254.5) green = 254.5;
+		if (green <   0.0) green =   0.0;
+		if (blue  > 254.5) blue  = 254.5;
+		if (blue  <   0.0) blue  =   0.0;
+	 
+		res[0] = (int) (red + 0.5);
+		res[1] = (int) (green +0.5);
+		res[2] = (int) (blue + 0.5);
+		return res;
+	}
+	
+	public double[] RGBtoCMYK(int red, int green, int blue, double kScale) {
+		double[] cmyk = new double[4];
+		double c = 1D - (red / 255D);
+		double m = 1D - (green / 255D);
+		double y = 1D - (blue / 255D);
+		cmyk[3] = 1D;
+		
+		if(c < cmyk[3])
+			cmyk[3] = c;
+		if(m < cmyk[3])
+			cmyk[3] = m;
+		if(y < cmyk[3])
+			cmyk[3] = y;
+		
+		cmyk[3] *= kScale;
+		
+		if(cmyk[3] < 1.0) {
+			cmyk[0] = ((double)(c - cmyk[3]) / (double)(1D - cmyk[3]));
+			cmyk[1] = ((double)(m - cmyk[3]) / (double)(1D - cmyk[3]));
+			cmyk[2] = ((double)(y - cmyk[3]) / (double)(1D - cmyk[3]));
+		} 
+		return cmyk;
+	}
+	
+	public double[] CMYKtoRGB(double cyan, double magenta, double yellow, double key) {
+		double[] rgb = new double[3];
+		double c = 1, m = 1, y = 1;
+		
+		if(key < 1D) {
+			c = cyan * (1D - key) + key;
+			m = magenta * (1D - key) + key;
+			y = yellow * (1D - key) + key;
+		}
+		
+		rgb[0] = 1D - c;
+		rgb[1] = 1D - m;
+		rgb[2] = 1D - y;
+		return rgb;
+	}
+	
+	public double getLuminosity(int red, int green, int blue) {
+		double   scaler, scaleg, scaleb;
+		double   low, high;
+	
+		scaler = (double) (red / 255.0);
+		scaleg = (double) (green / 255.0);
+		scaleb = (double) (blue / 255.0);
+  	 
+		high = scaler;
+    
+		if (scaleg > high)
+			high = scaleg;
+		if (scaleb > high)
+			high = scaleb;
+		low = scaler;
+		if (scaleg < low)
+			low = scaleg;
+		if (scaleb < low)
+			low = scaleb;
+    
+		return ((high + low) / 2.0);
+	}
+	
+	public byte[] getARGBFromIntToByteArray(int rgb) {
+		byte[] b = new byte[4];
+		b[0] = (byte) ((rgb & 0x00ff0000) >> 16);
+		b[1] = (byte) ((rgb & 0x0000ff00) >> 8);
+		b[2] = (byte) (rgb & 0x000000ff);
+		b[3] = (byte) ((rgb & 0xff000000) >> 24);
+		return b;
+	}
+
+	public int[] getARGBFromIntToIntArray(int rgb) {
+		int[] i = new int[4];
+		i[0] = (((rgb & 0x00ff0000) >> 16) & 0xff);
+		i[1] = (((rgb & 0x0000ff00) >> 8) & 0xff);
+		i[2] = ((rgb & 0x000000ff) & 0xff);
+		i[3] = (((rgb & 0xff000000) >> 24) & 0xff);
+		return i;
+	}
+
+	public int getIntFromARGB(int a, int r, int g, int b) {
+		return (((a & 0xff) << 24) + ((r & 0xff) << 16) + ((g & 0xff) << 8) + (b & 0xff));
+	}
+	
+	/**
+	 * Mezcla dos buffers de transparencia en uno solo.
+	 * @param dst Buffer destino de la mezcla
+	 * @param buf Buffer a mezclar sobre el destino
+	 * @return Buffer destino
+	 */
+	public Buffer mergeTransparencyBuffers(Buffer dst, Buffer buf) {
+		if(buf == null && dst != null)
+			return dst;
+		if(dst == null && buf != null)
+			return buf;
+		if(buf != null && dst != null) {
+			if(dst.getWidth() != buf.getWidth() || dst.getHeight() != buf.getHeight())
+				return null;
+			for (int y = 0; y < buf.getHeight(); y++)
+				for (int x = 0; x < buf.getWidth(); x++)
+					dst.setElem(y, x, 0,
+							(byte) (((dst.getElemByte(y, x, 0) & 0xff) * (buf.getElemByte(y, x, 0) & 0xff)) / 255D));
+			return dst;
+		}
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultColorConversion.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultCRSUtils_deprecated.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultCRSUtils_deprecated.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultCRSUtils_deprecated.java	(revision 15423)
@@ -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.util;
+
+import org.cresques.cts.ICRSFactory;
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.coverage.util.CRSUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class DefaultCRSUtils_deprecated implements CRSUtils {
+	private static Logger logger    =  LoggerFactory.getLogger(DefaultCRSUtils_deprecated.class.getName());
+	public ICRSFactory    factory   =  null;
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.CRSUtils#setCRSFactory(org.cresques.cts.ICRSFactory)
+	 */
+	public void setCRSFactory(ICRSFactory factory) {
+		this.factory = factory;
+	}
+
+	/**
+	 * Devuelve el CRSFactory asignado desde fuera o creado desde dentro, todo depende de como se haya
+	 * usado.
+	 *
+	 * @param code
+	 * @return
+	 */
+	private IProjection getCRS(String code) {
+		if (factory == null)
+			factory = CRSFactory.cp;//new ProjectionPool();
+		return factory.get(code);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.CRSUtils#convertWktToIProjection(java.lang.String)
+	 */
+	public IProjection convertWktToIProjection(String wkt) {
+		/*if (wkt == null || wkt.equals(""))
+			return null;
+
+		String code = null;
+		String name = null;
+
+		CoordinateReferenceSystem crs = null;
+		try {
+			crs = CRS.parseWKT(wkt);
+			CoordinateSystem cs = crs.getCoordinateSystem();
+			Iterator<?> it = cs.getIdentifiers().iterator();
+			while(it.hasNext()) {
+				NamedIdentifier epsg = (NamedIdentifier)it.next();
+				return getCRS(epsg.toString());
+			}
+			return null;
+		} catch (FactoryException e) {
+			logger.debug("", e);
+		} */
+		
+
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.CRSUtils#convertIProjectionToWkt(org.cresques.cts.IProjection)
+	 */
+	public String convertIProjectionToWkt(IProjection projection) {
+		/*if(projection == null)
+			return null;
+
+		String code = projection.getAbrev();
+		//String name = code.substring(0, code.indexOf(":"));
+		//code = code.substring(code.indexOf(":") + 1);
+		
+		try {
+			CoordinateReferenceSystem crs = CRS.decode(code);
+			return crs.toWKT();
+		} catch (FactoryException e) {
+			e.printStackTrace();
+		} */
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultCRSUtils_deprecated.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultMathUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultMathUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultMathUtils.java	(revision 15423)
@@ -0,0 +1,176 @@
+/* gvSIG. Sistema de Informaci�n Geogr�fica de la Generalitat Valenciana
+*
+* Copyright (C) 2007 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.util;
+
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+
+/**
+ * Utilidades para calculos matem�ticos
+ * 
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class DefaultMathUtils implements MathUtils {
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#clipDecimals(double, int)
+	 */
+	public double clipDecimals(double num, int n) {
+		long m = (long) Math.pow(10, n);
+		long aux = Math.round(num * m);
+		return (double) aux / (double) m;
+	}
+		
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertPixelsToMms(double, int)
+	 */
+	public double convertPixelsToMms(double pixels, int ppp){
+		return convertPixelsToInches(pixels, ppp) * MMSINCH;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertPixelsToCms(double, int)
+	 */
+	public double convertPixelsToCms(double pixels, int ppp){
+		return convertPixelsToInches(pixels, ppp) * CMSINCH;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertPixelsToMts(double, int)
+	 */
+	public double convertPixelsToMts(double pixels, int ppp){
+		return convertPixelsToInches(pixels, ppp) * MTRSINCH;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertPixelsToInches(double, int)
+	 */
+	public double convertPixelsToInches(double pixels, int ppp){
+		return (double)((double)pixels / (double)ppp);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertMtsToPixels(double, int)
+	 */
+	public int convertMtsToPixels(double mts, int ppp){
+		return (int)(mts * INCHESMTR * ppp);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertInchesToPixels(double, int)
+	 */
+	public int convertInchesToPixels(double inches, int ppp){
+		return (int)(inches * ppp);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertCmsToPixels(double, int)
+	 */
+	public int convertCmsToPixels(double cms, int ppp){
+		return (int)(cms * INCHESCM * ppp);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertMmsToPixels(double, int)
+	 */
+	public int convertMmsToPixels(double mms, int ppp) {
+		return (int) (mms * INCHESMM * ppp);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#format(double, int)
+	 */
+	public double format(double num, int n) {
+		long m = (long) Math.pow(10, n);
+		num *= m;
+		long aux = ((long) num);
+		num = (double) ((double) aux / (double) m);
+		return num;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertDoubleList(java.lang.Double[])
+	 */
+	public double[] convertDoubleList(Double[] list) {
+		if (list == null)
+			return null;
+		double[] result = new double[list.length];
+		for (int i = 0; i < list.length; i++)
+			result[i] = list[i].doubleValue();
+		return result;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertIntList(java.lang.Integer[])
+	 */
+	public int[] convertIntList(Integer[] list) {
+		if (list == null)
+			return null;
+		int[] result = new int[list.length];
+		for (int i = 0; i < list.length; i++)
+			result[i] = list[i].intValue();
+		return result;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#adjustDouble(double)
+	 */
+	public double adjustDouble(double d) {
+		if(d >= 1) {
+			double a = (d - (int)d);
+			a = (a > 0.95 || a < 0.05) ? Math.round(d) : d; 
+			a = Math.round(a * 10000) / (double)10000; //trunca a 4 decimales
+			return a;
+		}
+		return d;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.util.MathUtils#convertToHex(byte[])
+	 */
+	public String convertToHex(byte[] data) { 
+        StringBuffer buf = new StringBuffer();
+        for (int i = 0; i < data.length; i++) { 
+            int halfbyte = (data[i] >>> 4) & 0x0F;
+            int two_halfs = 0;
+            do { 
+                if ((0 <= halfbyte) && (halfbyte <= 9)) 
+                    buf.append((char) ('0' + halfbyte));
+                else 
+                    buf.append((char) ('a' + (halfbyte - 10)));
+                halfbyte = data[i] & 0x0F;
+            } while(two_halfs++ < 1);
+        } 
+        return buf.toString();
+    }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultMathUtils.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultProviderServices.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultProviderServices.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultProviderServices.java	(revision 15423)
@@ -0,0 +1,652 @@
+/* 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.util;
+
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.logging.Level;
+
+import org.gvsig.fmap.dal.DALFileLocator;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+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.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FileNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.process.overview.OverviewBuilder;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.util.CRSUtils;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+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.dal.raster.spi.CoverageStoreProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.spi.FilesystemServerExplorerProviderFactory;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.dal.spi.DataStoreProvider;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
+import org.gvsig.raster.impl.store.DefaultRasterStore;
+import org.gvsig.raster.impl.store.WriteFileFormatFeatures;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.raster.impl.store.rmf.RmfBlocksManager;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPoint.Extension;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *
+ * 31/10/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class DefaultProviderServices implements ProviderServices {
+	public TreeMap<String, WriteFileFormatFeatures>
+                                          fileFeature       = new TreeMap<String, WriteFileFormatFeatures>();
+	private Logger                        log               = LoggerFactory.getLogger(DefaultProviderServices.class);
+	private static List<Class<?>>         tiledProviders    = new ArrayList<Class<?>>();
+	private static Class<?>               tileclass         = null;
+	private static HashMap<String, ArrayList<Class<?>>>
+                                          formatsRegistry   = new HashMap<String, ArrayList<Class<?>>>();
+
+	public DefaultRasterManager getManager() {
+		return (DefaultRasterManager)RasterLocator.getManager();
+	}
+
+	public TreeMap<String, WriteFileFormatFeatures> getFileFeature() {
+		return fileFeature;
+	}
+
+	public RasterDataStore open(CoverageStoreProvider prov, DataStoreParameters params) throws NotSupportedExtensionException, RasterDriverException {
+		if(prov instanceof RasterProvider) {
+			DefaultRasterStore store = new DefaultRasterStore();
+			store.setProvider((RasterProvider)prov);
+			try {
+				store.intializePhase1(null, params);
+			} catch (InitializeException e) {
+				throw new RasterDriverException(e.getMessage());
+			}
+			return store;
+		}
+		return null;
+	}
+
+	/**
+	 * Abre un dataset pasando como par�metros la proyecci�n y un objeto identificador del dataset. Este
+	 * objeto puede ser una ruta a un fichero en disco. En este caso la extensi�n del fichero servir� para
+	 * buscar el driver que lo gestiona. Si proporcionamos un array de cadenas se tratar�n como la ruta a N ficheros
+	 * de disco. Tambi�n puede ser un buffer de datos en memoria o cualquier otro objeto
+	 * que pueda aceptar un driver.
+	 * @param param Par�metros al driver
+	 * @return RasterMultiDatset
+	 * @throws NotSupportedExtensionException
+	 * @throws RasterDriverException
+	 */
+	public RasterDataStore open(DataStoreParameters params) throws NotSupportedExtensionException, RasterDriverException {
+		if(params == null || !(params instanceof AbstractRasterDataParameters))
+			return null;
+		DefaultRasterStore dSet = new DefaultRasterStore();
+		DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+		try {
+			AbstractRasterProvider provider = (AbstractRasterProvider)dataManager.createProvider(dSet, (AbstractRasterDataParameters)params);
+			dSet.setProvider(provider);
+		} catch (InitializeException e) {
+			throw new RasterDriverException("Error initializing provider", e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new RasterDriverException("Provider not register error", e);
+		}
+		return dSet;
+	}
+
+	public RasterDataStore open(Object datasetOpenParam) throws NotSupportedExtensionException, RasterDriverException {
+		DefaultRasterStore dSet = new DefaultRasterStore();
+
+		if (datasetOpenParam instanceof String) {
+			AbstractRasterProvider provider = AbstractRasterProvider.singleDatasetInstance(dSet, (String)datasetOpenParam);
+			dSet.setProvider(provider);
+			return dSet;
+		}
+
+		return null;
+	}
+
+	public RasterDataStore open(String file) throws NotSupportedExtensionException, RasterDriverException, InitializeException, ProviderNotRegisteredException {
+		RasterDataParameters params = createNotTiledParameters(file);
+		return open(params);
+	}
+
+
+	/**
+	 * Loads the specific provider to download data
+	 * @param file
+	 * @return
+	 * @throws NotSupportedExtensionException
+	 * @throws FileNotSupportedException
+	 */
+	@SuppressWarnings("unchecked")
+	public static AbstractRasterProvider loadProvider(File file) throws ProviderNotRegisteredException, InitializeException {
+		DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+		DataStoreProviderServices storeServices = null;
+		DataStoreProvider prov = null;
+
+		if(file != null) {
+			//We have to locate a provider's name which manages the selected file
+			//A FilesystemServerExplorer will give a getProviderNames service
+			FilesystemServerExplorerParameters paramsExplorer = (FilesystemServerExplorerParameters)dataManager.createServerExplorerParameters(FilesystemServerExplorer.NAME);
+			FilesystemServerExplorer serverExplorer = null;
+			try {
+				paramsExplorer.setRoot(File.separator);
+				serverExplorer = (FilesystemServerExplorer)dataManager.openServerExplorer(FilesystemServerExplorer.NAME, paramsExplorer);
+			} catch (ValidateDataParametersException e) {
+				throw new InitializeException(e);
+			}
+
+			//Gets the list of provider's name to manage the file
+			List<String> provNameList = serverExplorer.getProviderNameList(file);
+			if(provNameList.size() > 0) {
+				for (int i = 0; i < provNameList.size(); i++) {
+					//Gets the first provider what is not a TileProvider
+					if(provNameList.get(i).compareTo("Tile Store") != 0) {
+						DataStoreParameters newparams = dataManager.createStoreParameters(provNameList.get(i));
+						((FilesystemStoreParameters)newparams).setFile(file);
+						prov = dataManager.createProvider(storeServices, newparams);
+					}
+				}
+			} else { //Default provider. This should be Gdal
+				ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+				ExtensionPoint point = extensionPoints.get("DefaultRasterProvider");
+				Extension ext = point.get("reader");
+				String provName = ext.getDescription();
+				DataStoreParameters newparams = dataManager.createStoreParameters(provName);
+				((FilesystemStoreParameters)newparams).setFile(file);
+				prov = dataManager.createProvider(storeServices, newparams);
+			}
+		}
+
+		if(prov != null && prov instanceof RasterProvider) {
+			if(((RasterProvider)prov).isRotated())
+				throw new InitializeException("Rotation not supported tiling files", new Throwable());
+
+			return (AbstractRasterProvider)prov;
+		}
+
+		return null;
+	}
+
+	public RasterDataParameters createNotTiledParameters(String id) throws InitializeException, ProviderNotRegisteredException {
+		DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+		ArrayList<RasterDataParameters> parametersList = createParametersList(id);
+		for (int i = 0; i < parametersList.size(); i++) {
+			DataStoreProvider p = dataManager.createProvider(null, parametersList.get(i));
+			if(p instanceof RasterProvider) {
+				if(!((RasterProvider)p).isTiled())
+					return parametersList.get(i);
+			}
+		}
+		return null;
+	}
+
+	public RasterDataParameters createParameters(String id) {
+		Iterator<?> it = DALFileLocator.getFilesystemServerExplorerManager().getRegisteredProviders();
+		while (it.hasNext()) {
+			ExtensionPoint.Extension o = (ExtensionPoint.Extension)it.next();
+			try {
+                Object factory = (FilesystemServerExplorerProviderFactory)o.create();
+                if (factory instanceof FilesystemServerExplorerProviderFactory) {
+                    Object obj = ((FilesystemServerExplorerProviderFactory)factory).createProvider();
+                    if (obj instanceof FilesystemServerExplorerProvider) {
+                        FilesystemServerExplorerProvider prov = (FilesystemServerExplorerProvider) obj;
+                        File file = new File(id);
+                        if (prov.accept(file)) {
+                            DataManager manager = DALLocator.getDataManager();
+                            RasterFileStoreParameters params = null;
+                            try {
+                                params =
+                                    (RasterFileStoreParameters) manager.createStoreParameters(prov
+                                        .getDataStoreProviderName());
+                            } catch (InitializeException e) {
+                            } catch (ProviderNotRegisteredException e) {
+                            }
+                            params.setFile(file);
+                            return params;
+                        }
+                    }
+                }
+			} catch (SecurityException e) {
+				log.debug("Error SecurityException in open", e);
+			} catch (IllegalArgumentException e) {
+				log.debug("Error IllegalArgumentException in open", e);
+			} catch (InstantiationException e) {
+				log.debug("Error InstantiationException in open", e);
+			} catch (IllegalAccessException e) {
+				log.debug("Error IllegalAccessException in open", e);
+			} catch (InitializeException e) {
+                log.debug("Error InitializeException in open", e);
+            }
+		}
+		return null;
+	}
+
+	public ArrayList<RasterDataParameters> createParametersList(String id) {
+        return createParametersList(new File(id));
+	}
+
+    public ArrayList<RasterDataParameters> createParametersList(File file) {
+        ArrayList<RasterDataParameters> list = new ArrayList<RasterDataParameters>();
+
+        Iterator<?> it = DALFileLocator.getFilesystemServerExplorerManager().getRegisteredProviders();
+        while (it.hasNext()) {
+            ExtensionPoint.Extension o = (ExtensionPoint.Extension) it.next();
+            try {
+                Object factory = (FilesystemServerExplorerProviderFactory) o.create();
+                if (factory instanceof FilesystemServerExplorerProviderFactory) {
+                    Object obj = ((FilesystemServerExplorerProviderFactory) factory).createProvider();
+                    if (obj instanceof FilesystemServerExplorerProvider) {
+                        FilesystemServerExplorerProvider prov = (FilesystemServerExplorerProvider) obj;
+                        if (prov.accept(file)) {
+                            DataManager manager = DALLocator.getDataManager();
+                            RasterFileStoreParameters params = null;
+                            try {
+                                params
+                                        = (RasterFileStoreParameters) manager.createStoreParameters(prov
+                                                .getDataStoreProviderName());
+                            } catch (InitializeException e) {
+                            } catch (ProviderNotRegisteredException e) {
+                            }
+                            params.setFile(file);
+                            list.add(params);
+                        }
+                    }
+                }
+            } catch (SecurityException e) {
+                log.debug("Error SecurityException in open", e);
+            } catch (IllegalArgumentException e) {
+                log.debug("Error IllegalArgumentException in open", e);
+            } catch (InstantiationException e) {
+                log.debug("Error InstantiationException in open", e);
+            } catch (IllegalAccessException e) {
+                log.debug("Error IllegalAccessException in open", e);
+            } catch (InitializeException e) {
+                log.debug("Error InitializeException in open", e);
+            }
+        }
+        return list;
+    }
+        
+
+	public RasterDataParameters createParametersForTiledFiled(String id) {
+		DataManager manager = DALLocator.getDataManager();
+		RasterFileStoreParameters params = null;
+		try {
+			params = (RasterFileStoreParameters) manager.createStoreParameters("Tile Store");
+		} catch (InitializeException e) {
+		} catch (ProviderNotRegisteredException e) {
+		}
+		File file = new File(id);
+		params.setFile(file);
+		return params;
+	}
+
+	@SuppressWarnings("unchecked")
+	public String[] getDriversExtensions() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterWriter");
+		return (String[])point.getNames().toArray(new String[0]);
+	}
+
+	public String[] getRODriversExtensions() {
+		return getReadOnlyFormatList();
+	}
+
+	public ArrayList<String> getExtensionsSupported(int dataType, int bands) throws RasterDriverException {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterWriter");
+		Iterator<?> iterator = point.iterator();
+		ArrayList<String> result = new ArrayList<String>();
+		while (iterator.hasNext()) {
+			ExtensionPoint.Extension extension = (ExtensionPoint.Extension) iterator.next();
+			String ext = extension.getName();
+			try {
+				if (isSupportedThisFileToWrite(ext, dataType, bands))
+					result.add(ext);
+			} catch (SecurityException e) {
+				throw new RasterDriverException("Error SecurityException in open");
+			}  catch (IllegalArgumentException e) {
+				throw new RasterDriverException("Error IllegalArgumentException in open");
+			}
+		}
+		return result;
+	}
+
+	@SuppressWarnings("rawtypes")
+	public String[] getWriteDriversType() {
+		if (fileFeature.size() == 0)
+			return null;
+		String[] list = new String[fileFeature.size()];
+		Set<?> values = fileFeature.entrySet();
+		int i = 0;
+		for (Iterator<?> it = values.iterator(); it.hasNext();) {
+			list[i] = ((WriteFileFormatFeatures) ((Map.Entry) it.next()).getValue()).getDriverName();
+			i++;
+		}
+
+		return list;
+	}
+
+	public String getWriteDriverType(String ext) {
+		return ((WriteFileFormatFeatures) fileFeature.get(ext)).getDriverName();
+	}
+
+	public int getWriteNDrivers() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterWriter");
+		return point.getCount();
+	}
+
+	public int getWriteNTypes() {
+		return fileFeature.size();
+	}
+
+	public boolean isSupportedThisFileToWrite(String ext, int dataType, int bands) {
+		WriteFileFormatFeatures features = (WriteFileFormatFeatures) fileFeature.get(ext);
+		if (features == null)
+			return false;
+		int[] bandsSupported = features.getNBandsSupported();
+		if (bandsSupported[0] != -1 && bandsSupported[0] < bands)
+			return false;
+		int[] dt = features.getDataTypesSupported();
+		for (int i = 0; i < dt.length; i++)
+			if (dataType == dt[i])
+				return true;
+		return false;
+	}
+
+	/**
+	 * Guarda en el RMF que trata el BlocksManager el valor value usando el serializador que soporta
+	 * la clase class1.
+	 *
+	 * @param blocksManager
+	 * @param class1
+	 * @param value
+	 * @throws RmfSerializerException
+	 */
+	public void saveObjectToRmfFile(RmfBlocksManager blocksManager, Class<?> class1, Object value) throws RmfSerializerException {
+		ClassSerializer serializerObject = getSerializerObject(class1, value);
+
+		if (serializerObject == null)
+			throw new RmfSerializerException("No se ha podido encontrar el serializador para el Rmf");
+
+		if (!blocksManager.checkRmf()) {
+			log.info("Error al comprobar el fichero Rmf");
+		}
+
+		blocksManager.addClient(serializerObject);
+		try {
+			blocksManager.write(true);
+		} catch (IOException e) {
+			log.info("Error al escribir el fichero Rmf", e);
+		}
+		blocksManager.removeAllClients();
+	}
+
+	public void saveObjectToRmfFile(String file, Class<?> class1, Object value) throws RmfSerializerException {
+		String fileRMF = RasterLocator.getManager().getFileUtils().getNameWithoutExtension(file) + ".rmf";
+		RmfBlocksManager blocksManager = new RmfBlocksManager(fileRMF);
+		saveObjectToRmfFile(blocksManager, class1, value);
+	}
+
+	public void saveObjectToRmfFile(String file, Object value) throws RmfSerializerException {
+		saveObjectToRmfFile(file, value.getClass(), value);
+	}
+
+	/**
+	 * Construye un serializador que soporte la clase class1. El constructor se invoca
+	 * con el parametro value.
+	 *
+	 * @param class1
+	 * @param value
+	 * @return
+	 * @throws RmfSerializerException
+	 */
+	public ClassSerializer getSerializerObject(Class<?> class1, Object value) throws RmfSerializerException {
+		try {
+			Class<?>[] args = { class1 };
+			Constructor<?> constructor = getSerializerClass(class1).getConstructor(args);
+			Object[] args2 = { value };
+			return (ClassSerializer) constructor.newInstance(args2);
+		} catch (Exception e) {
+			throw new RmfSerializerException("No se ha podido crear el serializador para el Rmf", e);
+		}
+	}
+
+	/**
+	 * Gets the serializer which has a constructor with the class selected in the
+	 * parameters of this function
+	 * @throws RmfSerializerException
+	 */
+	private Class<?> getSerializerClass(Class<?> class1)
+			throws RmfSerializerException {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		Iterator<?> iterator = point.iterator();
+		while (iterator.hasNext()) {
+			ExtensionPoint.Extension extension = (ExtensionPoint.Extension) iterator.next();
+			if (extension != null) {
+				Class<?>[] args = { class1 };
+				Class<?> clase = extension.getExtension();
+				try {
+					clase.getConstructor(args);
+					return clase;
+				} catch (Exception e) {
+					// Si no encuentra un constructor para esta clase, seguir� buscando en los dem�s elementos
+				}
+			}
+		}
+		throw new RmfSerializerException("No se ha encontrado la clase para el serializador");
+	}
+
+	@SuppressWarnings("deprecation")
+	public void exportBufferToFile(Buffer bufResult,
+			double pixelSize,
+			String extension,
+			boolean alphaBand,
+			File file,
+			Extent extent,
+			ColorInterpretation colorInterpretation) throws NotSupportedExtensionException, RasterDriverException, ProcessInterruptedException, IOException {
+		//Escritura en disco del tile
+		RasterManager rManager = RasterLocator.getManager();
+		DataServerWriter dataWriter = RasterLocator.getManager().createDataServerWriter();
+		dataWriter.setBuffer(bufResult, -1);
+		Params params = rManager.createWriter("_." + extension).getParams();
+		AffineTransform affineTransform = new AffineTransform(pixelSize, 0, 0, -pixelSize,
+				extent.getULX(),
+				extent.getULY());
+		RasterWriter rw = rManager.createWriter(dataWriter, file.getAbsolutePath(),
+				bufResult.getBandCount(), affineTransform, bufResult.getWidth(),
+				bufResult.getHeight(), bufResult.getDataType(), params, null);
+
+		if(colorInterpretation != null) {
+			String[] values = colorInterpretation.getValues();
+			if(alphaBand) {
+				String[] newValues = values;
+				boolean exists = false;
+				for (int i = 0; i < values.length; i++) {
+					if(values[i] != null && values[i].compareTo("Alpha") == 0)
+						exists = true;
+				}
+				if(!exists) {
+					newValues = new String[values.length + 1];
+					for (int i = 0; i < values.length; i++) {
+						newValues[i] = values[i];
+					}
+					newValues[newValues.length - 1] = "Alpha";
+				}
+				rw.setColorBandsInterpretation(newValues);
+			}
+
+		} else {
+			if(alphaBand) {
+				String[] ci = new String[bufResult.getBandCount()];
+				if(bufResult.getBandCount() == 4) {
+					ci[0] = "Red";
+					ci[1] = "Green";
+					ci[2] = "Blue";
+					ci[3] = "Alpha";
+				} else {
+					for (int i = 0; i < bufResult.getBandCount(); i++) {
+						ci[i] = "Gray";
+					}
+				}
+				rw.setColorBandsInterpretation(ci);
+			}
+		}
+		rw.dataWrite();
+		rw.writeClose();
+	}
+
+	public void addFormat(String ext, Class<?> c) {
+		ArrayList<Class<?>> list = formatsRegistry.get(ext);
+		if(list == null) {
+			list = new ArrayList<Class<?>>();
+			list.add(c);
+			formatsRegistry.put(ext, list);
+		} else {
+			if(!list.contains(c))
+				list.add(c);
+		}
+	}
+
+	public boolean isExtensionSupported(String ext, Class<?> c) {
+		String extension = getManager().getFileUtils().getExtensionFromFileName(ext);
+
+		ArrayList<Class<?>> list = formatsRegistry.get(extension);
+		if(list == null) {
+			return false;
+		} else {
+			for (int i = 0; i < list.size(); i++) {
+				if(c == list.get(i))
+					return true;
+			}
+		}
+		return false;
+	}
+
+	public boolean isExtensionSupported(String ext) {
+		String extension = getManager().getFileUtils().getExtensionFromFileName(ext);
+
+		ArrayList<Class<?>> list = formatsRegistry.get(extension);
+		if(list == null) {
+			return false;
+		}
+
+		return true;
+	}
+
+	public String[] getReadOnlyFormatList() {
+		return formatsRegistry.keySet().toArray(new String[0]);
+	}
+
+	public void registerFileProvidersTiled(Class<?> provider) {
+		if(!tiledProviders.contains(provider))
+			tiledProviders.add(provider);
+	}
+
+	public void registerTileProviderFormats(Class<?> c) {
+		if(tileclass == null) {
+			if(RasterProvider.class.isAssignableFrom(c)) {
+				List<Object> pList = getTiledProvidersInstance();
+				for (int i = 0; i < pList.size(); i++) {
+					String[] fList = ((RasterProvider)pList.get(i)).getFormatList();
+					for (int j = 0; j < fList.length; j++) {
+						String value = fList[j];
+						addFormat(value, c);
+					}
+				}
+			}
+			tileclass = c;
+		}
+	}
+
+	private List<Object> getTiledProvidersInstance() {
+		List<Object> list = new ArrayList<Object>();
+		for (int i = 0; i < tiledProviders.size(); i++) {
+			Class<?> provider = tiledProviders.get(i);
+			try {
+				Constructor<?> c = provider.getConstructor();
+				list.add(c.newInstance());
+			} catch (SecurityException e) {
+				log.info("Error SecurityException in open", e);
+			} catch (NoSuchMethodException e) {
+				log.info("Error NoSuchMethodException in open", e);
+			} catch (IllegalArgumentException e) {
+				log.info("Error IllegalArgumentException in open", e);
+			} catch (InstantiationException e) {
+				log.info("Error InstantiationException in open", e);
+			} catch (IllegalAccessException e) {
+				log.info("Error IllegalAccessException in open", e);
+			} catch (InvocationTargetException e) {
+				log.info("Error in open. Problemas con las librer�as nativas.", e);
+			}
+		}
+		return list;
+	}
+
+	public void registerOverviewBuilderImplementation(String id, OverviewBuilder ovBuilder) {
+		DefaultRasterManager.overviewBuilderRegistry.put(id, ovBuilder);
+	}
+
+	public void registerCRSUtilImplementation(CRSUtils crsUtil) {
+		DefaultRasterManager.crsUtilRegistry = crsUtil;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/DefaultProviderServices.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDouble.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDouble.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDouble.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentDouble extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.getDouble("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((Double)obj).doubleValue());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDouble.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentInt.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentInt.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentInt.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentInt extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.getInt("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((Integer)obj).intValue());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentInt.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentStatistics.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentStatistics.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentStatistics.java	(revision 15423)
@@ -0,0 +1,19 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentStatistics extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = (Statistics)state.get("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((Statistics)obj));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentStatistics.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentConvolutionUI.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentConvolutionUI.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentConvolutionUI.java	(revision 15423)
@@ -0,0 +1,22 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.raster.impl.datastruct.Kernel;
+import org.gvsig.raster.impl.grid.filter.convolution.ConvolutionUI;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @deprecated 
+ */
+public class GenericPersistentConvolutionUI extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		Kernel k = (Kernel)state.get("value");
+		obj = new ConvolutionUI(k);
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		Kernel k = ((ConvolutionUI)obj).getKernel();
+		state.set("value", k);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentConvolutionUI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBooleanArray.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBooleanArray.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBooleanArray.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentBooleanArray extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.getBooleanArray("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((boolean[])obj));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBooleanArray.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBaseForObjs.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBaseForObjs.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBaseForObjs.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentBaseForObjs extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.get("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", obj);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBaseForObjs.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBoolean.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBoolean.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBoolean.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentBoolean extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.getBoolean("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((Boolean)obj).booleanValue());
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentBoolean.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/PersistencyFilterParams.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/PersistencyFilterParams.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/PersistencyFilterParams.java	(revision 15423)
@@ -0,0 +1,168 @@
+/* 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.util.persistence;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterListManager;
+import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.Persistent;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Parameters to persist a filter
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PersistencyFilterParams implements Persistent {
+	private Logger    log                   = LoggerFactory.getLogger(PersistencyFilterParams.class);
+	private String    filterName            = null;
+	private Params    filterParams          = null;
+	private String    managerExtensionName  = null;
+	private Class<?>  filterClass           = null;
+
+	public String getFilterName() {
+		return filterName;
+	}
+
+	public void setFilterName(String filterName) {
+		this.filterName = filterName;
+	}
+
+	public Params getFilterParams() {
+		return filterParams;
+	}
+
+	public void setFilterParam(Params filterParams) {
+		this.filterParams = filterParams;
+	}
+
+	public Class<?> getFilterClass() {
+		return filterClass;
+	}
+
+	public String getManagerExtensionName() {
+		return managerExtensionName;
+	}
+
+	public void setManagerExtensionName(String managerExtensionName) {
+		this.managerExtensionName = managerExtensionName;
+	}
+
+	
+	/**
+	 * Sustituye la lista de filtros de filterList por la que le pasamos en forma
+	 * de lista de ParamStruct
+	 * @param filterList
+	 * @param listFilterUsed
+	 * @throws FilterTypeException 
+	 * @throws FilterManagerException 
+	 */
+	public static void addSelectedFilters(RasterFilterList filterList, ArrayList<PersistencyFilterParams> listFilterUsed) throws FilterTypeException, FilterManagerException {
+		filterList.clear();
+
+		for (int i = 0; i < listFilterUsed.size(); i++) {
+			PersistencyFilterParams aux = (PersistencyFilterParams) listFilterUsed.get(i);
+			RasterFilterListManager filterManager = filterList.getManagerByFilterClass(aux.getFilterClass());
+			filterManager.addFilter(aux.getFilterClass(), aux.getFilterParams());
+		}
+
+		filterList.resetPercent();
+	}
+	
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		this.filterName = state.getString("filtername");
+		this.filterParams = (Params)state.get("params");
+		this.managerExtensionName = state.getString("managerExtensionName");
+		this.filterClass = getFilterClass(filterName, managerExtensionName);
+	}
+	
+	private Class<?> getFilterClass(String filterName, String managerExtensionName) {
+		try {
+			ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+			ExtensionPoint point = extensionPoints.get("RasterFilter");
+			Class<?> c = point.get(managerExtensionName).getExtension();
+			Class<?>[] args = { RasterFilterList.class };
+			Constructor<?> hazNuevo = c.getConstructor(args);
+			RasterFilterListManager obj = (RasterFilterListManager)hazNuevo.newInstance(new DefaultRasterFilterList());
+			return obj.getFilterClassByID(filterName);
+		} catch (IllegalArgumentException e) {
+			log.debug("Error loading filter class", e);
+		} catch (InstantiationException e) {
+			log.debug("Error loading filter class", e);
+		} catch (IllegalAccessException e) {
+			log.debug("Error loading filter class", e);
+		} catch (InvocationTargetException e) {
+			log.debug("Error loading filter class", e);
+		} catch (SecurityException e) {
+			log.debug("Error loading filter class", e);
+		} catch (NoSuchMethodException e) {
+			log.debug("Error loading filter class", e);
+		}
+		return null;
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("filtername", filterName);
+		filterParams.setManagerID(managerExtensionName);
+		state.set("params", filterParams);
+		state.set("managerExtensionName", managerExtensionName);
+	}
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+
+		DynStruct definition = manager.addDefinition(
+				PersistencyFilterParams.class,
+				"PersistencyFilterParam_Persistence",
+				"PersistencyFilterParam Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldString("filtername")
+		.setMandatory(false);
+		
+		definition.addDynFieldObject("params")
+		.setClassOfValue(Params.class)
+		.setMandatory(false);
+		
+		definition.addDynFieldString("filterclass")
+		.setMandatory(false);
+		
+		definition.addDynFieldString("managerExtensionName")
+		.setMandatory(false);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/PersistencyFilterParams.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentColorTable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentColorTable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentColorTable.java	(revision 15423)
@@ -0,0 +1,20 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentColorTable extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = (ColorTable)state.get("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((ColorTable)obj));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentColorTable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentObject.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentObject.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentObject.java	(revision 15423)
@@ -0,0 +1,147 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.Persistent;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public abstract class GenericPersistentObject implements Persistent {
+	protected Object obj = null;
+	
+	public static GenericPersistentObject create(Object obj) {
+		GenericPersistentObject result = null;
+		if(obj instanceof Double)
+			result = new GenericPersistentDouble();
+		if(obj instanceof Integer)
+			result = new GenericPersistentInt();
+		if(obj instanceof Boolean)
+			result = new GenericPersistentBoolean();
+		if(obj instanceof ColorTable)
+			result = new GenericPersistentColorTable();
+		if(obj instanceof String)
+			result = new GenericPersistentString();
+		//if(obj instanceof ConvolutionUI)
+			//result = new GenericPersistentConvolutionUI();
+		if(obj instanceof double[])
+			result = new GenericPersistentDoubleArray();
+		if(obj instanceof int[])
+			result = new GenericPersistentIntArray();
+		if(obj instanceof boolean[])
+			result = new GenericPersistentBooleanArray();
+		if(obj instanceof Statistics)
+			result = new GenericPersistentStatistics();
+		if(result != null)
+			result.setObject(obj);
+		return result;
+	}
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+
+		DynStruct definition = manager.addDefinition(
+				GenericPersistentDouble.class,
+				"GenericDouble_Persistence",
+				"Generic Double Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldDouble("value").setMandatory(false);
+		
+		definition = manager.addDefinition(
+				GenericPersistentBoolean.class,
+				"GenericBoolean_Persistence",
+				"Generic Boolean Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldBoolean("value").setMandatory(false);
+		
+		definition = manager.addDefinition(
+				GenericPersistentInt.class,
+				"GenericInt_Persistence",
+				"Generic Integer Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldInt("value").setMandatory(false);
+		
+		definition = manager.addDefinition(
+				GenericPersistentColorTable.class,
+				"GenericPersistentColorTable_Persistence",
+				"Generic Color Table Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldObject("value").setClassOfValue(ColorTable.class).setMandatory(false);
+		
+		definition = manager.addDefinition(
+				GenericPersistentString.class,
+				"GenericPersistentString_Persistence",
+				"Generic String Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldString("value").setClassOfValue(String.class).setMandatory(false);
+		
+		/*definition = manager.addDefinition(
+				GenericPersistentConvolutionUI.class,
+				"GenericPersistentConvolutionUI_Persistence",
+				"Generic ConvolutionUI Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldObject("value").setClassOfValue(Kernel.class).setMandatory(false);*/
+		
+		definition = manager.addDefinition(
+				GenericPersistentDoubleArray.class,
+				"GenericPersistentDoubleArray_Persistence",
+				"Generic Double Array Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldList("value").setClassOfItems(double.class).setMandatory(false);
+		
+		definition = manager.addDefinition(
+				GenericPersistentIntArray.class,
+				"GenericPersistentIntArray_Persistence",
+				"Generic Integer Array Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldList("value").setClassOfItems(int.class).setMandatory(false);
+		
+		definition = manager.addDefinition(
+				GenericPersistentBooleanArray.class,
+				"GenericPersistentBooleanArray_Persistence",
+				"Generic Boolean Array Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldList("value").setClassOfItems(boolean.class).setMandatory(false);
+		
+		
+		definition = manager.addDefinition(
+				GenericPersistentStatistics.class,
+				"GenericPersistentStatistics_Persistence",
+				"Generic Statistics Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldList("value").setClassOfItems(Statistics.class).setMandatory(false);
+	}
+	
+	public Object getObject() {
+		return obj;
+	}
+	
+	public void setObject(Object obj) {
+		this.obj = obj;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentObject.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentString.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentString.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentString.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentString extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.getString("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", obj);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentString.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDoubleArray.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDoubleArray.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDoubleArray.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentDoubleArray extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.getDoubleArray("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((double[])obj));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentDoubleArray.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentIntArray.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentIntArray.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentIntArray.java	(revision 15423)
@@ -0,0 +1,18 @@
+package org.gvsig.raster.util.persistence;
+
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class GenericPersistentIntArray extends GenericPersistentObject {
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		obj = state.getIntArray("value");
+	}
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", ((int[])obj));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/util/persistence/GenericPersistentIntArray.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/BufferFactoryImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/BufferFactoryImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/BufferFactoryImpl.java	(revision 15423)
@@ -0,0 +1,117 @@
+package org.gvsig.raster.impl;
+
+import org.gvsig.fmap.dal.coverage.BufferFactory;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.BufferParam;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.exception.BufferCreationException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.impl.buffer.BufferParamImpl;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.buffer.RasterMemoryBuffer;
+import org.gvsig.raster.impl.buffer.cache.RasterCache;
+import org.gvsig.raster.impl.buffer.cache.RasterReadOnlyBuffer;
+import org.gvsig.raster.impl.store.QueryableRaster;
+import org.gvsig.raster.util.DefaultRasterUtils;
+
+
+/**
+ * Factory for raster buffers
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class BufferFactoryImpl implements BufferFactory {
+
+	public Buffer createBuffer(BufferParam param) throws BufferCreationException {
+		if(param.getAccessType() == BufferParam.CACHED) {
+			if(RasterBuffer.cacheOn){
+				long sizeDataType = (long)new DefaultRasterUtils().getBytesFromRasterBufType(param.getDataType());
+				long size = (long)(sizeDataType * (long)param.getWidth() * (long)param.getHeight() * (long)param.getBandCount()) / 1024L;
+				long ms1 = RasterLibrary.cacheSize * 1024L;
+				if(size <= ms1)
+					return createMemoryBuffer(param);
+				else
+					return new RasterCache(
+							param.getDataType(), 
+							param.getWidth(), 
+							param.getHeight(),
+							param.getBandCount());
+			}else
+				return createMemoryBuffer(param);
+		}
+		if(param.getAccessType() == BufferParam.MEMORY) {
+			return createMemoryBuffer(param);
+		}
+		if(param.getAccessType() == BufferParam.READ_ONLY) {
+			RasterReadOnlyBuffer rb  = new RasterReadOnlyBuffer(					
+											param.getDataType(), 
+											param.getWidth(), 
+											param.getHeight(), 
+											param.getBandCount());
+			RasterDataStore store = param.getDataStore();
+			int[] window = param.getRoWindow();
+			checkROWindow(window, store);
+			try {
+				rb.setBufferParams(
+						(QueryableRaster)param.getDataStore(),
+						window[0],
+						window[1],
+						window[2],
+						window[3],
+						param.getBandList());
+				return rb;
+			} catch (Exception e) {
+				throw new BufferCreationException("error_creating_ro_buffer", e);
+			}
+		}
+		return null;
+	}
+
+	private void checkROWindow(int[] window, RasterDataStore store) throws BufferCreationException {
+		if(	window[0] < 0 || 
+				window[1] < 0 || 
+				window[2] >= store.getWidth() || 
+				window[3] >= store.getHeight() ||
+				window[0] >= window[2] ||
+				window[1] >= window[3])
+			throw new BufferCreationException("window_not_valid");
+	}
+
+	private Buffer createMemoryBuffer(BufferParam param) {
+		return new RasterMemoryBuffer(
+				param.getDataType(), 
+				param.getWidth(), 
+				param.getHeight(),
+				param.getBandCount(), 
+				param.isMalloc());
+	}
+
+	public BufferParam createBufferParams(
+			int w, 
+			int h, 
+			int bandCount, 
+			int dataType, 
+			boolean malloc) {
+		return new BufferParamImpl(w, h, bandCount, dataType, malloc, BufferParam.CACHED);
+	}
+
+	public BufferParam createMemoryBufferParams(
+			int w, 
+			int h, 
+			int bandCount, 
+			int dataType, 
+			boolean malloc) {
+		return new BufferParamImpl(w, h, bandCount, dataType, malloc, BufferParam.MEMORY);
+	}
+
+	public BufferParam createReadOnlyBufferParams(
+			RasterDataStore store,
+			int minx,
+			int miny,
+			int maxx,
+			int maxy,
+			BandList bandList) {
+		return new BufferParamImpl(store, new int[]{minx, miny, maxx, maxy}, bandList);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/BufferFactoryImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridStatistic.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridStatistic.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridStatistic.java	(revision 15423)
@@ -0,0 +1,200 @@
+/* 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.impl.grid;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.props.BasicStats;
+
+
+/**
+ * Estadisticas de un grid
+ * @author Victor Olaya (volaya@ya.com)
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GridStatistic implements BasicStats {
+	private double[] 			max = null;
+	private double[] 			min = null;
+	private double[] 			mean = null;
+	private double[] 			variance = null;
+	private boolean 			statisticsCalculated = false;
+	private GridImpl			grid = null;
+	protected int				bandToOperate = 0;
+	
+	public GridStatistic(GridImpl grid){
+		this.grid = grid;
+	}
+	
+	private void calculateStatistics() throws GridException {
+		int x, y;
+		double z;
+		int[] iValues = new int[grid.getBandCount()];
+		mean = new double[grid.getBandCount()];
+		min = new double[grid.getBandCount()];
+		max = new double[grid.getBandCount()];
+		variance = new double[grid.getBandCount()];
+		
+		for (int iBand = 0; iBand < grid.getBandCount(); iBand++) {
+			mean[iBand]	= 0.0;
+			variance[iBand]	= 0.0;
+			iValues[iBand]	= 0;
+		}
+		int oldBandToOperate = bandToOperate;
+		statisticsCalculated = true;
+		
+		for (int iBand = 0; iBand < grid.getBandCount(); iBand++) {
+			grid.setBandToOperate(iBand);
+			for (y = 0; y < grid.getNY(); y++){
+				for (x = 0; x < grid.getNX(); x++){
+					z = getValue(x, y);
+					if( !grid.isNoDataValue(z))	{
+						if( iValues[iBand] == 0 )
+							min[iBand] = max[iBand] = z;
+						else if( min[iBand] > z )
+							min[iBand]	= z;
+						else if( max[iBand] < z )
+							max[iBand]	= z;
+
+						mean[iBand]	+= z;
+						variance[iBand] += z * z;
+						iValues[iBand]++;
+					}
+				}
+			}
+		
+			if( iValues[iBand] > 0 ){
+				mean[iBand]	/= (double) iValues[iBand];
+				variance[iBand] = variance[iBand] / (double) iValues[iBand] - mean[iBand] * mean[iBand];
+			}
+		}
+		bandToOperate = oldBandToOperate;
+		statisticsCalculated = true;
+	}
+
+	/**
+	 * Obtiene un valor de una celda del grid independientemente del tipo de dato.
+	 * @param x Posici�n en X
+	 * @param y Posici�n en Y
+	 * @return Valor de la celda en formato double
+	 * @throws RasterBufferInvalidAccessException
+	 */
+	private double getValue(int x, int y) throws GridException {
+		switch(grid.getDataType()) {
+		case Buffer.TYPE_BYTE:return (double)(grid.getCellValueAsByte(x, y)  & 0xff);
+		case Buffer.TYPE_SHORT:return (double)(grid.getCellValueAsShort(x, y)  & 0xffff);
+		case Buffer.TYPE_INT:return (double)(grid.getCellValueAsInt(x, y)  & 0xffffffff);
+		case Buffer.TYPE_FLOAT:return (double)grid.getCellValueAsFloat(x, y);
+		case Buffer.TYPE_DOUBLE:return (double)grid.getCellValueAsDouble(x, y);
+		}
+		return 0;
+	}
+	
+	/**
+	 * Asigna el flag que informa si las estadisticas est�n calculadas para un grid concreto
+	 * @param calc true si est�n calculadas y false si no lo est�n
+	 */
+	public void setStatisticsCalculated(boolean calc){
+		this.statisticsCalculated = calc;
+	}
+	
+	/**
+	 * Asigna la banda sobre la que se realizan las operaciones. Por defecto es la banda 0
+	 * con lo que para el uso de MDTs no habr� que modificar este valor.
+	 * @param band Banda sobre la que se realizan las operaciones.
+	 */
+	public void setBandToOperate(int band){
+		this.bandToOperate = band;
+	}
+
+	public void calcFullStatistics() throws FileNotOpenException,
+			RasterDriverException, InterruptedException {
+		try {
+			calculateStatistics();
+		} catch (GridException e) {
+			throw new RasterDriverException("");
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.BasicStats#getMaxValue()
+	 */
+	public double getMaxValue() throws BandAccessException {
+		return max[bandToOperate];
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.BasicStats#getMeanValue()
+	 */
+	public double getMeanValue() throws BandAccessException {
+		return mean[bandToOperate];
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.BasicStats#getMinValue()
+	 */
+	public double getMinValue() throws BandAccessException {
+		return min[bandToOperate];
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.BasicStats#getVarianceValue()
+	 */
+	public double getVarianceValue() throws BandAccessException {
+		return variance[bandToOperate];
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.BasicStats#isCalculated()
+	 */
+	public boolean isCalculated() {
+		return statisticsCalculated;
+	}
+	
+	public void dispose() {
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		max = null;
+		min = null;
+		mean = null;
+		variance = null;
+		grid = null;
+		super.finalize();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridStatistic.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridExtentImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridExtentImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridExtentImpl.java	(revision 15423)
@@ -0,0 +1,241 @@
+/*******************************************************************************
+		GridExtent.java
+		Copyright (C) Victor Olaya
+		
+		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.impl.grid;
+
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+/**
+ * This class defines a grid system (coordinates and cellsize)
+ * @author Victor Olaya (volaya@ya.com)
+ */
+public class GridExtentImpl extends ExtentImpl implements GridExtent {
+	double cellSizeX = 1;
+	double cellSizeY = -1;
+	int    m_iNX;
+	int    m_iNY;
+	
+	public GridExtentImpl(){}
+	
+	/**
+	 * Assign the extension value and cell size.
+	 * @param minX minimun value in X coordinate
+	 * @param minY minimun value in Y coordinate
+	 * @param maxX maximun value in X coordinate
+	 * @param maxY maximun value in Y coordinate
+	 * @param dCellSize cell size
+	 */
+	public GridExtentImpl(double minX, double minY, double maxX, double maxY, double dCellSize) {
+		super(minX, minY, maxX, maxY);
+		cellSizeX = dCellSize;
+		cellSizeY = -dCellSize;
+		recalculateNXAndNY();
+	}
+	
+	/**
+	 * Assign the extension value and cell size.
+	 * @param minX minimun value in X coordinate
+	 * @param minY minimun value in Y coordinate
+	 * @param maxX maximun value in X coordinate
+	 * @param maxY maximun value in Y coordinate
+	 * @param dCellSize cell size
+	 */
+	public GridExtentImpl(Extent extent, double dCellSize) {
+		super(extent);
+		cellSizeX = dCellSize;
+		cellSizeY = -dCellSize;
+		recalculateNXAndNY();
+	}
+	
+	/**
+	 * Assign the extension value and cell size.
+	 * @param minX minimun value in X coordinate
+	 * @param minY minimun value in Y coordinate
+	 * @param maxX maximun value in X coordinate
+	 * @param maxY maximun value in Y coordinate
+	 * @param dCellSizeX cell size in X coordinate
+	 * @param dCellSizeX cell size in X coordinate
+	 */
+	public GridExtentImpl(double minX, double minY, double maxX, double maxY, double dCellSizeX, double dCellSizeY) {
+		super(minX, minY, maxX, maxY);
+		cellSizeX = dCellSizeX;
+		cellSizeY = dCellSizeY;
+		recalculateNXAndNY();
+	}
+	
+	/**
+	 * Assign the extension value and cell size.
+	 * @param minX minimun value in X coordinate
+	 * @param minY minimun value in Y coordinate
+	 * @param maxX maximun value in X coordinate
+	 * @param maxY maximun value in Y coordinate
+	 * @param dCellSizeX cell size in X coordinate
+	 * @param dCellSizeX cell size in X coordinate
+	 */
+	public GridExtentImpl(Extent extent, double dCellSizeX, double dCellSizeY) {
+		super(extent);
+		cellSizeX = dCellSizeX;
+		cellSizeY = dCellSizeY;
+		recalculateNXAndNY();
+	}
+		
+	public void setXRange(double dXMin, double dXMax){
+		getMin().setLocation(Math.min(dXMin, dXMax), minY());
+		getMax().setLocation(Math.max(dXMin, dXMax), maxY());
+		recalculateNXAndNY();
+	}
+	
+	public void setYRange(double dYMin, double dYMax){
+		getMin().setLocation(minX(), Math.min(dYMin, dYMax));
+		getMax().setLocation(maxX(), Math.max(dYMin, dYMax));
+		recalculateNXAndNY();
+		
+	}
+
+	/**
+	 * Get cell size
+	 * @return cell size in double value
+	 */
+	public double getCellSize() {
+		return cellSizeX;
+	}
+
+	/**
+	 * Set cell size and recalculate pixel distance in both axis
+	 * @param cellSize cell size in double value
+	 */
+	public void setCellSize(double cellSize) {
+		this.cellSizeX = cellSize;
+		this.cellSizeY = -cellSize;
+		recalculateNXAndNY();
+	}
+
+	/**
+	 * Get pixel width 
+	 * @return A integer with the pixel width value
+	 */
+	public int getNX() {		
+		return m_iNX;
+	}
+
+	/**
+	 * Get pixel height 
+	 * @return A integer with the pixel height value
+	 */
+	public int getNY() {
+		return m_iNY;
+	}
+	
+	/**
+	 * Calculates pixel width and pixel height
+	 */
+	private void recalculateNXAndNY(){
+		m_iNY = (int) Math.abs(Math.floor((minY() - maxY()) / cellSizeY));
+		m_iNX = (int) Math.abs(Math.floor((maxX() - minX()) / cellSizeX));
+	}
+	
+	public boolean contains(double x, double y){
+		return (x >= minX() && x <= maxX() && y >= minY() && y <= maxY());
+	}
+	
+	public boolean fitsIn(GridExtent extent){
+		
+		boolean bFitsX, bFitsY;
+		double dOffset;
+		double dOffsetCols;
+		double dOffsetRows;
+		
+		if ((extent.getCellSizeX() != this.getCellSizeX())||(extent.getCellSizeY() != this.getCellSizeY())){
+			return false;
+		}
+		dOffset = Math.abs(extent.minX() - minX());
+		dOffsetCols = dOffset / getCellSizeX();
+		bFitsX = (dOffsetCols == Math.floor(dOffsetCols));
+
+		dOffset = Math.abs(extent.maxY() - maxY());
+		dOffsetRows = dOffset / getCellSizeY();
+		bFitsY = (dOffsetRows == Math.floor(dOffsetRows));
+		
+		return bFitsX && bFitsY;
+		
+	}
+	
+	/**
+	 * Compare a extent with the current GridExtent
+	 * @param extent extent to compare
+	 * @return true if two extents are equals and false if not
+	 */
+	public boolean equals(GridExtent extent){
+		return 	(minX() == extent.minX() &&
+			 	maxX() == extent.maxX() &&
+			 	minY() == extent.minY() &&
+			 	maxY() == extent.maxY() &&
+			 	cellSizeX == extent.getCellSizeX() && 
+			 	cellSizeY == extent.getCellSizeY());
+	}
+	
+	/**
+	 * Add the layer extent as current extent
+	 * @param layer Layer to set the extent
+	 */
+	/*public void addRasterLayerToExtent(FLyrRaster layer){
+		getMin().setLocation(Math.min(layer.getMinX(), minX()), Math.min(layer.getMinY(), minY()));
+		getMax().setLocation(Math.max(layer.getMaxX(), maxX()), Math.max(layer.getMaxY(), maxY()));
+				
+		cellSize = Math.min(layer.getGrid().getXCellSize(), cellSize);
+		recalculateNXAndNY();
+	}*/
+	
+	public GridCellImpl getGridCoordsFromWorldCoords(Point2D pt){
+		int x = (int)Math.floor((pt.getX() - minX()) / cellSizeX);
+		int y = (int)Math.ceil((maxY() - pt.getY()) / cellSizeY);
+		GridCellImpl cell = new GridCellImpl(x, y, 0.0);
+		
+		return cell;
+	}
+	
+	public Point2D getWorldCoordsFromGridCoords(GridCellImpl cell){
+		double x = minX() + (cell.getX() + 0.5) * cellSizeX;
+		double y = maxY() - (cell.getY() + 0.5) * cellSizeY;
+		
+		Point2D pt = new Point2D.Double(x, y);
+		
+		return pt;
+	}
+
+	public double getCellSizeX() {
+		return cellSizeX;
+	}
+
+	public void setCellSizeX(double cellSizeX) {
+		this.cellSizeX = cellSizeX;
+		recalculateNXAndNY();
+	}
+
+	public double getCellSizeY() {
+		return cellSizeY;
+	}
+
+	public void setCellSizeY(double cellSizeY) {
+		this.cellSizeY = cellSizeY;
+		recalculateNXAndNY();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridExtentImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/ImageDrawerImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/ImageDrawerImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/ImageDrawerImpl.java	(revision 15423)
@@ -0,0 +1,356 @@
+/* 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.impl.grid.render;
+
+import java.awt.Image;
+import java.awt.image.BufferedImage;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.filter.FilterLoader;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.render.ImageDrawer;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.grid.filter.enhancement.DefaultLinearStretchParams;
+import org.gvsig.raster.impl.grid.filter.enhancement.EnhancementStretchListManager;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Objeto para la escritura de datos desde un buffer a un objeto Image. En este nivel de
+ * renderizado no se gestiona extents, ni rotaciones ni coordenadas del mundo, solo la
+ * escritura desde un buffer hasta otro de tama�o dado. Por medio de par�metros y de objetos
+ * de estado varia el resultado de la escritura, selecci�n de bandas a escribir desde el buffer
+ * a RGB, transparencias aplicadas o paletas.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ImageDrawerImpl implements ImageDrawer {
+	private Logger        log                   = LoggerFactory.getLogger(ImageDrawerImpl.class);
+	private Buffer        rasterBuf             = null;
+	private double[]      step                  = null;
+	private int           width                 = -1;
+	private int           height                = -1;
+	private double        scaleX                = 1; //rate between input and output buffer
+	private double        scaleY                = 1; 
+	private Transparency  transparency          = null;
+	
+	public ImageDrawerImpl() {
+	}
+	
+	public void setLastTransparency(Transparency t) {
+		this.transparency = t;
+	}
+
+	public Image drawBufferOverImageObject() throws ProcessInterruptedException {
+		if (rasterBuf == null)
+			return null;
+
+		try { // Temporal para la traza de un error aleatorio
+			boolean supersamplingOn = false;
+			BufferedImage image = null;
+			if(width <= 0 && height <= 0) {
+				width = rasterBuf.getWidth();
+				height = rasterBuf.getHeight();
+				scaleX = scaleY = 1;
+			} else {
+				scaleX = rasterBuf.getWidth() / width;
+				scaleY = rasterBuf.getHeight() / height;
+			}
+			image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
+			
+			if(step != null) {
+				supersamplingOn = true;
+			}
+
+			//En el caso de que llegue un buffer que no sea byte es que no se ha aplicado 
+			//filtro de realce por lo que habr� que hacer una conversi�n a byte de cualquier manera
+			//para que se muestre algo.
+			if (rasterBuf.getDataType() != Buffer.TYPE_BYTE)
+				rasterBuf = convertToByte(rasterBuf);
+
+			if (transparency != null && transparency.isTransparencyActive()) {
+				drawWithTransparency(image, supersamplingOn, transparency);
+			} else
+				drawByte(image, supersamplingOn);
+
+			step = null;
+			return image;
+		} catch (OutOfMemoryError error) { // Temporal para la traza de un error
+											// aleatorio
+			log.debug("Buffer: " + rasterBuf.getWidth() + " " + rasterBuf.getHeight() , error);
+		}
+		return null;
+	}
+
+	/**
+	 * Calcula los vectores de desplazamiento en pixels en X e Y cuando se supersamplea.
+	 * @param r Array de desplazamientos para las filas. Debe tener espacio reservado
+	 * @param c Array de desplazamientos para las columnas. Debe tener espacio reservado
+	 * cargados.
+	 */
+	private void calcSupersamplingStepsArrays(int[] r, int[] c) {
+		double pos = step[1];
+		for(int row = 0; row < r.length; row ++) {
+			r[row] = (int)(pos / step[3]);
+			pos ++;
+		}
+		pos = step[0];
+		for(int col = 0; col < c.length; col ++) {
+			c[col] = (int)(pos / step[2]);
+			pos ++;
+		}
+	}
+
+	/**
+	 * Dibuja un raster sobre un BufferedImage
+	 * @param image BufferedImage sobre el que se dibuja
+	 * @param data buffer vacio. Se trata de un array de bytes donde cada elemento representa una banda.
+	 * @param supersampling true si se necesita supersamplear y false si no se necesita
+	 * @throws ProcessInterruptedException
+	 */
+	private void drawByte(BufferedImage image, boolean supersampling) throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		try {
+			byte[] data = new byte[rasterBuf.getBandCount()];
+			
+			if (supersampling) {
+				int[] r = new int[height];
+				int[] c = new int[width];
+				calcSupersamplingStepsArrays(r, c);
+				for (int row = 0; row < height; row++) {
+					for (int col = 0; col < width; col++)
+						try {
+							rasterBuf.getElemByte(r[row], c[col], data);
+							image.setRGB(col, row, (0xff000000 + ((data[0] & 0xff) << 16)
+									+ ((data[1] & 0xff) << 8) + (data[2] & 0xff)));
+						} catch (ArrayIndexOutOfBoundsException e) {
+							log.info("== Size Image:" + image.getWidth() + " " + image.getHeight());
+							log.info("== Position required:" + col + " " + row);
+							break;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+				}
+			} else {
+				for (int row = 0; row < height; row++) {
+					for (int col = 0; col < width; col++) {
+						try {
+							rasterBuf.getElemByte((int)(row * scaleY), (int)(col * scaleX), data);
+							image.setRGB(col, row, (0xff000000 + ((data[0] & 0xff) << 16)
+									+ ((data[1] & 0xff) << 8) + (data[2] & 0xff)));
+						} catch (ArrayIndexOutOfBoundsException ex) {
+							log.info("== Size Image:" + image.getWidth() + " " + image.getHeight());
+							log.info("== Position required:" + (int)(col * scaleX) + " " + (int)(row * scaleY));
+							break;
+						}
+					}
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+				}
+			}
+		} catch (Exception e) {
+			LoggerFactory.getLogger(this.getClass()).info(
+					"Buffer: " + rasterBuf.getWidth() + " " + rasterBuf.getHeight() , e);
+		}
+	}
+
+	/**
+	 * Dibuja un raster sobre un BufferedImage con las propiedades de paleta y transparencia
+	 * @param image BufferedImage sobre el que se dibuja
+	 * @param data buffer vacio. Se trata de un array de bytes donde cada elemento representa una banda.
+	 * @param supersampling true si se necesita supersamplear y false si no se necesita
+	 * @throws ProcessInterruptedException
+	 */
+	private void drawWithTransparency(BufferedImage image, 
+			boolean supersampling,
+			Transparency t) throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		int value = 0;
+		byte[] data = new byte[rasterBuf.getBandCount()];
+		try {
+			if (supersampling) {
+				int[] r = new int[height];
+				int[] c = new int[width];
+				calcSupersamplingStepsArrays(r, c);
+				for (int row = 0; row < height; row++) {
+					for (int col = 0; col < width; col++)
+						try {
+							rasterBuf.getElemByte(r[row], c[col], data);
+							value = t.processRGB(data[0] & 0xff, data[1] & 0xff, data[2] & 0xff, r[row], c[col], rasterBuf);
+							image.setRGB(col, row, value);
+						} catch (ArrayIndexOutOfBoundsException e) {
+							log.info("== Size Image:" + image.getWidth() + " " + image.getHeight());
+							log.info("== Position required:" + col + " " + row);
+							break;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+				}
+			} else {
+				for (int row = 0; row < height; row++) {
+					for (int col = 0; col < width; col++) {
+						try {
+							int r = (int)(row * scaleY);
+							int c = (int)(col * scaleX);
+							rasterBuf.getElemByte(r, c, data);
+							value = t.processRGB(data[0] & 0xff, data[1] & 0xff, data[2] & 0xff, r, c, rasterBuf);
+							image.setRGB(col, row, value);
+						} catch (ArrayIndexOutOfBoundsException e) {
+							log.info("== Size Image:" + image.getWidth() + " " + image.getHeight());
+							log.info("== Position required:" + col + " " + row);
+							break;
+						}  //catch (Exception e) {
+						//System.out.println("Row:" + (int)(row * scaleY) + " Col:" + (int)(col * scaleX) + " " + rasterBuf.getBandCount() + " " + data.length);
+						//}
+					}
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+				}
+
+			}
+		} catch (Exception e) {
+			LoggerFactory.getLogger(this.getClass()).info(
+					"Buffer: " + rasterBuf.getWidth() + " " + rasterBuf.getHeight() , e);
+		}
+	}	
+
+	/**
+	 * Converts a Buffer object into a byte
+	 * @param buf
+	 * @return
+	 */
+	private Buffer convertToByte(Buffer buf) {
+		Buffer b = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_BYTE, buf.getWidth(), buf.getHeight(), buf.getBandCount(), true);
+		if(buf.getDataType() == Buffer.TYPE_SHORT)
+			for (int nBand = 0; nBand < buf.getBandCount(); nBand++)
+				for (int row = 0; row < buf.getHeight(); row++)
+					for (int col = 0; col < buf.getWidth(); col++)
+						b.setElem(row, col, nBand, (byte)(buf.getElemShort(row, col, nBand) & 0xffff));
+		if(buf.getDataType() == Buffer.TYPE_INT)
+			for (int nBand = 0; nBand < buf.getBandCount(); nBand++)
+				for (int row = 0; row < buf.getHeight(); row++)
+					for (int col = 0; col < buf.getWidth(); col++)
+						b.setElem(row, col, nBand, (byte)(buf.getElemInt(row, col, nBand) & 0xffffffff));
+		if(buf.getDataType() == Buffer.TYPE_FLOAT)
+			for (int nBand = 0; nBand < buf.getBandCount(); nBand++)
+				for (int row = 0; row < buf.getHeight(); row++)
+					for (int col = 0; col < buf.getWidth(); col++)
+						b.setElem(row, col, nBand, (byte)(Math.round(buf.getElemFloat(row, col, nBand))));
+		if(buf.getDataType() == Buffer.TYPE_DOUBLE)
+			for (int nBand = 0; nBand < buf.getBandCount(); nBand++)
+				for (int row = 0; row < buf.getHeight(); row++)
+					for (int col = 0; col < buf.getWidth(); col++)
+						b.setElem(row, col, nBand, (byte)(Math.round(buf.getElemDouble(row, col, nBand))));
+		return b;
+	}
+
+	public void setBuffer(Buffer b) {
+		this.rasterBuf = b;
+	}
+
+	public void setSupersamplingOn(double[] step) {
+		this.step = step;
+	}
+
+	public void setOutputSize(int w, int h) {
+		this.width = w;
+		this.height = h;
+	}
+	
+	public void dispose() {
+		if(rasterBuf != null)
+			rasterBuf.dispose();
+		if(transparency != null)
+			transparency.dispose();
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	public void addFilters(Statistics stats, List<RasterFilter> filters) throws FilterTypeException {
+		RasterFilterList filterList = RasterLocator.getManager().createEmptyFilterList(rasterBuf.getDataType());
+		for (int i = 0; i < filters.size(); i++) {
+			filterList.add(filters.get(i));
+		}
+		applyFiltersToBuffer(stats, filterList);
+	}
+	
+	public Buffer addEnhanced(Statistics stats) {
+		return addEnhanced(stats, true, 0.0);
+	}
+
+	public Buffer addEnhanced(Statistics stats, boolean tailTrim, double tailTrimValue) {
+		RasterFilterList filterList = RasterLocator.getManager().createEmptyFilterList(rasterBuf.getDataType());
+
+		try {
+			EnhancementStretchListManager enhancementManager = (EnhancementStretchListManager) filterList.getManagerByClass(EnhancementStretchListManager.class);
+			int[] renderBands = new int[rasterBuf.getBandCount()];
+			for (int i = 0; i < renderBands.length; i++) {
+				renderBands[i] = i;
+			}
+			enhancementManager.addEnhancedStretchFilter(
+					DefaultLinearStretchParams.createStandardParam(new int[] { 0, 1, 2 }, tailTrimValue, stats, true), 
+					stats, 
+					renderBands, 
+					tailTrim);
+		} catch (FilterTypeException e1) {
+		} catch (FileNotOpenException e) {
+		} catch (RasterDriverException e) {
+		}
+
+		applyFiltersToBuffer(stats, filterList);
+		return rasterBuf;
+	}
+	
+	private void applyFiltersToBuffer(Statistics stats, RasterFilterList filterList) {
+		if(filterList != null) {
+			FilterLoader filterLoader = RasterLocator.getManager().createFilterLoader(filterList);
+			filterLoader.addSrcBandCount(rasterBuf.getBandCount());
+			filterLoader.addSrcDataType(rasterBuf.getDataType());
+			filterLoader.addSrcStatistics(stats);
+			filterLoader.addTransparency(transparency);
+			filterLoader.addSrcHistogram(rasterBuf.getHistogramComputer());
+			filterLoader.applyFilters(rasterBuf);
+			rasterBuf = filterLoader.getBufferResult();
+		}
+	}
+	
+	protected void finalize() throws Throwable {
+		step        = null;
+		rasterBuf   = null;
+		transparency = null;
+		super.finalize();
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/ImageDrawerImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/package.html	(revision 15423)
@@ -0,0 +1,5 @@
+<html>
+	<body>
+		Clases usadas para el renderizado de datos sobre objetos java.
+	</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/DefaultRender.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/DefaultRender.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/DefaultRender.java	(revision 15423)
@@ -0,0 +1,1056 @@
+/* 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.impl.grid.render;
+
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Dimension2D;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.WarpException;
+import org.gvsig.fmap.dal.coverage.filter.FilterLoader;
+import org.gvsig.fmap.dal.coverage.grid.FilterListChangeEvent;
+import org.gvsig.fmap.dal.coverage.grid.FilterListChangeListener;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterListManager;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.grid.render.VisualPropertyEvent;
+import org.gvsig.fmap.dal.coverage.grid.render.VisualPropertyListener;
+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.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.coverage.util.PropertyEvent;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.cache.tile.provider.TileListener;
+import org.gvsig.raster.impl.datastruct.DefaultViewPortData;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.grid.filter.band.ColorTableFilter;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.util.persistence.PersistencyFilterParams;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.Persistent;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.gvsig.tools.task.TaskStatus;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+/**
+ * Esta clase se encarga de la gesti�n del dibujado de datos le�dos desde la capa
+ * "dataaccess" sobre objetos java. Para ello necesita una fuente de datos que tipicamente
+ * es un buffer (RasterBuffer) y un objeto que realice la funci�n de escritura de datos a
+ * partir de un estado inicial.
+ * Esta capa del renderizado gestiona Extents, rotaciones, tama�os de vista pero la escritura
+ * de datos desde el buffer al objeto image es llevada a cabo por ImageDrawer.
+ *
+ * Par�metros de control de la visualizaci�n:
+ * <UL>
+ * <LI>renderBands: Orden de visualizado de las bands.</LI>
+ * <LI>replicateBands: Para visualizaci�n de raster de una banda. Dice si se replica sobre las otras dos bandas
+ * de visualizaci�n o se ponen a 0.</LI>
+ * <LI>enhanced: aplicaci�n de filtro de realce</LI>
+ * <LI>removeEnds: Eliminar extremos en el filtro de realce. Uso del segundo m�ximo y m�nimo</LI>
+ * <LI>tailTrim: Aplicacion de recorte de colas en el realce. Es un valor decimal que representa el porcentaje del recorte entre 100.
+ * Es decir, 0.1 significa que el recorte es de un 10%</LI>
+ * </UL>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultRender implements Render, PropertyListener, FilterListChangeListener, Persistent, TileListener {
+
+    private static final Logger LOG = LoggerFactory.getLogger(DefaultRender.class);
+
+	/**
+	 * Fuente de datos para el renderizado
+	 */
+	private RasterDataStore dataStore                  = null;
+	/**
+	 * N�mero de bandas a renderizar y en el orden que se har�. Esto es asignado
+	 * por el usuario de la renderizaci�n.
+	 */
+	ColorInterpretation      renderColorInterpretation = null;
+	//private int[]            renderBands              = { 0, 1, 2, 3 };
+
+	private ImageDrawerImpl  drawer                    = null;
+
+	/**
+	 *
+	 */
+	private Transparency     renderingTransparency     = null;
+	private int              lastAlphaBand             = -1;
+
+	/**
+	 * Lista de filtros aplicada en la renderizaci�n
+	 */
+	private RasterFilterList filterList               = null;
+
+	/**
+	 * Ancho y alto del objeto Image en una petici�n de dibujado a un raster
+	 * raster
+	 */
+	private double           widthImage, heightImage;
+
+	private Point2D          ulPxRequest, lrPxRequest;
+
+	/**
+	 * Array de listeners que ser�n informados cuando cambia una propiedad en la visualizaci�n
+	 */
+	private ArrayList<VisualPropertyListener>
+	                         visualPropertyListener   = new ArrayList<VisualPropertyListener>();
+	private RasterUtils      util                     = RasterLocator.getManager().getRasterUtils();
+	private boolean          isDrawing                = false;
+
+	private Graphics2D       lastGraphics             = null;
+	private ViewPortData     lastViewPortData         = null;
+	private ICoordTrans      lastCoordTrans           = null;
+	private Dimension2D      viewDimension            = null;
+	private boolean
+	                         reprojectionOnTheFly     = false;
+	private RasterManager    rManager                 = null;
+
+	/**
+	 * Constructor
+	 * @param grid
+	 */
+	public DefaultRender() {
+	}
+
+	/**
+	 * Constructor
+	 * @param ds
+	 */
+	public DefaultRender(RasterDataStore ds) {
+		this.dataStore = ds;
+		init();
+	}
+
+	private RasterManager getRasterManager() {
+		if(rManager == null)
+			rManager = RasterLocator.getManager();
+		return rManager;
+	}
+
+	public RasterDataStore getDataStore() {
+		return this.dataStore;
+	}
+
+	public void setDataStore(RasterDataStore dataStore) {
+		this.dataStore = dataStore;
+		init();
+	}
+
+	private void init() {
+		if(dataStore == null || dataStore.getDataType() == null)
+			return;
+
+		drawer = new ImageDrawerImpl();
+		getRenderColorInterpretation();
+	}
+
+	/**
+	 * Asigna un listener a la lista que ser� informado cuando cambie una
+	 * propiedad visual en la renderizaci�n.
+	 * @param listener VisualPropertyListener
+	 */
+	public void addVisualPropertyListener(VisualPropertyListener listener) {
+		visualPropertyListener.add(listener);
+	}
+
+	/**
+	 * M�todo llamado cuando hay un cambio en una propiedad de visualizaci�n
+	 */
+	private void callVisualPropertyChanged(Object obj) {
+		if(visualPropertyListener != null) {
+			for (int i = 0; i < visualPropertyListener.size(); i++) {
+				VisualPropertyEvent ev = new VisualPropertyEvent(obj);
+				((VisualPropertyListener)visualPropertyListener.get(i)).visualPropertyValueChanged(ev);
+			}
+		}
+	}
+
+	/**
+	 * Thread de dibujado
+	 */
+	public void run() {
+		try {
+			draw(lastGraphics, lastViewPortData, lastCoordTrans, null);
+		} catch (QueryException e) {
+			LoggerFactory.getLogger(getClass()).debug("Error in a query", e);
+		} catch (ProcessInterruptedException e) {
+		}
+	}
+
+	public void setGraphicInfo(Graphics2D g, ViewPortData vp) {
+		this.lastGraphics = g;
+		this.lastViewPortData = vp;
+	}
+
+	public void drawThread(Graphics2D g, ViewPortData vp) {
+		//Se dibuja si cae dentro de la vista
+		if(util.isOutside(vp.getExtent(), dataStore.getExtent()))
+			return;
+
+		setReading(true);
+		setGraphicInfo(g, vp);
+		new Thread(this).start();
+
+		while(isReading()) {
+			try {
+				Thread.sleep(50);
+			} catch (InterruptedException e) {
+				break;
+			}
+		}
+	}
+
+	public synchronized Buffer getLastRenderBuffer()
+		throws QueryException, ProcessInterruptedException {
+		return draw(null, lastViewPortData, lastCoordTrans, null);
+	}
+
+    public synchronized void drawTiledService(Graphics2D g, ViewPortData vp,
+        Dimension2D viewDimension, ICoordTrans coordTrans, TaskStatus taskStatus)
+        throws QueryException, ProcessInterruptedException {
+		lastGraphics = g;
+		lastViewPortData = vp;
+		lastCoordTrans = coordTrans;
+		this.viewDimension = viewDimension;
+		int[] renderBands = getRenderColorInterpretation().buildRenderBands();
+
+		Extent extent = dataStore.getExtent();
+		if(coordTrans != null){
+		      extent = extent.convert(coordTrans);
+		}
+
+		if(util.isOutside(vp.getExtent(), extent)) {
+			endReading();
+			return;
+		}
+
+		if (dataStore != null) {
+			lastAlphaBand = getRenderingTransparency().getAlphaBandNumber();
+
+			// Asignamos la banda de transparencia si existe esta
+			RasterQuery query = getRasterManager().createQuery();
+			query.setTaskStatus(taskStatus);
+			query.setTime(vp.getTime());
+			query.setSupersamplingOption(false); // Desactivamos el supersampleo en la carga del buffer.
+			if(dataStore.getColorInterpretation().isRGB())
+				renderBands[3] = 3;
+			query.setDrawableBands(renderBands);
+			if(dataStore.getDataType()[0] == Buffer.TYPE_BYTE) {
+				if(lastAlphaBand != -1)
+					query.forceARGBRequest();
+				else if(renderBands.length == 3 || (renderBands.length == 4 && renderBands[3] == -1))
+					query.forceRGBRequest();
+				else
+					query.forceARGBRequest();
+			} else
+				query.forceRGBRequest();
+
+			Extent areaOfInterest = vp.getExtent();
+			if(coordTrans != null){
+
+			    areaOfInterest = vp.getExtent().convert(coordTrans.getInverted());
+			}
+
+			query.setAreaOfInterest(areaOfInterest,
+					(int)Math.round(vp.getWidth()),
+					(int)Math.round(vp.getHeight()), this);
+			dataStore.query(query);
+			query.setSupersamplingOption(true);
+		} else
+			return;
+	}
+
+	public synchronized void tileReady(Tile loadedTile) throws TileGettingException {
+		boolean crash = false;
+		Boolean tiling = (Boolean)loadedTile.getDownloaderParams("Tiling");
+		double[] step = (double[])loadedTile.getDownloaderParams("Step");
+		AffineTransform transf = (AffineTransform)loadedTile.getDownloaderParams("AffineTransform");
+
+		Extent tileExtent = getRasterManager().getDataStructFactory().
+		createExtent(loadedTile.getUl().getX(),
+				loadedTile.getUl().getY(),
+				loadedTile.getLr().getX(),
+				loadedTile.getLr().getY());
+
+		Buffer buf = (loadedTile.getData() != null && loadedTile.getData().length > 0) ? (Buffer)loadedTile.getData()[0] : null;
+
+		if(!loadedTile.dataIsLoaded()) {
+			if(loadedTile.getCrashARGB() == null)
+				return;
+			crash = true;
+			buf = (Buffer)loadedTile.getCrashARGB();
+		} else {
+			if(buf == null)
+				return;
+			ColorTable tileColorTable = (loadedTile.getData() != null && loadedTile.getData().length > 2) ? (ColorTable)loadedTile.getData()[2] : null;
+			if(tiling == null || tiling.booleanValue()) {
+				if(filterList != null)
+					addTileColorTable(tileColorTable);
+			}
+		}
+		buf.setDataExtent(tileExtent.toRectangle2D());
+
+		if(lastCoordTrans != null){
+
+		    Extent projectedExtent = tileExtent.convert(lastCoordTrans);
+		    try {
+                buf =
+                    buf.project(lastCoordTrans.getInverted(), projectedExtent, loadedTile.getWidthPx(),
+                        loadedTile.getHeightPx());
+                tileExtent = projectedExtent;
+            } catch (WarpException e) {
+                LOG.error(String.format(
+                    "Can not project [level: %1s row: %2s column: %3s] tile buffer to %4s",
+                    loadedTile.getLevel(), loadedTile.getRow(), loadedTile.getCol(), lastCoordTrans
+                        .getPDest().getAbrev()));
+                return;
+            }
+		}
+
+		Transparency transparencyProcessed = null;
+		if(tiling == null || tiling.booleanValue()) {
+			try {
+				FilterLoader filterLoader = bufferPreprocessing(buf);
+				transparencyProcessed = filterLoader.getTransparency();
+				buf = filterLoader.getBufferResult();
+			} catch (ProcessInterruptedException e3) {
+				return;
+			}
+		}
+
+		if(tiling == null || tiling.booleanValue()) {
+			//Reescalado de los tiles. El tama�o en pixels de un tile no tiene pq coincidir con el de la vista.
+			double w = lastViewPortData.getWidth();
+			double h = lastViewPortData.getHeight();
+			if(viewDimension != null) {
+				w = viewDimension.getWidth();
+				h = viewDimension.getHeight();
+			}
+			double viewScaleW = lastViewPortData.getExtent().width() / w;
+			double tileScaleW = tileExtent.width() / (double)buf.getWidth();
+			double scaleW = viewScaleW / tileScaleW;
+			double viewScaleH = lastViewPortData.getExtent().height() / h;
+			double tileScaleH = tileExtent.height() / (double)buf.getHeight();
+			double scaleH = viewScaleH / tileScaleH;
+
+			ImageDrawerImpl d = new ImageDrawerImpl();
+			d.setBuffer(buf);
+			d.setSupersamplingOn(null);
+			d.setOutputSize(buf.getWidth(), buf.getHeight());
+			d.setLastTransparency(transparencyProcessed);
+			Image geoImage;
+			try {
+				geoImage = d.drawBufferOverImageObject();
+			} catch (ProcessInterruptedException e2) {
+				return;
+			}
+			d.dispose();
+
+			AffineTransform at = new AffineTransform();
+			at.scale(1 / scaleW, 1 / scaleH);
+
+			try {
+				Point2D pt = new Point2D.Double(tileExtent.getULX(), tileExtent.getULY());
+				((DefaultViewPortData)lastViewPortData).mat.transform(pt, pt);
+				at.inverseTransform(pt, pt);
+
+				lastGraphics.transform(at);
+				lastGraphics.drawImage(geoImage, (int) Math.round(pt.getX()), (int) Math.round(pt.getY()), null);
+				lastGraphics.transform(at.createInverse());
+				geoImage.flush();
+			} catch (NoninvertibleTransformException e1) {
+				e1.printStackTrace();
+			}
+		} else {
+			try {
+				drawBufferOnImage(lastGraphics, lastViewPortData, buf, step, transf, tileExtent);
+			} catch (QueryException e1) {
+				LoggerFactory.getLogger(getClass()).debug("Error loading data", e1);
+			} catch (ProcessInterruptedException e1) {
+			}
+		}
+
+		if(!crash) { //Las im�genes de crash no se liberan ya que est�n en un hashmap global
+			if(buf != null)
+				buf.dispose();
+		}
+	}
+
+	public synchronized Buffer draw(Graphics2D g, ViewPortData vp, ICoordTrans coordTrans, TaskStatus taskStatus)
+		throws QueryException, ProcessInterruptedException {
+		lastGraphics = g;
+		lastViewPortData = vp;
+		lastCoordTrans = coordTrans;
+
+		Extent extent = dataStore.getExtent();
+		if(coordTrans != null){
+		    extent = extent.convert(coordTrans);
+		}
+
+		if(util.isOutside(vp.getExtent(), extent)) {
+			endReading();
+			return null;
+		}
+
+		Extent adjustedRotedRequest = null;
+        try {
+            adjustedRotedRequest = request(vp, coordTrans, dataStore);
+        } catch (NoninvertibleTransformException e) {
+            throw new ProcessInterruptedException("Problems adjusting extent to render");
+        }
+
+		if ((widthImage <= 0) || (heightImage <= 0)) {
+			endReading();
+			return null;
+		}
+
+		if (dataStore == null)
+			return null;
+
+		Buffer buf = null;
+		double[] step = null;
+		int[] renderBands = getRenderColorInterpretation().buildRenderBands();
+
+        if (coordTrans != null) {
+            RasterRenderReprojection renderReprojection = new RasterRenderReprojection();
+            try {
+                buf =
+                    renderReprojection.warp(dataStore, coordTrans, adjustedRotedRequest,
+                        (int) Math.round(widthImage), (int) Math.round(heightImage), vp.getTime(),
+                        renderBands, taskStatus);
+            } catch (WarpException e) {
+                throw new ProcessInterruptedException(e);
+            }
+		} else {
+			lastAlphaBand = getRenderingTransparency().getAlphaBandNumber();
+
+			RasterQuery query = getRasterManager().createQuery();
+			query.setTaskStatus(taskStatus);
+			query.setTime(vp.getTime());
+			query.setAreaOfInterest(adjustedRotedRequest, (int)Math.round(widthImage), (int)Math.round(heightImage));
+			query.setDrawableBands(renderBands);
+			if(dataStore.getDataType()[0] == Buffer.TYPE_BYTE) {
+				if(lastAlphaBand != -1)
+					query.forceARGBRequest();
+				else if(renderBands.length == 3 || (renderBands.length == 4 && renderBands[3] == -1))
+					query.forceRGBRequest();
+			} else {
+				if(renderBands.length == 4 && renderBands[3] != -1)
+					query.forceARGBRequest();
+				else
+					query.forceRGBRequest();
+			}
+			buf = dataStore.query(query);
+			step = query.getStep();
+		}
+
+		if(drawer == null) {
+			init();
+		}
+
+		return drawBufferOnImage(lastGraphics,
+					lastViewPortData,
+					buf,
+					step,
+					dataStore.getAffineTransform(),
+					adjustedRotedRequest);
+	}
+
+	private synchronized Buffer drawBufferOnImage(Graphics2D g, ViewPortData vp, Buffer buf, double[] step, AffineTransform transf, Extent adjustedRotedRequest)
+		throws QueryException, ProcessInterruptedException {
+		FilterLoader filterLoader = bufferPreprocessing(buf);
+		Transparency transparencyProcessed = filterLoader.getTransparency();
+		buf = filterLoader.getBufferResult();
+
+		if(g == null)
+			return buf;
+
+		drawer.setBuffer(buf); // Buffer de datos a renderizar
+		drawer.setSupersamplingOn(step); // Desplazamiento para supersampleo
+		drawer.setOutputSize((int)Math.round(widthImage), (int)Math.round(heightImage)); // Ancho y alto del buffer
+		drawer.setLastTransparency(transparencyProcessed);
+		Image geoImage = drawer.drawBufferOverImageObject(); // Acci�n de renderizado
+		drawer.dispose();
+
+		//En el caso de no tenga rotaci�n y el tama�o de pixel sea positivo en X y negativo en Y no aplicamos ninguna
+		//transformaci�n. Esto no es necesario hacerlo, sin ello se visualiza igual. Unicamente se hace porque de esta
+		//forma el raster resultante mejora un poco en calidad en ciertos niveles de zoom ya que al aplicar transformaciones
+		//sobre el Graphics parece que pierde algo de calidad.
+		if(transf.getScaleX() > 0 && transf.getScaleY() < 0 && transf.getShearX() == 0 && transf.getShearY() == 0) {
+			Point2D lastGraphicOffset = new Point2D.Double(adjustedRotedRequest.getULX(), adjustedRotedRequest.getULY());
+			((DefaultViewPortData)vp).mat.transform(lastGraphicOffset, lastGraphicOffset);
+			g.drawImage(geoImage, (int) Math.round(lastGraphicOffset.getX()), (int) Math.round(lastGraphicOffset.getY()), null);
+			return buf;
+		}
+
+		/*
+		 * Tenemos una matriz con la transformaci�n de la coordenadas de la vista a coordenadas reales vp.mat, adem�s tenemos
+		 * la transformaci�n de coordenadas reales a coordenadas pixel (transf). Con ambas podemos obtener una matriz de trasformacion
+		 * entre coordenadas de la vista a coordenadas pixel (transf X vp.mat). As� obtenemos la transformaci�n entre coordenadas
+		 * de la vista y coordenadas pixel del raster. El problema es que a cada zoom la escala de la petici�n del raster varia
+		 * por lo que habr� que calcular una matriz con la escala (escale). escale X transf X vp.mat
+		 */
+		double sX = Math.abs(ulPxRequest.getX() - lrPxRequest.getX()) / widthImage;
+		double sY = Math.abs(ulPxRequest.getY() - lrPxRequest.getY()) / heightImage;
+		AffineTransform scale = new AffineTransform(sX, 0, 0, sY, 0, 0);
+
+		try {
+			AffineTransform at = (AffineTransform)scale.clone();
+			at.preConcatenate(transf);
+			at.preConcatenate(vp.getMat());
+			g.transform(at);
+			Point2D.Double pt = null;
+			//El punto sobre el que rota la imagen depende del signo de los tama�os del pixel
+			if(transf.getScaleX() < 0 && transf.getScaleY() < 0)
+				pt = new Point2D.Double(adjustedRotedRequest.maxX(), adjustedRotedRequest.maxY());
+			else if(transf.getScaleX() > 0 && transf.getScaleY() > 0)
+				pt = new Point2D.Double(adjustedRotedRequest.minX(), adjustedRotedRequest.minY());
+			else if(transf.getScaleX() < 0 && transf.getScaleY() > 0)
+				pt = new Point2D.Double(adjustedRotedRequest.maxX(), adjustedRotedRequest.minY());
+			else
+				pt = new Point2D.Double(adjustedRotedRequest.getULX(), adjustedRotedRequest.getULY());
+			vp.getMat().transform(pt, pt);
+			at.inverseTransform(pt, pt);
+			g.drawImage(geoImage, (int) Math.round(pt.getX()), (int) Math.round(pt.getY()), null);
+			g.transform(at.createInverse());
+			geoImage.flush();
+		} catch (NoninvertibleTransformException e) {
+			LoggerFactory.getLogger(getClass()).debug("Transformation error", e);
+		}
+
+		return buf;
+		// long t2 = new Date().getTime();
+		// System.out.println("Renderizando Raster: " + ((t2 - t1) / 1000D) + ", secs.");
+	}
+
+	/**
+	 * Applies filters and transparency on the buffer and returns the grid with the modified buffer.
+	 * @param buf
+	 * @param transparency
+	 * @throws ProcessInterruptedException
+	 */
+	private FilterLoader bufferPreprocessing(Buffer buf) throws ProcessInterruptedException {
+		//Asignamos los datos al objeto transparencia antes de aplicar la pila de filtros para que el valor NoData sea efectivo
+		if (getRenderingTransparency().getNoData().isNoDataTransparent() ||
+				getRenderingTransparency().existAlphaBand())
+			getRenderingTransparency().setDataBuffer(buf);
+		else {
+			getRenderingTransparency().setDataBuffer(null);
+		}
+		getRenderingTransparency().activeTransparency();
+		List<ROI> roi = null;
+		try {
+			roi = (List<ROI>)dataStore.getRois(lastViewPortData != null ? lastViewPortData.getProjection() : null);
+		} catch (ROIException e) {
+		}
+
+		FilterLoader filterLoader = RasterLocator.getManager().createFilterLoader(filterList);
+		filterLoader.addSrcBandCount(dataStore.getBandCount());
+		filterLoader.addSrcDataType(dataStore.getDataType()[0]);
+		filterLoader.addSrcStatistics(dataStore.getStatistics());
+		filterLoader.addSrcROI(roi);
+		filterLoader.addSrcHistogram(dataStore.getHistogramComputer());
+		filterLoader.addTransparency(getRenderingTransparency());
+		filterLoader.applyFilters(buf);
+
+		return filterLoader;
+	}
+
+	/**
+	 * When tiles are renderized the color table in each tile could be diferent.
+	 * In this case the color table must be replaced
+	 */
+	//@deprecated one color table by tiled layer
+	private void addTileColorTable(ColorTable tileColorTable) {
+		if(tileColorTable == null)
+			return;
+		else {
+			if(filterList.getFilterClassByID("ColorTable") == null) {
+				try {
+					RasterFilterListManager colorTableManager = filterList.getManagerByID("ColorTable");
+					Params params = filterList.createEmptyFilterParams();
+					params.setParam("colorTable", tileColorTable);
+					colorTableManager.addFilter(params);
+				} catch (FilterManagerException e) {
+					e.printStackTrace();
+				} catch (FilterTypeException e) {
+					e.printStackTrace();
+				}
+			}
+		}
+	}
+
+	public void endReading() {
+		isDrawing = false;
+	}
+
+	public boolean isReading() {
+		return isDrawing;
+	}
+
+	public void setReading(boolean reading) {
+		isDrawing = reading;
+	}
+
+	/**
+	 * Calculamos la petici�n en coordenadas del mundo real con la transformaci�n del raster. Esto
+	 * permite obtener las coordenadas de la petici�n con la rotaci�n, si la tiene.
+	 * @param vp
+	 * @param ldatastore
+	 * @return
+	 * @throws NoninvertibleTransformException
+	 */
+	private Extent request(ViewPortData vp, ICoordTrans coordTrans, RasterDataStore ldatastore) throws NoninvertibleTransformException {
+	    if (ldatastore.isRotated()) {
+			//Obtenemos las cuatro esquinas de la selecci�n que hemos hecho en la vista
+			Point2D ul = new Point2D.Double(vp.getExtent().minX(), vp.getExtent().maxY());
+			Point2D ur = new Point2D.Double(vp.getExtent().maxX(), vp.getExtent().maxY());
+			Point2D ll = new Point2D.Double(vp.getExtent().minX(), vp.getExtent().minY());
+			Point2D lr = new Point2D.Double(vp.getExtent().maxX(), vp.getExtent().minY());
+
+			//Las pasamos a coordenadas pixel del raster
+			ul = ldatastore.worldToRaster(ul);
+			ur = ldatastore.worldToRaster(ur);
+			ll = ldatastore.worldToRaster(ll);
+			lr = ldatastore.worldToRaster(lr);
+
+			//Obtenemos los valores pixel m�ximos y m�nimos para X e Y
+			double pxMaxX = Math.max(Math.max(ul.getX(), ur.getX()), Math.max(ll.getX(), lr.getX()));
+			double pxMaxY = Math.max(Math.max(ul.getY(), ur.getY()), Math.max(ll.getY(), lr.getY()));
+			double pxMinX = Math.min(Math.min(ul.getX(), ur.getX()), Math.min(ll.getX(), lr.getX()));
+			double pxMinY = Math.min(Math.min(ul.getY(), ur.getY()), Math.min(ll.getY(), lr.getY()));
+
+			//Ajustamos las coordenadas pixel al �rea m�xima del raster
+			pxMinX = Math.max(pxMinX, 0);
+			pxMinY = Math.max(pxMinY, 0);
+			pxMaxX = Math.min(pxMaxX, ldatastore.getWidth());
+			pxMaxY = Math.min(pxMaxY, ldatastore.getHeight());
+
+			//Petici�n en coordenadas pixel
+			ulPxRequest = new Point2D.Double(pxMinX, pxMinY);
+			lrPxRequest = new Point2D.Double(pxMaxX, pxMaxY);
+
+			//Calculamos el ancho y alto del buffer sobre el que se escribe la petici�n
+			widthImage = ((Math.abs(lrPxRequest.getX() - ulPxRequest.getX()) * vp
+					.getWidth()) / Math.abs(pxMaxX - pxMinX));
+			heightImage = ((Math.abs(lrPxRequest.getY() - ulPxRequest.getY()) * vp
+					.getHeight()) / Math.abs(pxMaxY - pxMinY));
+
+			//Convertimos la petici�n en coordenadas pixel a petici�n en coordenadas reales.
+			Point2D ulWC = ldatastore.rasterToWorld(ulPxRequest);
+			Point2D lrWC = ldatastore.rasterToWorld(lrPxRequest);
+
+			//Ajustamos la petici�n a los limites del raster, teniendo en cuenta la rotaci�n de este.
+			return new ExtentImpl(ulWC, lrWC);
+		}
+
+		AffineTransform at = ldatastore.getAffineTransform();
+        Extent adjustedRotedExtent = null;
+        if (coordTrans != null) {
+            Extent reprojectedExtent = ldatastore.getExtent().convert(coordTrans);
+            double cellSizeX =
+                (reprojectedExtent.getMax().getX() - reprojectedExtent.getMin().getX())
+                    / ldatastore.getWidth();
+            double cellSizeY =
+                (reprojectedExtent.getMax().getY() - reprojectedExtent.getMin().getY())
+                    / ldatastore.getHeight();
+
+            Extent intersection = vp.getExtent().intersection(reprojectedExtent);
+            at =
+                new AffineTransform(cellSizeX, at.getShearY(), at.getShearX(), -cellSizeY,
+                    intersection.getMin().getX(), intersection.getMax().getY());
+            double width = intersection.width() / cellSizeX;
+            double height = intersection.height() / cellSizeY;
+            adjustedRotedExtent = util.calculateAdjustedView(intersection, at, width, height);
+        } else {
+		    adjustedRotedExtent = util.calculateAdjustedView(vp.getExtent(), at, ldatastore.getWidth(),
+                ldatastore.getHeight());
+		}
+
+		widthImage = (int)Math.round(Math.abs(adjustedRotedExtent.width() * vp.getMat().getScaleX()));
+		heightImage = (int)Math.round(Math.abs(adjustedRotedExtent.height() * vp.getMat().getScaleY()));
+		Point2D ul = new Point2D.Double(adjustedRotedExtent.getMin().getX(), adjustedRotedExtent.getMax().getY());
+		Point2D lr = new Point2D.Double(adjustedRotedExtent.getMax().getX(), adjustedRotedExtent.getMin().getY());
+
+		Point2D worldUL = new Point2D.Double();
+		Point2D worldLR = new Point2D.Double();
+
+        if (coordTrans != null) {
+            ul = at.inverseTransform(ul, worldUL);
+            lr = at.inverseTransform(lr, worldLR);
+        } else {
+		    worldUL = ldatastore.worldToRaster(ul);
+		    worldLR = ldatastore.worldToRaster(lr);
+		}
+
+		ulPxRequest = new Point2D.Double(worldUL.getX(), worldUL.getY());
+		lrPxRequest = new Point2D.Double(worldLR.getX(), worldLR.getY());
+		return adjustedRotedExtent;
+	}
+
+	public boolean isRenderingAsGray() {
+		int[] renderBands = getRenderColorInterpretation().buildRenderBands();
+		if ((renderBands != null) && (renderBands.length == 3 || renderBands.length == 4) && (renderBands[0] >= 0) &&
+				(renderBands[0] == renderBands[1]) && (renderBands[1] == renderBands[2]))
+			return true;
+		return false;
+	}
+
+	public void setRenderColorInterpretation(ColorInterpretation ci) {
+		this.renderColorInterpretation = ci;
+	}
+
+	public ColorInterpretation getRenderColorInterpretation() {
+		if(renderColorInterpretation == null) {
+			//Initializes the color interpretation using the source but if the source does not have
+			//it will be figure out depending on the number of bands
+			renderColorInterpretation = dataStore.getColorInterpretation();
+			if(renderColorInterpretation == null || !renderColorInterpretation.hasInterpretation()) {
+				switch (dataStore.getBandCount()) {
+				case 1:
+				case 2:
+					renderColorInterpretation = DataStoreColorInterpretation.createGrayInterpretation();
+					break;
+				case 3:
+					renderColorInterpretation = DataStoreColorInterpretation.createRGBInterpretation();
+					break;
+				case 4:
+					renderColorInterpretation = DataStoreColorInterpretation.createRGBAInterpretation();
+				default:
+					renderColorInterpretation = DataStoreColorInterpretation.createRGBInterpretation();
+					break;
+				}
+			} else
+				renderColorInterpretation = dataStore.getColorInterpretation().cloneColorInterpretation();
+		}
+		return renderColorInterpretation;
+	}
+
+	/**
+		 * Asigna el n�mero de bandas y el orden de renderizado. Cada posici�n del vector es una banda
+	 * del buffer y el contenido de esa posici�n es la banda de la imagen que se dibujar�
+	 * sobre ese buffer. A la hora de renderizar hay que tener en cuenta que solo se renderizan las
+	 * tres primeras bandas del buffer por lo que solo se tienen en cuenta los tres primeros
+	 * elementos. Por ejemplo, el array {1, 0, 3} dibujar� sobre el Graphics las bandas 1,0 y 3 de un
+	 * raster que tiene al menos 4 bandas. La notaci�n con -1 en alguna posici�n del vector solo tiene sentido
+	 * en la visualizaci�n pero no se puede as�gnar una banda del buffer a null.
+	 * Algunos ejemplos:
+	 * <P>
+	 * {-1, 0, -1} Dibuja la banda 0 del raster en la G de la visualizaci�n.
+	 * Si replicateBand es true R = G = B sino R = B = 0
+	 * {1, 0, 3} La R = banda 1 del raster, G = 0 y B = 3
+	 * {0} La R = banda 0 del raster. Si replicateBand es true R = G = B sino G = B = 0
+	 * </P>
+	 *
+	 *
+		 * @param renderBands: bandas y su posici�n
+		 */
+	/*public void setRenderBands(int[] renderBands) {
+		if(	renderBands[0] != this.renderBands[0] ||
+			renderBands[1] != this.renderBands[1] ||
+			renderBands[2] != this.renderBands[2] ||
+			renderBands[3] != this.renderBands[3])
+			callVisualPropertyChanged(renderBands);
+
+		this.renderBands = renderBands;
+		if (filterList != null)
+			for (int i = 0; i < filterList.lenght(); i++)
+				(filterList.get(i)).addParam("renderBands", renderBands);
+	}
+
+	public int[] getRenderBands() {
+		return renderBands;
+	}*/
+
+	/**
+	 * Dado que la notaci�n de bandas para renderizado admite posiciones con -1 y la notaci�n del
+	 * buffer no ya que no tendria sentido. Esta funci�n adapta la primera notaci�n a la segunda
+	 * para realizar la petici�n setAreaOfInterest y cargar el buffer.
+	 * @param b Array que indica la posici�n de bandas para el renderizado
+	 * @return Array que indica la posici�n de bandas para la petici�n
+	 */
+	public int[] formatArrayRenderBand(int[] b) {
+		int cont = 0;
+		for(int i = 0; i < b.length; i++)
+			if(b[i] >= 0)
+				cont ++;
+		if(cont <= 0)
+			return null;
+		int[] out = new int[cont];
+		int pos = 0;
+		for(int i = 0; i < cont; i++) {
+			while(b[pos] == -1)
+				pos ++;
+			out[i] = b[pos];
+			pos ++;
+		}
+		return out;
+	}
+
+	public Transparency getRenderingTransparency() {
+		//If the transparency hasn't been defined yet then we'll take that from the store
+		if (renderingTransparency == null) {
+			renderingTransparency = dataStore.getTransparency().cloneTransparency();
+			renderingTransparency.addPropertyListener(this);
+		}
+		renderingTransparency.setColorInterpretation(getRenderColorInterpretation());
+		return renderingTransparency;
+	}
+
+	public int getLastAlphaBandNumber() {
+		return lastAlphaBand;
+	}
+
+	public void setLastTransparency(Transparency lastTransparency) {
+		this.renderingTransparency = lastTransparency;
+		if(this.renderingTransparency != null)
+			this.renderingTransparency.addPropertyListener(this);
+	}
+
+	public RasterFilterList getFilterList() {
+		return filterList;
+	}
+
+	public void setFilterList(RasterFilterList filterList) {
+		this.filterList = filterList;
+		this.filterList.addFilterListListener(this);
+	}
+
+	public boolean existColorTable() {
+		if(filterList != null)
+			return (filterList.getFilterByBaseClass(ColorTableFilter.class) != null);
+		else
+			return false;
+	}
+
+	public ColorTable getColorTable() {
+		if(existColorTable()) {
+			RasterFilter f = filterList.getFilterByBaseClass(ColorTableFilter.class);
+			return ((ColorTableFilter)f).getColorTable();
+		}
+		return null;
+	}
+
+	/**
+	 * Asigna la factoria de buffer del renderizador
+	 * @param ds
+	 */
+	public void setDataSource(RasterDataStore ds) {
+		this.dataStore = ds;
+	}
+
+	/**
+	 * Evento activado cuando cambia una propiedad de transparencia.
+	 */
+	public void actionValueChanged(PropertyEvent e) {
+		callVisualPropertyChanged(new VisualPropertyEvent(e.getSource()));
+	}
+
+	/**
+	 * Evento activado cuando cambia la lista de filtros.
+	 */
+	public void filterListChanged(FilterListChangeEvent e) {
+		callVisualPropertyChanged(new VisualPropertyEvent(e.getSource()));
+	}
+
+	/**
+	 * Sets buffers to null
+	 */
+	public void dispose() {
+		if (renderingTransparency != null)
+			renderingTransparency.dispose();
+		if (getFilterList() != null)
+			getFilterList().dispose();
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+
+	protected void finalize() throws Throwable {
+		dataStore                = null;
+        drawer                   = null;
+		renderingTransparency    = null;
+		filterList               = null;
+        ulPxRequest              = null;
+        lrPxRequest              = null;
+		lastGraphics             = null;
+		lastViewPortData         = null;
+		viewDimension            = null;
+
+		if(visualPropertyListener != null) {
+			visualPropertyListener.clear();
+			visualPropertyListener = null;
+		}
+		super.finalize();
+	}
+
+	//******************************
+	//Persistence
+	//******************************
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("DefaultRender_Persistent");
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DefaultRender.class,
+					"DefaultRender_Persistent",
+					"RasterRendering Persistent definition",
+					null,
+					null
+					);
+
+			definition.addDynFieldObject("lastTransparency")
+			.setClassOfValue(Transparency.class)
+			.setMandatory(false);
+
+			definition.addDynFieldObject("filterList")
+			.setClassOfValue(RasterFilterList.class)
+			.setMandatory(false);
+
+			definition.addDynFieldList("paramlist")
+			.setClassOfItems(PersistencyFilterParams.class)
+			.setMandatory(false);
+		}
+	}
+
+	private List<PersistencyFilterParams> listFilterParameters = null;
+
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		renderingTransparency = (Transparency)state.get("lastTransparency");
+		renderColorInterpretation = renderingTransparency.getColorInterpretation();
+		filterList = (RasterFilterList)state.get("filterList");
+		listFilterParameters = state.getList("paramlist");
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("lastTransparency", getRenderingTransparency());
+		state.set("filterList", getFilterList());
+		state.set("paramlist", buildPersistencyFilterParamFromFilters());
+	}
+
+	/**
+	 * Builds the list of filter parameters to persist
+	 * @return
+	 */
+	private List<PersistencyFilterParams> buildPersistencyFilterParamFromFilters() throws PersistenceException {
+		List<PersistencyFilterParams> filters = new ArrayList<PersistencyFilterParams>();
+
+		for (int i = 0; i < getFilterList().lenght(); i++) {
+			RasterFilter f = getFilterList().get(i);
+			Params uipar = f.getUIParams(f.getName());
+			PersistencyFilterParams param = new PersistencyFilterParams();
+			param.setFilterParam(uipar);
+			param.setFilterName(f.getName());
+			try {
+				RasterFilterListManager manager = getFilterList().getManagerByFilterClass(f.getClass());
+				param.setManagerExtensionName(manager.getManagerID());
+			} catch (FilterManagerException e) {
+				throw new PersistenceException("Error getting filter manager ID", e);
+			}
+			filters.add(param);
+		}
+		return filters;
+	}
+
+	/**
+	 * Builds the filters from the list of classes <code>PersistencyFilterParam</code> recovered from a project
+	 * @param stats
+	 * @throws PersistenceException
+	 */
+	public void buildFiltersFromPersistencyFilterParam(Statistics stats) throws PersistenceException {
+		filterList.addEnvParam("SrcStatistics", stats);
+		setFilterList(filterList);
+
+		ArrayList<Exception> exc = new ArrayList<Exception>();
+		for (int i = 0; i < listFilterParameters.size(); i++) {
+			try {
+				PersistencyFilterParams pfp = (PersistencyFilterParams) listFilterParameters.get(i);
+				if(pfp != null && pfp.getFilterClass() != null && pfp.getFilterParams() != null) {
+					RasterFilterListManager filterManager = filterList.getManagerByFilterClass(pfp.getFilterClass());
+					filterManager.setFilterList(filterList);
+					if(filterManager != null)
+						filterManager.addFilter(pfp.getFilterClass(), pfp.getFilterParams());
+				}
+			} catch (FilterTypeException e) {
+				exc.add(e);
+			} catch (FilterManagerException e) {
+				exc.add(e);
+			}
+		}
+
+		if(exc.size() != 0) {
+			throw new PersistenceException("error_adding_filters", exc.get(0));
+		}
+	}
+
+    @Override
+    public Buffer draw(Graphics2D g, ViewPortData vp, TaskStatus taskStatus) throws QueryException,
+        ProcessInterruptedException {
+        IProjection vpProjection = vp.getProjection();
+        IProjection dsProjection = dataStore.getProjection();
+        ICoordTrans ct = null;
+        if(vpProjection!=null && dsProjection!=null && !vpProjection.equals(dsProjection)){
+            ct = dsProjection.getCT(vpProjection);
+        }
+
+        return draw(g, vp, ct, taskStatus);
+    }
+
+    @Override
+    public void drawTiledService(Graphics2D g, ViewPortData vp, Dimension2D viewDimension,
+        TaskStatus status) throws QueryException, ProcessInterruptedException {
+        drawTiledService(g, vp, viewDimension, null, status);
+    }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/DefaultRender.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/RasterRenderReprojection.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/RasterRenderReprojection.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/RasterRenderReprojection.java	(revision 15423)
@@ -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.impl.grid.render;
+
+import java.awt.geom.Point2D;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.exception.WarpException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.timesupport.Time;
+import org.gvsig.tools.task.TaskStatus;
+
+/**
+ * Reprojects a RasterDataStore.
+ *
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class RasterRenderReprojection {
+
+    /**
+     * Warp the result buffer of bounding box.
+     * 
+     * @param store
+     *            Store of buffer to be projected
+     * @param coordTrans
+     *            Coordinate transformation between bounding box coordinate
+     *            system and raster store coordinate system.
+     * @param bbox
+     *            Adjusted extent of render petition
+     * @param w
+     *            Width of render petition
+     * @param h
+     *            Height of render petition
+     * @param time
+     *            time
+     * @param renderBands
+     *            Bands to be rendered
+     * @param status
+     * @return A projected buffer
+     * @throws QueryException 
+     * @throws ProcessInterruptedException
+     *             If the process is interrupted
+     * @throws WarpException 
+     */
+    public Buffer warp(RasterDataStore store, ICoordTrans coordTrans, Extent bbox, int w, int h,
+        Time time, int[] renderBands, TaskStatus status) throws WarpException {
+        
+        Point2D ul = new Point2D.Double(bbox.getULX(), bbox.getULY());
+        Point2D lr = new Point2D.Double(bbox.getLRX(), bbox.getLRY());
+
+        Extent newBbox = RasterLocator.getManager().getDataStructFactory().createExtent(ul, lr);
+        newBbox = bbox.convert(coordTrans.getInverted());
+
+        double[] size = getSize(bbox, newBbox, w, h);
+        RasterQuery query = DefaultRasterManager.getInstance().createQuery();
+        query.setTaskStatus(status);
+        query.setTime(time);
+        query.setSupersamplingOption(false);
+        query.forceARGBRequest();
+        query.setAreaOfInterest(newBbox, (int) size[0], (int) size[1]);
+        query.setDrawableBands(renderBands);
+        Buffer sourceBuffer;
+        try {
+            sourceBuffer = store.query(query);
+        } catch (ProcessInterruptedException | QueryException e) {
+            throw new WarpException(String.format(
+                "Can not query %1s store. [area of interest: %2s width %3s height %4s]",
+                store.getName(), newBbox, (int) size[0], (int) size[1]), e);
+        }
+
+        return sourceBuffer.project(coordTrans.getInverted(), bbox, w, h);
+    }
+
+    private double[] getSize(Extent bbox, Extent newBbox, int p1x, int p1y) {
+        // d1x d2x
+        // --------- ---------
+        // | p1x | | p2x |
+        // d1y|p1y | d2y|p2y |
+        // | | | |
+        // --------- ---------
+        double sumSideOldBBox = bbox.width() + bbox.height();
+        double sumSideNewBBox = newBbox.width() + newBbox.height();
+        double d1x = (bbox.width() * 100) / sumSideOldBBox;
+        double d1y = (bbox.height() * 100) / sumSideOldBBox;
+        double d2x = (newBbox.width() * 100) / sumSideNewBBox;
+        double d2y = (newBbox.height() * 100) / sumSideNewBBox;
+        double p2y = (p1y * d2y) / d1y;
+        double p2x = (p1x * d2x) / d1x;
+        double newCellSize = newBbox.width() / p2x;
+        return new double[] { Math.round(p2x), Math.round(p2y), newCellSize };
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/render/RasterRenderReprojection.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridInterpolated.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridInterpolated.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridInterpolated.java	(revision 15423)
@@ -0,0 +1,476 @@
+/*******************************************************************************
+		GridWrapperInterpolated
+		Copyright (C) Victor Olaya
+		
+		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.impl.grid;
+
+import java.awt.Rectangle;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.impl.DefaultRasterManager;
+
+/**
+ * A grid wrapper that performs interpolation to calculate
+ * cell values. This should be used when the window extent
+ * does not 'fit' into the structure (coordinates and cellsize)
+ * of the grid.
+ * 
+ * @author Victor Olaya
+ */
+
+public class GridInterpolated extends GridReader {
+
+	public static final int INTERPOLATION_NearestNeighbour = Buffer.INTERPOLATION_NearestNeighbour;
+	public static final int INTERPOLATION_Bilinear = Buffer.INTERPOLATION_Bilinear;
+	public static final int INTERPOLATION_InverseDistance = Buffer.INTERPOLATION_InverseDistance;
+	public static final int INTERPOLATION_BicubicSpline = Buffer.INTERPOLATION_BicubicSpline;
+	public static final int INTERPOLATION_BSpline = Buffer.INTERPOLATION_BSpline;
+	
+	double m_dXMin , m_dYMax; //coordinates of the layer, not the window
+	double m_dCellSizeX; //cellsize of the layer, not the window
+	double m_dCellSizeY; //cellsize of the layer, not the window
+	int m_iInterpolationMethod = INTERPOLATION_BSpline;
+
+	/**
+	 * Crea un objeto lector a partir de un buffer de datos y el extent de la extensi�n
+	 * completa y de la ventana accedida.
+	 * @param rb Buffer de datos
+	 * @param layerExtent extent de la capa completa
+	 * @param windowExtent Extent
+	 * @param bands N�mero de bandas del origen
+	 */
+	public GridInterpolated(	Buffer rb, 
+								GridExtent layerExtent,
+								GridExtent windowExtent,
+								int[] bands){
+		super(rb, layerExtent, windowExtent, bands);
+		m_dXMin = layerExtent.minX();
+		m_dYMax = layerExtent.maxY();
+		
+		m_dCellSizeX = layerExtent.getCellSizeX();
+		m_dCellSizeY = layerExtent.getCellSizeY();
+	}
+	
+	/**
+	 * Crea un objeto lector a partir de una fuente de datos y el extent de la extensi�n
+	 * completa y de la ventana accedida.
+	 * @param ds Fuente de datos
+	 * @param layerExtent extent de la capa completa
+	 * @param windowExtent Extent
+	 * @param bands N�mero de bandas del origen
+	 */
+	public GridInterpolated(	RasterDataStore ds, 
+								GridExtent layerExtent,
+								GridExtent windowExtent,
+								int[] bands){
+		super(ds, layerExtent, windowExtent, bands);
+		init();
+	}
+	
+	/**
+	 * Inicializaci�n de la fuente de datos y carga del buffer.
+	 */
+	private void init(){
+		m_dXMin = dataStore.getExtent().minX();
+		m_dYMax = dataStore.getExtent().maxY();
+		
+		m_dCellSizeX = dataStore.getAffineTransform().getScaleX();
+		m_dCellSizeY = dataStore.getAffineTransform().getScaleY();
+		
+	}
+		
+	/**
+	 * Asigna el m�todo de interpolaci�n 
+	 * @param iMethod
+	 */
+	public void setInterpolationMethod(int iMethod){
+		m_iInterpolationMethod = iMethod;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsByte(int, int)
+	 */
+	public byte getCellValueAsByte(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		return  (byte)_getValueAt(x, y);
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsShort(int, int)
+	 */
+	public short getCellValueAsShort(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		return (short) _getValueAt(x, y);
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsInt(int, int)
+	 */
+	public int getCellValueAsInt(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {		
+		return (int) _getValueAt(x, y);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsFloat(int, int)
+	 */
+	public float getCellValueAsFloat(int x, int y)  throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		return (float) _getValueAt(x, y);
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsDouble(int, int)
+	 */
+	public double getCellValueAsDouble(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		return _getValueAt(x, y);
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsDouble(int, int)
+	 */
+	public double getCellValue(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		return _getValueAt(x, y);
+	}
+	
+	private double _getValueAt(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		double dX = windowExtent.minX() + windowExtent.getCellSize() * (x + 0.5);
+		double dY = windowExtent.maxY() - windowExtent.getCellSize() * (y + 0.5);
+		return getValueAt(dX, dY);
+	}
+
+	
+	/** Devuelve el valor interpolado para unas coordenadas de la imagen no enteras
+	 *  la distancia se toma al vertice superior izquierdo del pixel
+	 * */
+	public double _getValueAt(double x, double y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		int x_int, y_int;
+		x_int= (int)Math.floor(x);
+		y_int= (int)Math.floor(y);
+		double dX = windowExtent.minX() + windowExtent.getCellSize() * (x_int + (x-x_int));
+		double dY = windowExtent.maxY() - windowExtent.getCellSize() * (y_int + (y-y_int));
+		return getValueAt(dX, dY);
+	}
+	
+	
+	private double getValueAt(double xPosition, double yPosition) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		int	x, y;
+		double	dx, dy;
+		double dValue;
+
+		x	= (int) Math.floor(xPosition = (xPosition - m_dXMin) / m_dCellSizeX);
+		y	= (int) Math.floor(yPosition = (yPosition - m_dYMax) / m_dCellSizeY);
+
+		dValue = _getCellValueInLayerCoords(x, y);
+		
+		if(	!isNoDataValue(dValue) ) {
+
+			dx	= xPosition - x;
+			dy	= yPosition - y;
+			
+			switch( m_iInterpolationMethod ) {
+			case INTERPOLATION_NearestNeighbour:
+				dValue = _getValueNearestNeighbour (x, y, dx, dy);
+				break;
+
+			case INTERPOLATION_Bilinear:
+				dValue	= _getValueBiLinear (x, y, dx, dy);
+				break;
+
+			case INTERPOLATION_InverseDistance:
+				dValue	= _getValueInverseDistance(x, y, dx, dy);
+				break;
+
+			case INTERPOLATION_BicubicSpline:
+				dValue	= _getValueBiCubicSpline (x, y, dx, dy);
+				break;
+
+			case INTERPOLATION_BSpline:
+				dValue	= _getValueBSpline (x, y, dx, dy);
+				break;
+			}
+		} else {
+			dValue = getNoDataValue();
+		}
+
+		return dValue;
+	}
+
+	private double _getValueNearestNeighbour(int x, int y, double dx, double dy) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		x += (int)(0.5 + dx);
+		y += (int)(0.5 + dy);
+
+		return _getCellValueInLayerCoords(x, y);
+	}
+
+	private  double _getValueBiLinear(int x, int y, double dx, double dy) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		double	z = 0.0, n = 0.0, d;
+		double dValue;
+		
+		dValue = _getCellValueInLayerCoords(x, y);
+		if (!isNoDataValue(dValue)){
+			 d = (1.0 - dx) * (1.0 - dy);
+			 z += d * dValue; 
+			 n += d;
+		}
+		
+		dValue = _getCellValueInLayerCoords(x + 1, y);
+		if (!isNoDataValue(dValue)){
+			 d = (dx) * (1.0 - dy);
+			 z += d * dValue; 
+			 n += d;
+		}
+		
+		dValue = _getCellValueInLayerCoords(x, y + 1);
+		if (!isNoDataValue(dValue)){
+			 d = (1.0 - dx) * (dy);
+			 z += d * dValue; 
+			 n += d;
+		}
+		
+		dValue = _getCellValueInLayerCoords(x + 1, y + 1);
+		if (!isNoDataValue(dValue)){
+			 d = (dx) * (dy);
+			 z += d * dValue; 
+			 n += d;
+		}
+
+		if( n > 0.0 ){
+			return( z / n );
+		}
+
+		return( getNoDataValue() );
+	}
+
+	private double _getValueInverseDistance(int x, int y, double dx, double dy) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		double	z = 0.0, n = 0.0, d;
+		double dValue;
+		
+		if( dx > 0.0 || dy > 0.0 ){
+
+			dValue = _getCellValueInLayerCoords(x, y);
+			if (!isNoDataValue(dValue)){
+				d = 1.0 / Math.sqrt(dx*dx + dy*dy); 
+				z += d * dValue; 
+				n += d;
+			}
+			
+			dValue = _getCellValueInLayerCoords(x + 1, y);
+			if (!isNoDataValue(dValue)){
+				d = 1.0 / Math.sqrt((1.0-dx)*(1.0-dx) + dy*dy); 
+				z += d * dValue; 
+				n += d;
+			}
+			
+			dValue = _getCellValueInLayerCoords(x, y + 1);
+			if (!isNoDataValue(dValue)){
+				d = 1.0 / Math.sqrt(dx*dx + (1.0-dy)*(1.0-dy)); 
+				z += d * dValue; 
+				n += d;
+			}
+			
+			dValue = _getCellValueInLayerCoords(x + 1, y + 1);
+			if (!isNoDataValue(dValue)){
+				d = 1.0 / Math.sqrt((1.0-dx)*(1.0-dx) + (1.0-dy)*(1.0-dy)); 
+				z += d * dValue; 
+				n += d;
+			}
+
+			if( n > 0.0 ){
+				return( z / n );
+			}
+		}else
+			return( _getCellValueInLayerCoords(x, y) );
+		
+		return( getNoDataValue());
+	}
+
+	private double _getValueBiCubicSpline(int x, int y, double dx, double dy) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		int		i;
+		double	a0, a2, a3, b1, b2, b3, c[], z_xy[][];
+
+		c = new double[4];
+		z_xy = new double[4][4];
+		
+		if( _get4x4Submatrix(x, y, z_xy) ){
+			
+			for(i=0; i<4; i++){
+				a0		= z_xy[0][i] - z_xy[1][i];
+				a2		= z_xy[2][i] - z_xy[1][i];
+				a3		= z_xy[3][i] - z_xy[1][i];
+
+				b1		= -a0 / 3.0 + a2       - a3 / 6.0;
+				b2		=  a0 / 2.0 + a2 / 2.0;
+				b3		= -a0 / 6.0 - a2 / 2.0 + a3 / 6.0;
+
+				c[i]	= z_xy[1][i] + b1 * dx + b2 * dx*dx + b3 * dx*dx*dx;
+			}
+
+			a0		= c[0] - c[1];
+			a2		= c[2] - c[1];
+			a3		= c[3] - c[1];
+
+			b1		= -a0 / 3.0 + a2       - a3 / 6.0;
+			b2		=  a0 / 2.0 + a2 / 2.0;
+			b3		= -a0 / 6.0 - a2 / 2.0 + a3 / 6.0;
+
+			return( c[1] + b1 * dy + b2 * dy*dy + b3 * dy*dy*dy );
+		}
+
+		return( _getValueBiLinear(x, y, dx, dy) );
+	}
+
+	private double _getValueBSpline(int x, int y, double dx, double dy) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		int		i, ix, iy;
+		double	z, px, py, Rx[], Ry[], z_xy[][];
+		
+		Rx = new double[4];
+		Ry = new double[4];
+		z_xy = new double [4][4];
+
+		if( _get4x4Submatrix(x, y, z_xy) ) {
+			for(i=0, px=-1.0-dx, py=-1.0-dy; i<4; i++, px++, py++) {
+				Rx[i]	= 0.0;
+				Ry[i]	= 0.0;
+
+				if( (z = px + 2.0) > 0.0 )
+					Rx[i]	+=        z*z*z;
+				if( (z = px + 1.0) > 0.0 )
+					Rx[i]	+= -4.0 * z*z*z;
+				if( (z = px + 0.0) > 0.0 )
+					Rx[i]	+=  6.0 * z*z*z;
+				if( (z = px - 1.0) > 0.0 )
+					Rx[i]	+= -4.0 * z*z*z;
+				if( (z = py + 2.0) > 0.0 )
+					Ry[i]	+=        z*z*z;
+				if( (z = py + 1.0) > 0.0 )
+					Ry[i]	+= -4.0 * z*z*z;
+				if( (z = py + 0.0) > 0.0 )
+					Ry[i]	+=  6.0 * z*z*z;
+				if( (z = py - 1.0) > 0.0 )
+					Ry[i]	+= -4.0 * z*z*z;
+
+				Rx[i]	/= 6.0;
+				Ry[i]	/= 6.0;
+			}
+
+			for(iy=0, z=0.0; iy<4; iy++) {
+				for(ix=0; ix<4; ix++){
+					z	+= z_xy[ix][iy] * Rx[ix] * Ry[iy];
+				}
+			}
+			return( z );
+		}
+		return( _getValueBiLinear(x, y, dx, dy) );
+	}
+
+	private boolean _get4x4Submatrix(int x, int y, double z_xy[][]) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		int	ix, iy, px, py;
+		double dValue;
+
+		for(iy=0, py=y-1; iy<4; iy++, py++) {
+			for(ix=0, px=x-1; ix<4; ix++, px++) {
+				dValue = _getCellValueInLayerCoords(px, py);
+				if (isNoDataValue(dValue)) {
+					return false;
+				} else {
+					z_xy[ix][iy] = dValue;
+				}
+			}
+		}
+		return( true );
+	}
+
+	private double _getCellValueInLayerCoords(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		int w, h;
+		int pX = 0, pY = 0;
+		RasterQuery query = DefaultRasterManager.getInstance().createQuery();
+		query.setDrawableBands(bands);
+		query.storeLastBuffer(true);
+		
+		if (dataStore != null) {
+			w = (int)dataStore.getWidth();
+			h = (int)dataStore.getHeight();
+			try {
+				if (y >= h || x >= w || x < 0 || y < 0)
+					return getNoDataValue();
+				query.setAreaOfInterest(new Rectangle(x, y, 1, 1));
+				rasterBuf = dataStore.query(query);
+			} catch (QueryException e) {
+				throw new RasterBufferInvalidAccessException("");
+			} catch (ProcessInterruptedException e) {
+				// La cancelaci�n de la lectura de un pixel no es significativa
+			}
+		} else {
+			w = rasterBuf.getWidth();
+			h = rasterBuf.getHeight();
+			pX = x;
+			pY = y;
+		}
+
+		if (x >= 0 && y >= 0 && x < w && y < h) {
+			switch (dataType) {
+				case Buffer.TYPE_DOUBLE:
+					return rasterBuf.getElemDouble(pY, pX, bandToOperate);
+				case Buffer.TYPE_INT:
+					return (double) rasterBuf.getElemInt(pY, pX, bandToOperate);
+				case Buffer.TYPE_FLOAT:
+					return (double) rasterBuf.getElemFloat(pY, pX, bandToOperate);
+				case Buffer.TYPE_BYTE:
+					return ((byte) (rasterBuf.getElemByte(pY, pX, bandToOperate)) & 0xff);
+				case Buffer.TYPE_SHORT:
+				case Buffer.TYPE_USHORT:
+					return (double) rasterBuf.getElemShort(pY, pX, bandToOperate);
+			}
+		}
+		return getNoDataValue();
+	}
+
+	public byte[] getBandsValuesAsByte(int x, int y) {
+		//TODO: FUNCIONALIDAD: getBandsValuesAsByte:Obtener los valores interpolados en todas las bandas
+		return null;
+	}
+
+	public short[] getBandsValuesAsShort(int x, int y) {
+		//TODO: FUNCIONALIDAD: getBandsValuesAsShort:Obtener los valores interpolados en todas las bandas
+		return null;
+	}
+
+	public int[] getBandsValuesAsInt(int x, int y) {
+		//TODO: FUNCIONALIDAD: getBandsValuesAsInt:Obtener los valores interpolados en todas las bandas
+		return null;
+	}
+
+	public float[] getBandsValuesAsFloat(int x, int y) {
+		//TODO: FUNCIONALIDAD: getBandsValuesAsFloat:Obtener los valores interpolados en todas las bandas
+		return null;
+	}
+
+	public double[] getBandsValuesAsDouble(int x, int y) {
+		//TODO: FUNCIONALIDAD: getBandsValuesAsDouble:Obtener los valores interpolados en todas las bandas
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridInterpolated.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridNotInterpolated.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridNotInterpolated.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridNotInterpolated.java	(revision 15423)
@@ -0,0 +1,401 @@
+/*******************************************************************************
+    GridWrapperNotInterpolated
+    Copyright (C) Victor Olaya
+    
+    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.impl.grid;
+
+import java.awt.Rectangle;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+
+/**
+ * A grid wrapper that does not perform interpolation to 
+ * calculate cell values. This should be used when the window 
+ * extent 'fits' into the structure (coordinates and cellsize)
+ * of the grid, so it is faster than using a grid wrapper with
+ * interpolation
+ * 
+ * Upon construction, cellsizes are not checked, so they are assumed
+ * to be equal. Use a QueryableGridWindow to safely create a GridWrapper
+ * better than instantiating this class directly.
+ * 
+ * @author Victor Olaya (volaya@ya.com)
+ */
+
+public class GridNotInterpolated extends GridReader {
+	
+	//this offsets are in cells, not in map units.
+	int m_iOffsetX;
+	int m_iOffsetY;
+	
+	//width of the valid area (the RasterBuffer)
+	int m_iWidth;
+	int m_iHeight;
+	
+	/**
+	 * Crea un objeto lector a partir de un buffer de datos y el extent de la extensi�n
+	 * completa y de la ventana accedida.
+	 * @param rb Buffer de datos
+	 * @param layerExtent extent de la capa completa
+	 * @param windowExtent Extent
+	 * @param bands N�mero de bandas del origen
+	 */
+	public GridNotInterpolated(	Buffer rb, 
+								GridExtent layerExtent,
+								GridExtent windowExtent,
+								int[] bands) {
+		super(rb, layerExtent, windowExtent, bands);
+		m_iWidth = rb.getWidth();
+		m_iHeight = rb.getHeight();
+	}
+	
+	/**
+	 * Crea un objeto lector a partir de una fuente de datos y el extent de la extensi�n
+	 * completa y de la ventana accedida. La fuente de datos no tiene bandas asignadas ni �rea
+	 * de inter�s. Estas son calculadas a partir de los extent pasados por par�metro.
+	 * @param ds Fuente de datos
+	 * @param layerExtent extent de la capa completa
+	 * @param windowExtent Extent
+	 * @param bands N�mero de bandas del origen
+	 */
+	public GridNotInterpolated(	RasterDataStore ds, 
+								GridExtent layerExtent,
+								GridExtent windowExtent,
+								int[] bands) {
+		super(ds, layerExtent, windowExtent, bands);
+		init();
+	}
+	
+	/**
+	 * Inicializaci�n de la fuente de datos y carga del buffer.
+	 */
+	private void init() {
+		double dMinX, dMaxX, dMinY, dMaxY;
+		int iWindowMinX, iWindowMinY;	
+		int iBufMinX, iBufMaxX, iBufMinY, iBufMaxY;	
+		
+		iWindowMinX = (int) ((windowExtent.minX() - layerExtent.minX() ) 
+				/ windowExtent.getCellSizeX());
+		iWindowMinY = (int) ((layerExtent.maxY() - windowExtent.maxY() ) 
+				 / windowExtent.getCellSizeY());
+		
+		dMinX = Math.min(Math.max(windowExtent.minX(), layerExtent.minX()), layerExtent.maxX());
+		dMinY = Math.min(Math.max(windowExtent.minY(), layerExtent.minY()), layerExtent.maxY());
+		dMaxX = Math.max(Math.min(windowExtent.maxX(), layerExtent.maxX()), layerExtent.minX());
+		dMaxY = Math.max(Math.min(windowExtent.maxY(), layerExtent.maxY()), layerExtent.minY());
+		
+		iBufMinX = (int) Math.floor((dMinX - windowExtent.minX()) / windowExtent.getCellSizeX())
+					+ iWindowMinX;
+		iBufMinY = (int) Math.floor((dMaxY - windowExtent.maxY()) / windowExtent.getCellSizeY())
+					+ iWindowMinY;;
+		iBufMaxX = (int) Math.floor((dMaxX - windowExtent.minX()) / windowExtent.getCellSizeX())
+					+ iWindowMinX;
+		iBufMaxY = (int) Math.floor((dMinY - windowExtent.maxY()) / windowExtent.getCellSizeY())
+					+ iWindowMinY;
+		
+		m_iOffsetX = iBufMinX - iWindowMinX;
+		m_iOffsetY = iBufMinY - iWindowMinY;
+		
+		m_iWidth = Math.abs(iBufMaxX - iBufMinX) ;
+		m_iHeight = Math.abs(iBufMaxY - iBufMinY) ;
+			
+		try {
+			RasterQuery query = DefaultRasterManager.getInstance().createQuery();
+			query.setDrawableBands(bands);
+			query.setAreaOfInterest(new Rectangle(iBufMinX, iBufMinY, m_iWidth, m_iHeight));
+			query.storeLastBuffer(true);
+			rasterBuf = dataStore.query(query);
+		} catch (Exception e){
+			rasterBuf = null;
+		}
+	}	
+	
+	/**
+	 * Comprueba si una coordenada pixel est� dentro del grid
+	 * @param x Coordenada X a comprobar
+	 * @param y Coordenada Y a comprobar
+	 * @return true si la coordenada X e Y pasada por par�metro cae dentro del grid
+	 * y false si cae fuera.
+	 */
+	private boolean isInRasterBuf(int x, int y){
+		if (rasterBuf != null)
+			return x >= 0 && y >= 0 && x <  m_iWidth && y < m_iHeight;
+		else
+			return false;
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsByte(int, int)
+	 */
+	public byte getCellValueAsByte(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY))
+				return rasterBuf.getElemByte(y -  m_iOffsetY, x - m_iOffsetX, bandToOperate);
+			else
+				return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue;
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidException("Null Buffer");
+		}		
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsShort(int, int)
+	 */
+	public short getCellValueAsShort(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY))
+				return rasterBuf.getElemShort(y -  m_iOffsetY, x - m_iOffsetX, bandToOperate);
+			else
+				return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue;
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidException("Null Buffer");
+		}
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsInt(int, int)
+	 */
+	public int getCellValueAsInt(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY))
+				return rasterBuf.getElemInt(y -  m_iOffsetY, x - m_iOffsetX, bandToOperate);
+			else
+				return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue;
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidException("Null Buffer");
+		}		
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsFloat(int, int)
+	 */
+	public float getCellValueAsFloat(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY))
+				return rasterBuf.getElemFloat(y -  m_iOffsetY, x - m_iOffsetX, bandToOperate);
+			else
+				return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue;
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidException("Null Buffer");
+		}
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getCellValueAsDouble(int, int)
+	 */
+	public double getCellValueAsDouble(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY))
+				return rasterBuf.getElemDouble(y -  m_iOffsetY, x - m_iOffsetX, bandToOperate);
+			else
+				return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue;
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidException("Null Buffer");
+		}
+	}
+	
+	/**
+	 * Obtiene el valor de una celda en double.
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Valor de tipo double contenido en la posici�n especificada
+	 */
+	public double getCellValue(int x, int y)throws RasterBufferInvalidAccessException{
+		try{
+			if (dataType == RasterBuffer.TYPE_DOUBLE) {
+	        	return rasterBuf.getElemDouble(x, y, 0);
+	        } else if (dataType == RasterBuffer.TYPE_INT) {
+	        	return (double) rasterBuf.getElemInt(x, y, 0);
+	        } else if (dataType == RasterBuffer.TYPE_FLOAT) {
+	        	return (double) rasterBuf.getElemFloat(x, y, 0);
+	        } else if (dataType == RasterBuffer.TYPE_BYTE) {
+	        	return (double) rasterBuf.getElemByte(x, y, 0);
+	        } else if ((dataType == RasterBuffer.TYPE_SHORT) | (dataType == RasterBuffer.TYPE_USHORT)) {
+	        	return (double) rasterBuf.getElemShort(x, y, 0);
+	        }
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}
+		return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue;
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getBandsValuesAsByte(int, int)
+	 */
+	public byte[] getBandsValuesAsByte(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		byte[] b = new byte[rasterBuf.getBandCount()];
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY)){
+				try{
+					rasterBuf.getElemByte(y -  m_iOffsetY, x - m_iOffsetX, b);
+				}catch(ArrayIndexOutOfBoundsException e){
+					throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+				}catch(NullPointerException e){
+					throw new RasterBufferInvalidException("Null Buffer");
+				}
+				return b;
+			}else{
+				for(int i = 0; i < rasterBuf.getBandCount(); i++)
+	        		b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue;
+				return b;
+			}
+		}catch(Exception e){
+			for(int i = 0; i < rasterBuf.getBandCount(); i++)
+        		b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue;
+			return b;
+		}	
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getBandsValuesAsShort(int, int)
+	 */
+	public short[] getBandsValuesAsShort(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		short[] b = new short[rasterBuf.getBandCount()];
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY)){
+				try{
+					rasterBuf.getElemShort(y -  m_iOffsetY, x - m_iOffsetX, b);
+				}catch(ArrayIndexOutOfBoundsException e){
+					throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+				}catch(NullPointerException e){
+					throw new RasterBufferInvalidException("Null Buffer");
+				}
+				return b;
+			}else{
+				for(int i = 0; i < rasterBuf.getBandCount(); i++)
+	        		b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue;
+				return b;
+			}
+		}catch(Exception e){
+			for(int i = 0; i < rasterBuf.getBandCount(); i++)
+        		b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue;
+			return b;
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getBandsValuesAsInt(int, int)
+	 */
+	public int[] getBandsValuesAsInt(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		int[] b = new int[rasterBuf.getBandCount()];
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY)){
+				try{
+					rasterBuf.getElemInt(y -  m_iOffsetY, x - m_iOffsetX, b);
+				}catch(ArrayIndexOutOfBoundsException e){
+					throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+				}catch(NullPointerException e){
+					throw new RasterBufferInvalidException("Null Buffer");
+				}
+				return b;
+			}else{
+				for(int i = 0; i < rasterBuf.getBandCount(); i++)
+					b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue;
+				return b;
+			}
+		}catch(Exception e){
+			for(int i = 0; i < rasterBuf.getBandCount(); i++)
+				b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue;
+			return b;
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getBandsValuesAsFloat(int, int)
+	 */
+	public float[] getBandsValuesAsFloat(int x, int y)  throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		float[] b = new float[rasterBuf.getBandCount()];
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY)){
+				try{
+					rasterBuf.getElemFloat(y -  m_iOffsetY, x - m_iOffsetX, b);
+				}catch(ArrayIndexOutOfBoundsException e){
+					throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+				}catch(NullPointerException e){
+					throw new RasterBufferInvalidException("Null Buffer");
+				}
+				return b;
+			}else{
+				for(int i = 0; i < rasterBuf.getBandCount(); i++)
+					b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue;
+				return b;
+			}
+		}catch(Exception e){
+			for(int i = 0; i < rasterBuf.getBandCount(); i++)
+				b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue;
+			return b;
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.GridReader#getBandsValuesAsDouble(int, int)
+	 */
+	public double[] getBandsValuesAsDouble(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException {
+		double[] b = new double[rasterBuf.getBandCount()];
+		try{
+			if (isInRasterBuf(x - m_iOffsetX, y -  m_iOffsetY)){
+				try{
+					rasterBuf.getElemDouble(y -  m_iOffsetY, x - m_iOffsetX, b);
+				}catch(ArrayIndexOutOfBoundsException e){
+					throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+				}catch(NullPointerException e){
+					throw new RasterBufferInvalidException("Null Buffer");
+				}
+				return b;
+			}else{
+				for(int i = 0; i < rasterBuf.getBandCount(); i++)
+	        		b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue;
+				return b;
+			}
+		}catch(Exception e){
+			for(int i = 0; i < rasterBuf.getBandCount(); i++)
+        		b[i] = rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue;
+			return b;
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridNotInterpolated.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridWriter.java	(revision 15423)
@@ -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.impl.grid;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+
+/**
+ * Esta clase representa un grid para escritura
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GridWriter{
+
+	private Buffer	        rasterBuf     = null;
+	private GridExtent		extent        = null;
+	private int 			dataType      = Buffer.TYPE_UNDEFINED;
+	private int				bandToOperate = 0;
+
+	/**
+	 * Asignaci�n del buffer de datos e inicializaci�n de variables.
+	 * @param ge Extent del grid
+	 * @param dataType Tipo de dato del grid
+	 * @param rasterBuf Buffer de datos del grid
+	 */
+	public GridWriter(GridExtent ge, int dataType, Buffer rasterBuf){
+		this.rasterBuf = rasterBuf;
+		this.extent = ge;
+	}
+
+	/**
+	 * Creaci�n del escritor de grid a trav�s de los par�metros de su extent. Con
+	 * ellos se crear� el GridExtent y el buffer de datos para escribir.
+	 * @param iNX Ancho en pixeles
+	 * @param iNY Alto en pixeles
+	 * @param dCellSize Tama�o de celda
+	 * @param dMinX Coordenada m�nima en X
+	 * @param dMinY Coordenada m�nima en Y
+	 * @param dataType Tipo de dato
+	 * @param bands Bandas a escribir
+	 */
+	public GridWriter(int iNX, int iNY, double dCellSize,
+						double dMinX, double dMinY, int dataType,
+						int[] bands) {
+		extent = new GridExtentImpl();
+		extent.setCellSize(dCellSize);
+		extent.setXRange(dMinX, dMinX + iNX * dCellSize);
+		extent.setYRange(dMinY, dMinY + iNY * dCellSize);
+
+		rasterBuf = DefaultRasterManager.getInstance().createBuffer(dataType, iNX, iNY, bands.length, true);
+	}
+
+	public void assign(byte value) throws RasterBufferInvalidAccessException {
+		try{
+			rasterBuf.assign(bandToOperate, value);
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}
+	}
+
+	public void assign(short value) throws RasterBufferInvalidAccessException {
+		try{
+			rasterBuf.assign(bandToOperate, value);
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}
+	}
+
+	public void assign(int value) throws RasterBufferInvalidAccessException {
+		try{
+			rasterBuf.assign(bandToOperate, value);
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}
+	}
+
+	public void assign(float value) throws RasterBufferInvalidAccessException {
+		try{
+			rasterBuf.assign(bandToOperate, value);
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}
+	}
+
+	public void assign(double value) throws RasterBufferInvalidAccessException {
+		try{
+			rasterBuf.assign(bandToOperate, value);
+		}catch(ArrayIndexOutOfBoundsException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}catch(NullPointerException e){
+			throw new RasterBufferInvalidAccessException("Access to data type " + dataType + "invalid");
+		}
+	}
+
+	public GridExtent getGridExtent() {
+		return extent;
+	}
+
+	public void setCellValue( int iX, int iY, byte value) throws OutOfGridException {
+		if (isCellInGrid(iX, iY))
+			rasterBuf.setElem(iY, iX, bandToOperate, value);
+		else
+			throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid.");
+	}
+
+	public void setCellValue( int iX, int iY, short value) throws OutOfGridException {
+		if (isCellInGrid(iX, iY))
+			rasterBuf.setElem(iY, iX, bandToOperate, value);
+		else
+			throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid.");
+	}
+
+	public void setCellValue( int iX, int iY, int value) throws OutOfGridException {
+		if (isCellInGrid(iX, iY))
+			rasterBuf.setElem(iY, iX, bandToOperate, value);
+		else
+			throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid.");
+	}
+
+	public void setCellValue( int iX, int iY, float value) throws OutOfGridException {
+		if (isCellInGrid(iX, iY))
+			rasterBuf.setElem(iY, iX, bandToOperate, value);
+		else
+			throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid.");
+	}
+
+	public void setCellValue( int iX, int iY, double value) throws OutOfGridException {
+		if (isCellInGrid(iX, iY))
+			rasterBuf.setElem(iY, iX, bandToOperate, value);
+		else
+			throw new OutOfGridException("Point:(" + iX + "," + iY + ") out of grid.");
+	}
+
+	public void setNoData( int iX, int iY) {
+		if (isCellInGrid(iX,iY))
+			switch(rasterBuf.getDataType()) {
+			case Buffer.TYPE_BYTE: rasterBuf.setElem(iY, iX, bandToOperate, 
+					rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue);
+			break;
+			case Buffer.TYPE_SHORT: rasterBuf.setElem(iY, iX, bandToOperate, 
+					rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue);
+			break;
+			case Buffer.TYPE_INT: rasterBuf.setElem(iY, iX, bandToOperate, 
+					rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue);
+			break;
+			case Buffer.TYPE_FLOAT: rasterBuf.setElem(iY, iX, bandToOperate, 
+					rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue);
+			break;
+			case Buffer.TYPE_DOUBLE: rasterBuf.setElem(iY, iX, bandToOperate, 
+					rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue);
+			break;
+			}
+	}
+
+	public void setNoDataValue(NoData noDataValue) {
+		if(noDataValue.isDefined())
+			rasterBuf.setNoDataValue(noDataValue);
+	}
+
+	/**
+	 * Consulta si el grid tiene la posici�n indicada por par�metro o si esta cae
+	 * fuera del �rea.
+	 * @param iX Posici�n X
+	 * @param iY Posici�n Y
+	 * @return true si est� incluido en el Grid y false si no lo est�
+	 */
+	public boolean isCellInGrid(int iX, int iY) {
+		return (iX >= 0 && iX < extent.getNX() && iY >= 0 && iY < extent.getNY());
+	}
+
+	/**
+	 * Asigna la banda sobre la que se realizan las operaciones. Por defecto es la banda 0
+	 * con lo que para el uso de MDTs no habr� que modificar este valor.
+	 * @param band Banda sobre la que se realizan las operaciones.
+	 */
+	public void setBandToOperate(int band) {
+		this.bandToOperate = band;
+	}
+
+	/**
+	 * Releases buffer resources
+	 */
+	public void dispose() {
+		if (rasterBuf != null) {
+			rasterBuf.dispose();
+		}
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		rasterBuf     = null;
+		extent        = null;
+		super.finalize();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridPaletteDeprecated.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridPaletteDeprecated.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridPaletteDeprecated.java	(revision 15423)
@@ -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.impl.grid;
+
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+/**
+ * Tabla de color asociada a un grid
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GridPaletteDeprecated extends DataStoreColorTable {
+	/**
+	 * Flag de activaci�n de la paleta cuando se visualiza o exporta.
+	 */
+	private boolean 		paletteActive = true;
+
+	/**
+	 * Constructor
+	 * @param fp
+	 */
+	public GridPaletteDeprecated() {
+		paletteActive = true;
+	}
+
+	/**
+	 * Constructor
+	 * @param fp
+	 */
+	public GridPaletteDeprecated(ColorTable fp){
+		if (fp == null)
+			return;
+		DataStoreColorTable palette = null;
+		if(fp instanceof DataStoreColorTable)
+			palette = (DataStoreColorTable)fp;
+		else
+			return;
+		this.range = palette.getRange();
+		this.paletteActive = true;
+		this.paletteByBand = palette.getColorTableByBand();
+		this.nameClass = palette.getNameClass();
+		this.name = palette.getName();
+		this.filePath = palette.getFilePath();
+		this.colorItems = palette.getColorItems();
+		this.interpolated = palette.isInterpolated();
+	}
+
+	/**
+	 * Obtiene el flag de paleta activa o desactivada.
+	 * @return true la paleta est� activa y false desactiva
+	 */
+	public boolean isPaletteActive() {
+		return paletteActive;
+	}
+
+	/**
+	 * Asigna el flag de paleta activa o desactivada.
+	 * @param paletteActive true activa la paleta false la desactiva
+	 */
+	public void setPaletteActive(boolean paletteActive) {
+		this.paletteActive = paletteActive;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridPaletteDeprecated.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingByteFilter.java	(revision 15423)
@@ -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.impl.grid.filter.histogramMatching;
+
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+
+/**
+ * Filtro para la aplicaci�n de HistogramMatching a un raster de tipo byte.
+ * 
+ * @author aMu�oz (alejandro.munoz@uclm.es)
+ * @version 27-5-2008
+ * 
+ * */
+
+public class HistogramMatchingByteFilter extends  HistogramMatchingFilter {
+	
+	/** 
+	 * Filtro de Histogram Matching par imagenes de tipo byte
+	 * */	
+	public HistogramMatchingByteFilter() {
+		super();	
+	}
+
+	/**
+	 * Ejecucion del filtro tipo byte
+	 * */
+	public void process(int x, int y) {
+		int index = 0;
+		for(int band = 0; band < rasterResult.getBandCount(); band++) {
+			int data= (int) (raster.getElemByte(y,x,band));
+			index = data & 0xff;
+			rasterResult.setElem(y,x,band,(byte)tableAsign[band][index]);
+		}
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de entrada
+	 * */
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+
+	/**
+	 * @return tipo de dato del buffer de salida
+	 * */
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	
+} // Fin de la clase
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingFilter.java	(revision 15423)
@@ -0,0 +1,173 @@
+/* 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.impl.grid.filter.histogramMatching;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.store.ParamsImpl;
+
+/**
+ * Filtro para la aplicaci�n de HistogramMatching a un raster.
+ * 
+ * @author aMu�oz (alejandro.munoz@uclm.es)
+ * @version 27-5-2008
+ * */
+public class HistogramMatchingFilter  extends BaseRasterFilter {
+
+	public static String[]           names               = new String[] {"HistogramMatch"};
+	public BufferHistogram           histogramReference  = null;
+	private BufferHistogram          histogramSource     = null;
+	private double [][]              acumulateS          = null;
+	private double [][]              acumulateR          = null;
+	public String                    fileNameOutput      = null;
+	public byte                      tableAsign[][]      = null;
+	public int                       numbands            = 0;
+	
+	/**
+	 * Constructor 
+	 **/
+	public HistogramMatchingFilter() {
+			super();
+	}
+
+	public String getGroup() {
+		return "HistogramMatch";
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public String[] getNames() {
+		return names;			
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		return params;
+	}
+
+
+	public boolean isVisible() {
+		return false;
+	}
+
+	/**
+	 * Acciones antes de la ejecuci�n del filtro
+	 * */
+	public void pre() {	
+		// Carga de los parametros del filtro y obtencion de histogramas
+		try {
+			loadParam();
+		} catch (HistogramException e) {
+			exec = false;
+		} catch (ProcessInterruptedException e) {
+			exec = false;
+		}
+		
+		// Funcion que calcula la correspondencia entre los histogramas, El resultado es tableAsign completa
+		// para cada clase en el histograma fuente asigan su clase en el histograma corregido.
+		double inValue=0;
+		tableAsign= new byte[numbands][256];
+		
+		// C�lculo de la tabla de asignaciones entre los histogramas
+		for (int band=0; band <numbands; band++){
+			for(int i= 0; i< tableAsign[0].length; i++){
+				inValue = acumulateS[band][i];
+				int value= (searchInHistogramReference(inValue,band));
+				tableAsign[band][i]= (byte)value;
+			}
+		}
+	}
+	
+	/**
+	 * Acciones posteriores a la ejecuci�n del filtro
+	 * */
+	public void post() {		
+	}
+	
+	/**
+	 *  Se recogen los parametros necesarios para la aplicacion del filtro. 
+	 * 	histogramReference histograma de referencia.
+	 *	fileNameOutput 
+	 * @throws HistogramException 
+	 *  
+	 */
+	protected void loadParam() throws HistogramException, ProcessInterruptedException {	
+		// Raster
+		raster = (RasterBuffer) params.get("raster"); 
+		height = raster.getHeight();
+		width = raster.getWidth();
+
+		histogramSource = raster.getHistogramComputer().getBufferHistogram();
+		histogramSource = BufferHistogramImpl.convertHistogramToRGB(histogramSource);
+
+		// COMPROBACION HISTOGRAMA RGB
+		if (!histogramSource.isInRangeRGB())
+			return;
+
+		// Histograma de referencia
+		histogramReference = (BufferHistogram)params.get("histogramReference");
+		histogramReference = BufferHistogramImpl.convertHistogramToRGB(histogramReference);
+		//numbands = (int)params.get("numbads");
+		numbands = ((Integer)params.get("numbands")).intValue();
+		// Histogramas acumilados y normalizados 
+		acumulateS = BufferHistogramImpl.convertTableToNormalizeAccumulate(histogramSource.getTable());
+		acumulateR = BufferHistogramImpl.convertTableToNormalizeAccumulate(histogramReference.getTable());
+
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(RasterBuffer.TYPE_BYTE,raster.getWidth(),raster.getHeight(),numbands,true);
+		fileNameOutput = (String)params.get("fileNameOutput");
+	}
+
+
+	/**
+	 * M�todo que realiza la correspondencia entre las clases de los histogramas
+	 **/
+	public int searchInHistogramReference(double value,int band) {
+		int i = 0;
+		while(value > acumulateR[band][i]) {
+			i++;
+			if(i == 255) 
+				return (int)255;
+		}
+		if(i == 0)
+			return 0;
+		if((acumulateR[band][i]-value) < (acumulateR[band][i-1]-value))
+			return (int)i;
+		else 
+			return (int)(i-1);
+	}
+
+	public void process(int x, int y) {
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingListManager.java	(revision 15423)
@@ -0,0 +1,170 @@
+/* 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.impl.grid.filter.histogramMatching;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+
+/**
+ * Gestion  de la lista de filtros para el filtro de tipo HistogramMatchig
+ *
+ * @author aMu�oz (alejandro.munoz@uclm.es)
+ * @version 27-05-2008
+ *
+ * */
+public class HistogramMatchingListManager extends AbstractRasterFilterManager {
+	private static String   ID = "Matching";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public HistogramMatchingListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, HistogramMatchingListManager.class);
+	}
+	
+	public HistogramMatchingListManager(RasterFilterListManagerImpl filterListManager){
+		super(filterListManager.getFilterList());
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("HistogramMatch") == 0)
+			return HistogramMatchingFilter.class;
+		return null;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (HistogramMatchingFilter.class.isAssignableFrom(classFilter)) {
+			String fileNameOutput = null;
+			RasterDataStore raster = null;
+			int numbands=0;
+			HistogramComputer histogramReference		= null;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("raster"))
+					raster = (RasterDataStore)(((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("numbands"))
+					numbands = ((Integer)(((ParamImpl)params.getParam(i)).getDefaultValue())).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("histogramReference"))
+					histogramReference = (HistogramComputer)(((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("fileNameOutput"))
+					fileNameOutput= new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue());
+			}
+			addHistogramMatchingFilter(raster,numbands,histogramReference,fileNameOutput);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(HistogramMatchingFilter.class, params);
+	}
+
+	/**
+	 * A�ade un filtro HistogramMatching a la pila de filtros.
+	 * @param histogramReference Histograma de referencia al que ajustar el raster
+	 * @param fileNameOutput fichero de salida
+	 * @throws FilterTypeException
+	 */
+	public void addHistogramMatchingFilter(RasterDataStore raster,int numbands,HistogramComputer histogramReference,String fileNameOutput) throws FilterTypeException {
+		RasterFilter filter = new HistogramMatchingByteFilter();
+		if (filter != null){
+			filter.addParam("raster", raster);
+			filter.addParam("histogramReference", histogramReference);
+			filter.addParam("numbands",new Integer(numbands));
+			filter.addParam("fileNameOutput",fileNameOutput);
+			getFilterList().add(filter);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		if(	params.getParamById("ladoVentana") != null) {
+			RasterDataStore raster = ((RasterDataStore) params.getParamById("raster").getDefaultValue());
+			Integer numbands = ((Integer) params.getParamById("numbands").getDefaultValue());
+			HistogramComputer histogramReference = ((HistogramComputer) params.getParamById("histogramReference").getDefaultValue());
+			String fileNameOutput = ((String) params.getParamById("fileNameOutput").getDefaultValue());
+			
+			RasterFilter filter = new HistogramMatchingByteFilter();
+			filter.addParam("raster", raster);
+			filter.addParam("histogramReference", histogramReference);
+			filter.addParam("numbands",new Integer(numbands));
+			filter.addParam("fileNameOutput",fileNameOutput);
+			return filter;
+		}
+		return null;
+	}
+
+	/*public int createFilterListFromStrings(List<String> filters, String fil, int filteri) {
+		return filteri;
+	}*/
+
+	/**
+	 * Obtiene un Array de Strings a partir de una pila de filtros. Cada elemento
+	 * del array tendr� la forma de elemento=valor.
+	 */
+	/*public List<String> getStringsFromFilterList(List<String> filterList, RasterFilter rf) {
+
+		if (rf instanceof HistogramMatchingFilter) {
+			HistogramMatchingFilter histogramMatchingFilter = (HistogramMatchingFilter) rf;
+			filterList.add("filter.histogramMatch.active=true");
+			filterList.add("filter.histogramMatch.histogramReference="+histogramMatchingFilter.histogramReference);
+			filterList.add("filter.histogramMatch.numbands="+histogramMatchingFilter.numbands);
+			filterList.add("filter.histogramMatch.filenameOutput="+histogramMatchingFilter.fileNameOutput);
+			filterList.add("filter.histogramMatch.filterName=" + histogramMatchingFilter.getName());
+		}
+
+		return filterList;
+	}*/
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(HistogramMatchingFilter.class);
+		return filters;
+	}
+
+	public static RasterFilter createHistogramMatchFilter() {
+		RasterFilter filter = new HistogramMatchingFilter();
+		return filter;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/histogramMatching/HistogramMatchingListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimIntegerFilter.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.impl.grid.filter.statistics;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+/**
+ * Proceso del filtro de recorte de colas aplicado a im�genes 32 bits
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TailTrimIntegerFilter extends TailTrimFilter {
+
+	public TailTrimIntegerFilter() {}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		sample = new int[raster.getBandCount()][nSamples];
+		result = new double[raster.getBandCount()][2];
+	}
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < raster.getBandCount(); iBand++)
+			sample[iBand][count] = raster.getElemInt(line, col, iBand);
+		count++;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+
+	public void post() {
+		super.post();
+
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int i = 0; i < raster.getBandCount(); i++) {
+			result[i][0] = sample[i][posInit + tailSize];
+			result[i][1] = sample[i][(posInit + nSamples) - tailSize];
+		}
+		stats.setTailTrimValue(tailPercent, result);
+		
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int iValue = 0; iValue < tailSizeList.length; iValue++) {
+			double [][] res = new double[raster.getBandCount()][2];
+			for (int i = 0; i < raster.getBandCount(); i++) {
+				res[i][0] = sample[i][posInit + tailSizeList[iValue]];
+				res[i][1] = sample[i][(posInit + nSamples) - tailSizeList[iValue]];
+			}
+			stats.setTailTrimValue(tailPercentList[iValue], res);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFilter.java	(revision 15423)
@@ -0,0 +1,283 @@
+/* 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.impl.grid.filter.statistics;
+
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Filtro de recorte de colas. Este filtro toma pixels de la imagen (todos o
+ * algunas muestras dependiendo de la variable percentSample) y los ordena.
+ * Recorta un porcentaje controlado por tailPercenten ambos extremos del vector
+ * ordenado. El nuevo m�ximo y m�nimo coinciden con el valor de la posici�n del
+ * vector recortado. Por arriba para el m�ximo y por abajo para el m�nimo.
+ * El execute de este filtro no recorre toda la imagen sino que lo hace en
+ * funci�n del porcentaje de muestras que quieren tomarse y calculando a partir
+ * de este porcentaje un incremento.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TailTrimFilter extends BaseRasterFilter {
+	public static String[] names             = new String[] {"tailTrim"};
+
+	protected int 			count            = 0;
+	protected int 			tailSize         = 0;
+	protected int[]			tailSizeList     = null;
+	protected int 			nSamples         = 0;
+	protected boolean 		removeMaxValue   = false;
+	protected int 			incX , incY;
+
+	//Par�metros del filtro
+	protected double 		tailPercent      = 0D;
+	protected double[] 		tailPercentList  = null;
+	public double 			percentSamples   = 0D;
+
+	protected int[][] 		sample           = null;
+	protected double[][] 	sampleDec        = null;
+	protected Statistics	stats            = null;
+	/**
+	 * Array con el resultado. La primera dimensi�n es el n�mero de bandas y la segunda son dos elementos
+	 * el m�ximo y el m�nimo para esa banda.
+	 */
+	protected double[][]	result = null;
+
+
+	public TailTrimFilter() {
+		setName(names[0]);
+	}
+	
+	/**
+	 * Calcula el incremento de X y de Y para la toma de muestras en el calculo de
+	 * valores para el recorte
+	 * @throws FilterAddException 
+	 */
+	public void pre() throws FilterAddException {
+		super.pre();
+		if(params.get("tail") != null)
+			tailPercent = ((Double) params.get("tail")).doubleValue();
+		tailPercentList = ((double[]) params.get("tailList"));
+		if(params.get("samples") != null)
+			percentSamples = ((Double) params.get("samples")).doubleValue();
+		if(params.get("remove") != null)
+			removeMaxValue = ((Boolean) params.get("remove")).booleanValue();
+		stats = ((Statistics) params.get("stats"));
+
+		if(tailPercentList != null)
+			tailSizeList = new int[tailPercentList.length];
+		
+		if (exec) {
+			count = 0;
+
+			if (this.percentSamples == 0) { // Se toman todos los pixeles de la imagen
+				nSamples = height * width;
+				tailSize = (int) Math.round(this.tailPercent * nSamples);
+				if(tailPercentList != null) {
+					for (int i = 0; i < tailPercentList.length; i++)
+						tailSizeList[i] = (int) Math.round(this.tailPercentList[i] * nSamples);
+				}		
+			} else { // Se toma un porcentaje de pixeles de la imagen para el calculo
+				incX = (int) Math.round(width / (int) Math.round(this.percentSamples * width));
+				incY = (int) Math.round(height / (int) Math.round(this.percentSamples * height));
+				nSamples = (int) ((Math.round(width / incX) + 1) * (Math.round(height / incY) + 1));
+				tailSize = (int) (nSamples * this.tailPercent);
+				if(tailPercentList != null) {
+					for (int i = 0; i < tailPercentList.length; i++)
+						tailSizeList[i] = (int) (nSamples * this.tailPercentList[i]);
+				}
+			}
+		}
+	}
+
+	protected int posInit = 0;
+	protected int posFin = 0;
+
+	/**
+	 * Ordena las muestras , recorta y asigna m�ximo y m�nimo dependiendo del
+	 * porcentaje de recorte
+	 */
+	public void post() {
+		if (exec) {
+			// Ordenamos los vectores
+			if (sample != null) {
+				posInit = 0;
+				posFin = sample[0].length - 1;
+				for (int i = 0; i < raster.getBandCount(); i++)
+					Arrays.sort(sample[i]);
+			} else {
+				posInit = 0;
+				posFin = sampleDec[0].length - 1;
+				for (int i = 0; i < raster.getBandCount(); i++)
+					Arrays.sort(sampleDec[i]);
+			}
+
+			// Si est� marcada la opci�n removeMaxValue se calcula la posici�n en la que el m�ximo valor
+			// y el m�nimo ya no estan, teniendo as� un subconjunto del vector que elimina estos valores
+			if (removeMaxValue) {
+				if (sample != null)
+					this.calcPosInitEnd();
+
+				if (sampleDec != null)
+					this.calcPosInitEndDec();
+			}
+
+			// Calculamos de nuevo el n�mero de muestras ya que hemos quitado los valores m�ximo y m�nimo
+			nSamples = posFin - posInit;
+
+			// Como ha podido cambiar nSamples recalculamos tailsize
+			tailSize = (int) (nSamples * this.tailPercent);
+			if(tailPercentList != null) {
+				for (int i = 0; i < tailPercentList.length; i++)
+					tailSizeList[i] = (int) (nSamples * this.tailPercentList[i]);
+			}
+		}
+	}
+
+	/**
+	 * Calcula la posici�n de inicio y final donde el m�ximo y el m�nimo ya no
+	 * est�n para valores enteros.
+	 */
+	private void calcPosInitEnd() {
+		for (int i = 0; i < sample[0].length; i++) {
+			for (int iBand = 0; iBand < raster.getBandCount(); iBand++) {
+				if (sample[iBand][i] != sample[iBand][0]) {
+					posInit = i;
+					break;
+				}
+			}
+			if (posInit != 0)
+				break;
+		}
+
+		for (int i = sample[0].length - 1; i > 0; i--) {
+			for (int iBand = 0; iBand < raster.getBandCount(); iBand++) {
+				if (sample[0][i] != sample[0][sample[0].length - 1]) {
+					posFin = i;
+					break;
+				}
+			}
+			if (posFin != sample[0].length - 1)
+				break;
+		}
+	}
+
+	/**
+	 * Calcula la posici�n de inicio y final donde el m�ximo y el m�nimo ya no
+	 * est�n para valores decimal.
+	 */
+	private void calcPosInitEndDec() {
+		for (int i = 0; i < sampleDec[0].length; i++) {
+			for (int iBand = 0; iBand < raster.getBandCount(); iBand++) {
+				if (sampleDec[iBand][i] != sampleDec[iBand][0]) {
+					posInit = i;
+					break;
+				}
+			}
+			if (posInit != 0)
+				break;
+		}
+
+		for (int i = sampleDec[0].length - 1; i > 0; i--) {
+			for (int iBand = 0; iBand < raster.getBandCount(); iBand++) {
+				if (sampleDec[0][i] != sampleDec[0][sampleDec[0].length - 1]) {
+					posFin = i;
+					break;
+				}
+			}
+			if (posFin != sampleDec[0].length - 1)
+				break;
+		}
+	}
+
+	/**
+	 * Obtiene el porcentaje de recorte
+	 * @return porcentaje de recorte
+	 */
+	public double getTailPercent() {
+		return tailPercent;
+	}
+
+	/**
+	 * Obtiene la lista de porcentajes de recorte 
+	 * @return porcentajes de recorte
+	 */
+	public double[] getTailPercentList() {
+		return tailPercentList;
+	}
+	
+	/**
+	 * Devuelve true si se eliminan los extremos de la serie antes del calculo del recorte de colas
+	 * o false si no se eliminan.
+	 * @return
+	 */
+	public boolean removeMaxValue() {
+		return this.removeMaxValue;
+	}
+
+	public String getGroup() {
+		return "basics";
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("tail",
+				new Double(tailPercent),
+				Params.NONE,
+				null);
+		params.setParam("samples",
+				new Double(percentSamples),
+				Params.NONE,
+				null);
+		params.setParam("remove",
+				new Boolean(removeMaxValue),
+				Params.NONE,
+				null);
+		if(tailPercentList != null)
+			params.setParam("tailList",
+					tailPercentList,
+					Params.NONE,
+					null);
+		return params;
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public int getOutRasterDataType() {
+		return 0;
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public boolean isVisible() {
+		return false;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimShortFilter.java	(revision 15423)
@@ -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.impl.grid.filter.statistics;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+/**
+ * Proceso del filtro de recorte de colas aplicado a im�genes 16 bits
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TailTrimShortFilter extends TailTrimFilter {
+
+	public TailTrimShortFilter() {
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		sample = new int[raster.getBandCount()][nSamples];
+		result = new double[raster.getBandCount()][2];
+	}
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < raster.getBandCount(); iBand++)
+			sample[iBand][count] = raster.getElemShort(line, col, iBand);
+		count++;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+
+	public void post() {
+		super.post();
+
+		//Cogemos el minimo y m�ximo para cada banda
+		if(tailPercentList == null) {
+			for (int i = 0; i < raster.getBandCount(); i++) {
+				result[i][0] = sample[i][posInit + tailSize];
+				result[i][1] = sample[i][(posInit + nSamples) - tailSize];
+			}
+			stats.setTailTrimValue(tailPercent, result);
+		}
+		
+		if(tailPercentList == null)
+			return;
+		
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int iValue = 0; iValue < tailSizeList.length; iValue++) {
+			double [][] res = new double[raster.getBandCount()][2];
+			for (int i = 0; i < raster.getBandCount(); i++) {
+				res[i][0] = sample[i][posInit + tailSizeList[iValue]];
+				res[i][1] = sample[i][(posInit + nSamples) - tailSizeList[iValue]];
+			}
+			stats.setTailTrimValue(tailPercentList[iValue], res);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/package.html	(revision 15423)
@@ -0,0 +1,5 @@
+<html>
+	<body>
+		Filtros que calculan datos estadisticos.
+	</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimByteFilter.java	(revision 15423)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.statistics;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+/**
+ * Proceso del filtro de recorte de colas aplicado al tipo de datos byte
+ * @version 31/05/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TailTrimByteFilter extends TailTrimFilter {
+
+	/**
+	 * Array con el resultado. La primera dimensi�n es el n�mero de bandas y la segunda son dos elementos 
+	 * el m�ximo y el m�nimo para esa banda.
+	 */
+	private double[][]	result	= null;
+
+	public TailTrimByteFilter() {}
+
+	/**
+	 * Obtiene par�metros para el filtro y obtiene el ancho y alto de
+	 * la imagen sobre la que se aplica el filtro
+	 * @throws FilterAddException 
+	 */
+	public void pre() throws FilterAddException {
+		super.pre();
+		sample = new int[raster.getBandCount()][nSamples];
+		result = new double[raster.getBandCount()][2];
+	}
+
+	/**
+	 * Carga sobre el vector de muestras los valores de estas cogidos
+	 * de la imagen
+	 */
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < raster.getBandCount(); iBand++)
+			sample[iBand][count] = (raster.getElemByte(line, col, iBand) & 0xff);
+		count++;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public void post() {
+		super.post();
+
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int i = 0; i < raster.getBandCount(); i++) {
+			result[i][0] = sample[i][posInit + tailSize];
+			result[i][1] = sample[i][(posInit + nSamples) - tailSize];
+		}
+		stats.setTailTrimValue(tailPercent, result);
+		
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int iValue = 0; iValue < tailSizeList.length; iValue++) {
+			double [][] res = new double[raster.getBandCount()][2];
+			for (int i = 0; i < raster.getBandCount(); i++) {
+				res[i][0] = sample[i][posInit + tailSizeList[iValue]];
+				res[i][1] = sample[i][(posInit + nSamples) - tailSizeList[iValue]];
+			}
+			stats.setTailTrimValue(tailPercentList[iValue], res);
+		}
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/StatisticsListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/StatisticsListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/StatisticsListManager.java	(revision 15423)
@@ -0,0 +1,215 @@
+/* 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.impl.grid.filter.statistics;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Param;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+/**
+ * Gestor de la pila de filtros para filtros estad�sticos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class StatisticsListManager extends AbstractRasterFilterManager {
+	private static String                   ID                  = "Statistics";
+	//private Statistics                      stats               = null;
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, StatisticsListManager.class);
+	}
+
+	/**
+	 * Constructor. Asigna el gestor de todos los filtros y el objeto que
+	 * contiene las estad�sticas.
+	 * @param filterListManager Gestor general de filtros donde se registran los gestores de filtros
+	 * de las extensiones
+	 * @param stats Estadisticas
+	 */
+	public StatisticsListManager(RasterFilterList filterList) {
+		super(filterList);
+		//stats = (Statistics)filterList.getEnvParam("SrcStatistics");
+	}
+	
+	/**
+	 * Constructor. Asigna el gestor de todos los filtros y el objeto que
+	 * contiene las estad�sticas.
+	 * @param filterListManager Gestor general de filtros donde se registran los gestores de filtros
+	 * de las extensiones
+	 * @param stats Estadisticas
+	 */
+	public StatisticsListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+		/*if(filterListManager instanceof RasterFilterListManagerImpl) {
+			stats = (Statistics)filterListManager.getFilterList().getEnvParam("SrcStatistics");
+		}*/
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("tailTrim") == 0)
+			return TailTrimFilter.class;
+		return null;
+	}
+
+	/**
+	 * A�ade un filtro de recorte de colas.
+	 * @param tail porcentaje de recorte
+	 * @param samples porcentaje de muestras tomadas del total de la imagen
+	 * @param removeMaxValue
+	 * @param stats
+	 * @throws FilterTypeException
+	 */
+	public void addTailFilter(double tail, double samples, boolean removeMaxValue, Statistics stats) throws FilterTypeException {
+		RasterFilter filter = createTailFilter(tail, samples, removeMaxValue, stats);
+
+		if (filter != null)
+			getFilterList().add(filter);
+	}
+
+	/**
+	 * A�ade un filtro de recorte de colas con una lista de valores de recorte a obtener
+	 * @param tail porcentaje de recorte
+	 * @param samples porcentaje de muestras tomadas del total de la imagen
+	 * @param removeMaxValue
+	 * @param stats
+	 * @throws FilterTypeException
+	 */
+	public void addTailFilter(double[] tailList, double samples, boolean removeMaxValue, Statistics stats) throws FilterTypeException {
+		RasterFilter filter = createTailFilter(tailList, samples, removeMaxValue, stats);
+
+		if (filter != null)
+			getFilterList().add(filter);
+	}
+
+	/**
+	 * Crea un filtro de recorte de forma est�tica
+	 * @param tail Porcentaje de recorte
+	 * @param samples
+	 * @param removeMaxValue
+	 * @param stats
+	 * @return
+	 */
+	public static RasterFilter createTailFilter(double tail, double samples, boolean removeMaxValue, Statistics stats) {
+		RasterFilter filter = new TailTrimFloatFilter();
+		
+		if (filter != null) {
+			filter.addParam("stats", stats);
+			filter.addParam("tail", new Double(tail));
+			filter.addParam("samples", new Double(samples));
+			filter.addParam("remove", new Boolean(removeMaxValue));
+		}
+
+		return filter;
+	}
+
+	/**
+	 * Crea un filtro de recorte de forma est�tica
+	 * @param tailList Lista de porcentajes de recorte
+	 * @param samples
+	 * @param removeMaxValue
+	 * @param stats
+	 * @return
+	 */
+	public static RasterFilter createTailFilter(double[] tailList, double samples, boolean removeMaxValue, Statistics stats) {
+		RasterFilter filter = new TailTrimFloatFilter();
+
+		if (filter != null) {
+			filter.addParam("stats", stats);
+			filter.addParam("tailList", tailList);
+			filter.addParam("samples", new Double(samples));
+			filter.addParam("remove", new Boolean(removeMaxValue));
+		}
+
+		return filter;
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(TailTrimFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) {
+		if(TailTrimFilter.class.isAssignableFrom(classFilter)) {
+			try {
+				addFilter(params);
+			} catch (FilterTypeException e) {
+			}
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		if(	params.getParamById("tail") != null &&
+				params.getParamById("samples") != null &&
+				params.getParamById("remove") != null) {
+			
+			Param p = params.getParamById("stats");
+			Statistics stats = p != null ? (Statistics)p.getDefaultValue() : null;
+			if(stats == null)
+				stats = (Statistics)getFilterList().getEnvParam("SrcStatistics");
+			
+			addTailFilter(((Double)params.getParamById("tail").getDefaultValue()).doubleValue(), 
+					((Double)params.getParamById("samples").getDefaultValue()).doubleValue(), 
+					((Boolean)params.getParamById("remove").getDefaultValue()).booleanValue(),
+					stats);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		if(	params.getParamById("tail") != null &&
+				params.getParamById("samples") != null &&
+				params.getParamById("remove") != null) {
+
+			Param p = params.getParamById("stats");
+			Statistics stats = p != null ? (Statistics)p.getDefaultValue() : null;
+			if(stats == null)
+				stats = (Statistics)getFilterList().getEnvParam("SrcStatistics");
+			
+			RasterFilter filter = new TailTrimFloatFilter();
+			filter.addParam("stats", stats);
+			filter.addParam("tail", params.getParamById("tail").getDefaultValue());
+			filter.addParam("samples", params.getParamById("samples").getDefaultValue());
+			filter.addParam("remove", params.getParamById("remove").getDefaultValue());
+			if(params.getParamById("tailList") != null)
+				filter.addParam("tailList", params.getParamById("tailList").getDefaultValue());
+
+			return filter;
+			
+		}
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/StatisticsListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFloatFilter.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.impl.grid.filter.statistics;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+/**
+ * Proceso del filtro de recorte de colas aplicado a im�genes 16 bits
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TailTrimFloatFilter extends TailTrimFilter {
+
+	public TailTrimFloatFilter() {}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		sampleDec = new double[raster.getBandCount()][nSamples];
+		result = new double[raster.getBandCount()][2];
+	}
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < raster.getBandCount(); iBand++)
+			sampleDec[iBand][count] = raster.getElemFloat(line, col, iBand);
+		count++;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+
+	public void post() {
+		super.post();
+
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int i = 0; i < raster.getBandCount(); i++) {
+			result[i][0] = sampleDec[i][posInit + tailSize];
+			result[i][1] = sampleDec[i][(posInit + nSamples) - tailSize];
+		}
+		stats.setTailTrimValue(tailPercent, result);
+		
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int iValue = 0; iValue < tailSizeList.length; iValue++) {
+			double [][] res = new double[raster.getBandCount()][2];
+			for (int i = 0; i < raster.getBandCount(); i++) {
+				res[i][0] = sampleDec[i][posInit + tailSizeList[iValue]];
+				res[i][1] = sampleDec[i][(posInit + nSamples) - tailSizeList[iValue]];
+			}
+			stats.setTailTrimValue(tailPercentList[iValue], res);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimDoubleFilter.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.impl.grid.filter.statistics;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+/**
+ * Proceso del filtro de recorte de colas aplicado a im�genes double
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TailTrimDoubleFilter extends TailTrimFilter {
+
+	public TailTrimDoubleFilter() {}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		sampleDec = new double[raster.getBandCount()][nSamples];
+		result = new double[raster.getBandCount()][2];
+	}
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < raster.getBandCount(); iBand++)
+			sampleDec[iBand][count] = raster.getElemDouble(line, col, iBand);
+		count++;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+
+	public void post() {
+		super.post();
+
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int i = 0; i < raster.getBandCount(); i++) {
+			result[i][0] = sampleDec[i][posInit + tailSize];
+			result[i][1] = sampleDec[i][(posInit + nSamples) - tailSize];
+		}
+		stats.setTailTrimValue(tailPercent, result);
+		
+		//Cogemos el minimo y m�ximo para cada banda
+		for (int iValue = 0; iValue < tailSizeList.length; iValue++) {
+			double [][] res = new double[raster.getBandCount()][2];
+			for (int i = 0; i < raster.getBandCount(); i++) {
+				res[i][0] = sampleDec[i][posInit + tailSizeList[iValue]];
+				res[i][1] = sampleDec[i][(posInit + nSamples) - tailSizeList[iValue]];
+			}
+			stats.setTailTrimValue(tailPercentList[iValue], res);
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/statistics/TailTrimDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningByteFilter.java	(revision 15423)
@@ -0,0 +1,285 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.pansharp;
+
+import java.awt.geom.AffineTransform;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+
+public class PanSharpeningByteFilter extends  PanSharpeningFilter {
+	
+	/** Filtro de pansharpening aplicado a un buffer Multiespectral y Pancromatico de tipo byte
+	 * El buffer resultante es de tipo byte*/	
+	public PanSharpeningByteFilter (){
+		super();	
+	}
+
+	/**
+	 *  Se toman los buffers multiespectral y pancromatico para la aplicacion del filtro.
+	 */
+	public void init (){
+	
+		loadParam();
+		checkInput();  
+		//colorConversion= new ColorConversion();
+
+		try {
+			// Tomar el Buffer Multiespectral con las bandas activas
+			Object[] bands= null;
+			bands = bandOrder.toArray();
+			int bandas[]= new int [bands.length];
+			for (int i=0;i<bands.length;i++)
+				bandas[i]= ((Integer) bands[i]).intValue();
+
+			RasterQuery query = DefaultRasterManager.getInstance().createQuery();
+			Extent adjustedExtent = util.calculateAdjustedView(dataset.getExtent(),dataset.getAffineTransform(), widthMultiespec, heightMultiespec);
+			query.setDrawableBands(bandas);
+			try {
+				query.setAreaOfInterest(adjustedExtent, widthMultiespec, heightMultiespec);
+				bufferMultiespectral = (dataset.query(query));
+			} catch (QueryException e) {
+				e.printStackTrace();
+			}
+
+			// Tomar buffer Pancromatica
+			query = DefaultRasterManager.getInstance().createQuery();
+			AffineTransform[] at = dataset.getAffineTransformByProvider();
+			Extent adjustedExtentP = util.calculateAdjustedView(
+					dataset.getExtent(), 
+					at[posPancromat], 
+					widthPancr, 
+					heightPancr);
+			query.setDrawableBands(new int[]{posPancromatica});
+			try {
+				query.setAreaOfInterest(adjustedExtentP, widthPancr, heightPancr);
+				bufferPancr = (dataset.query(query));
+			} catch (QueryException e) {
+				e.printStackTrace();
+			}
+
+			// Buffer donde se pinta el resultado
+			rasterResult= DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_BYTE, widthPancr, heightPancr, 3, true);
+		} catch (ProcessInterruptedException e) {
+			//Gestionar cancelaci�n de la lectura
+		}
+	}		
+
+	/**
+	 *  Validamos que haya alguna otra banda adem�s de la pancrom�tica y que la pancrom�tica 
+	 *  sea de mayor resoluci�n que las dem�s.
+	 */
+	private void checkInput() {
+		exec = true;
+		if(	heightMultiespec > heightPancr || 
+			widthMultiespec > widthPancr || 
+			heightMultiespec == 0 || 
+			widthMultiespec == 0)
+			exec = false;
+		
+		double[] h = dataset.getHeightByProvider();
+		double[] w = dataset.getWidthByProvider();
+		for(int i = 0; i < dataset.getProviderCount(); i++) {
+			if(i != posPancromat) {
+				if(h[i] != heightMultiespec || w[i] != widthMultiespec) { 
+					exec = false;
+					break;
+				}   		
+			}
+		}
+	}
+
+	/**
+	 *  Se recogen los parametros necesarios para la aplicacion del filtro. 
+	 *  posPancromatica: posicion de la banda pancromatica 
+	 *  dataset:  
+	 *  bandOrden: 			array con las bandas que se visualizan
+	 *  alpha: 				parametro alpha 
+	 *  coef: 				parametro coef
+	 *  coefBrovey: 		parametro  co
+	 *  filenameOutput:		ruta con el nombre del ficheo de salida(fichero temporal)
+	 *  heightPancr: 		height de la imagen Pancromatica
+	 *  widthPancr :		width de la imagen Pancromatica
+	 *  widthMultiespec: 	width de la imagen multiespectral
+	 *  heightMultiespec:	heigth de la imagen multiespectral
+	 *  
+	 */
+	@SuppressWarnings("unchecked")
+	private void loadParam() {
+		posPancromatica = ((Integer) params.get("posPancromatica")).intValue();
+		dataset =  (RasterDataStore)params.get("dataset");
+		bandOrder = (ArrayList) params.get("order");
+		alpha = ((Integer) params.get("alpha")).intValue();
+		method = (String) params.get("method");
+		coef = ((Double) params.get("coef")).doubleValue();
+		coefBrovey = ((Integer) params.get("coefBrovey")).intValue();
+		fileNameOutput= (String)params.get("fileNameOutput");
+		
+		// Name de pancromatica
+		//pancrName = dataset.getBands().getBand(posPancromatica).getFileName();
+		//params.put("pancName", pancrName);
+		heightPancr = (int)dataset.getHeightByProvider()[posPancromatica];
+		widthPancr = (int)dataset.getWidthByProvider()[posPancromatica];
+		
+		// Nombre de los ficheros que componen el dataser
+		for(int i = 0; i < dataset.getProviderCount(); i++) {
+			if(i != posPancromat){
+				heightMultiespec = (int)dataset.getHeightByProvider()[i]; 
+				widthMultiespec = (int)dataset.getWidthByProvider()[i];
+				break;
+			}
+		}
+
+		if (widthMultiespec != 0 && heightMultiespec !=0 ) {
+			relX = (int)widthPancr / widthMultiespec;
+			relY = (int)heightPancr / heightMultiespec;
+		}
+	}
+
+
+	/**Ejecucion del filtro*/
+	public void execute() {
+	
+		pre();
+		init();
+		if(exec){	
+			byte [][] pRGBMultiespectral= null;
+			//Para cada linea leemos los valores  del buffer multiespectral. Aplicamos el algoritmo
+			// El resultado se almacena en rasterResult
+			if(method.equals("hsl")){
+				for(int iLine=0;iLine<heightMultiespec ;iLine++){
+					pRGBMultiespectral = bufferMultiespectral.getLineByte(iLine);
+					processIHS(pRGBMultiespectral, iLine);	    		
+				}
+			}else{
+				// Para cada linea leemos los valores  del buffer multiespectral. Aplicamos el algoritmo
+				// El resultado se almacena en rasterResult
+				for(int iLine=0;iLine<heightMultiespec ;iLine++){
+					pRGBMultiespectral = bufferMultiespectral.getLineByte(iLine);
+					processBrovey(pRGBMultiespectral, iLine);	    		
+				}
+			}
+		}	
+		post();
+	}
+	
+	/**
+	 * @return  tipo de dato del buffer de entrada
+	 * */
+
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+
+	/**
+	 * @return tipo de dato del buffer de salida
+	 * */
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+	
+
+	/**
+	 * Aplica la operaci�n de refinamiento sobre el buffer Multiespectral que contiene 
+	 * el RGB que es pasado por par�metro utilizando la pancrom�tica.
+	 * @param bufferInput	Buffer rgb 
+	 * @param length		longitud del buffer de la pancromatica utilizado
+	 * @param iLine			l�nea leida de la imagen multiespectral
+	 * @return				
+	 */
+	private void processBrovey(byte[][] bufferInput, int iLine){    	
+	
+		int r=0,g=0,b=0;
+		double r1=0, g1=0, b1=0;
+		double scale=0;
+		int valorPanc=0;
+		int line=0, col=0;
+		// Para cada elemento Punto de la multiespectral
+		for(int iElem=0; iElem<bufferInput[0].length; iElem++){
+			r = (int)(bufferInput[0][iElem]& 0xff);
+			g = (int) (bufferInput[1][iElem]&0xff);
+			b = (int)(bufferInput[2][iElem]& 0xff);
+			for(int j=0;j<relX;j++){
+				for(int k=0;k<relY;k++){	
+					line=iLine*relX+j;
+					col= iElem*relY+k;
+					valorPanc = (bufferPancr.getElemByte(line,col,0)&0xff);
+					scale = (3*(valorPanc+coefBrovey))/(r+g+b+1.0);		
+					r1 = r*scale;
+					g1 = g*scale; 
+					b1 = b*scale;
+					rasterResult.setElem(line, col, 0, (byte)r1);
+					rasterResult.setElem(line, col, 1, (byte)g1);
+					rasterResult.setElem(line, col, 2, (byte)b1);
+				}
+			}
+		}
+	
+	}
+
+	/**
+	 * Aplica la operaci�n de refinamiento sobre el buffer Multiespectral que contiene 
+	 * el RGB que es pasado por par�metro utilizando la pancrom�tica.
+	 * @param bufferInput	Buffer rgb 
+	 * @param length		longitud del buffer de la pancromatica utilizado
+	 * @param iLine			l�nea leida de la imagen multiespectral
+	 * @return				buffer con el resultado de la operaci�n
+	 */
+	private void processIHS(byte[][] bufferInput, int iLine){    	
+	
+		int[] uvw , tmp = new int[3];
+		int line=0,col=0;
+	    double[] xyz;
+		
+	    for(int iElem=0; iElem<bufferInput[0].length; iElem++){
+	    	xyz = colorConversion.RGBtoHSL((int)(bufferInput[0][iElem]& 0xff),(int)(bufferInput[1][iElem]& 0xff),(int)(bufferInput[2][iElem]& 0xff));
+			for(int j=0;j<relX;j++){
+				for(int k=0;k<relY;k++){
+					line= iLine*relX+j;
+					col= iElem*relY+k;
+					xyz[2] = (((bufferPancr.getElemByte(line,col,0)& 0xff))/255.0) + coef;
+					tmp[0] = (int)(255.0 * xyz[0] / 360.0 + 0.5);
+					tmp[2] = (int) (xyz[2]*255. + 0.5);
+					tmp[1] = (int) (xyz[1]*255. + 0.5);
+					uvw = colorConversion.HSLtoRGB(tmp[0],
+								   tmp[1],
+								   tmp[2]);
+					
+					rasterResult.setElem(line, col, 0, (byte)uvw[0]);
+					rasterResult.setElem(line, col, 1, (byte)uvw[1]);
+					rasterResult.setElem(line, col, 2, (byte)uvw[2]);
+				
+				}
+			}
+		} // Fin del prodeso para la linea iLine
+	}
+
+} // Fin de la clase
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningFilter.java	(revision 15423)
@@ -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.impl.grid.filter.pansharp;
+
+import java.io.IOException;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.DefaultDataServerWriter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.util.DefaultColorConversion;
+
+
+
+/**
+ * Filtros de  Pansharpening
+ * */
+
+public class PanSharpeningFilter  extends BaseRasterFilter {
+
+	public static String[] 				names 					= new String[] {"pansharp"};
+	protected RasterDataStore 		    dataset                 = null;
+	protected int 						heightPancr 			= 0;
+	protected int 						widthPancr 				= 0;
+	protected int 						heightMultiespec 		= 0;
+	protected int 						widthMultiespec 		= 0;
+	protected int						nBands 					= 0;
+	protected int						relX 					= 0;
+	protected int						relY 					= 0;
+	protected int						posPancromatica 		= 0;	
+	public ArrayList<Object>			bandOrder 				= null;
+	public int							alpha 					= 0;
+	public String						method 					= "";
+	public String 						fileNameOutput			= "";
+	public double						coef 					= 0.0;
+	public int							coefBrovey 				= 0;
+	protected int					    posPancromat            = -1;
+	protected Buffer 					bufferMultiespectral	= null;
+	protected Buffer 					bufferPancr				= null;
+	protected DefaultColorConversion    colorConversion         = null;	 
+		
+		public PanSharpeningFilter() {
+			super();
+		}
+
+	public String getGroup() {
+		return "espectrales";
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public String[] getNames() {
+		return names;			
+	}
+
+	public int getOutRasterDataType() {
+		return 0;
+	}
+
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		return params;
+	}
+
+	
+	 public boolean isVisible() {
+			return false;
+		 }
+	
+	public void post() {	
+		// Escritura del raster a disco en fichero temporal
+		RasterWriter grw = null;
+		DefaultDataServerWriter writerBufferServer = new DefaultDataServerWriter(rasterResult);
+	
+		try {
+			grw = DefaultRasterManager.getInstance().createWriter(writerBufferServer, 
+						fileNameOutput, 
+						rasterResult.getBandCount(),
+						dataset.getAffineTransformByProvider()[posPancromat], 
+						rasterResult.getWidth(), 
+						rasterResult.getHeight(), 
+						rasterResult.getDataType(), 
+						DefaultRasterManager.getInstance().createWriterParams(fileNameOutput), 
+						dataset.getProjection());
+			grw.setWkt(dataset.getWktProjection());
+			grw.dataWrite();
+			grw.writeClose();
+			
+		} catch (NotSupportedExtensionException e) {
+			e.printStackTrace();
+		} catch (RasterDriverException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		} catch (ProcessInterruptedException e) {
+			//TODO: Gestionar cancelaci�n de escritura
+		}
+		rasterResult.dispose();
+	}
+
+	public void pre() {	
+		if(colorConversion == null)
+			colorConversion = new DefaultColorConversion();
+	}
+
+	public void process(int x, int y) {	
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningListManager.java	(revision 15423)
@@ -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.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.pansharp;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestion  de la lista de filtros
+ */
+public class PanSharpeningListManager extends AbstractRasterFilterManager {
+	private static String   ID = "PanSharpening";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public PanSharpeningListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, PanSharpeningListManager.class);
+	}
+
+	public PanSharpeningListManager(RasterFilterListManagerImpl filterListManager){
+		super(filterListManager.getFilterList());
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("pansharp") == 0)
+			return PanSharpeningFilter.class;
+		return null;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (PanSharpeningFilter.class.isAssignableFrom(classFilter)) {
+			String method = "";
+			String fileNameOutput = null;
+			RasterDataStore dataset = null;
+			ArrayList<?> order = null;
+			int alpha = 0, coefBrovey = 0, posPancromatica = -1;
+			double coef = 0;
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("dataset"))
+					dataset = (RasterDataStore) params.getParam(i);
+				if (((ParamImpl)params.getParam(i)).getId().equals("posPancromatica"))
+					posPancromatica = new Integer((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("order"))
+					order = (ArrayList<?>) ((ParamImpl)params.getParam(i)).getDefaultValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("alpha"))
+					alpha = new Integer((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("method"))
+					method = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("coef"))
+					coef = new Double((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("coefBrovey"))
+					coefBrovey = new Integer((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("fileNameOutput"))
+					fileNameOutput = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue());
+			}
+			addPanSharpeningFilter(dataset, posPancromatica, order, alpha, method, coef, coefBrovey, fileNameOutput);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(PanSharpeningFilter.class, params);
+	}
+
+	/**
+	 * A�ade un filtro pansharp a la pila de filtros.
+	 * @param dataset: dataset con los ficheros
+	 * @param posPancromatica  posicion de la banda pancromatica
+	 * @param orden: orden de asignacion de las bandas a RGB. El valor contenido en cada posicion del array
+	 * 		  se corresponde al n�mero de banda de fichero que se visualiza en R, G y B.
+	 * @param alpha
+	 * @param method  metodo(HSL o Brovey)
+	 * @param coef
+	 * @param coefBrovey
+	 * @throws FilterTypeException
+	 */
+	public void addPanSharpeningFilter(RasterDataStore ldatastore,int posPancromatica, ArrayList<?> order, int alpha, String method, double coef, int coefBrovey,String fileNameOutput) throws FilterTypeException {
+		RasterFilter filter = new PanSharpeningByteFilter();
+
+		if (filter != null) {
+			filter.addParam("dataset", ldatastore);
+			filter.addParam("posPancromatica", new Integer(posPancromatica));
+			filter.addParam("order", order);
+			filter.addParam("alpha", new Integer(alpha));
+			filter.addParam("method", method);
+			filter.addParam("coef", new Double(coef));
+			filter.addParam("coefBrovey", new Integer(coefBrovey));
+			filter.addParam("fileNameOutput", fileNameOutput);
+			getFilterList().add(filter);
+		}
+	}
+
+	/*public int createFilterListFromStrings(List<String> filters, String fil, int filteri) {
+
+				if ((fil.startsWith("filter.pansharpening.active")) && (RasterFilterListManager.getValue(fil).equals("true"))) {
+
+			int posPancromatica = 0;
+						int[] bandOrder = {0, 1, 2};
+						ArrayList files = new ArrayList();
+						IRasterDataset dataset=null;
+						int alpha = 0;
+						String method = "";
+						double coef = 0D;
+						int coefBrovey = 0;
+
+						for (int propFilter = 0;propFilter < filters.size();propFilter++) {
+								String elem = (String) filters.get(propFilter);
+
+								if (elem.startsWith("filter.pansharpening.dataset")) {
+										dataset = RasterFilterListManager.getValue(elem);
+										filters.remove(propFilter);
+										propFilter--;
+								}
+								if (elem.startsWith("filter.pansharpening.posPancromatica")) {
+										posPancromatica = Integer.parseInt(RasterFilterListManager.getValue(elem));
+										filters.remove(propFilter);
+										propFilter--;
+								}
+								if (elem.startsWith("filter.pansharpening.bandOrder")) {
+									String rango = RasterFilterListManager.getValue(elem);
+										bandOrder[0] = Integer.parseInt(rango.substring(0, rango.indexOf(",")));
+										bandOrder[1] = Integer.parseInt(rango.substring(rango.indexOf(",") + 1, rango.lastIndexOf(",")));
+										bandOrder[2] = Integer.parseInt(rango.substring(rango.lastIndexOf(",") + 1, rango.length()));
+										filters.remove(propFilter);
+										propFilter--;
+								}
+								if (elem.startsWith("filter.pansharpening.file")) {
+										files.add(RasterFilterListManager.getValue(elem));
+										filters.remove(propFilter);
+										propFilter--;
+								}
+								if (elem.startsWith("filter.pansharpening.alpha")) {
+										alpha = Integer.parseInt(RasterFilterListManager.getValue(elem));
+										filters.remove(propFilter);
+										propFilter--;
+								}
+								if (elem.startsWith("filter.pansharpening.method")) {
+										method = RasterFilterListManager.getValue(elem);
+										filters.remove(propFilter);
+										propFilter--;
+								}
+								if (elem.startsWith("filter.pansharpening.coefHSL")) {
+										coef = Double.parseDouble(RasterFilterListManager.getValue(elem));
+										filters.remove(propFilter);
+										propFilter--;
+								}
+					if (elem.startsWith("filter.pansharpening.coefBrovey")) {
+						coefBrovey = Integer.parseInt(RasterFilterListManager.getValue(elem));
+						//filters.remove(propFilter);
+						//propFilter--;
+					}
+						}
+
+						addPanSharpeningFilter(dataset,posPancromatica, bandOrder, alpha, method, coef, coefBrovey);
+		}
+		return filteri;
+	}
+
+	public List<String> getStringsFromFilterList(List<String> filterList, RasterFilter rf) {
+		if (rf instanceof PanSharpeningFilter) {
+			PanSharpeningFilter pansharpFilter = (PanSharpeningFilter) rf;
+			filterList.add("filter.pansharpening.active=true");
+			filterList.add("filter.pansharpening.dataset=" + pansharpFilter.dataset);
+			filterList.add("filter.pansharpening.posPancromatica=" + pansharpFilter.posPancromatica);
+			filterList.add("filter.pansharpening.bandOrder=" + pansharpFilter.bandOrder.get(0) + "," + pansharpFilter.bandOrder.get(1) + "," + pansharpFilter.bandOrder.get(2));
+			filterList.add("filter.pansharpening.method=" + pansharpFilter.method);
+			filterList.add("filter.pansharpening.coefHSL=" + pansharpFilter.coef);
+			filterList.add("filter.pansharpening.coefBrovey=" + pansharpFilter.coefBrovey);
+			filterList.add("filter.pansharpening.alpha=" + pansharpFilter.alpha);
+			filterList.add("filter.pansharp.filterName=" + pansharpFilter.getName());
+		}
+		return filterList;
+	}*/
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(PanSharpeningFilter.class);
+		return filters;
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/pansharp/PanSharpeningListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeDoubleFilter.java	(revision 15423)
@@ -0,0 +1,90 @@
+/* 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.impl.grid.filter.segmentation;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+/**
+ * Filtro de primera derivada que se aplica en la imagen. Toma como entrada la imagen y el
+ * umbral (cero para no umbralizar).
+ * 
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class FirstDerivativeDoubleFilter extends FirstDerivativeFilter {
+	public void process(int col, int line) {
+		int out;
+		int convoResult[] = new int[4];
+		int ladoVentana = 3;
+		int semiLado = (ladoVentana - 1) >> 1;
+
+		double ventana[][] = new double[ladoVentana][ladoVentana];
+
+		Kernel kernel = null;
+
+		for (int band = 0; band < nBandsToProcess; band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				// Obtener el vector con la ventanas de muestras
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemDouble(line + j, col + i, band);
+
+				kernel = new Kernel(ventana);
+
+				convoResult[0] = (int) operatorH.convolution(kernel);
+				convoResult[1] = (int) operatorV.convolution(kernel);
+
+				if (compare) {
+					if (convoResult[0] > convoResult[1])
+						out = convoResult[0];
+					else
+						out = convoResult[1];
+				} else {
+					out = (int) Math.sqrt(Math.pow(convoResult[0], 2) + Math.pow(convoResult[1], 2));
+				}
+
+				if (umbral > 0) {
+					if (out >= (255 - umbral))
+						out = 255;
+					else
+						out = 0;
+				} else {
+					if (out < 0)
+						out = 0;
+					else if (out > 255)
+						out = 255;
+				}
+
+				rasterResult.setElem(line, col, band, (byte) out);
+			} else {
+				rasterResult.setElem(line, col, band, (byte) raster.getElemDouble(line, col, band));
+			}
+		}
+		
+		if(hasTransparency)  
+			rasterResult.setElem(line, col, rasterResult.getBandCount() - 1, 
+					raster.getElemDouble(line, col, raster.getBandCount() - 1));
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeIntegerFilter.java	(revision 15423)
@@ -0,0 +1,90 @@
+/* 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.impl.grid.filter.segmentation;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+/**
+ * Filtro de primera derivada que se aplica en la imagen. Toma como entrada la imagen y el
+ * umbral (cero para no umbralizar).
+ * 
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class FirstDerivativeIntegerFilter extends FirstDerivativeFilter {
+	public void process(int col, int line) {
+		int out;
+		int convoResult[] = new int[4];
+		int ladoVentana = 3;
+		int semiLado = (ladoVentana - 1) >> 1;
+
+		double ventana[][] = new double[ladoVentana][ladoVentana];
+
+		Kernel kernel = null;
+
+		for (int band = 0; band < nBandsToProcess; band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				// Obtener el vector con la ventanas de muestras
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemInt(line + j, col + i, band) & 0xffffffff;
+
+				kernel = new Kernel(ventana);
+
+				convoResult[0] = (int) operatorH.convolution(kernel);
+				convoResult[1] = (int) operatorV.convolution(kernel);
+
+				if (compare) {
+					if (convoResult[0] > convoResult[1])
+						out = convoResult[0];
+					else
+						out = convoResult[1];
+				} else {
+					out = (int) Math.sqrt(Math.pow(convoResult[0], 2) + Math.pow(convoResult[1], 2));
+				}
+
+				if (umbral > 0) {
+					if (out >= (255 - umbral))
+						out = 255;
+					else
+						out = 0;
+				} else {
+					if (out < 0)
+						out = 0;
+					else if (out > 255)
+						out = 255;
+				}
+
+				rasterResult.setElem(line, col, band, (byte) out);
+			} else {
+				rasterResult.setElem(line, col, band, (byte) raster.getElemInt(line, col, band));
+			}
+		}
+		
+		if(hasTransparency)  
+			rasterResult.setElem(line, col, rasterResult.getBandCount() - 1, 
+					raster.getElemInt(line, col, raster.getBandCount() - 1));
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/package.html	(revision 15423)
@@ -0,0 +1,8 @@
+<html>
+	<body>
+		<P>
+		Filtros de primera deriva que basan su funcionamiento en el vector gradiente y 
+		de segunda derivada.
+		</P>
+	</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFilter.java	(revision 15423)
@@ -0,0 +1,181 @@
+/* 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.impl.grid.filter.segmentation;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Clase base para los filtros de primera derivada.
+ *
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ */
+public class FirstDerivativeFilter extends BaseRasterFilter {
+	public static String[] names            = new String[] {"sobel", "roberts", "prewitt", "freichen"};
+	public static final int TYPE_SOBEL      = 0;
+	public static final int TYPE_ROBERTS    = 1;
+	public static final int TYPE_PREWITT    = 2;
+	public static final int TYPE_FREICHEN   = 3;
+
+	protected int           umbral          = 0;
+	protected boolean       compare         = false;
+	protected Kernel        operatorH;
+	protected Kernel        operatorV;
+	private int             operator        = 0;
+
+	// Kernels:------------------------------------------
+	static final double     sobelH[][]      = {{-1,0,1},{-2,0,2},{-1,0,1}};
+	static final double     sobelV[][]      = {{-1,-2,-1},{0,0,0},{1,2,1}};
+	static final Kernel     sobelHKernel    = new Kernel(sobelH);
+	static final Kernel     sobelVKernel    = new Kernel(sobelV);
+
+	static final double     robertsH[][]    = {{0,0,-1},{0,1,0},{0,0,0}};
+	static final double     robertsV[][]    = {{-1,0,0},{0,1,0},{0,0,0}};
+	static final Kernel     robertsHKernel  = new Kernel(robertsH);
+	static final Kernel     robertsVKernel  = new Kernel(robertsV);
+
+	static final double     prewittH[][]    = {{1,0,-1},{1,0,-1},{1,0,-1}};
+	static final double     prewittV[][]    = {{-1,-1,-1},{0,0,0},{1,1,1}};
+	static final Kernel     prewittHKernel  = new Kernel(prewittH);
+	static final Kernel     prewittVKernel  = new Kernel(prewittV);
+
+	static final double     freiChenH[][]   = {{-1,-1.4D,-1},{0,0,0},{1,1.4D,1}};
+	static final double     freiChenV[][]   = {{-1,0,1},{-1.4D,0,1.4D},{-1,0,1}};
+	//static final double freiChenH[][]= {{-1,-1.4142D,-1},{0,0,0},{1,1.4142D,1}};
+	//static final double freiChenV[][]= {{-1,0,1},{-1.4142D,0,1.4142D},{-1,0,1}};
+	static final Kernel     freiChenHKernel = new Kernel(freiChenH);
+	static final Kernel     freiChenVKernel = new Kernel(freiChenV);
+	
+	protected int           nBandsToProcess = 0;
+	protected boolean       hasTransparency = false;
+	// --------------------------------------------------
+
+	/**
+	 * Constructor
+	 */
+	public FirstDerivativeFilter() {
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		if(transparency != null && transparency.existAlphaBand()) {
+			nBandsToProcess = raster.getBandCount() - 1;
+			hasTransparency = true;
+		} else
+			nBandsToProcess = raster.getBandCount();
+
+		if (params.get("umbral") != null)
+			umbral = ((Integer) params.get("umbral")).intValue();
+		else
+			umbral = 0;
+
+		if (params.get("compare") != null)
+			compare = ((Boolean) params.get("compare")).booleanValue();
+		else
+			compare = false;
+
+		operator = 0;
+		for (int i = 0; i < names.length; i++) {
+			if (names[i].equals(getName())) {
+				operator = i;
+				break;
+			}
+		}
+
+		switch (operator) {
+			case TYPE_SOBEL:
+				operatorH = sobelHKernel;
+				operatorV = sobelVKernel;
+				break;
+			case TYPE_ROBERTS:
+				operatorH = robertsHKernel;
+				operatorV = robertsVKernel;
+				break;
+			case TYPE_PREWITT:
+				operatorH = prewittHKernel;
+				operatorV = prewittVKernel;
+				break;
+			case TYPE_FREICHEN:
+				operatorH = freiChenHKernel;
+				operatorV = freiChenVKernel;
+				break;
+		}
+
+		createBufferResult(Buffer.TYPE_BYTE, raster.getBandCount());
+	}
+
+	/**
+	 * Obtiene el umbral
+	 * @return entero que representa el umbral
+	 */
+	public int getUmbral() {
+		return umbral;
+	}
+
+	public String getGroup() {
+		return "deteccion_bordes";
+	}
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("Umbral",
+				new Integer(umbral),
+				Params.SLIDER,
+				new String[] {"0", "255", "0", "1", "25" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("Compare",
+				new Boolean(compare),
+				Params.CHECK,
+				null);
+		params.setParam("FilterName",
+				getName(),
+				-1,
+				null);
+		return params;
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+
+	public void process(int x, int y) {
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeShortFilter.java	(revision 15423)
@@ -0,0 +1,90 @@
+/* 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.impl.grid.filter.segmentation;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+/**
+ * Filtro de primera derivada que se aplica en la imagen. Toma como entrada la imagen y el
+ * umbral (cero para no umbralizar).
+ * 
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class FirstDerivativeShortFilter extends FirstDerivativeFilter {
+	public void process(int col, int line) {
+		int out;
+		int convoResult[] = new int[4];
+		int ladoVentana = 3;
+		int semiLado = (ladoVentana - 1) >> 1;
+
+		double ventana[][] = new double[ladoVentana][ladoVentana];
+
+		Kernel kernel = null;
+
+		for (int band = 0; band < nBandsToProcess; band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				// Obtener el vector con la ventanas de muestras
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemShort(line + j, col + i, band) & 0xffff;
+
+				kernel = new Kernel(ventana);
+
+				convoResult[0] = (int) operatorH.convolution(kernel);
+				convoResult[1] = (int) operatorV.convolution(kernel);
+
+				if (compare) {
+					if (convoResult[0] > convoResult[1])
+						out = convoResult[0];
+					else
+						out = convoResult[1];
+				} else {
+					out = (int) Math.sqrt(Math.pow(convoResult[0], 2) + Math.pow(convoResult[1], 2));
+				}
+
+				if (umbral > 0) {
+					if (out >= (255 - umbral))
+						out = 255;
+					else
+						out = 0;
+				} else {
+					if (out < 0)
+						out = 0;
+					else if (out > 255)
+						out = 255;
+				}
+
+				rasterResult.setElem(line, col, band, (byte) out);
+			} else {
+				rasterResult.setElem(line, col, band, (byte) raster.getElemShort(line, col, band));
+			}
+		}
+		
+		if(hasTransparency)  
+			rasterResult.setElem(line, col, rasterResult.getBandCount() - 1, 
+					raster.getElemShort(line, col, raster.getBandCount() - 1));
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeListManager.java	(revision 15423)
@@ -0,0 +1,146 @@
+/* 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.impl.grid.filter.segmentation;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor de la pila de filtros para el filtro de primera derivada.
+ *
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ */
+public class FirstDerivativeListManager extends AbstractRasterFilterManager {
+	private static String   ID = "FirstDerivative";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public FirstDerivativeListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, FirstDerivativeListManager.class);
+	}
+	
+	/**
+	 * Constructor. Asigna la lista de filtros y el manager.
+	 * @param filterListManager
+	 */
+	public FirstDerivativeListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("sobel") == 0 ||
+			id.compareTo("roberts") == 0 ||
+			id.compareTo("prewitt") == 0 ||
+			id.compareTo("freichen") == 0)
+			return FirstDerivativeFilter.class;
+		return null;
+	}
+
+	/**
+	 * A�ade un filtro de convoluc�n a la pila de filtros.
+	 * @param Name Nombre del filtro
+	 * @param umbral
+	 * @param operator
+	 * @param compare
+	 * @param Name
+	 * @throws FilterTypeException
+	 */
+	public void addFirstDerivativeFilter(int umbral, boolean compare, String Name) throws FilterTypeException {
+		RasterFilter filter = new FirstDerivativeByteFilter();
+
+		// Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			filter.addParam("umbral", new Integer(umbral));
+			filter.addParam("compare", new Boolean(compare));
+			filter.addParam("filterName", new String(Name));
+			filter.setName(Name);
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(FirstDerivativeFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (FirstDerivativeFilter.class.isAssignableFrom(classFilter)) {
+			int umbral = 0;
+			boolean compare = false;
+			String name = "";
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("Umbral") &&
+					((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+					umbral = ((Integer)((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("Compare") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Boolean)
+					compare = ((Boolean)((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("FilterName") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String)
+					name = (String)((ParamImpl)params.getParam(i)).getDefaultValue();
+			}
+			addFirstDerivativeFilter(umbral, compare, name);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(FirstDerivativeFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		if(	params.getParamById("Umbral") != null) {
+			Integer umbral = ((Integer) params.getParamById("Umbral").getDefaultValue());
+			Boolean compare = ((Boolean) params.getParamById("Compare").getDefaultValue());
+			String name = ((String) params.getParamById("FilterName").getDefaultValue());
+			
+			RasterFilter filter = new FirstDerivativeByteFilter();
+			filter.addParam("umbral", new Integer(umbral));
+			filter.addParam("compare", new Boolean(compare));
+			filter.addParam("filterName", new String(name));
+			return filter;
+		}
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeByteFilter.java	(revision 15423)
@@ -0,0 +1,90 @@
+/* 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.impl.grid.filter.segmentation;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+/**
+ * Filtro de primera derivada que se aplica en la imagen. Toma como entrada la imagen y el
+ * umbral (cero para no umbralizar).
+ * 
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class FirstDerivativeByteFilter extends FirstDerivativeFilter {
+	public void process(int col, int line) {
+		int out;
+		int convoResult[] = new int[4];
+		int ladoVentana = 3;
+		int semiLado = (ladoVentana - 1) >> 1;
+
+		double ventana[][] = new double[ladoVentana][ladoVentana];
+
+		Kernel kernel = null;
+
+		for (int band = 0; band < nBandsToProcess; band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				// Obtener el vector con la ventanas de muestras
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[j + semiLado][i + semiLado] = raster.getElemByte(line + j, col + i, band) & 0xff;
+
+				kernel = new Kernel(ventana);
+
+				convoResult[0] = (int) operatorH.convolution(kernel);
+				convoResult[1] = (int) operatorV.convolution(kernel);
+
+				if (compare) {
+					if (convoResult[0] > convoResult[1])
+						out = convoResult[0];
+					else
+						out = convoResult[1];
+				} else {
+					out = (int) Math.sqrt(Math.pow(convoResult[0], 2) + Math.pow(convoResult[1], 2));
+				}
+
+				if (umbral > 0) {
+					if (out >= (255 - umbral))
+						out = 255;
+					else
+						out = 0;
+				} else {
+					if (out < 0)
+						out = 0;
+					else if (out > 255)
+						out = 255;
+				}
+
+				rasterResult.setElem(line, col, band, (byte) out);
+			} else {
+				rasterResult.setElem(line, col, band, (byte) raster.getElemByte(line, col, band));
+			}
+		}
+		
+		if(hasTransparency)  
+			rasterResult.setElem(line, col, rasterResult.getBandCount() - 1, 
+					raster.getElemByte(line, col, raster.getBandCount() - 1));
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFloatFilter.java	(revision 15423)
@@ -0,0 +1,90 @@
+/* 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.impl.grid.filter.segmentation;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+/**
+ * Filtro de primera derivada que se aplica en la imagen. Toma como entrada la imagen y el
+ * umbral (cero para no umbralizar).
+ * 
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class FirstDerivativeFloatFilter extends FirstDerivativeFilter {
+	public void process(int col, int line) {
+		int out;
+		int convoResult[] = new int[4];
+		int ladoVentana = 3;
+		int semiLado = (ladoVentana - 1) >> 1;
+
+		double ventana[][] = new double[ladoVentana][ladoVentana];
+
+		Kernel kernel = null;
+
+		for (int band = 0; band < nBandsToProcess; band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				// Obtener el vector con la ventanas de muestras
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemFloat(line + j, col + i, band);
+
+				kernel = new Kernel(ventana);
+
+				convoResult[0] = (int) operatorH.convolution(kernel);
+				convoResult[1] = (int) operatorV.convolution(kernel);
+
+				if (compare) {
+					if (convoResult[0] > convoResult[1])
+						out = convoResult[0];
+					else
+						out = convoResult[1];
+				} else {
+					out = (int) Math.sqrt(Math.pow(convoResult[0], 2) + Math.pow(convoResult[1], 2));
+				}
+
+				if (umbral > 0) {
+					if (out >= (255 - umbral))
+						out = 255;
+					else
+						out = 0;
+				} else {
+					if (out < 0)
+						out = 0;
+					else if (out > 255)
+						out = 255;
+				}
+
+				rasterResult.setElem(line, col, band, (byte) out);
+			} else {
+				rasterResult.setElem(line, col, band, (byte) raster.getElemFloat(line, col, band));
+			}
+		}
+		
+		if(hasTransparency)  
+			rasterResult.setElem(line, col, rasterResult.getBandCount() - 1, 
+					raster.getElemFloat(line, col, raster.getBandCount() - 1));
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/segmentation/FirstDerivativeFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/FilterLoaderImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/FilterLoaderImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/FilterLoaderImpl.java	(revision 15423)
@@ -0,0 +1,106 @@
+package org.gvsig.raster.impl.grid.filter;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.filter.FilterLoader;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.roi.ROI;
+import org.slf4j.LoggerFactory;
+
+/**
+ * <P>
+ * Applies the stack of filters to a buffer. With the same <code>FilterLoader</code>
+ * you can process different buffers. Each buffer can use a different environment
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class FilterLoaderImpl implements FilterLoader {
+	private RasterFilterList     filterList  = null;
+	private Buffer               inputBuffer = null;
+	
+	/**
+	 * Creates a filter loader with a default filter list
+	 * @param dataType
+	 */
+	public FilterLoaderImpl(int dataType) {
+		this.filterList = RasterLocator.getManager().createEmptyFilterList(dataType);
+	}
+	
+	/**
+	 * Creates a filter loader with the list of filters passed by parameter
+	 * @param filterList
+	 */
+	public FilterLoaderImpl(RasterFilterList filterList) {
+		this.filterList = filterList;
+	}
+	
+	public void addTransparency(Transparency transparency) {
+		if(transparency != null)
+			filterList.addEnvParam("Transparency", transparency.cloneTransparency());
+	}
+	
+	public void addSrcDataType(int datatype) {
+		filterList.addEnvParam("SrcDataType", datatype);
+	}
+	
+	public void addSrcBandCount(int bandcount) {
+		filterList.addEnvParam("SrcBandCount", bandcount);
+	}
+	
+	public void addSrcStatistics(Statistics statistics) {
+		filterList.addEnvParam("SrcStatistics", statistics);
+	}
+	
+	public void addSrcROI(List<ROI> roi) {
+		filterList.addEnvParam("SrcROI", roi);
+	}
+	
+	public void addSrcHistogram(HistogramComputer histogram) {
+		filterList.addEnvParam("SrcHistogram", histogram);
+	}
+	
+	public Buffer applyFilters(Buffer buffer) {
+		this.inputBuffer = buffer;
+		
+		//Checks if the transparency is inside the buffer
+		Transparency transparency = (Transparency)filterList.getEnvParam("Transparency");
+		if( transparency != null && 
+			transparency.existAlphaBand() && 
+			transparency.getAlphaBandNumber() >= buffer.getBandCount()) {
+			transparency.setTransparencyBand(-1);
+			transparency.activeTransparency();
+		}
+		filterList.setInitRasterBuf(inputBuffer);
+		try {
+			filterList.execute();
+		} catch (ProcessInterruptedException e) {
+			return inputBuffer;
+		} catch (FilterAddException e) {
+			LoggerFactory.getLogger(this.getClass()).debug("Filters cannot be applied", e);
+			return inputBuffer;
+		}
+		if(filterList.getResult() != null)
+			return (Buffer) filterList.getResult();
+		return inputBuffer;
+	}
+	
+	public Transparency getTransparency() {
+		Transparency t = filterList.getTransparency();
+		t.setDataBuffer(inputBuffer);
+		return t;
+	}
+	
+	public Buffer getBufferResult() {
+		if(filterList.getResult() != null)
+			return (Buffer) filterList.getResult();
+		return inputBuffer;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/FilterLoaderImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/RasterFilterListManagerImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/RasterFilterListManagerImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/RasterFilterListManagerImpl.java	(revision 15423)
@@ -0,0 +1,432 @@
+/* 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.impl.grid.filter;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterListManager;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.extensionpoint.ExtensionPoint.Extension;
+
+/*
+ * TODO: FUNCIONALIDAD: Anulada las estad�sticas. Hay que incluirlas de nuevo.
+ */
+/**
+ * Esta clase es de la parte cliente y es la encargada de la gesti�n de la pila
+ * de filtros. Cada tipo de filtro o conjunto de tipos de filtro deben tener un
+ * gestor que implementa IRasterFilterManager. Esos gestores deben registrarse
+ * en esta clase con la funci�n addClassListManager. Este registro puede hacerse
+ * desde esta misma clase o desde una extensi�n. Un cliente que desee aplicar un
+ * filtro deber� introducirlo en la lista usando para ello las funciones que su
+ * manager de filtros le ofrece. Adem�s se encarga de otras funciones como la
+ * conversi�n de un filtro a cadena de Strings y la recuperaci�n desde cadena de
+ * Strings y el control de tipos de la salida de un raster de la lista con la
+ * entrada del siguiente filtro.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterFilterListManagerImpl {
+	protected RasterFilterList	            rasterFilterList       = null;
+	protected List<String>			        filterList             = null;
+	private List<RasterFilterListManager>   managers               = new ArrayList<RasterFilterListManager>();
+
+	/**
+	 * Constructor
+	 * @param filterStack
+	 */
+	public RasterFilterListManagerImpl(RasterFilterList filterStack) {
+		this.rasterFilterList = filterStack;
+
+		// Cargamos el manager con los gestores de drivers registrados
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterFilter");
+		Iterator<?> iterator = point.iterator();
+		while (iterator.hasNext()) {
+			ExtensionPoint.Extension entry = (ExtensionPoint.Extension) iterator
+					.next();
+			if (entry != null) {
+				Class<?> RasterClass = entry.getExtension();
+				Object obj = RasterFilterListManagerImpl.loadClass(RasterClass, this);
+				if (obj != null)
+					managers.add((RasterFilterListManager)obj);
+			}
+		}
+	}
+
+	/**
+	 * Controla que los tipos de los filtros de la pila sean correctos, es decir,
+	 * que el tipo de salida de un filtro de salida coincida con el tipo de la
+	 * entrada del siguiente. En caso de no ser as� crea el filtro de tipo
+	 * adecuado y lo sustituye en el no coincidente. Esto es necesario ya que en
+	 * la eliminaci�n de filtros puede quedarse en inconsistencia de tipos.
+	 */
+	public void controlTypes() throws FilterTypeException {
+		RasterUtils util = RasterLocator.getManager().getRasterUtils();
+		ArrayList<Exception> exceptions = new ArrayList<Exception>();
+		for (int i = 0; i < rasterFilterList.lenght(); i++) {
+			String classFilter = null, packageFilter = null, oldClass = null;
+			try {
+				RasterFilter rf = rasterFilterList.get(i);
+				if (rf == null)
+					return;
+				classFilter = rf.getClass().toString();
+				packageFilter = classFilter.substring(classFilter.indexOf(" ") + 1, classFilter.lastIndexOf("."));
+				oldClass = classFilter.substring(classFilter.lastIndexOf(".") + 1, classFilter.length());
+			} catch (ArrayIndexOutOfBoundsException ex) {
+				return;
+			} catch (NullPointerException ex) {
+				return;
+			}
+
+			// Para el primer filtro comprobamos con el tipo de dato de entrada a la pila
+			if (i == 0) {
+				if (rasterFilterList.getInitDataType() != rasterFilterList.get(i).getInRasterDataType()) {
+					Pattern p = Pattern.compile(util.typesToString(rasterFilterList.get(i).getInRasterDataType()));
+					Matcher m = p.matcher(oldClass);
+					String newClass = m.replaceAll(util.typesToString(rasterFilterList.getInitDataType()));
+					String strPackage = packageFilter + "." + newClass;
+
+					renewFilterFromControlTypes(strPackage, i, exceptions);
+				}
+
+				// Desde el filtro 2 en adelante se compara la salida de uno con la entrada del siguiente
+			} else if (rasterFilterList.get(i - 1).getOutRasterDataType() != rasterFilterList.get(i).getInRasterDataType()) {
+				Pattern p = Pattern.compile(util.typesToString(rasterFilterList.get(i).getInRasterDataType()));
+				Matcher m = p.matcher(oldClass);
+				String newClass = m.replaceAll(util.typesToString(rasterFilterList.get(i - 1).getOutRasterDataType()));
+				String strPackage = packageFilter + "." + newClass;
+
+				renewFilterFromControlTypes(strPackage.trim(), i, exceptions);
+			}
+		}
+
+		if (exceptions.size() > 0)
+			throw new FilterTypeException("");
+
+	}
+
+	/**
+	 * Reemplaza un filtro segun su nombre a la lista de filtros, util para cambiar
+	 * el tipo de datos de un filtro en la pila de filtros.
+	 * @param nameFilter
+	 * @param pos
+	 * @param exceptions
+	 */
+	private void renewFilterFromControlTypes(String nameFilter, int pos, List<Exception> exceptions) {
+		try {
+			RasterFilter newFilter = rasterFilterList.createEmptyFilter(nameFilter);
+			
+			newFilter.setParams(rasterFilterList.get(pos).getParams());
+			if (newFilter.getParams().get("filterName") != null)
+				newFilter.setName((String) newFilter.getParams().get("filterName"));
+			else
+				newFilter.setName(rasterFilterList.get(pos).getName());
+			rasterFilterList.replace(newFilter, pos);
+		} catch (FilterTypeException e) {
+			exceptions.add(e);
+		}
+	}
+
+	/**
+	 * M�todo que devuelve true si el tipo de filtro pasado por par�metro est� en
+	 * la pila y false si no lo est�.
+	 * @param filter Tipo de filtro a comprobar
+	 * @return true si est� en la pila y false si no lo est�
+	 */
+	public boolean isActive(String name) {
+		return rasterFilterList.isActive(name);
+	}
+
+	/**
+	 * Elimina los filtros de la pila de un determinado tipo
+	 *
+	 * @param type Tipo de filtro a eliminar
+	 * @throws FilterTypeException
+	 */
+	public void removeFilter(String name) throws FilterTypeException {
+		rasterFilterList.remove(name);
+		this.controlTypes();
+	}
+
+	/*public List<String> getStringsFromFilterList() {
+		filterList = new ArrayList<String>();
+		for (int i = 0; i < rasterFilterList.lenght(); i++) {
+			RasterFilter rf = rasterFilterList.get(i);
+
+			// Se recorren todos los managers registrados comprobando si corresponde a
+			// la clase del filtro
+			for (int j = 0; j < managers.size(); j++)
+				filterList = ((RasterFilterListManager) managers.get(j)).getStringsFromFilterList(filterList, rf);
+		}
+
+		return filterList;
+	}*/
+	
+	/*public int createStackFromStrings(List<?> filters, String fil, int filteri) {
+		return filteri;
+	}*/
+	
+	/**
+	 * Crea una pila de filtros a partir de un Array de Strings. Cada elemento del array debe
+	 * tener la forma elemento=valor.
+	 * @param filters
+	 * @throws FilterTypeException
+	 */
+	/*public static void createFilterListFromStrings(RasterFilterList rasterFilterList, List<String> f) throws FilterTypeException {
+		new RasterFilterListManagerImpl(rasterFilterList).createFilterListFromStrings(f, new Integer(0));
+	}*/
+
+	/**
+	 * Crea una pila de filtros a partir de un Array de Strings. Cada elemento del array debe
+	 * tener la forma elemento=valor.
+	 * @param filters
+	 * @throws FilterTypeException
+	 */
+	/*public void createFilterListFromStrings(List<String> f) throws FilterTypeException {
+		createFilterListFromStrings(f, new Integer(0));
+	}*/
+
+	/**
+	 * Crea una pila de filtros a partir de un Array de Strings. Cada elemento del array debe
+	 * tener la forma elemento=valor.
+	 * @param pos Posici�n desde la cual se empieza a analizar.
+	 * @param filters
+	 * @throws FilterTypeException
+	 */
+	/*private void createFilterListFromStrings(List<String> f, Integer pos) throws FilterTypeException {
+		List<String> filters = null;
+		if(f instanceof ArrayList) {
+			filters = (List<String>)((ArrayList<String>) f).clone();
+		} else {
+			filters = new ArrayList<String>();
+			for (int i = 0; i < f.size(); i++) {
+				filters.add(f.get(i));
+			}
+		}
+		rasterFilterList.clear();
+
+		int filteri = pos.intValue();
+
+		// Busca un filtro activo y despu�s todas las propiedades que necesita ese
+		// filtro para ser creado. Una vez las tiene a�ade en la pila el tipo de
+		// filtro.
+		while ((filters.size() > 0) && (filteri < filters.size())) {
+			String fil = (String) filters.get(filteri);
+
+			for (int j = 0; j < managers.size(); j++)
+				try {
+					filteri = ((RasterFilterListManager) managers.get(j)).createFilterListFromStrings(filters, fil, filteri);
+				} catch (NullPointerException e) {
+				}
+
+			filteri++;
+		}
+	}*/
+
+	/**
+	 * Obtiene el elemento de una cadena de la forma elemento=valor
+	 * @param cadena
+	 * @return
+	 */
+	public static String getElem(String cadena) {
+		if (cadena != null)
+			return cadena.substring(0, cadena.indexOf("="));
+		else
+			return null;
+	}
+
+	/**
+	 * Obtiene el valor de una cadena de la forma elemento=valor
+	 * @param cadena
+	 * @return
+	 */
+	public static String getValue(String cadena) {
+		if (cadena != null)
+			return cadena.substring(cadena.indexOf("=") + 1, cadena.length());
+		else
+			return null;
+	}
+
+	/**
+	 * Carga una clase pasada por par�metro. Como argumento del constructor de la
+	 * clase se pasar� un RasterFilterStackManager. Esto es usado para instanciar
+	 * los gestores de filtros registrados
+	 * @param clase Clase a instanciar
+	 * @param stackManager Par�metro del constructor de la clase a instanciar
+	 * @return Objeto que corresponde a la instancia de la clase pasada.
+	 */
+	public static Object loadClass(Class<?> clase, RasterFilterListManagerImpl stackManager) {
+		Object obj = null;
+		try {
+			try {
+				Constructor<?> hazNuevo = clase.getConstructor(new Class[]{ RasterFilterList.class });
+				obj = hazNuevo.newInstance(new Object[]{stackManager.getFilterList()});
+			} catch (NoSuchMethodException e) {
+				Constructor<?> hazNuevo = clase.getConstructor(new Class[]{ RasterFilterListManagerImpl.class });
+				obj = hazNuevo.newInstance(new Object[]{stackManager});
+			}
+		} catch (SecurityException e) {
+			e.printStackTrace();
+		} catch (NoSuchMethodException e) {
+			e.printStackTrace();
+		} catch (IllegalArgumentException e) {
+			e.printStackTrace();
+		} catch (InstantiationException e) {
+			e.printStackTrace();
+		} catch (IllegalAccessException e) {
+			e.printStackTrace();
+		} catch (InvocationTargetException e) {
+			e.printStackTrace();
+		}
+		return obj;
+	}
+	
+	public RasterFilterList getFilterList() {
+		return rasterFilterList;
+	}
+	
+	public RasterFilterListManager getManagerByID(String id) throws FilterManagerException {
+		// Cargamos el manager con los gestores de drivers registrados
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterFilter");
+		Extension ext = point.get(id);
+		if (ext != null) {
+			Class<?> clase = ext.getExtension();
+			Class<?> [] args = {RasterFilterListManagerImpl.class};
+			try {
+				Constructor<?> hazNuevo = clase.getConstructor(args);
+				Object [] args2 = {this};
+				return (RasterFilterListManager) hazNuevo.newInstance(args2);
+			} catch (SecurityException e) {
+				throw new FilterManagerException("Error SecurityException in open", e);
+			} catch (NoSuchMethodException e) {
+				throw new FilterManagerException("Error NoSuchMethodException in open", e);
+			} catch (IllegalArgumentException e) {
+				throw new FilterManagerException("Error IllegalArgumentException in open", e);
+			} catch (InstantiationException e) {
+				throw new FilterManagerException("Error InstantiationException in open", e);
+			} catch (IllegalAccessException e) {
+				throw new FilterManagerException("Error IllegalAccessException in open", e);
+			} catch (InvocationTargetException e) {
+				throw new FilterManagerException("Error opening this image with " + clase, e);
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Obtiene el manager registrado a partir de la clase
+	 * @return
+	 */
+	public RasterFilterListManager getManagerByClass(Class<?> c) {
+		for (int j = 0; j < managers.size(); j++)
+			if (managers.get(j).getClass().equals(c))
+				return (RasterFilterListManager) managers.get(j);
+		return null;
+	}
+
+	/**
+	 * Obtiene el manager registrado a partir de la clase de un filtro
+	 * @return
+	 */
+	public RasterFilterListManager getManagerByFilterClass(Class<?> c) {
+		for (int i = 0; i < managers.size(); i++) {
+			RasterFilterListManager localMan = ((RasterFilterListManager) managers.get(i));
+			for (int j = 0; j < localMan.getRasterFilterList().size(); j++) {
+				Class<?> f = (Class<?>)localMan.getRasterFilterList().get(j);
+				if (f.isAssignableFrom(c))//(f.equals(c))
+					return localMan;
+			}
+		}
+		return null;
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		for (int i = 0; i < managers.size(); i++) {
+			List<Class<?>> auxFilters = managers.get(i).getRasterFilterList();
+			for (int j = 0; j < auxFilters.size(); j++)
+				filters.add(auxFilters.get(j));
+		}
+		return filters;
+	}
+	
+	public List<Class<?>> getRasterFilterListByDataType(int dataType) {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		for (int i = 0; i < managers.size(); i++) {
+			RasterFilterListManager man = managers.get(i);
+			if(man.isDataTypeSupported(dataType)) {
+				List<Class<?>> auxFilters = man.getRasterFilterList();
+				for (int j = 0; j < auxFilters.size(); j++)
+					filters.add(auxFilters.get(j));
+			}
+		}
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params)
+			throws FilterTypeException {
+		
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		throw new FilterTypeException("Method not implemented in globar manager");
+	}
+
+	/*public int createFilterListFromStrings(List<String> filters,
+			String fil, int filteri) throws FilterTypeException {
+		return 0;
+	}*/
+
+	/*public List<String> getStringsFromFilterList(
+			List<String> filterList, RasterFilter rf) {
+		return null;
+	}*/
+	
+	protected void finalize() throws Throwable {
+		rasterFilterList           = null;
+		if(managers != null) {
+			managers.clear();
+			managers = null;
+		}
+		if(filterList != null) {
+			filterList.clear();
+			filterList = null;
+		}
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/RasterFilterListManagerImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/package.html	(revision 15423)
@@ -0,0 +1,15 @@
+<html>
+	<body>
+		<P>
+		Filtros de convoluci�n. Las convoluciones discretas son usadas en el procesado 
+		de imagen para el suavizado de im�genes, el afilado de im�genes, detecci�n de bordes, 
+		y otros efectos. 
+		</P>
+		<P>
+			<B>g(x,y) = f(x,y) op a(x,y)</B>
+		</P>
+		<P>
+		donde a(x,y) es la funci�n respuesta al impulso del filtro a aplicar (o m�scara de convoluci�n), f(x,y) es la imagen de entrada y g(x,y) es la imagen filtrada
+		</P>
+	</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionDoubleFilter.java	(revision 15423)
@@ -0,0 +1,93 @@
+/* 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.impl.grid.filter.convolution;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+
+/**
+ * Filtro de convolucion para Buffer de tipo Double
+ * @author Alejandro Mu�oz        <alejandro.munoz@uclm.es> 
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es> 
+ * */
+
+public class ConvolutionDoubleFilter extends ConvolutionFilter {
+
+	public ConvolutionDoubleFilter() {
+		super();
+	}
+	/** 
+	 * @param Kernel a aplicar. En caso de que no se trate de un kernel definido en ConvolutionFilter, se puede pasar como 
+	 * parametro el kernel se pretende aplicar.
+	 * **/
+	public ConvolutionDoubleFilter(Kernel k) {
+		super();
+		super.kernel = k;
+	}
+	
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_DOUBLE, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	
+	/** Aplicacion del filtro para el pixel de la posicion line, col */
+	public void process(int col, int line) {
+		
+		int lado= kernel.getLado();
+		int semiLado = (lado - 1) >> 1;
+		double ventana[][] = new double[lado][lado];
+		double resultConvolution=0;
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {	
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)){
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemDouble(line + j, col + i, band);
+				Kernel Kventana= new Kernel(ventana);
+				resultConvolution=(double)kernel.convolution(Kventana);
+				if (resultConvolution<0)
+					resultConvolution = 0;
+				rasterResult.setElem(line, col, band,resultConvolution);	
+			}
+			else rasterResult.setElem(line, col,band,raster.getElemDouble(line,col,band));
+		}	
+	}
+	
+	/**
+	 * @return  tipo de dato del buffer de entrada
+	 * */
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_DOUBLE;
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de salida
+	 * */		
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_DOUBLE;
+	}
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionIntegerFilter.java	(revision 15423)
@@ -0,0 +1,93 @@
+/* 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.impl.grid.filter.convolution;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+
+/**
+ * Filtro de convolucion para Buffer de tipo Int
+ * @author Alejandro Mu�oz        <alejandro.munoz@uclm.es>
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ * */
+
+public class ConvolutionIntegerFilter extends ConvolutionFilter {
+
+	public ConvolutionIntegerFilter() {
+		super();
+	}
+	/**
+	 * @param Kernel a aplicar. En caso de que no se trate de un kernel definido en ConvolutionFilter, se puede pasar como
+	 * parametro el kernel se pretende aplicar.
+	 * **/
+	public ConvolutionIntegerFilter(Kernel k) {
+		super();
+		super.kernel = k;
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_INT, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	/** Aplicacion del filtro para el pixel de la posicion line, col */
+	public void process(int col, int line) {
+		int lado = kernel.getLado();
+		int semiLado = (lado - 1) >> 1;
+		double ventana[][] = new double[lado][lado];
+		double resultConvolution = 0;
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemInt(line + j, col + i, band) & 0xff;
+				Kernel Kventana = new Kernel(ventana);
+				resultConvolution = kernel.convolution(Kventana);
+				if (resultConvolution > Integer.MAX_VALUE)
+					resultConvolution = Integer.MAX_VALUE;
+				else
+					if (resultConvolution < 0)
+						resultConvolution = 0;
+				rasterResult.setElem(line, col, band, (int) resultConvolution);
+			} else
+				rasterResult.setElem(line, col, band, raster.getElemInt(line, col, band));
+		}
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de entrada
+	 * */
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_INT;
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de salida
+	 * */
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_INT;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFilter.java	(revision 15423)
@@ -0,0 +1,210 @@
+/* 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.impl.grid.filter.convolution;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.datastruct.Kernel;
+import org.gvsig.raster.impl.store.ParamsImpl;
+
+/**
+ * Filtros de  Convolucion
+ * @author  Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ * @author	Alejandro Mu�oz S�nchez  < alejandro.munoz@uclm.es>
+ * */
+
+public class ConvolutionFilter extends BaseRasterFilter {
+
+	public static String[]     names           = new String[] {"media", "pasobajo", "sharpen", "gauss", "personalizado"};
+	public int                 ladoVentana     = 0;
+	protected Kernel           kernel          = null;
+
+	/** Tipos de filtros de convolucion */
+	public static final int    TYPE_MEDIA      = 0;
+	public static final int    TYPE_LOWPASS    = 1;
+	public static final int    TYPE_HIGHPASS   = 2;
+	public static final int    TYPE_GAUSS      = 3;
+	public static final int    TYPE_OTHER      = 4;
+
+	/**Definicion de los filtros basicos */
+	static final double        gauss3x3[][]    = {{1,4,1},{4,12,4},{1,4,1}};
+	static final double        gauss5x5[][]    = {{1,2,3,2,1},{2,7,11,7,2},{3,11,17,11,3},{2,7,11,7,2},{1,2,3,2,1}};
+	static final double        gauss7x7[][]    = {{1,1,2,2,2,1,1},{1,2,2,4,2,2,1},{2,2,4,8,4,2,2},{2,4,8,16,8,4,2},{2,2,4,8,4,2,2},{1,2,2,4,2,2,1},{1,1,2,2,2,1,1}};
+	static final double        gauss7x7aux[][] = {{0,0,0.0003,0.0006,0.0003,0,0},{0,0.0011,0.0079,0.0153,0.0079,0.0011,0},{0.0003,0.0079,0.0563,0.1082,0.0563,0.0079,0.0003},{0.0006,0.0153,0.1082,0.2079,0.1082,0.0153,0.0006},{0.0003,0.0079,0.0563,0.1082,0.0563,0.0079,0.0003},{0,0.0011,0.0079,0.0153,0.0079,0.0011,0},{0,0,0.0003,0.0006,0.0003,0,0}};
+	static final double        lowpass3x3[][]  = {{0,1,0},{1,6,1},{0,1,0}};
+	static final double        lowpass5x5[][]  = {{1,1,1,1,1},{1,4,4,4,1},{1,4,12,4,1},{1,4,4,4,1},{1,1,1,1,1}};
+	static final double        media3x3[][]    = {{1,1,1},{1,1,1},{1,1,1}};
+	static final double        media5x5[][]    = {{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1},{1,1,1,1,1}};
+	static final double        media7x7[][]    = {{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1},{1,1,1,1,1,1,1}};
+	static final double        highpass3x3[][] = {{-1,-1,-1},{-1,9,-1},{-1,-1,-1}};
+
+	static final Kernel        kGauss3x3       = new Kernel(gauss3x3,34);
+	static final Kernel        kGauss5x5       = new Kernel(gauss5x5,121);
+	static final Kernel        kGauss7x7       = new Kernel (gauss7x7aux);
+	static final Kernel        kLowpass3x3     = new Kernel(lowpass3x3,10);
+	static final Kernel        kLowpass5x5     = new Kernel(lowpass5x5);
+	static final Kernel        kMedia3x3       = new  Kernel(media3x3,9);
+	static final Kernel        kMedia5x5       = new Kernel (media5x5,25);
+	static final Kernel        kMedia7x7       = new Kernel (media7x7,49);
+	static final Kernel        kHighpass3x3    = new Kernel (highpass3x3);
+	private int			       operator        = 0;
+	private double             agudeza         = 1; 
+
+	/** Filtro de Convolucion*/
+	public ConvolutionFilter() {
+		super();
+		setName(names[0]);
+	}
+
+
+	public String getGroup() {
+		return "espaciales";
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public int getOutRasterDataType() {
+		return 0;
+	}
+
+	public void post() {
+		//	En caso de que nadie apunte a raster, se liberara su memoria.
+		raster = null;
+
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		ladoVentana = ((Integer) params.get("ladoVentana")).intValue();
+		if(params.get("Agudeza") != null)
+			agudeza = ((Double) params.get("Agudeza")).doubleValue();
+		Kernel userKernel = (Kernel) params.get("kernel");
+		String name = ((String)params.get("filterName"));
+		operator = 0;
+		for (int i = 0; i < names.length; i++) {
+			if (names[i].equals(name)) {
+				operator = i;
+				setName(names[i]);
+				break;
+			}
+		}
+
+		switch (operator) {
+			case TYPE_MEDIA:
+				setName(names[0]);
+				switch (ladoVentana) {
+					case 2:
+						kernel = kMedia7x7;
+						break;
+					case 1:
+						kernel = kMedia5x5;
+						break;
+					default:
+						kernel = kMedia3x3;
+						break;
+				}
+				break;
+			case TYPE_LOWPASS:
+				setName(names[1]);
+				switch (ladoVentana) {
+					case 1:
+						kernel = kLowpass5x5;
+						break;
+					default:
+						kernel = kLowpass3x3;
+						break;
+				}
+				break;
+			case TYPE_HIGHPASS:
+				setName(names[2]);
+				double[][] h = new double[3][3];
+				for (int i = 0; i < h.length; i++) {
+					for (int j = 0; j < h[i].length; j++) {
+						h[i][j] = highpass3x3[i][j];
+					}
+				}
+				h[1][1] = 29 - (agudeza * 20.9) / 100;
+				kernel = new Kernel (h);
+				break;
+			case TYPE_GAUSS:
+				setName(names[3]);
+				switch (ladoVentana) {
+					case 2:
+						kernel = kGauss7x7;
+						break;
+					case 1:
+						kernel = kGauss5x5;
+						break;
+					default:
+						kernel = kGauss3x3;
+						break;
+				}
+				break;
+			case TYPE_OTHER:
+				setName(names[4]);
+				kernel = userKernel;
+				break;
+		}
+
+		if (kernel == null)
+			kernel = kMedia3x3;
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		if(nameFilter == "personalizado") {
+			params.setParam("Panel", new ConvolutionUI(kernel), -1, null);
+		} else if (nameFilter != "pasobajo" && nameFilter != "sharpen") {
+			params.setParam("LadoVentana",
+					new Integer(ladoVentana),
+					Params.CHOICE,
+					new String[] {"3", "5", "7"});
+		} else if (nameFilter == "sharpen") {
+			params.setParam("Agudeza",
+					new Double(agudeza),
+					Params.SLIDER,
+					new String[] {"0", "100", "0", "1", "25" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		} else {
+			params.setParam("LadoVentana",
+					new Integer(ladoVentana),
+					Params.CHOICE,
+					new String[] {"3", "5"});
+		}
+
+		params.setParam("FilterName",
+				nameFilter,
+				-1,
+				null);
+		return params;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionShortFilter.java	(revision 15423)
@@ -0,0 +1,93 @@
+/* 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.impl.grid.filter.convolution;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+
+/**
+ * Filtro de convolucion para Buffer de tipo Short
+ * @author Alejandro Mu�oz        <alejandro.munoz@uclm.es>
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ * */
+public class ConvolutionShortFilter extends ConvolutionFilter {
+
+	public ConvolutionShortFilter() {
+		super();
+	}
+
+	/**
+	 * @param Kernel a aplicar. En caso de que no se trate de un kernel definido en ConvolutionFilter, se puede pasar como
+	 * parametro el kernel se pretende aplicar.
+	 * **/
+	public ConvolutionShortFilter(Kernel k) {
+		super();
+		super.kernel = k;
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_SHORT, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	/** Aplicacion del filtro para el pixel de la posicion line, col */
+	public void process(int col, int line) {
+		int lado = kernel.getLado();
+		int semiLado = (lado - 1) >> 1;
+		double ventana[][] = new double[lado][lado];
+		double resultConvolution = 0;
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemShort(line + j, col + i, band) & 0xff;
+				Kernel Kventana = new Kernel(ventana);
+				resultConvolution = kernel.convolution(Kventana);
+				if (resultConvolution > Short.MAX_VALUE)
+					resultConvolution = Short.MAX_VALUE;
+				else
+					if (resultConvolution < 0)
+						resultConvolution = 0;
+				rasterResult.setElem(line, col, band, (short) resultConvolution);
+			} else
+				rasterResult.setElem(line, col, band, (short) raster.getElemShort(line, col, band));
+		}
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de entrada
+	 * */
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_SHORT;
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de salida
+	 * */
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_SHORT;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionListManager.java	(revision 15423)
@@ -0,0 +1,154 @@
+/* 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.impl.grid.filter.convolution;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RegistrableFilterListener;
+import org.gvsig.raster.impl.datastruct.Kernel;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestion  de la lista de filtros
+ */
+public class ConvolutionListManager extends AbstractRasterFilterManager {
+	private static String   ID = "Convolucion";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public ConvolutionListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, ConvolutionListManager.class, ConvolutionUI.class);
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("media") == 0 ||
+			id.compareTo("pasobajo") == 0 ||
+			id.compareTo("sharpen") == 0 ||
+			id.compareTo("gauss") == 0 ||
+			id.compareTo("personalizado") == 0)
+			return ConvolutionFilter.class;
+		return null;
+	}
+	
+	public ConvolutionListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de convolucion  a la pila de filtros.
+	 * @param ladoVentana
+	 * @throws FilterTypeException
+	 */
+	public void addConvolutionFilter(String Name,int ladoVentana, double agudeza, Kernel kernel) throws FilterTypeException {
+		RasterFilter filter = new ConvolutionByteFilter();
+
+		// Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+		if (filter != null) {
+			filter.addParam("ladoVentana", Integer.valueOf(ladoVentana));
+			filter.addParam("Agudeza", Double.valueOf(agudeza));
+			filter.addParam("filterName", String.valueOf(Name));
+			filter.addParam("kernel", kernel);
+			getFilterList().add(filter);
+		}
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (ConvolutionFilter.class.isAssignableFrom(classFilter)) {
+			int ladoVentana = 0;
+			double agudeza = 0;
+			Kernel kernel = null;
+			String name = "";
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("Panel") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof RegistrableFilterListener) {
+					params = ((RegistrableFilterListener) ((ParamImpl)params.getParam(i)).getDefaultValue()).getParams();
+					break;
+				}
+			}
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("LadoVentana") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+					ladoVentana = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+
+				if (((ParamImpl)params.getParam(i)).getId().equals("FilterName")) {
+					Object obj = ((ParamImpl)params.getParam(i)).getDefaultValue();
+					if(obj != null)
+						name = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				}
+
+				if (((ParamImpl)params.getParam(i)).getId().equals("Kernel") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Kernel)
+					kernel = (Kernel) ((ParamImpl)params.getParam(i)).getDefaultValue();
+
+				if (((ParamImpl)params.getParam(i)).getId().equals("Agudeza") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					agudeza = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+			}
+			addConvolutionFilter(name, ladoVentana, agudeza, kernel);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(ConvolutionFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		Integer ladoVentana = ((Integer) params.getParamById("LadoVentana").getDefaultValue());
+		String name = ((String) params.getParamById("FilterName").getDefaultValue());
+		Kernel kernel = ((Kernel) params.getParamById("Kernel").getDefaultValue());
+		Double agudeza = ((Double) params.getParamById("Agudeza").getDefaultValue());
+		
+		RasterFilter filter = new ConvolutionByteFilter();
+		filter.addParam("LadoVentana", ladoVentana);
+		filter.addParam("Agudeza", agudeza);
+		filter.addParam("filterName", name);
+		filter.addParam("kernel", kernel);
+		return filter;
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(ConvolutionFilter.class);
+		return filters;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionByteFilter.java	(revision 15423)
@@ -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.impl.grid.filter.convolution;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+
+/**
+ * Filtro de convolucion para Buffer de tipo Byte
+ * @author Alejandro Mu�oz        <alejandro.munoz@uclm.es>
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ * */
+public class ConvolutionByteFilter extends ConvolutionFilter {
+
+	public ConvolutionByteFilter() {
+		super();
+	}
+
+	/**
+	 * @param Kernel a aplicar. En caso de que no se trate de un kernel definido en ConvolutionFilter, se puede pasar como
+	 * parametro el kernel se pretende aplicar.
+	 * **/
+	public ConvolutionByteFilter(Kernel k) {
+		super();
+		super.kernel = k;
+	}
+
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_BYTE, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	/** Aplicacion del filtro para el pixel de la posicion line, col */
+	public void process(int col, int line) {
+		int lado = kernel.getLado();
+		int semiLado = (lado - 1) >> 1;
+		double ventana[][] = new double[lado][lado];
+		double resultConvolution = 0;
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)) {
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemByte(line + j, col + i, band) & 0xff;
+				Kernel Kventana = new Kernel(ventana);
+
+				resultConvolution = kernel.convolution(Kventana);
+				if (resultConvolution > 255)
+					resultConvolution = 255;
+				else
+					if (resultConvolution < 0)
+						resultConvolution = 0;
+
+				rasterResult.setElem(line, col, band, (byte) resultConvolution);
+			} else
+				rasterResult.setElem(line, col, band, (byte) raster.getElemByte(line, col, band));
+		}
+		
+		writeAlphaBand(line, col);
+			
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de entrada
+	 * */
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+	/**
+	 * @return tipo de dato del buffer de salida
+	 * */
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFloatFilter.java	(revision 15423)
@@ -0,0 +1,93 @@
+/* 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.impl.grid.filter.convolution;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.Kernel;
+
+/**
+ * Filtro de convolucion para Buffer de tipo Float
+ * @author Alejandro Mu�oz        <alejandro.munoz@uclm.es> 
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es> 
+ * */
+public class ConvolutionFloatFilter extends ConvolutionFilter {
+
+	public ConvolutionFloatFilter() {
+		super();	
+	}
+	
+	/** 
+	 * @param Kernel a aplicar. En caso de que no se trate de un kernel definido en ConvolutionFilter, se puede pasar como 
+	 * parametro el kernel se pretende aplicar.
+	 * **/
+	public ConvolutionFloatFilter(Kernel k) {
+		super();
+		super.kernel = k;
+	}
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_FLOAT, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	/** Aplicacion del filtro para el pixel de la posicion line, col */
+	public void process(int col, int line) {
+		
+		int lado= kernel.getLado();
+		int semiLado = (lado - 1) >> 1;
+		double ventana[][] = new double[lado][lado];
+		double resultConvolution = 0;
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {	
+			if ((col - semiLado >= 0) && (line - semiLado >= 0) && (col + semiLado < width) && (line + semiLado < height)){
+				for (int j = -semiLado; j <= semiLado; j++)
+					for (int i = -semiLado; i <= semiLado; i++)
+						ventana[i + semiLado][j + semiLado] = raster.getElemFloat(line + j, col + i, band);;
+				Kernel Kventana = new Kernel(ventana);
+				resultConvolution = kernel.convolution(Kventana);
+				if(resultConvolution > Float.MAX_VALUE)
+					resultConvolution = Float.MAX_VALUE;
+				else if (resultConvolution<0)
+					resultConvolution = 0;
+				rasterResult.setElem(line, col, band,(float)resultConvolution);	
+			}
+			else rasterResult.setElem(line, col,band,raster.getElemFloat(line,col,band));
+		}	
+	}
+	
+	/**
+	 * @return  tipo de dato del buffer de entrada
+	 * */		
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_FLOAT;
+	}
+
+	/**
+	 * @return  tipo de dato del buffer de salida
+	 * */		
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_FLOAT;
+	}
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionUI.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionUI.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionUI.java	(revision 15423)
@@ -0,0 +1,367 @@
+/* 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.impl.grid.filter.convolution;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.GridLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.text.NumberFormat;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JFormattedTextField;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.text.DefaultFormatterFactory;
+import javax.swing.text.NumberFormatter;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.grid.FilterUIListener;
+import org.gvsig.fmap.dal.coverage.grid.RegistrableFilterListener;
+import org.gvsig.raster.impl.datastruct.Kernel;
+import org.gvsig.raster.impl.grid.filter.DefaultRegistrableFilterListener;
+import org.gvsig.raster.impl.store.ParamsImpl;
+
+/**
+ * Panel del filtro personalizado de convoluci�n. Consta de una matriz de cajas de texto
+ * de 3x3 o de 5x5 seleccionable desde un combo.
+ *
+ * 28/09/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ConvolutionUI extends JPanel implements RegistrableFilterListener, ActionListener, FocusListener {
+
+	private static final long    serialVersionUID             = 7102390746959243164L;
+	private JTextField[][]       matrix                       = new JTextField[5][5];
+	//Panel superior
+	private JPanel               panelMatrixSelector          = null;
+	private JPanel               panelMatrix                  = null;
+	private JPanel               panelSelector                = null;
+	//Panel inferior
+	private JPanel               panelTest                    = null;
+	private JComboBox            selector                     = null;
+	private JButton              buttonTest                   = null;
+	private JFormattedTextField  divisor                      = null;
+	private double               lastValue                    = 0;
+	private DefaultRegistrableFilterListener
+                                 defaultRegistrableListener   = null;
+	private Kernel               kernel                       = null;
+	private Params               loadedParams                 = null; 
+	
+	/**
+	 * Constructor.
+	 */
+	public ConvolutionUI(Kernel k) {
+		init(k);
+	}
+	
+	/**
+	 * Initialize this object
+	 * @param obj
+	 */
+	public void init(Object obj) {
+		if(!(obj instanceof Kernel) && obj != null )
+			return;
+		this.kernel = (Kernel)obj;
+		defaultRegistrableListener = new DefaultRegistrableFilterListener();
+		getPanelMatrixSelector().setLayout(new BorderLayout());
+		getPanelTest().setLayout(new BorderLayout());
+
+		GridLayout gridLayout = new GridLayout(5, 5);
+		getPanelMatrix().setLayout(gridLayout);
+		gridLayout.setVgap(2);
+		gridLayout.setHgap(2);
+
+		for (int i = 0; i < matrix.length; i++) {
+			for (int j = 0; j < matrix[0].length; j++) {
+				if(kernel == null) { //Caso en que no se pase ning�n kernel. Se ponen todos a 0 y el del centro a 1.
+					matrix[i][j] = new JTextField("0");
+					if(i == Math.ceil(matrix.length / 2) && j == Math.ceil(matrix[0].length / 2))
+						matrix[i][j].setText("1");
+				} else {
+					if(kernel.kernel.length == 5) {
+						String value = (kernel.kernel[i][j] == (int)kernel.kernel[i][j]) ? ((int)kernel.kernel[i][j]) + "" : kernel.kernel[i][j] + "";
+						matrix[i][j] = new JTextField(value + "");
+					} else {
+						if(kernel.kernel.length == 3) {
+							if(i > 0 && j > 0 && i < 4 && j < 4) {
+								String value = (kernel.kernel[i - 1][j - 1] == (int)kernel.kernel[i - 1][j - 1]) ? ((int)kernel.kernel[i - 1][j - 1]) + "" : kernel.kernel[i - 1][j - 1] + "";
+								matrix[i][j] = new JTextField(value + "");
+							} else {
+								matrix[i][j] = new JTextField("0");
+								matrix[i][j].setVisible(false);
+							}
+						}
+					}
+				}
+				matrix[i][j].addFocusListener(this);
+				getPanelMatrix().add(matrix[i][j]);
+			}
+		}
+
+		getPanelSelector().add(new JLabel("Kernel: "));
+		getPanelSelector().add(getSelector());
+		getPanelSelector().add(new JLabel("Divisor: "));
+		getPanelSelector().add(getDivisor());
+
+		getPanelMatrixSelector().add(getPanelMatrix(), BorderLayout.NORTH);
+		getPanelMatrixSelector().add(getPanelSelector(), BorderLayout.SOUTH);
+		if(kernel != null && kernel.kernel.length == 3)
+			getSelector().setSelectedIndex(0);
+		else if(kernel != null && kernel.kernel.length == 5)
+			getSelector().setSelectedIndex(1);
+
+		getPanelTest().add(getButtonTest(), BorderLayout.SOUTH);
+
+		this.setLayout(new BorderLayout());
+		this.add(getPanelMatrixSelector(), BorderLayout.CENTER);
+		this.add(getPanelTest(), BorderLayout.SOUTH);
+	}
+	
+	/**
+	 * Obtiene el bot�n de test
+	 * @return JPanel
+	 */
+	private JButton getButtonTest() {
+		if(buttonTest == null) {
+			buttonTest = new JButton("Test");
+			buttonTest.addActionListener(this);
+		}
+		return buttonTest;
+	}
+
+	/**
+	 * Obtiene el panel con el bot�n de test
+	 * @return JPanel
+	 */
+	private JPanel getPanelTest() {
+		if(panelTest == null)
+			panelTest = new JPanel();
+		return panelTest;
+	}
+
+	/**
+	 * Obtiene el panel de la matriz y el selector
+	 * @return JPanel
+	 */
+	private JPanel getPanelMatrixSelector() {
+		if(panelMatrixSelector == null)
+			panelMatrixSelector = new JPanel();
+		return panelMatrixSelector;
+	}
+
+	/**
+	 * Obtiene el panel de la matriz
+	 * @return JPanel
+	 */
+	private JPanel getPanelMatrix() {
+		if(panelMatrix == null)
+			panelMatrix = new JPanel();
+		return panelMatrix;
+	}
+
+	/**
+	 * Obtiene el panel que contiene el selector de lado
+	 * @return JPanel
+	 */
+	private JPanel getPanelSelector() {
+		if(panelSelector == null) {
+			panelSelector = new JPanel();
+		}
+		return panelSelector;
+	}
+
+	/**
+	 * Obtiene el selector de lado
+	 * @return JComboBox
+	 */
+	private JComboBox getSelector() {
+		if(selector == null) {
+			selector = new JComboBox(new String[]{"3", "5"});
+			selector.setSelectedIndex(1);
+			selector.addActionListener(this);
+		}
+		return selector;
+	}
+
+	/**
+	 * Obtiene el selector de lado
+	 * @return JComboBox
+	 */
+	private JFormattedTextField getDivisor() {
+		if(divisor == null) {
+			NumberFormat doubleDisplayFormat = NumberFormat.getNumberInstance();
+			doubleDisplayFormat.setMinimumFractionDigits(0);
+			NumberFormat doubleEditFormat = NumberFormat.getNumberInstance();
+			divisor = new JFormattedTextField(new DefaultFormatterFactory(
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleDisplayFormat),
+					new NumberFormatter(doubleEditFormat)));
+			divisor.setBackground(Color.white);
+			divisor.setValue(new Double(0));
+			divisor.setColumns(3);
+		}
+		return divisor;
+	}
+
+	/**
+	 * Convierte la matrix de JTextField en un objeto de tipo Kernel
+	 * @return Kernel
+	 */
+	public Kernel getKernel() {
+		double[][] values = null;
+		if(((String)selector.getSelectedItem()).equals("3")) {
+			values = new double[matrix.length - 2][matrix[0].length - 2];
+			for (int i = 1; i < matrix.length - 1; i++)
+				for (int j = 1; j < matrix[0].length - 1; j++)
+					values[i - 1][j - 1] = new Double(matrix[i][j].getText()).doubleValue();
+
+		}
+		if(((String)selector.getSelectedItem()).equals("5")) {
+			values = new double[matrix.length][matrix[0].length];
+			for (int i = 0; i < matrix.length; i++)
+				for (int j = 0; j < matrix[0].length; j++)
+					values[i][j] = new Double(matrix[i][j].getText()).doubleValue();
+		}
+		double value = ((Number)divisor.getValue()).doubleValue();
+		if(value != 0)
+			kernel = new Kernel(values, value);
+		else
+			kernel = new Kernel(values);
+		return kernel;
+	}
+
+	/**
+	 * Eventos lanzados por el bot�n de test y el combo de selecci�n de
+	 * lados del kernel.
+	 */
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource().equals(getSelector())) {
+			if(((String)selector.getSelectedItem()).equals("3")) {
+				for (int i = 0; i < matrix.length; i++) {
+					for (int j = 0; j < matrix[0].length; j++) {
+						if(i == 0 || i == (matrix.length - 1) || j == 0 || j == (matrix[0].length - 1))
+							matrix[i][j].setVisible(false);
+						else
+							matrix[i][j].setVisible(true);
+					}
+				}
+			}
+			if(((String)selector.getSelectedItem()).equals("5")) {
+				for (int i = 0; i < matrix.length; i++)
+					for (int j = 0; j < matrix[0].length; j++)
+						matrix[i][j].setVisible(true);
+			}
+		}
+
+		//Si es el bot�n de test cargamos el objeto Params y llamamos al listener.
+		if(e.getSource().equals(getButtonTest())) {
+			callStateChanged();
+		}
+	}
+
+	/**
+	 * Sobrecargamos el m�todo getParams para que siempre devuelva
+	 * algo.
+	 */
+	public Params getParams() {
+		Params params = null;
+		if(loadedParams != null) {
+			params = loadedParams;
+			loadedParams = null;
+			return params;
+		}
+		
+		params = new ParamsImpl();
+		defaultRegistrableListener.setParams(params);
+		
+		int lado = 0;
+		if(((String)selector.getSelectedItem()).equals("5"))
+			lado = 1;
+		params.setParam("LadoVentana",
+				new Integer(lado),
+				Params.CHOICE,
+				new String[] {"3","5","7"});
+		params.setParam("Kernel",
+				getKernel(),
+				Params.CHOICE,
+				null);
+		params.setParam("FilterName",
+				"personalizado",
+				-1,
+				null);
+		return params;
+	}
+	
+	public void setParams(Params params) {
+		this.loadedParams = params;
+	}
+
+	/**
+	 * Cuando un elemento de la matriz tiene el foco se salva el valor
+	 * que hay dentro.
+	 */
+	public void focusGained(FocusEvent e) {
+		if(e.getSource() instanceof JTextField) {
+			try {
+				lastValue = Double.parseDouble(((JTextField)e.getSource()).getText());
+			} catch (NumberFormatException ex) {
+				lastValue = 0;
+				((JTextField)e.getSource()).setText("0");
+			}
+		}
+	}
+
+	/**
+	 * Cuando un elemento de la matriz pierde el foco se comprueba
+	 * que el nuevo elemento sea double. Si no lo es se restaura el antiguo valor.
+	 */
+	public void focusLost(FocusEvent e) {
+		if(e.getSource() instanceof JTextField) {
+			try {
+				Double.parseDouble(((JTextField)e.getSource()).getText());
+			} catch (NumberFormatException ex) {
+				if(lastValue == (int)lastValue)
+					((JTextField)e.getSource()).setText(((int)lastValue) + "");
+				else
+					((JTextField)e.getSource()).setText(lastValue + "");
+			}
+		}
+	}
+
+	public void addFilterUIListener(FilterUIListener listener) {
+		defaultRegistrableListener.addFilterUIListener(listener);
+	}
+
+	public void callStateChanged() {
+		defaultRegistrableListener.callStateChanged();
+	}
+
+	public void removeStateChangedListener(FilterUIListener listener) {
+		defaultRegistrableListener.removeStateChangedListener(listener);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/convolution/ConvolutionUI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRegistrableFilterListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRegistrableFilterListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRegistrableFilterListener.java	(revision 15423)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter;
+
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.Iterator;
+
+import javax.swing.JPanel;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.grid.FilterUIListener;
+
+/**
+ * Clase de la que deben heredar todos los paneles para filtros 
+ * definidos por el usuario. Tiene los m�todos para el registro de listeners
+ * 
+ * 28/09/2007
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class DefaultRegistrableFilterListener extends JPanel {
+	private static final long           serialVersionUID       = 5528469123516861351L;
+	private ArrayList<FilterUIListener>          
+	                                    actionCommandListeners = new ArrayList<FilterUIListener>();
+	protected Params                    params                 = null;
+	
+	/**
+	 * Borrar el disparador de eventos de los botones.
+	 * @param listener
+	 */
+	public void removeStateChangedListener(FilterUIListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	
+	/**
+	 * 
+	 * Ejecuci�n del m�todo actionValuesCompleted en todos los filtros registrados
+	 */
+	public void callStateChanged() {
+		Iterator<FilterUIListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			FilterUIListener listener = (FilterUIListener) acIterator.next();
+			listener.actionValuesCompleted(new EventObject(this));
+		}
+	}
+	
+	/**
+	 * A�adir el listener para los paneles definidos por el usuario
+	 * @param listener
+	 */
+	public void addFilterUIListener(FilterUIListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+	
+	/**
+	 * Obtiene los par�metros cargados por el panel
+	 * @return
+	 */
+	public Params getParams() {
+		return params;
+	}
+	
+	/**
+	 * Sets the parameters
+	 * @param params
+	 */
+	public void setParams(Params params) {
+		this.params = params;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRegistrableFilterListener.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYFilter.java	(revision 15423)
@@ -0,0 +1,136 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.util.ColorConversion;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.util.DefaultColorConversion;
+/**
+ * <P>
+ * Clase base para el balance de color CMY
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorBalanceCMYFilter extends BaseRasterFilter {
+	public static String[]            names            = new String[] { "colorbalancecmy" };
+	protected ColorConversion         colorConversion  = null;
+	protected int                     out              = Buffer.TYPE_BYTE;
+	protected double                  cyan             = 0;
+	protected double                  magenta          = 0;
+	protected double                  yellow           = 0;
+	protected boolean                 luminosity       = false;
+	
+	protected int                     redBandNumber    = -1;
+	protected int                     greenBandNumber  = -1;
+	protected int                     blueBandNumber   = -1;
+
+	/**
+	 * Constructor
+	 */
+	public ColorBalanceCMYFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		//A este filtro ya llega una imagen RGB con el orden de las bandas correcto 
+		//ColorInterpretation colorInterpretation = getColorInterpretation();
+		redBandNumber = 0;//colorInterpretation.getBand(ColorInterpretation.RED_BAND);
+		greenBandNumber = 1;//colorInterpretation.getBand(ColorInterpretation.GREEN_BAND);
+		blueBandNumber = 2;//colorInterpretation.getBand(ColorInterpretation.BLUE_BAND);
+		
+		if(getInputBuffer().getDataType() != Buffer.TYPE_BYTE) {
+			exec = false;
+			raster = rasterResult;
+			return;
+		}
+		if(params.get("cyan") != null)
+			cyan = ((Double) params.get("cyan")).doubleValue();
+		if(params.get("magenta") != null)
+			magenta = ((Double) params.get("magenta")).doubleValue();
+		if(params.get("yellow") != null)
+			yellow = ((Double) params.get("yellow")).doubleValue();
+		if(params.get("luminosity") != null)
+			luminosity = ((Boolean) params.get("luminosity")).booleanValue();
+		
+		createARGBBufferResult();
+		
+		if(colorConversion == null)
+			colorConversion = new DefaultColorConversion();
+	}
+	
+	public String getGroup() {
+		return "colores";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("cyan",
+				new Double(cyan),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "5", "25"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("magenta",
+				new Double(magenta),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "5", "25"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("yellow",
+				new Double(yellow),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "5", "25"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("luminosity",
+				new Boolean(luminosity),
+				Params.CHECK,
+				null);
+
+		return params;
+	}
+
+	public void post() {
+	
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKFilter.java	(revision 15423)
@@ -0,0 +1,109 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.util.DefaultColorConversion;
+/**
+ * <P>
+ * Clase base para los filtros de conversi�n de RGB a CMYK. La entrada ser� 
+ * siempre un raster de 3 bandas que ser�n tomadas como RGB.
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RGBToCMYKFilter extends BaseRasterFilter {
+	public static String[]            names            = new String[] { "rgbtocmyk" };
+	protected DefaultColorConversion  colorConversion  = null;
+	protected int                     out              = Buffer.TYPE_BYTE;
+	protected int                     redBandNumber       = -1;
+	protected int                     greenBandNumber     = -1;
+	protected int                     blueBandNumber      = -1;
+
+	/**
+	 * Constructor
+	 */
+	public RGBToCMYKFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		out = ((Integer) params.get("outputType")).intValue();
+		
+		//A este filtro ya llega una imagen RGB con el orden de las bandas correcto 
+		//ColorInterpretation colorInterpretation = getColorInterpretation();
+		redBandNumber = 0;//colorInterpretation.getBand(ColorInterpretation.RED_BAND);
+		greenBandNumber = 1;//colorInterpretation.getBand(ColorInterpretation.GREEN_BAND);
+		blueBandNumber = 2;//colorInterpretation.getBand(ColorInterpretation.BLUE_BAND);
+		
+		if(out == Buffer.TYPE_BYTE)
+			createARGBBufferResult();
+		else {
+			createBufferResult(out, 4);
+		}
+			
+		if(colorConversion == null)
+			colorConversion = new DefaultColorConversion();
+	}
+	
+	public String getGroup() {
+		return "colores";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("outputType",
+				new Integer(0),
+				Params.CHOICE,
+				new String[]{ "Byte", "Double"});
+		return params;
+	}
+
+	public void post() {
+	
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBByteFilter.java	(revision 15423)
@@ -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.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.band;
+
+
+/**
+ * Filtro de balance de colores para tipo de datos byte.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorBalanceRGBByteFilter extends ColorBalanceRGBFilter {
+
+	public void process(int col, int line) {
+		byte[] value = new byte[4];
+		value[0] = raster.getElemByte(line, col, redBandNumber);
+		value[1] = raster.getElemByte(line, col, greenBandNumber);
+		value[2] = raster.getElemByte(line, col, blueBandNumber);
+		value[3] = (byte)255;
+		
+		double lum = colorConversion.getLuminosity(value[0] & 0xff, value[1] & 0xff, value[2] & 0xff);
+		value[0] = (byte)Math.min((value[0] & 0xff) + (red >> 1), 255);
+		value[1] = (byte)Math.min((value[1] & 0xff) + (green >> 1), 255);
+		value[2] = (byte)Math.min((value[2] & 0xff) + (blue >> 1), 255);
+		
+		if(luminosity) {
+			double[] hsl = colorConversion.RGBtoHSL(value[0] & 0xff, 
+													value[1] & 0xff, 
+													value[2] & 0xff);
+			hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
+			hsl[1] = (int) (hsl[1] * 255. + 0.5);
+			hsl[2] = (int) (lum * 255. + 0.5);
+			int[] v1 = colorConversion.HSLtoRGB((int)(((int)hsl[0]) & 0xffffffff), 
+												(int)(((int)hsl[1]) & 0xffffffff), 
+												(int)(((int)hsl[2]) & 0xffffffff));
+			byte[] v = new byte[4];
+			for (int band = 0; band < 3; band++)
+				v[band] = (byte)v1[band];
+			v[3] = value[3];
+			rasterResult.setElemByte(line, col, v);
+		} else
+			rasterResult.setElemByte(line, col, value);
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBManager.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor del filtro de balance de color RGB
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorBalanceRGBManager  extends AbstractRasterFilterManager {
+	private static String   ID = "ColorBalanceRGB";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public ColorBalanceRGBManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, ColorBalanceRGBManager.class);
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("colorbalancergb") == 0)
+			return ColorTableFilter.class;
+		return null;
+	}
+
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public ColorBalanceRGBManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de conversi�n de balance de color RGB.
+ * @throws FilterTypeException
+	 */
+	public void addColorBalanceFilter(int red, int green, int blue, boolean luminosity, int[] renderBands) throws FilterTypeException {
+		BaseRasterFilter filter = new ColorBalanceRGBByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			filter.addParam("red", new Integer(red));
+			filter.addParam("green", new Integer(green));
+			filter.addParam("blue", new Integer(blue));
+			filter.addParam("luminosity", new Boolean(luminosity));
+			filter.addParam("renderBands", renderBands);
+			getFilterList().add(filter);
+		}
+
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(ColorBalanceRGBFilter.class);
+		return filters;
+	}
+	
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (ColorBalanceRGBFilter.class.isAssignableFrom(classFilter)) {
+			int red = 0, green = 0, blue = 0;
+			boolean luminosity = false;
+			int[] renderBands = { 0, 1, 2, 3 };
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("alphaBand") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) {
+					renderBands[3] = (Integer)((ParamImpl)params.getParam(i)).getDefaultValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("red"))
+					red = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("green"))
+					green = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("blue"))
+					blue = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("luminosity"))
+					luminosity = ((Boolean) ((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
+			}
+			addColorBalanceFilter(red, green, blue, luminosity, renderBands);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		int[] renderBands = { 0, 1, 2 };
+		String b = ((String) params.getParamById("RenderBands").getDefaultValue());
+		String[] bands = b.split(" "); 
+		renderBands[0] = new Integer(bands[0]).intValue();
+		renderBands[1] = new Integer(bands[1]).intValue();
+		renderBands[2] = new Integer(bands[2]).intValue();
+		Double red = ((Double) params.getParamById("red").getDefaultValue());
+		Double green = ((Double) params.getParamById("green").getDefaultValue());
+		Double blue = ((Double) params.getParamById("blue").getDefaultValue());
+		Double lum = ((Double) params.getParamById("luminosity").getDefaultValue());
+		
+		RasterFilter filter = new ColorBalanceRGBByteFilter();
+		filter.addParam("red", red);
+		filter.addParam("luminosity", lum);
+		filter.addParam("green", green);
+		filter.addParam("blue", blue);
+		filter.addParam("renderBands", renderBands);
+		return filter;
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(ColorBalanceRGBFilter.class, params);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableIntegerFilter.java	(revision 15423)
@@ -0,0 +1,40 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de tabla de color para tipo de datos int.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableIntegerFilter extends ColorTableFilter {
+	public void process(int col, int line) {
+		int value = raster.getElemInt(line, col, 0);
+		byte[] rgba = colorTable.getRGBAByBand((double) (value));
+		rasterResult.setElemByte(line, col, rgba);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableShortFilter.java	(revision 15423)
@@ -0,0 +1,40 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de tabla de color para tipo de datos short.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableShortFilter extends ColorTableFilter {
+	public void process(int col, int line) {
+		double value = (double) raster.getElemShort(line, col, 0);
+		byte[] rgba = colorTable.getRGBAByBand(value);
+		rasterResult.setElemByte(line, col, rgba);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableListManager.java	(revision 15423)
@@ -0,0 +1,294 @@
+/* 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.impl.grid.filter.band;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor del filtro de aplicaci�n de tablas de color sobre un raster.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class ColorTableListManager  extends AbstractRasterFilterManager {
+	private static String   ID = "ColorTable";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public ColorTableListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, ColorTableListManager.class);
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("colortable") == 0)
+			return ColorTableFilter.class;
+		return null;
+	}
+	
+
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public ColorTableListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de tabla de color a la pila de filtros.
+	 * @param ladoVentana
+ * @throws FilterTypeException
+	 */
+	public void addColorTableFilter(ColorTable palette) throws FilterTypeException {
+		BaseRasterFilter filter = new ColorTableByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			filter.addParam("colorTable", palette);
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(ColorTableFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (ColorTableFilter.class.isAssignableFrom(classFilter)) {
+			ColorTable colorTable = null;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("colorTable"))
+					colorTable = (ColorTable) ((ParamImpl)params.getParam(i)).getDefaultValue();
+			}
+			addColorTableFilter(colorTable);
+		}
+	}
+
+	/**
+	 * Devuelve el color si lo encuentra en el arraylist y lo elimina, en caso
+	 * contrario devuelve null
+	 * @param list
+	 * @param value
+	 * @return
+	 */
+	/*private static ColorItem getColorItem(List<ColorItem> list, double value) {
+		for (int i = 0; i < list.size(); i++) {
+			if (((ColorItem) list.get(i)).getValue() == value) {
+				return (ColorItem) list.remove(i);
+			}
+		}
+		return null;
+	}
+
+	public static ColorTable createColorTableFromArray(List<String> lines) {
+		String pkgBase = "filter.colortable.";
+		List<String> linesCloned = null;
+		
+		if(lines instanceof ArrayList) {
+			linesCloned = (List<String>)((ArrayList<?>) lines).clone();
+		} else {
+			linesCloned = new ArrayList<String>();
+			for (int i = 0; i < lines.size(); i++) {
+				linesCloned.add(lines.get(i));
+			}
+		}
+
+		String paletteName = "";
+		int color = 0;
+		int alpha = 0;
+		List<ColorItem> rows = new ArrayList<ColorItem>();
+
+		ColorItem colorItem = new ColorItemImpl();
+		boolean interpolated = false;
+
+		while (linesCloned.size() > 0) {
+			String elem = (String) linesCloned.get(0);
+
+			if (!elem.startsWith(pkgBase)) {
+				linesCloned.remove(0);
+				continue;
+			}
+
+			if (elem.startsWith(pkgBase + "name"))
+				paletteName = RasterFilterListManagerImpl.getValue(elem);
+
+			if (elem.startsWith(pkgBase + "interpolated"))
+				interpolated = Boolean.parseBoolean(RasterFilterListManagerImpl.getValue(elem));
+
+			if (elem.startsWith(pkgBase + "color" + color)) {
+				if (elem.startsWith(pkgBase + "color" + color + ".value"))
+					colorItem.setValue(Double.parseDouble(RasterFilterListManagerImpl.getValue(elem)));
+				if (elem.startsWith(pkgBase + "color" + color + ".name"))
+					colorItem.setNameClass(RasterFilterListManagerImpl.getValue(elem));
+				if (elem.startsWith(pkgBase + "color" + color + ".rgb")) {
+
+					String rgb = RasterFilterListManagerImpl.getValue(elem);
+					int r = Integer.valueOf(rgb.substring(0, rgb.indexOf(","))).intValue();
+					int g = Integer.valueOf(rgb.substring(rgb.indexOf(",") + 1, rgb.lastIndexOf(","))).intValue();
+					int b = Integer.valueOf(rgb.substring(rgb.lastIndexOf(",") + 1, rgb.length())).intValue();
+
+					colorItem.setColor(new Color(r, g, b));
+				}
+				if (elem.startsWith(pkgBase + "color" + color + ".interpolated"))
+					colorItem.setInterpolated(Double.parseDouble(RasterFilterListManagerImpl.getValue(elem)));
+
+				if ((linesCloned.size() <= 1) || (!((String) linesCloned.get(1)).startsWith(pkgBase + "color" + color))) {
+					rows.add(colorItem);
+					color++;
+					colorItem = new ColorItemImpl();
+				}
+			}
+
+			if (elem.startsWith(pkgBase + "alpha" + alpha)) {
+				if (elem.startsWith(pkgBase + "alpha" + alpha + ".value")) {
+					ColorItem aux = getColorItem(rows, Double.parseDouble(RasterFilterListManagerImpl.getValue(elem)));
+					if (aux != null) {
+						colorItem = aux;
+						colorItem.setNameClass(aux.getNameClass());
+						colorItem.setInterpolated(aux.getInterpolated());
+						colorItem.setColor(new Color(aux.getColor().getRed(), aux.getColor().getGreen(), aux.getColor().getBlue(), colorItem.getColor().getAlpha()));
+					}
+
+					colorItem.setValue(Double.parseDouble(RasterFilterListManagerImpl.getValue(elem)));
+				}
+				if (elem.startsWith(pkgBase + "alpha" + alpha + ".a")) {
+					Color c = colorItem.getColor();
+					colorItem.setColor(new Color(c.getRed(), c.getGreen(), c.getBlue(),Integer.parseInt(RasterFilterListManagerImpl.getValue(elem))));
+				}
+				if (elem.startsWith(pkgBase + "alpha" + alpha + ".interpolated"))
+					colorItem.setInterpolated(Double.parseDouble(RasterFilterListManagerImpl.getValue(elem)));
+
+				if ((linesCloned.size() <= 1) || (!((String) linesCloned.get(1)).startsWith(pkgBase + "alpha" + alpha))) {
+					rows.add(colorItem);
+					alpha++;
+					colorItem = new ColorItemImpl();
+				}
+			}
+
+			linesCloned.remove(0);
+		}
+
+		ColorTable colorTable = new DataStoreColorTable();
+
+		colorTable = new DataStoreColorTable();
+		colorTable.setName(paletteName);
+		colorTable.createPaletteFromColorItems(rows, false);
+		colorTable.setInterpolated(interpolated);
+
+		return colorTable;
+	}
+
+	public int createFilterListFromStrings(List<String> filters, String fil, int filteri) throws FilterTypeException {
+		String pkgBase = "filter.colortable.";
+		if (fil.startsWith(pkgBase + "active")) {
+			boolean exec = true;
+			if ((RasterFilterListManagerImpl.getValue(fil).equals("false")))
+				exec = false;
+			filters.remove(0);
+
+			ColorTable colorTable = createColorTableFromArray(filters);
+
+			getFilterList().remove(ColorTableFilter.class);
+			addColorTableFilter(new DataStoreColorTable(colorTable));
+
+			ColorTableFilter ct = (ColorTableFilter) getFilterList().getFilterByBaseClass(ColorTableFilter.class);
+			ct.setExec(exec);
+		}
+		return filteri;
+	}
+
+	public List<String> getStringsFromFilterList(List<String> filterList, RasterFilter rf) {
+		if (rf instanceof ColorTableFilter) {
+			String pkgBase = "filter.colortable.";
+			ColorTableFilter colorTableFilter = (ColorTableFilter) rf;
+			ColorTable colorTable = (ColorTable) colorTableFilter.getParam("colorTable");
+			if (colorTable != null) {
+				if (colorTableFilter.isExec())
+					filterList.add(pkgBase + "active=true");
+				else
+					filterList.add(pkgBase + "active=false");
+
+				filterList.add(pkgBase + "name=" + colorTable.getName());
+				filterList.add(pkgBase + "interpolated=" + colorTable.isInterpolated());
+
+				for (int i = 0; i < colorTable.getColorItems().size(); i++) {
+					ColorItem colorItem = (ColorItem) colorTable.getColorItems().get(i);
+					filterList.add(pkgBase + "color" + i + ".value=" + colorItem.getValue());
+					filterList.add(pkgBase + "color" + i + ".name=" + colorItem.getNameClass());
+					Color c = colorItem.getColor();
+					filterList.add(pkgBase + "color" + i + ".rgb=" + c.getRed() + "," + c.getGreen() + "," + c.getBlue());
+					filterList.add(pkgBase + "color" + i + ".interpolated=" + colorItem.getInterpolated());
+				}
+
+				for (int i = 0; i < colorTable.getColorItems().size(); i++) {
+					ColorItem colorItem = (ColorItem) colorTable.getColorItems().get(i);
+					filterList.add(pkgBase + "alpha" + i + ".value=" + colorItem.getValue());
+					Color c = colorItem.getColor();
+					filterList.add(pkgBase + "alpha" + i + ".a=" + c.getAlpha());
+					filterList.add(pkgBase + "alpha" + i + ".interpolated=" + colorItem.getInterpolated());
+				}
+			}
+		}
+		return filterList;
+	}*/
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(ColorTableFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		ColorTable colorTable = ((ColorTable) params.getParamById("colorTable").getDefaultValue());
+		
+		RasterFilter filter = new ColorTableByteFilter();
+		filter.addParam("colorTable", colorTable);
+		return filter;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/package.html	(revision 15423)
@@ -0,0 +1,5 @@
+<html>
+	<body>
+		Parte de la arquitectura de filtros que tiene que ver con el manejo bandas de raster.
+	</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaByteFilter.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+
+/**
+ * Filtro de balance de Tono, Salturaci�n y Luminosidad
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ToLumSaByteFilter extends ToLumSaFilter {
+	public void process(int col, int line) {
+		byte[] value = new byte[4];
+		value[0] = raster.getElemByte(line, col, redBandNumber);
+		value[1] = raster.getElemByte(line, col, greenBandNumber);
+		value[2] = raster.getElemByte(line, col, blueBandNumber);
+		value[3] = (byte)255;
+		
+		double[] hsl = colorConversion.RGBtoHSL(value[0] & 0xff, value[1] & 0xff, value[2] & 0xff);
+		hsl[0] = ((hsl[0] + hue) % 360);
+		hsl[1] = Math.max(Math.min(hsl[1] + (saturation / 100.0), 1D), 0.001);
+		hsl[2] = Math.max(Math.min(hsl[2] + (luminosity / 100.0), 1D), 0);
+		int[] rgb = colorConversion.HSLtoRGB(hsl[0], hsl[1], hsl[2]);
+		for (int band = 0; band < 3; band++)
+			value[band] = (byte)(rgb[band]);
+		rasterResult.setElemByte(line, col, value);
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLByteFilter.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+
+/**
+ * Filtro de conversi�n de datos RGB a HSL para tipo de datos byte.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RGBToHSLByteFilter extends RGBToHSLFilter {
+	public void process(int col, int line) {
+		byte[] value = new byte[4];
+		value[0] = raster.getElemByte(line, col, redBandNumber);
+		value[1] = raster.getElemByte(line, col, greenBandNumber);
+		value[2] = raster.getElemByte(line, col, blueBandNumber);
+		value[3] = (byte)255;
+
+		
+		double[] hsl = colorConversion.RGBtoHSL(value[0] & 0xff, value[1] & 0xff, value[2] & 0xff);
+		if(out == Buffer.TYPE_BYTE) {
+			hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
+			hsl[2] = (int) (hsl[2] * 255. + 0.5);
+			hsl[1] = (int) (hsl[1] * 255. + 0.5);
+			
+			for (int band = 0; band < 3; band++)
+				value[band] = (byte)(((byte)hsl[band]) & 0xff);
+			rasterResult.setElemByte(line, col, value);
+		} else if(out == Buffer.TYPE_DOUBLE) 
+			rasterResult.setElemDouble(line, col, hsl);
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBByteFilter.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+
+/**
+ * Filtro de conversi�n de datos RGB a HSL para tipo de datos byte.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class HSLToRGBByteFilter extends HSLToRGBFilter {
+	public void process(int col, int line) {
+		byte[] value = new byte[4];
+		value[0] = raster.getElemByte(line, col, redBandNumber);
+		value[1] = raster.getElemByte(line, col, greenBandNumber);
+		value[2] = raster.getElemByte(line, col, blueBandNumber);
+		value[3] = (byte)255;
+		
+		int[] rgb = colorConversion.HSLtoRGB((value[0] & 0xff), (value[1] & 0xff), (value[2] & 0xff));
+		for (int band = 0; band < 3; band++)
+			value[band] = (byte)(((byte)rgb[band]) & 0xff);
+		rasterResult.setElemByte(line, col, value);
+		writeAlphaBand(line, col);
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaManager.java	(revision 15423)
@@ -0,0 +1,158 @@
+/* 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.impl.grid.filter.band;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor del filtro de Tono, Saturaci�n y Brillo
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ToLumSaManager extends AbstractRasterFilterManager {
+	private static String   ID = "ToLumSa";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public ToLumSaManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, ToLumSaManager.class);
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("tolumsa") == 0)
+			return ToLumSaFilter.class;
+		return null;
+	}
+
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public ToLumSaManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de control de Tono, Saturaci�n y Brillo a la lista de filtros.
+ * @throws FilterTypeException
+	 */
+	public void addToLumSaFilter(double hue, double luminosity, double saturation, int[] renderBands) throws FilterTypeException {
+		BaseRasterFilter filter = new ToLumSaByteFilter();
+
+		// Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+		if (filter != null) {
+			filter.addParam("hue", new Double(hue));
+			filter.addParam("luminosity", new Double(luminosity));
+			filter.addParam("saturation", new Double(saturation));
+			filter.addParam("renderBands", renderBands);
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(ToLumSaFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (ToLumSaFilter.class.isAssignableFrom(classFilter)) {
+			double hue = 0, saturation = 0, luminosity = 0;
+			int[] renderBands = { 0, 1, 2, 3 };
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("alphaBand") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) {
+					renderBands[3] = (Integer)((ParamImpl)params.getParam(i)).getDefaultValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("hue"))
+					hue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("saturation"))
+					saturation = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("luminosity"))
+					luminosity = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+
+			}
+			addToLumSaFilter(hue, luminosity, saturation, renderBands);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(ToLumSaFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		int[] renderBands = { 0, 1, 2 };
+		String b = ((String) params.getParamById("RenderBands").getDefaultValue());
+		String[] bands = b.split(" "); 
+		renderBands[0] = new Integer(bands[0]).intValue();
+		renderBands[1] = new Integer(bands[1]).intValue();
+		renderBands[2] = new Integer(bands[2]).intValue();
+		Double hue = ((Double) params.getParamById("hue").getDefaultValue());
+		Double sat = ((Double) params.getParamById("saturation").getDefaultValue());
+		Double lum = ((Double) params.getParamById("luminosity").getDefaultValue());
+		
+		RasterFilter filter = new ToLumSaByteFilter();
+		filter.addParam("hue", hue);
+		filter.addParam("luminosity", lum);
+		filter.addParam("saturation", sat);
+		filter.addParam("renderBands", renderBands);
+		return filter;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLManager.java	(revision 15423)
@@ -0,0 +1,153 @@
+/* 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.impl.grid.filter.band;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor del filtro de conversi�n de RGB a HSL.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RGBToHSLManager  extends AbstractRasterFilterManager {
+	private static String   ID = "RGBToHSL";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public RGBToHSLManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, RGBToHSLManager.class);
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("rgbtohsl") == 0)
+			return RGBToHSLFilter.class;
+		return null;
+	}
+
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public RGBToHSLManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de conversi�n de RGB a HSL a la pila de filtros.
+ * @throws FilterTypeException
+	 */
+	public void addRGBToHSLFilter(int outputType, int[] renderBands) throws FilterTypeException {
+		BaseRasterFilter filter = new RGBToHSLByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			filter.addParam("outputType", new Integer(outputType));
+			filter.addParam("renderBands", renderBands);
+			getFilterList().add(filter);
+		}
+
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(RGBToHSLFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (RGBToHSLFilter.class.isAssignableFrom(classFilter)) {
+			int[] renderBands = { 0, 1, 2, 3 };
+			int out = Buffer.TYPE_BYTE;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("alphaBand") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) {
+					renderBands[3] = (Integer)((ParamImpl)params.getParam(i)).getDefaultValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("outputType")) {
+					int value = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+					if(value == 0)
+						out = Buffer.TYPE_BYTE;
+					if(value == 1)
+						out = Buffer.TYPE_DOUBLE;
+				}
+			}
+			addRGBToHSLFilter(out, renderBands);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		int[] renderBands = { 0, 1, 2 };
+		String b = ((String) params.getParamById("RenderBands").getDefaultValue());
+		String[] bands = b.split(" "); 
+		renderBands[0] = new Integer(bands[0]).intValue();
+		renderBands[1] = new Integer(bands[1]).intValue();
+		renderBands[2] = new Integer(bands[2]).intValue();
+		Integer outputType = ((Integer) params.getParamById("outputType").getDefaultValue());
+		
+		RasterFilter filter = new RGBToHSLByteFilter();
+		filter.addParam("outputType", outputType);
+		filter.addParam("renderBands", renderBands);
+		return filter;
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(RGBToHSLFilter.class, params);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBManager.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor del filtro de conversi�n de HSL a RGB.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class HSLToRGBManager  extends AbstractRasterFilterManager {
+	private static String   ID = "HSLToRGB";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public HSLToRGBManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, HSLToRGBManager.class);
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("hsltorgb") == 0)
+			return HSLToRGBFilter.class;
+		return null;
+	}
+	
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public HSLToRGBManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de conversi�n de RGB a HSL a la pila de filtros.
+ * @throws FilterTypeException
+	 */
+	public void addHSLToRGBFilter(int[] renderBands) throws FilterTypeException {
+		BaseRasterFilter filter = new HSLToRGBByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			getFilterList().add(filter);
+			filter.addParam("renderBands", renderBands);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(HSLToRGBFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (HSLToRGBFilter.class.isAssignableFrom(classFilter)) {
+			int[] renderBands = { 0, 1, 2, 3 };
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("alphaBand") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) {
+					renderBands[3] = (Integer)((ParamImpl)params.getParam(i)).getDefaultValue();
+					continue;
+				}
+			}
+			addHSLToRGBFilter(renderBands);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(HSLToRGBFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		int[] renderBands = { 0, 1, 2 };
+		String b = ((String) params.getParamById("RenderBands").getDefaultValue());
+		String[] bands = b.split(" "); 
+		renderBands[0] = new Integer(bands[0]).intValue();
+		renderBands[1] = new Integer(bands[1]).intValue();
+		renderBands[2] = new Integer(bands[2]).intValue();
+		
+		RasterFilter filter = new HSLToRGBByteFilter();
+		filter.addParam("renderBands", renderBands);
+		return filter;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableByteFilter.java	(revision 15423)
@@ -0,0 +1,40 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de tabla de color para tipo de datos byte.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableByteFilter extends ColorTableFilter {
+	public void process(int col, int line) {
+		byte value = raster.getElemByte(line, col, 0);
+		byte[] rgba = colorTable.getRGBAByBand((double) (value & 0x000000ff));
+		rasterResult.setElemByte(line, col, rgba);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFloatFilter.java	(revision 15423)
@@ -0,0 +1,40 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de tabla de color para tipo de datos float.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableFloatFilter extends ColorTableFilter {
+	public void process(int col, int line) {
+		double value = (double) raster.getElemFloat(line, col, 0);
+		byte[] rgba = colorTable.getRGBAByBand(value);
+		rasterResult.setElemByte(line, col, rgba);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBFilter.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.util.DefaultColorConversion;
+/**
+ * <P>
+ * Clase base para los filtros de balance de color RGB
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorBalanceRGBFilter extends BaseRasterFilter {
+	public static String[]            names               = new String[] { "colorbalancergb" };
+	protected DefaultColorConversion  colorConversion     = null;
+	protected int                     out                 = Buffer.TYPE_BYTE;
+	protected int                     red                 = 0;
+	protected int                     green               = 0;
+	protected int                     blue                = 0;
+	protected boolean                 luminosity          = false;
+	protected int                     redBandNumber       = -1;
+	protected int                     greenBandNumber     = -1;
+	protected int                     blueBandNumber      = -1;
+
+	/**
+	 * Constructor
+	 */
+	public ColorBalanceRGBFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		//A este filtro ya llega una imagen RGB con el orden de las bandas correcto 
+		//ColorInterpretation colorInterpretation = getColorInterpretation();
+		redBandNumber = 0;//colorInterpretation.getBand(ColorInterpretation.RED_BAND);
+		greenBandNumber = 1;//colorInterpretation.getBand(ColorInterpretation.GREEN_BAND);
+		blueBandNumber = 2;//colorInterpretation.getBand(ColorInterpretation.BLUE_BAND);
+		
+		if(raster.getDataType() != Buffer.TYPE_BYTE) {
+			exec = false;
+			raster = rasterResult;
+			return;
+		}
+		if(params.get("red") != null)
+			red = ((Integer) params.get("red")).intValue();
+		if(params.get("green") != null)
+			green = ((Integer) params.get("green")).intValue();
+		if(params.get("blue") != null)
+			blue = ((Integer) params.get("blue")).intValue();
+		if(params.get("luminosity") != null)
+			luminosity = ((Boolean) params.get("luminosity")).booleanValue();
+		
+		createARGBBufferResult();
+		if(colorConversion == null)
+			colorConversion = new DefaultColorConversion();
+	}
+	
+	public String getGroup() {
+		return "colores";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("red",
+				new Integer(red),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "5", "25"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("green",
+				new Integer(green),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "5", "25"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("blue",
+				new Integer(blue),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "5", "25"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("luminosity",
+				new Boolean(luminosity),
+				Params.CHECK,
+				null);
+
+		return params;
+	}
+
+	public void post() {
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceRGBFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableDoubleFilter.java	(revision 15423)
@@ -0,0 +1,40 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de tabla de color para tipo de datos double.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableDoubleFilter extends ColorTableFilter {
+	public void process(int col, int line) {
+		double value = raster.getElemDouble(line, col, 0);
+		byte[] rgba = colorTable.getRGBAByBand(value);
+		rasterResult.setElemByte(line, col, rgba);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYByteFilter.java	(revision 15423)
@@ -0,0 +1,68 @@
+/* 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.impl.grid.filter.band;
+
+
+/**
+ * Filtro de balance de colores para tipo de datos byte.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorBalanceCMYByteFilter extends ColorBalanceCMYFilter {
+
+	public void process(int col, int line) {
+		byte[] value = new byte[4];
+		value[0] = raster.getElemByte(line, col, redBandNumber);
+		value[1] = raster.getElemByte(line, col, greenBandNumber);
+		value[2] = raster.getElemByte(line, col, blueBandNumber);
+		value[3] = (byte)255;
+		
+		double[] cmyk = colorConversion.RGBtoCMYK(value[0] & 0xff, value[1] & 0xff, value[2] & 0xff, 1);
+		double lum = colorConversion.getLuminosity(value[0] & 0xff, value[1] & 0xff, value[2] & 0xff);
+		cmyk[0] = Math.min(cmyk[0] + (cyan / 300.0), 1D);
+		cmyk[1] = Math.min(cmyk[1] + (magenta / 300.0), 1D);
+		cmyk[2] = Math.min(cmyk[2] + (yellow / 300.0), 1D);
+		double[] rgb = colorConversion.CMYKtoRGB(cmyk[0], cmyk[1], cmyk[2], cmyk[3]);
+		for (int band = 0; band < 3; band++)
+			value[band] = (byte)(rgb[band] * 255);
+		
+		if(luminosity) {
+			double[] hsl = colorConversion.RGBtoHSL(value[0] & 0xff, 
+													value[1] & 0xff, 
+													value[2] & 0xff);
+			hsl[0] = (int)(255.0 * hsl[0] / 360.0 + 0.5);
+			hsl[1] = (int) (hsl[1] * 255. + 0.5);
+			hsl[2] = (int) (lum * 255. + 0.5);
+			int[] v1 = colorConversion.HSLtoRGB((int)(((int)hsl[0]) & 0xffffffff), 
+												(int)(((int)hsl[1]) & 0xffffffff), 
+												(int)(((int)hsl[2]) & 0xffffffff));
+			byte[] v = new byte[4];
+			for (int band = 0; band < 3; band++)
+				v[band] = (byte)v1[band];
+			v[3] = value[3];
+			getOutputBuffer().setElemByte(line, col, v);
+		} else
+			getOutputBuffer().setElemByte(line, col, value);
+		
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYManager.java	(revision 15423)
@@ -0,0 +1,166 @@
+/* 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.impl.grid.filter.band;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.grid.filter.correction.MedianByteFilter;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor del filtro de balance de color
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorBalanceCMYManager extends AbstractRasterFilterManager {
+	private static String   ID = "ColorBalanceCMY";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public ColorBalanceCMYManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, ColorBalanceCMYManager.class);
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("colorbalancecmy") == 0)
+			return ColorBalanceCMYFilter.class;
+		return null;
+	}
+
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public ColorBalanceCMYManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de conversi�n de RGB a CMYK a la pila de filtros.
+ * @throws FilterTypeException
+	 */
+	public void addColorBalanceFilter(double cyan, double magenta, double yellow, boolean luminosity, int[] renderBands) throws FilterTypeException {
+		RasterFilter filter = new ColorBalanceCMYByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			filter.addParam("cyan", new Double(cyan));
+			filter.addParam("magenta", new Double(magenta));
+			filter.addParam("yellow", new Double(yellow));
+			filter.addParam("luminosity", new Boolean(luminosity));
+			filter.addParam("renderBands", renderBands);
+			getFilterList().add(filter);
+		}
+
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(ColorBalanceCMYFilter.class);
+		return filters;
+	}
+	
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (ColorBalanceCMYFilter.class.isAssignableFrom(classFilter)) {
+			double cyan = 0, magenta = 0, yellow = 0;
+			boolean luminosity = false;
+			int[] renderBands = { 0, 1, 2, 3 };
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("alphaBand") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) {
+					renderBands[3] = (Integer)((ParamImpl)params.getParam(i)).getDefaultValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("cyan"))
+					cyan = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("magenta"))
+					magenta = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("yellow"))
+					yellow = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("luminosity"))
+					luminosity = ((Boolean) ((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
+
+			}
+			addColorBalanceFilter(cyan, magenta, yellow, luminosity, renderBands);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		int[] renderBands = { 0, 1, 2 };
+		String b = ((String) params.getParamById("RenderBands").getDefaultValue());
+		String[] bands = b.split(" "); 
+		renderBands[0] = new Integer(bands[0]).intValue();
+		renderBands[1] = new Integer(bands[1]).intValue();
+		renderBands[2] = new Integer(bands[2]).intValue();
+		Double cyan = ((Double) params.getParamById("cyan").getDefaultValue());
+		Double magenta = ((Double) params.getParamById("magenta").getDefaultValue());
+		Double yellow = ((Double) params.getParamById("yellow").getDefaultValue());
+		Double lum = ((Double) params.getParamById("luminosity").getDefaultValue());
+		
+		RasterFilter filter = new MedianByteFilter();
+		filter.addParam("cyan", cyan);
+		filter.addParam("luminosity", lum);
+		filter.addParam("magenta", magenta);
+		filter.addParam("yellow", yellow);
+		filter.addParam("renderBands", renderBands);
+		return filter;
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(ColorBalanceCMYFilter.class, params);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorBalanceCMYManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBFilter.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.util.DefaultColorConversion;
+/**
+ * <P>
+ * Clase base para los filtros de conversi�n de HSL a RGB. La entrada ser� 
+ * siempre un raster de 3 bandas que ser�n tomadas como HSL.
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class HSLToRGBFilter extends BaseRasterFilter {
+	public static String[]            names               = new String[] { "hsltorgb" };
+	protected DefaultColorConversion  colorConversion     = null;
+	protected int                     redBandNumber       = -1;
+	protected int                     greenBandNumber     = -1;
+	protected int                     blueBandNumber      = -1;
+
+	/**
+	 * Constructor
+	 */
+	public HSLToRGBFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		//A este filtro ya llega una imagen RGB con el orden de las bandas correcto 
+		//ColorInterpretation colorInterpretation = getColorInterpretation();
+		redBandNumber = 0;//colorInterpretation.getBand(ColorInterpretation.RED_BAND);
+		greenBandNumber = 1;//colorInterpretation.getBand(ColorInterpretation.GREEN_BAND);
+		blueBandNumber = 2;//colorInterpretation.getBand(ColorInterpretation.BLUE_BAND);
+		
+		createARGBBufferResult();
+		if(colorConversion == null)
+			colorConversion = new DefaultColorConversion();
+	}
+
+	public String getGroup() {
+		return "colores";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		return params;
+	}
+
+	public void post() {
+	
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/HSLToRGBFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLFilter.java	(revision 15423)
@@ -0,0 +1,130 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.util.DefaultColorConversion;
+/**
+ * <P>
+ * Clase base para los filtros de conversi�n de RGB a HSL. La entrada ser� 
+ * siempre un raster de 3 bandas que ser�n tomadas como RGB.
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RGBToHSLFilter extends BaseRasterFilter {
+	public static String[]            names               = new String[] { "rgbtohsl" };
+	protected DefaultColorConversion  colorConversion     = null;
+	protected int                     out                 = Buffer.TYPE_BYTE;
+	protected int                     redBandNumber       = -1;
+	protected int                     greenBandNumber     = -1;
+	protected int                     blueBandNumber      = -1;
+
+	/**
+	 * Constructor
+	 */
+	public RGBToHSLFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		out = ((Integer) params.get("outputType")).intValue();
+		
+		//A este filtro ya llega una imagen RGB con el orden de las bandas correcto 
+		//ColorInterpretation colorInterpretation = getColorInterpretation();
+		redBandNumber = 0;//colorInterpretation.getBand(ColorInterpretation.RED_BAND);
+		greenBandNumber = 1;//colorInterpretation.getBand(ColorInterpretation.GREEN_BAND);
+		blueBandNumber = 2;//colorInterpretation.getBand(ColorInterpretation.BLUE_BAND);
+		
+		if(out == Buffer.TYPE_BYTE)
+			createARGBBufferResult();
+		else {
+			createBufferResult(out, 3);
+		}
+			
+		if(colorConversion == null)
+			colorConversion = new DefaultColorConversion();
+	}
+	
+	/**
+	 * Gets the result of this filter
+	 */
+	public Object getResult(String name) {
+		if (name.equals(RESULT_TRANSPARENCY)) {
+			if(super.getResult(RESULT_TRANSPARENCY) == null) {
+				String[] values = new String[rasterResult.getBandCount()];
+				for (int i = 0; i < values.length; i++) {
+					values[i] = ColorInterpretation.UNDEF_BAND;
+				}
+				ColorInterpretation ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(values);
+				transparency.setColorInterpretation(ci);
+				transparency.activeTransparency();
+				return transparency;
+			}
+		}
+		return super.getResult(name);
+	}
+
+	public String getGroup() {
+		return "colores";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("outputType",
+				new Integer(0),
+				Params.CHOICE,
+				new String[]{ "Byte", "Double"});
+		return params;
+	}
+
+	public void post() {
+	
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToHSLFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaFilter.java	(revision 15423)
@@ -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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.util.DefaultColorConversion;
+/**
+ * <P>
+ * Clase base para el filtro de Tono, Saturaci�n y Brillo
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ToLumSaFilter extends BaseRasterFilter {
+	public static String[]            names               = new String[] { "tolumsa" };
+	protected DefaultColorConversion  colorConversion     = null;
+	protected int                     out                 = Buffer.TYPE_BYTE;
+	protected double                  hue                 = 0;
+	protected double                  luminosity          = 0;
+	protected double                  saturation          = 0;
+	protected int                     redBandNumber       = -1;
+	protected int                     greenBandNumber     = -1;
+	protected int                     blueBandNumber      = -1;
+	
+	/**
+	 * Constructor
+	 */
+	public ToLumSaFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		//A este filtro ya llega una imagen RGB con el orden de las bandas correcto 
+		//ColorInterpretation colorInterpretation = getColorInterpretation();
+		redBandNumber = 0;//colorInterpretation.getBand(ColorInterpretation.RED_BAND);
+		greenBandNumber = 1;//colorInterpretation.getBand(ColorInterpretation.GREEN_BAND);
+		blueBandNumber = 2;//colorInterpretation.getBand(ColorInterpretation.BLUE_BAND);
+		
+		if(raster.getDataType() != Buffer.TYPE_BYTE) {
+			exec = false;
+			raster = rasterResult;
+			return;
+		}
+		if(params.get("hue") != null)
+			hue = ((Double) params.get("hue")).doubleValue();
+		if(params.get("luminosity") != null)
+			luminosity = ((Double) params.get("luminosity")).doubleValue();
+		if(params.get("saturation") != null)
+			saturation = ((Double) params.get("saturation")).doubleValue();
+		
+		createARGBBufferResult();
+		
+		if(colorConversion == null)
+			colorConversion = new DefaultColorConversion();
+	}
+
+	public String getGroup() {
+		return "colores";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("hue",
+				new Double(hue),
+				Params.SLIDER,
+				new String[]{ "-180", "180", "0", "10", "50"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("luminosity",
+				new Double(luminosity),
+				Params.SLIDER,
+				new String[]{ "-100", "100", "0", "10", "50"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		params.setParam("saturation",
+				new Double(saturation),
+				Params.SLIDER,
+				new String[]{ "-100", "100", "0", "10", "50"}); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		return params;
+	}
+
+	public void post() {
+	
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ToLumSaFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKByteFilter.java	(revision 15423)
@@ -0,0 +1,51 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+
+/**
+ * Filtro de conversi�n de datos RGB a CMYK para tipo de datos byte.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RGBToCMYKByteFilter extends RGBToCMYKFilter {
+	public void process(int col, int line) {
+		byte[] value = new byte[4];
+		value[0] = raster.getElemByte(line, col, redBandNumber);
+		value[1] = raster.getElemByte(line, col, greenBandNumber);
+		value[2] = raster.getElemByte(line, col, blueBandNumber);
+		value[3] = (byte)255;
+
+		double[] cmyk = colorConversion.RGBtoCMYK(value[0] & 0xff, value[1] & 0xff, value[2] & 0xff, 1);
+		
+		if(out == Buffer.TYPE_BYTE) {
+			double[] rgb = colorConversion.CMYKtoRGB(cmyk[0], cmyk[1], cmyk[2], cmyk[3]);
+			for (int band = 0; band < 3; band++)
+				value[band] = (byte)(rgb[band] * 255);
+			rasterResult.setElemByte(line, col, value);
+		} else if(out == Buffer.TYPE_DOUBLE) 
+			rasterResult.setElemDouble(line, col, cmyk);
+		
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFilter.java	(revision 15423)
@@ -0,0 +1,137 @@
+/* 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.impl.grid.filter.band;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
+/**
+ * <P>
+ * Clase base para los filtros de tabla de color. Siempre gastar� la banda cero
+ * del raster para aplicar el filtro ya que la aplicaci�n de tablas suele tener
+ * sentido solo en raster de una sola banda.
+ * </P>
+ * <P>
+ * La salida siempre es un ARGB.
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableFilter extends BaseRasterFilter {
+	public static String[]          names        = new String[] { "colortable" };
+	protected DataStoreColorTable   colorTable   = new DataStoreColorTable();
+	protected boolean               hasAlpha     = false; 
+
+	/**
+	 * Constructor
+	 */
+	public ColorTableFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		colorTable = ((DataStoreColorTable) params.get("colorTable"));
+		hasAlpha = colorTable.hasAlpha();
+		
+		//El filtro de tabla de color convierte a ARGB a partir de paleta
+		ColorInterpretation ci = RasterLocator.getManager().getDataStructFactory().createColorInterpretation(
+				new String[]{ColorInterpretation.RED_BAND,
+						ColorInterpretation.GREEN_BAND,
+						ColorInterpretation.BLUE_BAND,
+						ColorInterpretation.ALPHA_BAND});
+		if(transparency != null) {
+			transparency.setColorInterpretation(ci);
+		} else {
+			transparency = new DataStoreTransparency(ci);
+		}
+		transparency.activeTransparency();
+		
+		createARGBBufferResult();
+	}
+
+	public String getGroup() {
+		return "radiometrico";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("colorTable",
+				new DataStoreColorTable(colorTable),
+				-1,
+				null);
+		return params;
+	}
+
+	public void post() {
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return false;
+	}
+	
+	public boolean isToConvertToRGB() {
+		return true;
+	}
+
+	/**
+	 * Obtiene la tabla de color que se usar� para la aplicaci�n del filtro
+	 * @return GridPalette
+	 */
+	public ColorTable getColorTable() {
+		if ((colorTable == null) || (colorTable.getColorItems() == null))
+			colorTable = ((DataStoreColorTable) params.get("colorTable"));
+		return colorTable;
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	/**
+	 * Define la tabla de color
+	 * @param colorTable the colorTable to set
+	 */
+	public void setColorTable(ColorTable colorTable) {
+		this.colorTable = (DataStoreColorTable)colorTable;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/ColorTableFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKManager.java	(revision 15423)
@@ -0,0 +1,151 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.band;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor del filtro de conversi�n de RGB a CMYK.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RGBToCMYKManager  extends AbstractRasterFilterManager {
+	private static String   ID = "RGBToCMYK";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public RGBToCMYKManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, RGBToCMYKManager.class);
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("rgbtocmyk") == 0)
+			return RGBToCMYKFilter.class;
+		return null;
+	}
+
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public RGBToCMYKManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	/**
+	 * A�ade un filtro de conversi�n de RGB a CMYK a la pila de filtros.
+	 * @throws FilterTypeException
+	 */
+	public void addRGBToCMYKFilter(int outputType, int[] renderBands) throws FilterTypeException {
+		BaseRasterFilter filter = new RGBToCMYKByteFilter();
+
+		// Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+		if (filter != null) {
+			filter.addParam("outputType", new Integer(outputType));
+			filter.addParam("renderBands", renderBands);
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(RGBToCMYKFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+	int[] renderBands = { 0, 1, 2, 3 };
+		if (RGBToCMYKFilter.class.isAssignableFrom(classFilter)) {
+			int out = Buffer.TYPE_BYTE;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("alphaBand") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) {
+					renderBands[3] = (Integer)((ParamImpl)params.getParam(i)).getDefaultValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("outputType")) {
+					int value = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+					if(value == 0)
+						out = Buffer.TYPE_BYTE;
+					if(value == 1)
+						out = Buffer.TYPE_DOUBLE;
+				}
+			}
+			addRGBToCMYKFilter(out, renderBands);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		int[] renderBands = { 0, 1, 2 };
+		String b = ((String) params.getParamById("RenderBands").getDefaultValue());
+		String[] bands = b.split(" "); 
+		renderBands[0] = new Integer(bands[0]).intValue();
+		renderBands[1] = new Integer(bands[1]).intValue();
+		renderBands[2] = new Integer(bands[2]).intValue();
+		Integer outputType = ((Integer) params.getParamById("outputType").getDefaultValue());
+		
+		RasterFilter filter = new RGBToCMYKByteFilter();
+		filter.addParam("outputType", outputType);
+		filter.addParam("renderBands", renderBands);
+		return filter;
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(RGBToCMYKFilter.class, params);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/band/RGBToCMYKManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFilter.java	(revision 15423)
@@ -0,0 +1,112 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Clase base para los filtros de brillo.
+ *
+ * @author Miguel �ngel Querol Carratal�  
+ */
+public class BrightnessFilter extends BaseRasterFilter {
+	public static String[]	   names           = new String[] {"brightness"};
+
+	/**
+	 * Variable para guardar el incremento de brillo que se va a aplicar
+	 */
+	int incrBrillo = 0;
+
+	/**
+	 * Constructor. Llama al constructor de la clase base y asigna el
+	 * nombre del filtro.
+	 */
+	public BrightnessFilter() {
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		incrBrillo = ((Integer) params.get("incrBrillo")).intValue();
+		createBufferResult(Buffer.TYPE_BYTE, raster.getBandCount());
+	}
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	/**
+	 * Obtiene el incremento de brillo que se est� aplicando
+	 * @return entero que representa el incremento de brillo aplicado.
+	 */
+	public int getBrightnessIncrease() {
+		return this.incrBrillo;
+	}
+
+	public String getGroup() {
+		return "realces";
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("Brightness",
+				new Integer(incrBrillo),
+				Params.SLIDER,
+				new String[]{ "-255", "255", "50", "1", "25" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		return params;
+	}
+
+	public int getInRasterDataType() {
+		//No parece que tenga sentido para im�genes que no sean RGB
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+	public void process(int x, int y) {
+	}
+
+	/**
+	 * Calcula el brillo para un pixel
+	 * @param px
+	 * @return
+	 */
+	protected int calcBrightness(int px) {
+		px += incrBrillo;
+		if (px > 255)
+			px = 255;
+		else if (px < 0)
+			px = 0;
+		return px;
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/package.html	(revision 15423)
@@ -0,0 +1,5 @@
+<html>
+	<body>
+		Filtros de realce de raster.
+	</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/DefaultLinearStretchParams.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/DefaultLinearStretchParams.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/DefaultLinearStretchParams.java	(revision 15423)
@@ -0,0 +1,191 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.Stretch;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.filter.LinearStretchParams;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.datastruct.DefaultStretch;
+/**
+ * Par�metros necesarios para el filtro de realce por tramos. Contiene
+ * informaci�n de cada tramo. Valores m�ximos y m�nimos reales y correspondencia
+ * a RGB de cada tramo.
+ * 
+ * Tambi�n contiene los valores calculados en el preproceso de escala y
+ * desplazamiento para cada banda.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class DefaultLinearStretchParams implements LinearStretchParams {
+	public DefaultStretch             red               = new DefaultStretch();
+	public DefaultStretch             green             = new DefaultStretch();
+	public DefaultStretch             blue              = new DefaultStretch();
+	public boolean                    rgb               = false;
+			
+	public boolean hasTailTrim() {
+		return (red.hasTailTrim() ||
+				green.hasTailTrim() ||
+				blue.hasTailTrim());
+	}
+	
+	public double[] getTailTrimList() {
+		return new double[]{
+				red.tailTrimMin, green.tailTrimMin, blue.tailTrimMin, 
+				red.tailTrimMax, green.tailTrimMax,	blue.tailTrimMax};
+	}
+	
+	public void loadTailTrimValues(Statistics stats) {
+		double[][] result;
+		result = (double[][]) stats.getTailTrimValue(red.tailTrimMin);
+		if (result != null)
+			red.tailTrimValueMin = result[0][0];
+		result = (double[][]) stats.getTailTrimValue(red.tailTrimMax);
+		if (result != null)
+			red.tailTrimValueMax = result[0][1];
+		result = (double[][]) stats.getTailTrimValue(green.tailTrimMin);
+		if (result != null && result.length >= 2)
+			green.tailTrimValueMin = result[1][0];
+		result = (double[][]) stats.getTailTrimValue(green.tailTrimMax);
+		if (result != null && result.length >= 2)
+			green.tailTrimValueMax = result[1][1];
+		result = (double[][]) stats.getTailTrimValue(blue.tailTrimMin);
+		if (result != null && result.length >= 3)
+			blue.tailTrimValueMin = result[2][0];
+		result = (double[][]) stats.getTailTrimValue(blue.tailTrimMax);
+		if (result != null && result.length >= 3)
+			blue.tailTrimValueMax = result[2][1];
+	}
+	
+	public void applyTrimToStretchs() {
+		red.applyTrimToStretchs();
+		green.applyTrimToStretchs();
+		blue.applyTrimToStretchs();
+	}
+	
+	public void calcLinearScaleAndOffset() {
+		red.calcLinearScaleAndOffset();
+		green.calcLinearScaleAndOffset();
+		blue.calcLinearScaleAndOffset();
+	}
+	
+	public void setMaxMin(Statistics stats, int[] renderBands) {
+		if (renderBands[0] > -1)
+			red.setMaxMin(stats, renderBands[0], rgb);
+		if (renderBands[1] > -1)
+			green.setMaxMin(stats, renderBands[1], rgb);
+		if (renderBands[2] > -1)
+			blue.setMaxMin(stats, renderBands[2], rgb);
+	}
+	
+	public void applyRemoveEndsToStretchs(Statistics stats, int[] renderBands) {
+		if (renderBands[0] > -1)
+			red.applyRemoveEndsToStretchs(stats, rgb, renderBands[0]);
+		if (renderBands[1] > -1)
+			green.applyRemoveEndsToStretchs(stats, rgb, renderBands[1]);
+		if (renderBands[2] > -1)
+			blue.applyRemoveEndsToStretchs(stats, rgb, renderBands[2]);
+	}
+	
+	/**
+	 * Obtiene un objeto LinearStretchParams para una aplicaci�n de realce lineal estandar, es decir, el rango
+	 * de datos de salida es 0-255 y con solo un tramo para los datos. 
+	 * @param nBands N�mero de bandas
+	 * @param tailTrim Recorte de colas
+	 * @param stats Estad�sticas
+	 * @return LinearStretchParams
+	 * @throws FileNotOpenException
+	 * @throws RasterDriverException
+	 */
+	public static DefaultLinearStretchParams createStandardParam(int[] renderBands, double tailTrim, Statistics stats, boolean rgb) throws FileNotOpenException, RasterDriverException {
+		DefaultLinearStretchParams leParams = new DefaultLinearStretchParams();
+		leParams.rgb = rgb;
+		try {
+			stats.calculate(RasterLibrary.statisticsScale);
+		} catch (ProcessInterruptedException e) {
+			return null;
+		}
+		if (renderBands[0] >= 0) {
+			if (rgb)
+				leParams.red.stretchIn = new double[] { stats.getMinByteUnsigned()[0], stats.getMaxByteUnsigned()[0] };
+			else
+				leParams.red.stretchIn = new double[] { stats.getMin()[renderBands[0]], stats.getMax()[renderBands[0]] };
+		}
+		leParams.red.stretchOut = new int[] { 0, 255 };
+		leParams.red.tailTrimMin = tailTrim;
+		leParams.red.tailTrimMax = tailTrim;
+		if (renderBands[1] >= 0) {
+			if (rgb)
+				leParams.green.stretchIn = new double[] { stats.getMinByteUnsigned()[0], stats.getMaxByteUnsigned()[0] };
+			else
+				leParams.green.stretchIn = new double[] { stats.getMin()[renderBands[1]], stats.getMax()[renderBands[1]] };
+		}
+		leParams.green.stretchOut = new int[] { 0, 255 };
+		leParams.green.tailTrimMin = tailTrim;
+		leParams.green.tailTrimMax = tailTrim;
+		if (renderBands[2] >= 0) {
+			if (rgb)
+				leParams.blue.stretchIn = new double[] { stats.getMinByteUnsigned()[0], stats.getMaxByteUnsigned()[0] };
+			else
+				leParams.blue.stretchIn = new double[] { stats.getMin()[renderBands[2]], stats.getMax()[renderBands[2]] };
+		}
+		leParams.blue.stretchOut = new int[] { 0, 255 };
+		leParams.blue.tailTrimMin = tailTrim;
+		leParams.blue.tailTrimMax = tailTrim;
+		return leParams;
+	}
+
+	public Stretch getRed() {
+		return red;
+	}
+
+	public void setRed(Stretch red) {
+		this.red = (DefaultStretch)red;
+	}
+
+	public Stretch getGreen() {
+		return green;
+	}
+
+	public void setGreen(Stretch green) {
+		this.green = (DefaultStretch)green;
+	}
+	
+	public Stretch getBlue() {
+		return blue;
+	}
+
+	public void setBlue(Stretch blue) {
+		this.blue = (DefaultStretch)blue;
+	}
+
+	public boolean isRgb() {
+		return rgb;
+	}
+
+	public void setRgb(boolean rgb) {
+		this.rgb = rgb;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/DefaultLinearStretchParams.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleFilter.java	(revision 15423)
@@ -0,0 +1,108 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+/**
+ * <P>
+ * Clase base para los filtros de conversi�n a escala de gris
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GrayScaleFilter extends BaseRasterFilter {
+	public static final int        R                = 0;
+	public static final int        G                = 1;
+	public static final int        B                = 2;
+	public static final int        RGB              = 3;
+	public static final int        GRAY             = 4;
+	public static final int        UNDEFINED        = -1;
+	public static String[]         names            = new String[] { GrayScaleManager.ID };
+	protected int                  type             = UNDEFINED;
+
+	/**
+	 * Constructor
+	 */
+	public GrayScaleFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		type = ((Integer)params.get("typeBand")).intValue();
+		
+		if(type == RGB && raster.getBandCount() < 3)
+			type = R;
+		
+		createARGBBufferResult();
+	}
+	
+	public String getGroup() {
+		return "colores";
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		if(type == UNDEFINED) {
+			if(this.params != null) {
+				Object obj = this.params.get("typeBand");
+				if(obj != null)
+					type = ((Integer)obj).intValue();
+			}
+		}
+		
+		Params params = RasterLocator.getManager().createParams(
+				"typeBand", 
+				new Integer(R), 
+				Params.CHOICE, 
+				new String[]{ "R", "G", "B", "RGB", "GRAY"});
+
+		return params;
+	}
+
+	public void post() {
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public boolean isVisible() {
+		return true;
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastIntegerFilter.java	(revision 15423)
@@ -0,0 +1,39 @@
+/* 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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de contraste para tipo de datos int.
+ * 
+ * @author Miguel �ngel Querol Carratal�  
+ */
+public class ContrastIntegerFilter extends ContrastFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcContrast(raster.getElemInt(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementDoubleFilter.java	(revision 15423)
@@ -0,0 +1,55 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de realce para tipos de datos Double. En el m�todo de proceso 
+ * procesa un solo pixel double. Asigna su valor en relaci�n a los datos calculados
+ * en el m�todo pre() del padre.
+ * 
+ * @deprecated This filter should not be used. Use <code>LinearStretchEnhancementFilter</code> instead
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearEnhancementDoubleFilter extends LinearEnhancementFilter {
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand ++) {
+			double p = raster.getElemDouble(line, col, iBand);
+			/*if(renderBands[iBand] < 0) {
+				rasterResult.setElem(line, col, iBand, (byte)p);
+				continue;
+			}
+			if (p > maxBandValue[renderBands[iBand]])
+				p = (double) maxBandValue[renderBands[iBand]];
+			else if (p < minBandValue[renderBands[iBand]])
+				p = (double) minBandValue[renderBands[iBand]];*/
+			
+			int value = (int)(((int) (( p * scale[iBand]) + offset[iBand])) & 0xff);
+			rasterResult.setElem(line, col, iBand, (byte)value);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastShortFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de contraste para im�genes de 16 bits. En el m�todo de proceso procesa
+ * un solo pixel short. Varia su contraste en relaci�n a los par�metros
+ * asignados en el m�todo pre();
+ * 
+ * @author Miguel �ngel Querol Carratal� 
+ */
+public class ContrastShortFilter extends ContrastFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcContrast((int) raster.getElemShort(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFilter.java	(revision 15423)
@@ -0,0 +1,359 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.datastruct.DefaultStretch;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Clase base para los filtros de realzado lineal. Lee el m�nimo y m�xmo de la
+ * clase Statistic que ser�n calculados por PercentTailTrimFilter o
+ * ComputeMinMaxFilter dependiendo de si est� activado el recorte de colas o no.
+ * En Statistic tambi�n est�n los segundos valores despu�s del m�nimo y m�ximo
+ * que son los que se utilizan con la opci�n eliminar extremos activada. Estos
+ * se usaran en vez del m�nimo y m�ximo cuando la variable removeExtrema est� a
+ * true.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearStretchEnhancementFilter extends BaseRasterFilter {
+	protected double[][]                      scale              = null;
+	protected double[][]                      offset             = null;
+	protected Statistics	                  stats              = null;
+	protected double[]                        minBandValue	     = null;
+	protected double[]                        maxBandValue	     = null;
+	public static String[]                    names              = new String[] {"enhanced_stretch"};
+	private boolean                           removeEnds         = false;
+	protected DefaultLinearStretchParams      stretchs           = null;
+	protected DefaultStretch[]                scaleOffsetList    = null;
+	protected int[]                           renderBands        = null; 
+
+	/**
+	 * Construye un LinearEnhancementFilter
+	 */
+	public LinearStretchEnhancementFilter() {
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		stats = (Statistics)getEnv().get("SrcStatistics");
+		
+		stretchs = (DefaultLinearStretchParams) params.get("stretchs");
+		if (params.get("remove") != null)
+			removeEnds = ((Boolean) params.get("remove")).booleanValue();
+
+		if (stretchs == null)
+			return;
+		
+		try {
+			stats.calculate(RasterLibrary.statisticsScale);
+		} catch (FileNotOpenException e) {
+			exec = false;
+		} catch (RasterDriverException e) {
+			exec = false;
+		} catch (ProcessInterruptedException e) {
+			exec = false;
+		}
+
+		if (raster.getDataType() != Buffer.TYPE_BYTE)
+			stretchs.rgb = false;
+		
+		ColorInterpretation outputColorInterp = getColorInterpretation();
+		renderBands = outputColorInterp.buildRenderBands();
+		
+		stretchs.setMaxMin(stats, renderBands);
+
+		if (removeEnds)
+			stretchs.applyRemoveEndsToStretchs(stats, renderBands);
+
+		stretchs.loadTailTrimValues(stats);
+
+		if (stretchs.hasTailTrim())
+			stretchs.applyTrimToStretchs();
+
+		stretchs.calcLinearScaleAndOffset();
+
+		loadStretchList();
+
+		createBufferResult(Buffer.TYPE_BYTE, raster.getBandCount());
+	}
+
+	/**
+	 * La lista de escalas y desplazamientos es un array de 3 elementos en el que
+	 * cada posici�n es un objeto Stretch con la escala y desplazamiento de la
+	 * banda que se dibuja en esa posici�n. El objetivo es aplicar a cada banda
+	 * el m�ximo y m�nimo que le corresponde. Por ejemplo, cuando tenemos una imagen de
+	 * 3 bandas de tipo short y queremos visualizar en RGB solo la primera banda entonces
+	 * escaleOffsetList tendr� stretchs.red en las 3 posiciones.
+	 */
+	private void loadStretchList() {
+		scaleOffsetList = new DefaultStretch[3];
+		scaleOffsetList[0] = stretchs.red;
+		scaleOffsetList[1] = stretchs.green;
+		scaleOffsetList[2] = stretchs.blue;
+	}
+
+	/**
+	 * Obtiene el porcentaje de recorte de colas aplicado o 0 si no tiene.
+	 * @return
+	 */
+	public Double getTailTrim() {
+		double[] tailTrimList;
+		if (stretchs != null)
+			tailTrimList = stretchs.getTailTrimList();
+		else
+			tailTrimList = new double[0];
+		double median = 0;
+		double nValues = tailTrimList.length;
+		for (int i = 0; i < tailTrimList.length; i++)
+			median += tailTrimList[i];
+		return new Double(nValues > 0 ? median / nValues : median);
+	}
+	
+	public boolean isToConvertToRGB() {
+		return true;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	/**
+	 * Obtiene true si est� activado el flag de eliminar extremos y false si no lo
+	 * est�
+	 */
+	public Boolean getRemoveEnds() {
+		return new Boolean(removeEnds);
+	}
+
+	public String getGroup() {
+		return "radiometricos";
+	}
+
+	public Params getUIParams(String nameFilter) {
+		if(stretchs == null)
+			stretchs = (DefaultLinearStretchParams) this.params.get("stretchs");
+		Params params = new ParamsImpl();
+		params.setParam("TailTrim",
+				new Double(Math.round(getTailTrim().doubleValue() * 100.0)),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "1", "25" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		
+		
+		params.setParam("StretchInRed",
+				stretchs.red.stretchIn,
+				Params.CHOICE,
+				null);
+		params.setParam("StretchInGreen",
+				stretchs.green.stretchIn,
+				Params.CHOICE,
+				null);
+		params.setParam("StretchInBlue",
+				stretchs.blue.stretchIn,
+				Params.CHOICE,
+				null);
+		params.setParam("StretchOutRed",
+				stretchs.red.stretchOut,
+				Params.CHOICE,
+				null);
+		params.setParam("StretchOutGreen",
+				stretchs.green.stretchOut,
+				Params.CHOICE,
+				null);
+		params.setParam("StretchOutBlue",
+				stretchs.blue.stretchOut,
+				Params.CHOICE,
+				null);
+		
+		
+		params.setParam("TailTrimRedMin",
+				new Double(stretchs.red.tailTrimMin),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimRedMax",
+				new Double(stretchs.red.tailTrimMax),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimGreenMin",
+				new Double(stretchs.green.tailTrimMin),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimGreenMax",
+				new Double(stretchs.green.tailTrimMax),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimBlueMin",
+				new Double(stretchs.blue.tailTrimMin),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimBlueMax",
+				new Double(stretchs.blue.tailTrimMax),
+				Params.CHOICE,
+				null);
+		
+		
+		params.setParam("RedMaxValue",
+				new Double(stretchs.red.maxValue),
+				Params.CHOICE,
+				null);
+		params.setParam("RedMinValue",
+				new Double(stretchs.red.minValue),
+				Params.CHOICE,
+				null);
+		params.setParam("GreenMaxValue",
+				new Double(stretchs.green.maxValue),
+				Params.CHOICE,
+				null);
+		params.setParam("GreenMinValue",
+				new Double(stretchs.green.minValue),
+				Params.CHOICE,
+				null);
+		params.setParam("BlueMaxValue",
+				new Double(stretchs.blue.maxValue),
+				Params.CHOICE,
+				null);
+		params.setParam("BlueMinValue",
+				new Double(stretchs.blue.minValue),
+				Params.CHOICE,
+				null);
+		
+
+		params.setParam("TailTrimRedValueMax",
+				new Double(stretchs.red.tailTrimValueMax),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimRedValueMin",
+				new Double(stretchs.red.tailTrimValueMin),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimGreenValueMax",
+				new Double(stretchs.green.tailTrimValueMax),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimGreenValueMin",
+				new Double(stretchs.green.tailTrimValueMin),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimBlueValueMax",
+				new Double(stretchs.blue.tailTrimValueMax),
+				Params.CHOICE,
+				null);
+		params.setParam("TailTrimBlueValueMin",
+				new Double(stretchs.blue.tailTrimValueMin),
+				Params.CHOICE,
+				null);
+		
+		params.setParam("RedOffset",
+				stretchs.red.offset,
+				Params.CHOICE,
+				null);
+		params.setParam("GreenOffset",
+				stretchs.green.offset,
+				Params.CHOICE,
+				null);
+		params.setParam("BlueOffset",
+				stretchs.blue.offset,
+				Params.CHOICE,
+				null);
+		params.setParam("RedScale",
+				stretchs.red.scale,
+				Params.CHOICE,
+				null);
+		params.setParam("GreenScale",
+				stretchs.green.scale,
+				Params.CHOICE,
+				null);
+		params.setParam("BlueScale",
+				stretchs.blue.scale,
+				Params.CHOICE,
+				null);
+		
+		
+		params.setParam("Remove",
+				new Boolean(removeEnds),
+				Params.CHOICE,
+				null);
+		/*if(renderBands == null)
+			renderBands = (int[]) this.params.get("renderBands");
+		params.setParam("RenderBands",
+				convertArrayToString(renderBands),
+				Params.NONE,
+				null);*/
+		params.setParam("RGB",
+				new Boolean(stretchs.rgb),
+				Params.NONE,
+				null);
+		return params;
+	}
+
+	/**
+	 * Convierte un array de dobles a una cadena
+	 * @param values
+	 * @return
+	 */
+	/*private String convertArrayToString(int[] values) {
+		StringBuffer buffer = new StringBuffer();
+		for (int i = 0; i < values.length; i++) {
+			buffer.append(values[i]);
+			if (i < (values.length - 1))
+				buffer.append(" ");
+		}
+		return buffer.toString();
+	}*/
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public boolean isVisible() {
+		return false;
+	}
+
+	/**
+	 * @return the stretchs
+	 */
+	public DefaultLinearStretchParams getStretchs() {
+		return stretchs;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFloatFilter.java	(revision 15423)
@@ -0,0 +1,39 @@
+/* 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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de contraste para tipo de datos float.
+ * 
+ * @author Miguel �ngel Querol Carratal�  
+ */
+public class ContrastFloatFilter extends ContrastFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcContrast((int) raster.getElemFloat(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationShortFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+/**
+ * Filtro de ecualizaci�n de histograma para tipo de datos short.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EqualizationShortFilter extends EqualizationFilter {
+	private double[]                distance            = null;
+	private double[]                dto                 = null;
+	
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand++) {
+			short p = raster.getElemShort(line, col, iBand);
+			if(!equalizationActive(iBand)) {
+				rasterResult.setElem(line, col, iBand, p);
+				continue;
+			}
+		
+			int pos = (int)(((p + dto[iBand]) * nClasses) / distance[iBand]);
+			int ecualizationPositive = (int)(lahe[iBand][pos]);
+			int ecualizationNegative = (int)(lahe[iBand][nElements - pos]);
+			double value = ((nElements - ecualizationNegative) + ecualizationPositive) / 2;
+			
+			rasterResult.setElem(line, col, iBand, (short)value);
+		}
+	}
+	
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		distance = new double[raster.getBandCount()];
+		dto = new double[raster.getBandCount()];
+		for (int i = 0; i < raster.getBandCount(); i++) {
+			distance[i] = maxBandValue[i] - minBandValue[i];
+			dto[i] = -minBandValue[i];
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+	
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessIntegerFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de brillo para buffer de datos tipo int. En el m�todo de proceso
+ * procesa un solo pixel int e incrementa su brillo en la cantidad indicada en
+ * la variable incrBrillo.
+ * 
+ * @author Miguel �ngel Querol Carratal� (miguelangel.querol@iver.es)
+ */
+public class BrightnessIntegerFilter extends BrightnessFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcBrightness(raster.getElemInt(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessShortFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de brillo para buffer de datos tipo short. En el m�todo de proceso
+ * procesa un solo pixel short e incrementa su brillo en la cantidad indicada en
+ * la variable incrBrillo.
+ * 
+ * @author Miguel �ngel Querol Carratal� (miguelangel.querol@iver.es)
+ */
+public class BrightnessShortFilter extends BrightnessFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcBrightness((int) raster.getElemShort(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessByteFilter.java	(revision 15423)
@@ -0,0 +1,38 @@
+/* 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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de brillo para buffer de datos tipo byte. En el m�todo de proceso
+ * procesa un solo pixel byte e incrementa su brillo en la cantidad indicada en
+ * la variable incrBrillo.
+ * 
+ * @author Miguel �ngel Querol Carratal� 
+ */
+public class BrightnessByteFilter extends BrightnessFilter {
+
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcBrightness(raster.getElemByte(line, col, i) & 0xff));
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFilter.java	(revision 15423)
@@ -0,0 +1,125 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Clase base para todos los filtros de contraste
+ *
+ * @author Miguel �ngel Querol Carratal�  
+ */
+public class ContrastFilter extends BaseRasterFilter {
+	public static String[]	   names           = new String[] {"contrast"};
+
+	/**
+	 * Variable que contendra el incremento del contraste.
+	 */
+	int incrContraste = 0;
+
+	/**
+	 * Constructor. Llama al constructor de la clase base y asigna el
+	 * nombre del filtro.
+	 */
+	public ContrastFilter() {
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		incrContraste = ((Integer) params.get("incrContraste")).intValue();
+		createBufferResult(Buffer.TYPE_BYTE, raster.getBandCount());
+	}
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	/**
+	 * Obtiene el incremento de contraster que se est� aplicando
+	 * @return entero que representa el incremento de contraste aplicado.
+	 */
+	public int getContrastIncrease(){
+		return this.incrContraste;
+	}
+
+	public String getGroup() {
+		return "realces";
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("Contrast",
+				new Integer(incrContraste),
+				Params.SLIDER,
+				new String[]{ "-255", "255", "50", "1", "25" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		return params;
+	}
+
+	public int getInRasterDataType() {
+		//No parece que tenga sentido para im�genes que no sean RGB
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+	public void process(int x, int y) {
+	}
+
+	/**
+	 * Algoritmo de contraste
+	 * @param px valor de la banda
+	 * @return valor de la banda con el algoritmo aplicado
+	 */
+	protected int calcContrast(int px) {
+		int result;
+		int diferencia = 127 - px;
+		if (incrContraste >= 0) {
+			result = (int) (px - (0.02 * diferencia * incrContraste)); // ((5.0 * 0.1) / 25) = 0.02
+		} else {
+			result = (int) (px - (0.004 * diferencia * incrContraste)); // (0.1 / 25) = 0.004;
+			if (px < 127) {
+				if (result > 127) result = 127;
+			} else {
+				if (result < 127) result = 127;
+			}
+		}
+		if (result < 0)
+			result = 0;
+		else {
+			if (result > 255)
+				result = 255;
+		}
+		return result;
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFloatFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de brillo para buffer de datos tipo float. En el m�todo de proceso
+ * procesa un solo pixel float e incrementa su brillo en la cantidad indicada en
+ * la variable incrBrillo.
+ * 
+ * @author Miguel �ngel Querol Carratal� (miguelangel.querol@iver.es)
+ */
+public class BrightnessFloatFilter extends BrightnessFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcBrightness((int) raster.getElemFloat(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleByteFilter.java	(revision 15423)
@@ -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.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.enhancement;
+
+
+/**
+ * Filtro para la conversi�n a escala de grises de tipo byte
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class GrayScaleByteFilter extends GrayScaleFilter {
+	public void process(int col, int line) {
+		byte value = 0;
+		switch (type) {
+		case 0:
+		case 4:	value = raster.getElemByte(line, col, 0);
+				break;
+		case 1:	value = raster.getElemByte(line, col, 1);
+				break;
+		case 2:	value = raster.getElemByte(line, col, 2);
+				break;
+		case 3:	int r = (raster.getElemByte(line, col, 0) & 0xff);
+				int g = (raster.getElemByte(line, col, 1) & 0xff);
+				int b = (raster.getElemByte(line, col, 2) & 0xff);
+				value = (byte)((r + g + b) / 3);
+				break;
+		}
+		
+		rasterResult.setElem(line, col, 0, value);
+		rasterResult.setElem(line, col, 1, value);
+		rasterResult.setElem(line, col, 2, value);
+		rasterResult.setElem(line, col, 3, (byte)255);
+		
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementByteFilter.java	(revision 15423)
@@ -0,0 +1,83 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.DefaultStretch;
+/**
+ * Filtro de realce lineal para tipos de datos byte. El realce es aplicado por intervalos.
+ * Para cada pixel se obtiene en que intervalo se encuentra y se aplica la scala y offset
+ * calculados para ese intervalo.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearStretchEnhancementByteFilter extends LinearStretchEnhancementFilter {
+		
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < renderBands.length; iBand++) {
+			if(renderBands[iBand] >= 0) {
+				int p;
+				if (stretchs.rgb)
+					p = (int) (raster.getElemByte(line, col, iBand) & 0xff);
+				else
+					p = (int) raster.getElemByte(line, col, iBand);
+
+				if (iBand < scaleOffsetList.length)
+					processValue(p, scaleOffsetList[iBand], col, line, iBand);
+				else
+					rasterResult.setElem(line, col, iBand, (byte) p);
+			}
+		}
+		writeAlphaBand(line, col);
+	}
+	
+	/**
+	 * Procesa un dato del raster aplicandole el factor de escala y desplazamiento que
+	 * necesita.
+	 * @param p Valor del punto
+	 * @param data Estructura de datos con los valores de escala y desplazamiento
+	 * @param col Columna del valor dentro del raster
+	 * @param line L�nea del valor dentro del raster
+	 * @param iBand N�mero de banda del valor dentro del raster
+	 * @return true si ha podido ser procesado y false si no lo hace
+	 */
+	private void processValue(int p, DefaultStretch data, int col, int line, int iBand) {
+		if(data.scale != null) {
+			if (p > data.maxValue)
+				p = (int) data.maxValue;
+			else if (p < data.minValue)
+				p = (int) data.minValue;
+			
+			for (int i = 0; i < data.scale.length; i++) {
+				if((p > data.stretchIn[i] && p <= data.stretchIn[i + 1]) || (i == 0 && p == data.stretchIn[i])) {
+					p =  (int)( (((double)p) - data.stretchIn[i]) * data.scale[i] + data.offset[i]);
+					break;
+				}
+			}
+			rasterResult.setElem(line, col, iBand, (byte)p);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessDoubleFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de brillo para buffer de datos tipo double. En el m�todo de proceso
+ * procesa un solo pixel double e incrementa su brillo en la cantidad indicada
+ * en la variable incrBrillo.
+ * 
+ * @author Miguel �ngel Querol Carratal� (miguelangel.querol@iver.es)
+ */
+public class BrightnessDoubleFilter extends BrightnessFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcBrightness((int) raster.getElemDouble(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationFilter.java	(revision 15423)
@@ -0,0 +1,211 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Clase base para los filtros de ecualizaci�n de histograma.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EqualizationFilter extends BaseRasterFilter {
+	protected Statistics               stats              = null;
+	protected double[]                 minBandValue	      = null;
+	protected double[]                 maxBandValue	      = null;
+	protected int                      nbands             = 3;
+	protected int[]                    k                  = null;                   
+	public static String[]             names              = new String[] {"equalization"};
+	protected BufferHistogram          histogram          = null;
+	protected long                     nPixels            = 0;
+	protected int[][]                  resValues          = null;
+	protected int                      nElements          = 0;
+	protected int[]                    ecualizedBands     = null;
+	protected double[][]               aproximationNeg    = null;
+	protected int                      nClasses           = RasterLibrary.defaultNumberOfClasses;
+	protected long[][]                 lahe               = null;
+	protected long[][]                 laheNegative       = null;
+	
+	/**
+	 * Construye un LinearEnhancementFilter
+	 */
+	public EqualizationFilter() {
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		stats = (Statistics)getEnv().get("SrcStatistics");
+		HistogramComputer hist = (HistogramComputer)getEnv().get("SrcHistogram");
+		try {
+			if (!stats.isCalculated()) {
+				try {
+					stats.calculate(RasterLibrary.statisticsScale);
+				} catch (FileNotOpenException e) {
+					// No podemos aplicar el filtro
+					return;
+				} catch (RasterDriverException e) {
+					// No podemos aplicar el filtro
+					return;
+				}
+			}
+		} catch (ProcessInterruptedException e) {
+			//Si se ha interrumpido no a�adimos el filtro
+		}
+
+		try {
+			this.histogram = hist.getBufferHistogram();
+		} catch (ProcessInterruptedException e) {
+			exec = false;
+		} catch (HistogramException e) {
+			exec = false;
+		} 
+		
+		ecualizedBands = (int[]) params.get("ecualizedBands");
+		if(ecualizedBands == null)
+			ecualizedBands = getColorInterpretation().buildRenderBands();
+		
+		height = raster.getHeight();
+		width = raster.getWidth();
+		nPixels = height * width;
+		
+		try {
+			stats.calculate(RasterLibrary.statisticsScale);
+		} catch (FileNotOpenException e) {
+			exec = false;
+		} catch (RasterDriverException e) {
+			exec = false;
+		} catch (ProcessInterruptedException e) {
+			exec = false;
+		}
+
+		if(raster.getDataType() == Buffer.TYPE_BYTE) {
+			minBandValue = stats.getMinByteUnsigned();
+			maxBandValue = stats.getMaxByteUnsigned();
+		} 
+		if((minBandValue == null || maxBandValue == null) || (minBandValue[0] == 0 && maxBandValue[0] == 0)) {
+			minBandValue = new double[raster.getBandCount()];
+			maxBandValue = new double[raster.getBandCount()];
+			if(raster.getDataType() == Buffer.TYPE_BYTE) {
+				for (int i = 0; i < minBandValue.length; i++) {
+					minBandValue[i] = 0;
+					maxBandValue[i] = 255;
+				}
+			} else {
+				minBandValue = stats.getMin();
+				maxBandValue = stats.getMax();
+			}
+		}
+
+		BufferHistogram rgbHistogram = null;
+		if(raster.getDataType() == Buffer.TYPE_BYTE)
+			rgbHistogram = BufferHistogramImpl.convertHistogramToRGB(histogram);
+		else 
+			rgbHistogram = histogram;
+		double[][] accumNormalize = BufferHistogramImpl.convertTableToNormalizeAccumulate(rgbHistogram.getTable());
+		double[][] accumNormalizeNeg = BufferHistogramImpl.convertTableToNormalizeAccumulate(rgbHistogram.getNegativeTable());
+		
+		int value = 255;
+		if(raster.getDataType() != RasterBuffer.TYPE_BYTE)
+			value = nClasses;
+		
+		lahe = lahe(accumNormalize, value);
+		laheNegative = lahe(accumNormalizeNeg, value);
+		nElements = (laheNegative[0].length - 1);
+		
+		nbands = stats.getBandCount();
+		createBufferResult(raster.getDataType(), raster.getBandCount());
+	}
+
+	/**
+	 * M�todo lahe para la ecualizaci�n. Cada posici�n del array resultante tendr� el valor de salida para
+	 * un valor de entrada dado.
+	 * @param accumNorm Histograma acumulado
+	 * @param value Valor m�ximo
+	 * @return
+	 */
+	private long[][] lahe(double[][] accumNorm, int value) {
+		long[][] res = new long[accumNorm.length][accumNorm[0].length];
+		for (int i = 0; i < res.length; i++) 
+			  for (int j = 0; j < res[i].length; j++) 
+				  res[i][j] = Math.round(accumNorm[i][j] * value);
+		return res;
+	}
+	
+	/**
+	 * Consulta si la ecualizaci�n est� activa para una banda o no
+	 * @param band N�mero de banda a consultar si se ha activado la ecualizaci�n
+	 * @return true si est� activa para esa banda y false si no lo est�.
+	 */
+	protected boolean equalizationActive(int band) {
+		for (int i = 0; i < ecualizedBands.length; i++) {
+			if(band == ecualizedBands[i])
+				return true;
+		}
+		return false;
+	}
+		
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public String getGroup() {
+		return "realces";
+	}
+
+	public Params getUIParams(String nameFilter) {
+		return new ParamsImpl();
+	}
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+	
+	public boolean isVisible() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementDoubleFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.DefaultStretch;
+/**
+ * Filtro de realce lineal para tipos de datos double. El realce es aplicado por intervalos.
+ * Para cada pixel se obtiene en que intervalo se encuentra y se aplica la scala y offset
+ * calculados para ese intervalo.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearStretchEnhancementDoubleFilter extends LinearStretchEnhancementFilter {
+		
+	public void process(int col, int line) {
+		for (int destinationBand = 0; destinationBand < renderBands.length; destinationBand++) {
+			if(renderBands[destinationBand] >= 0) {
+				double p = raster.getElemDouble(line, col, destinationBand);
+				if (destinationBand < scaleOffsetList.length)
+					processValue(p, scaleOffsetList[destinationBand], col, line, destinationBand);
+				else
+					rasterResult.setElem(line, col, destinationBand, (byte) p);
+			}
+		}
+	}
+
+	/**
+	 * Procesa un dato del raster aplicandole el factor de escala y desplazamiento que
+	 * necesita.
+	 * @param p Valor del punto
+	 * @param data Estructura de datos con los valores de escala y desplazamiento
+	 * @param col Columna del valor dentro del raster
+	 * @param line L�nea del valor dentro del raster
+	 * @param iBand N�mero de banda del valor dentro del raster
+	 * @return true si ha podido ser procesado y false si no lo hace
+	 */
+	private void processValue(double p, DefaultStretch data, int col, int line, int iBand) {
+		if(data.scale != null) {
+			if (p > data.maxValue)
+				p = (double) data.maxValue;
+			else if (p < data.minValue)
+				p = (double) data.minValue;
+			
+			for (int i = 0; i < data.scale.length; i++) {
+				if((p > data.stretchIn[i] && p <= data.stretchIn[i + 1]) || (i == 0 && p == data.stretchIn[i])) {
+					p =  (double)( (((double)p) - data.stretchIn[i]) * data.scale[i] + data.offset[i]);
+					break;
+				}
+			}
+			rasterResult.setElem(line, col, iBand, (byte)(((byte) p) & 0xff));
+		}
+	}
+	
+	public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFilter.java	(revision 15423)
@@ -0,0 +1,182 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Clase base para los filtros de realzado lineal. Lee el m�nimo y m�xmo de la
+ * clase Statistic que ser�n calculados por PercentTailTrimFilter o
+ * ComputeMinMaxFilter dependiendo de si est� activado el recorte de colas o no.
+ * En Statistic tambi�n est�n los segundos valores despu�s del m�nimo y m�ximo
+ * que son los que se utilizan con la opci�n eliminar extremos activada. Estos
+ * se usaran en vez del m�nimo y m�ximo cuando la variable removeExtrema est� a
+ * true.
+ * @deprecated This filter should not be used. Use <code>LinearStretchEnhancementFilter</code> instead
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearEnhancementFilter extends BaseRasterFilter {
+	protected double[]                 scale        = new double[3];
+	protected double[]                 offset       = new double[3];
+	protected Statistics               stats        = null;
+	protected double[]                 minBandValue	= null;
+	protected double[]                 maxBandValue	= null;
+	protected boolean                  removeEnds   = false;
+	protected double                   tailTrim     = 0D;
+	protected int                      nbands       = 3;
+	public static String[]             names        = new String[] {"enhanced"};
+
+	/**
+	 * Construye un LinearEnhancementFilter
+	 */
+	public LinearEnhancementFilter() {
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		stats = (Statistics) params.get("stats");
+		removeEnds = ((Boolean) params.get("remove")).booleanValue();
+		tailTrim = ((Double) params.get("tailTrim")).doubleValue();
+		// En realidad esto no se deberia hacer, pero por logica, un valor del 50%
+		// devolveria una capa en blanco, asi que evitamos un resultado supuestamente
+		// no esperado
+		if ((tailTrim >= 0.5) && (tailTrim < 0.51))
+			tailTrim = 0.51;
+		if ((tailTrim > 0.49) && (tailTrim < 0.50))
+			tailTrim = 0.49;
+		
+		try {
+			stats.calculate(RasterLibrary.statisticsScale);
+		} catch (FileNotOpenException e) {
+			exec = false;
+		} catch (RasterDriverException e) {
+			exec = false;
+		} catch (ProcessInterruptedException e) {
+			exec = false;
+		}
+		double[][] tailTrimByBand = (double[][]) stats.getTailTrimValue(tailTrim);
+		if ((tailTrim != 0) && (tailTrimByBand != null)) { // Max y Min con recorte de colas
+			scale = new double[tailTrimByBand.length];
+			offset = new double[tailTrimByBand.length];
+			minBandValue = new double[tailTrimByBand.length];
+			maxBandValue = new double[tailTrimByBand.length];
+			for (int i = 0; i < tailTrimByBand.length; i++) {
+				minBandValue[i] = tailTrimByBand[i][0];
+				maxBandValue[i] = tailTrimByBand[i][1];
+			}
+		} else {
+			scale = new double[stats.getMin().length];
+			offset = new double[stats.getMin().length];
+			if (removeEnds) { // Si est� activado eliminar extremos gastamos el 2� m�ximo/m�nimo
+				if(raster.getDataType() == Buffer.TYPE_BYTE) {
+					minBandValue = stats.getSecondMinByteUnsigned();
+					maxBandValue = stats.getSecondMaxByteUnsigned();
+				} else {
+					minBandValue = stats.getSecondMin();
+					maxBandValue = stats.getSecondMax();
+				}
+			} else { // Si no est� activado eliminar extremos
+				if(raster.getDataType() == Buffer.TYPE_BYTE) {
+					minBandValue = stats.getMinByteUnsigned();
+					maxBandValue = stats.getMaxByteUnsigned();
+				} else {
+					minBandValue = stats.getMin();
+					maxBandValue = stats.getMax();
+				}
+			}
+		}
+
+		for (int i = 0; i < minBandValue.length; i++) {
+			scale[i] = 255D / (maxBandValue[i] - minBandValue[i]);
+			offset[i] = (255D * minBandValue[i]) / (minBandValue[i] - maxBandValue[i]);
+		}
+
+		nbands = stats.getBandCount();
+		createBufferResult(Buffer.TYPE_BYTE, raster.getBandCount());
+	}
+
+	/**
+	 * Obtiene true si est� activado el flag de eliminar extremos y false si no lo
+	 * est�
+	 */
+	public Boolean getRemoveEnds() {
+		return new Boolean(removeEnds);
+	}
+
+	/**
+	 * Obtiene el porcentaje de recorte de colas aplicado o 0 si no tiene.
+	 * @return
+	 */
+	public Double getTailTrim(){
+		return new Double(tailTrim);
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public String getGroup() {
+		return "radiometricos";
+	}
+
+	public Params getUIParams(String nameFilter) {
+		Params params = new ParamsImpl();
+		params.setParam("RemoveEnds",
+				new Boolean(removeEnds),
+				Params.CHECK,
+				null);
+		params.setParam("TailTrim",
+				new Double(Math.round(tailTrim * 100.0)),
+				Params.SLIDER,
+				new String[]{ "0", "100", "0", "1", "25" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		return params;
+	}
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public void process(int x, int y) {
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+	
+	public boolean isVisible() {
+		return true;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastByteFilter.java	(revision 15423)
@@ -0,0 +1,35 @@
+/* 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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de contraste para tipo de datos byte.
+ * 
+ * @author Miguel �ngel Querol Carratal� 
+ */
+public class ContrastByteFilter extends ContrastFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcContrast(raster.getElemByte(line, col, i) & 0xff));
+		writeAlphaBand(line, col);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastDoubleFilter.java	(revision 15423)
@@ -0,0 +1,39 @@
+/* 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.impl.grid.filter.enhancement;
+
+/**
+ * Filtro de contraste para tipo de datos double.
+ * 
+ * @author Miguel �ngel Querol Carratal�  
+ */
+public class ContrastDoubleFilter extends ContrastFilter {
+	public void process(int col, int line) {
+		for (int i = 0; i < numberOfBandsToProcess(); i++)
+			rasterResult.setElem(line, col, i, (byte) calcContrast((int) raster.getElemDouble(line, col, i) & 0xff));
+	}
+
+	//No parece que tenga sentido para im�genes que no sean RGB
+	/*public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}*/
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/ContrastDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationByteFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de ecualizaci�n de histograma.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EqualizationByteFilter extends EqualizationFilter {
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand++) {
+			int p = (int)(raster.getElemByte(line, col, iBand) & 0xff);
+			if(!equalizationActive(iBand)) {
+				rasterResult.setElem(line, col, iBand, (byte)p);
+				continue;
+			}
+			
+			//Las estad�sticas est�n calculadas para todas las bandas por lo que hay que seleccionar solo las que se renderiza
+			/*if (p > maxBandValue[renderBands[iBand]])
+				p = (int) maxBandValue[renderBands[iBand]];
+			else if (p < minBandValue[renderBands[iBand]])
+				p = (int) minBandValue[renderBands[iBand]];*/
+
+			//M�todo lahe
+			int ecualizationPositive = (int)lahe[iBand][p % histogram.getNumValues()];
+			int ecualizationNegative = (int)laheNegative[iBand][nElements - (p % histogram.getNumValues())];
+			
+			int value = ((nElements - ecualizationNegative) + ecualizationPositive) / 2;
+			rasterResult.setElem(line, col, iBand, (byte)(value & 0x000000ff));
+		}
+		
+		writeAlphaBand(line, col);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationManager.java	(revision 15423)
@@ -0,0 +1,160 @@
+/* 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.impl.grid.filter.enhancement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor de la pila de filtros para el filtro de ecualizaci�n de histograma.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EqualizationManager extends AbstractRasterFilterManager {
+	private static String   ID = "Equalization";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public EqualizationManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, EqualizationManager.class);
+	}
+
+	/**
+	 * Constructor
+	 * @param filterListManager
+	 */
+	public EqualizationManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("equalization") == 0)
+			return EqualizationFilter.class;
+		return null;
+	}
+
+	/**
+	 * A�ade un filtro de ecualizaci�n de histograma.
+	 * @throws FilterTypeException
+	 */
+	public void addEqualizationFilter(int[] renderBands, int[] ecualizedBands) throws FilterTypeException {
+		RasterFilter filter = createEnhancedFilter(renderBands, ecualizedBands);
+		if (filter != null)
+			getFilterList().add(filter);
+	}
+
+	/**
+	 * Crea un filtro de Ecualizaci�n de histograma.
+	 * @param stats
+	 * @param renderBands
+	 * @return
+	 */
+	public static RasterFilter createEnhancedFilter(int[] renderBands, int[] ecualizedBands) {
+		RasterFilter filter = new EqualizationByteFilter();
+		if (filter != null) {
+			filter.addParam("renderBands", renderBands);
+			filter.addParam("ecualizedBands", ecualizedBands);
+		}
+		return filter;
+	}
+
+	/**
+	 * Obtiene un Array de Strings a partir de una pila de filtros. Cada elemento
+	 * del array tendr� la forma de elemento=valor.
+	 */
+	public List<String> getStringsFromFilterList(List<String> filterList, RasterFilter rf) {
+		return filterList;
+	}
+
+	public int createFilterListFromStrings(List<String> filters, String fil, int filteri) throws FilterTypeException {
+		return filteri;
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(EqualizationFilter.class);
+		return filters;
+	}
+
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (EqualizationFilter.class.isAssignableFrom(classFilter)) {
+			int[] renderBands = { 0, 1, 2, 3 };
+			int[] ecualizedBands = { 0, 1, 2 };
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+					((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("alphaBand") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer) {
+					renderBands[3] = (Integer)((ParamImpl)params.getParam(i)).getDefaultValue();
+					continue;
+				}
+			
+				if (((ParamImpl)params.getParam(i)).getId().equals("EcualizedBands") &&
+					((ParamImpl)params.getParam(i)).getDefaultValue() instanceof int[]) {
+					ecualizedBands = (int[])((ParamImpl)params.getParam(i)).getDefaultValue();
+				}
+			}
+
+			addEqualizationFilter(renderBands, ecualizedBands);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(EqualizationFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		//TODO: crear un filtro de este tipo
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EqualizationManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementIntegerFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.DefaultStretch;
+/**
+ * Filtro de realce lineal para tipos de datos int. El realce es aplicado por intervalos.
+ * Para cada pixel se obtiene en que intervalo se encuentra y se aplica la scala y offset
+ * calculados para ese intervalo.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearStretchEnhancementIntegerFilter extends LinearStretchEnhancementFilter {
+		
+	public void process(int col, int line) {
+		for (int destinationBand = 0; destinationBand < renderBands.length; destinationBand++) {
+			if(renderBands[destinationBand] >= 0) {
+				int p = raster.getElemInt(line, col, destinationBand);
+				if (destinationBand < scaleOffsetList.length)
+					processValue(p, scaleOffsetList[destinationBand], col, line, destinationBand);
+				else
+					rasterResult.setElem(line, col, destinationBand, (byte) p);
+			}
+		}
+	}
+	
+	/**
+	 * Procesa un dato del raster aplicandole el factor de escala y desplazamiento que
+	 * necesita.
+	 * @param p Valor del punto
+	 * @param data Estructura de datos con los valores de escala y desplazamiento
+	 * @param col Columna del valor dentro del raster
+	 * @param line L�nea del valor dentro del raster
+	 * @param iBand N�mero de banda del valor dentro del raster
+	 * @return true si ha podido ser procesado y false si no lo hace
+	 */
+	private void processValue(int p, DefaultStretch data, int col, int line, int iBand) {
+		if(data.scale != null) {
+			if (p > data.maxValue)
+				p = (int) data.maxValue;
+			else if (p < data.minValue)
+				p = (int) data.minValue;
+			
+			for (int i = 0; i < data.scale.length; i++) {
+				if((p > data.stretchIn[i] && p <= data.stretchIn[i + 1]) || (i == 0 && p == data.stretchIn[i])) { 
+					p =  (int)( (((double)p) - data.stretchIn[i]) * data.scale[i] + data.offset[i]);
+					break;
+				}
+			}
+			rasterResult.setElem(line, col, iBand, (byte)(((byte) p) & 0xff));
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementShortFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.DefaultStretch;
+/**
+ * Filtro de realce lineal para tipos de datos short. El realce es aplicado por intervalos.
+ * Para cada pixel se obtiene en que intervalo se encuentra y se aplica la scala y offset
+ * calculados para ese intervalo.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearStretchEnhancementShortFilter extends LinearStretchEnhancementFilter {
+		
+	public void process(int col, int line) {
+		for (int destinationBand = 0; destinationBand < renderBands.length; destinationBand++) {
+			if(renderBands[destinationBand] >= 0) {
+				short p = raster.getElemShort(line, col, destinationBand);
+				if (destinationBand < scaleOffsetList.length)
+					processValue(p, scaleOffsetList[destinationBand], col, line, destinationBand);
+				else
+					rasterResult.setElem(line, col, destinationBand, (byte) p);
+			}
+		}
+	}
+
+	/**
+	 * Procesa un dato del raster aplicandole el factor de escala y desplazamiento que
+	 * necesita.
+	 * @param p Valor del punto
+	 * @param data Estructura de datos con los valores de escala y desplazamiento
+	 * @param col Columna del valor dentro del raster
+	 * @param line L�nea del valor dentro del raster
+	 * @param iBand N�mero de banda del valor dentro del raster
+	 * @return true si ha podido ser procesado y false si no lo hace
+	 */
+	private void processValue(short p, DefaultStretch data, int col, int line, int iBand) {
+		if (data.scale != null) {
+			if (p > data.maxValue)
+				p = (short) data.maxValue;
+			else
+				if (p < data.minValue)
+					p = (short) data.minValue;
+
+			for (int i = 0; i < data.scale.length; i++) {
+				if ((p > data.stretchIn[i] && p <= data.stretchIn[i + 1]) || (i == 0 && p == data.stretchIn[i])) {
+					p = (short) (((short) (((((double) p) - data.stretchIn[i]) * data.scale[i]) + data.offset[i])) & 0xff);
+					break;
+				}
+			}
+			rasterResult.setElem(line, col, iBand, (byte) (((byte) p) & 0xff));
+		}
+	}
+	
+	public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementIntegerFilter.java	(revision 15423)
@@ -0,0 +1,55 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de realce para tipos de datos int. En el m�todo de proceso procesa
+ * un solo pixel int. Asigna su valor en relaci�n a los datos calculados en el
+ * m�todo pre() del padre.
+ * 
+ * @deprecated This filter should not be used. Use <code>LinearStretchEnhancementFilter</code> instead
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearEnhancementIntegerFilter extends LinearEnhancementFilter {
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand++) {
+			int p = raster.getElemInt(line, col, iBand);
+			/*if(renderBands[iBand] < 0) {
+				rasterResult.setElem(line, col, iBand, (byte)p);
+				continue;
+			}
+			if (p > maxBandValue[renderBands[iBand]])
+				p = (int) maxBandValue[renderBands[iBand]];
+			else if (p < minBandValue[renderBands[iBand]])
+				p = (int) minBandValue[renderBands[iBand]];*/
+
+			p = (int) (((int) ((p * scale[iBand]) + offset[iBand])) & 0xff);
+			rasterResult.setElem(line, col, iBand, (byte) p);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleManager.java	(revision 15423)
@@ -0,0 +1,116 @@
+/* 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.impl.grid.filter.enhancement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+/**
+ * Gestor del filtro de conversi�n a escala de grises
+ *
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class GrayScaleManager extends AbstractRasterFilterManager {
+	public static String   ID = "GrayScale";
+
+	public String getManagerID() {
+		return ID;
+	}
+	
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, GrayScaleManager.class);
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		if(dataType != Buffer.TYPE_BYTE)
+			return false;
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if( id.compareTo("grayscale") == 0)
+			return GrayScaleFilter.class;
+		return null;
+	}
+
+	/**
+	 * Constructor.
+	 * Asigna la lista de filtros y el managener global.
+	 *
+	 * @param filterListManager
+	 */
+	public GrayScaleManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+
+	/**
+	 * A�ade un filtro de conversi�n de balance de color RGB.
+	 * @param type. par�metro para el filtro que indica que banda o combinaci�n de
+	 * estas es usada para la conversi�n a escala de gris. El valor de este par�mtro
+	 * est� definido en las constantes de la clase GrayScaleFilter
+	 * @throws FilterTypeException
+	 */
+	public void addGrayScaleFilter(int type) throws FilterTypeException {
+		RasterFilter filter = new GrayScaleByteFilter();
+
+		if (filter != null) {
+			filter.addParam("typeBand", new Integer(type));
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(GrayScaleFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (classFilter.equals(GrayScaleFilter.class)) {
+			int type = 0;
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (params.getParam(i).getId().equals("typeBand"))
+					type = ((Integer) params.getParam(i).getDefaultValue()).intValue();
+			}
+			addGrayScaleFilter(type);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		Integer type = ((Integer) params.getParamById("typeBand").getDefaultValue());
+		
+		RasterFilter filter = new GrayScaleByteFilter();
+		filter.addParam("typeBand", type);
+		return filter;
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(GrayScaleFilter.class, params);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/GrayScaleManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementShortFilter.java	(revision 15423)
@@ -0,0 +1,55 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de realce para tipos de datos short. En el m�todo de proceso procesa
+ * un solo pixel short. Asigna su valor en relaci�n a los datos calculados en el
+ * m�todo pre() del padre.
+ * 
+ * @deprecated This filter should not be used. Use <code>LinearStretchEnhancementFilter</code> instead
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearEnhancementShortFilter extends LinearEnhancementFilter {
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand++) {
+			short p = raster.getElemShort(line, col, iBand);
+			/*if(renderBands[iBand] < 0) {
+				rasterResult.setElem(line, col, iBand, (byte)p);
+				continue;
+			}
+			if (p > maxBandValue[renderBands[iBand]])
+				p = (short) maxBandValue[renderBands[iBand]];
+			else if (p < minBandValue[renderBands[iBand]])
+				p = (short) minBandValue[renderBands[iBand]];*/
+
+			p = (short) (((short) ((((double) p) * scale[iBand]) + offset[iBand])) & 0xff);
+			rasterResult.setElem(line, col, iBand, (byte) p);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementStretchListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementStretchListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementStretchListManager.java	(revision 15423)
@@ -0,0 +1,370 @@
+/* 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.impl.grid.filter.enhancement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.grid.filter.statistics.StatisticsListManager;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor de la pila de filtros para el filtro de realce por intervalos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class EnhancementStretchListManager extends AbstractRasterFilterManager {
+	private static String               ID                = "EnhancementStretch";
+	private RasterFilterListManagerImpl filterListManager = null;
+
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public EnhancementStretchListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, EnhancementStretchListManager.class);
+	}
+
+	/**
+	 * Constructor
+	 * @param filterListManager
+	 */
+	public EnhancementStretchListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+		this.filterListManager = filterListManager;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("enhanced_stretch") == 0)
+			return LinearStretchEnhancementFilter.class;
+		return null;
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+
+	/**
+	 * A�ade un filtro de realce.
+	 * La forma de insercion del filtro es fija ya que la insercion de un realce lleva implicita
+	 * la insercion de un filtro de recorte de colas (tailtrim), aunque no en todos los casos.
+	 * Si ya existe un filtro de realce en la lista se obtiene la posici�n de este.
+	 * Si es necesario un recorte de colas entonces se comprueba si existe un uno reemplazandose
+	 * por el nuevo y sino se insertar� uno. Al final reemplazamos el realce que existia.
+	 *
+	 * Si por el contrario no existen realce ni trim se a�aden ambos al final de la lista.
+	 * @param stats Objeto de estadisticas asociado
+	 * @param tailTrim porcentaje de recorte de colas. Ser� un valor entre 0 y 1.
+	 * @param insertionMode Modo de inserci�n
+	 * @param renderBands bandas RGB mostradas en la visualizaci�n.
+	 * @throws FilterTypeException
+	 */
+	public void addEnhancedStretchFilter(DefaultLinearStretchParams leParams, Statistics stats, int[] renderBands, boolean removeEnds) throws FilterTypeException {
+		try {
+			if (!leParams.hasTailTrim()) { // En este caso siempre es necesario el m�ximo y
+				// m�nimo
+				if (!stats.isCalculated())
+					try {
+						stats.calculate(RasterLibrary.statisticsScale);
+					} catch (FileNotOpenException e) {
+						// No podemos aplicar el filtro
+						return;
+					} catch (RasterDriverException e) {
+						// No podemos aplicar el filtro
+						return;
+					}
+			} else {
+				StatisticsListManager slm = null;
+				if(filterListManager !=  null)
+					slm = new StatisticsListManager(filterListManager/*, stats*/);
+				else
+					slm = new StatisticsListManager(getFilterList());
+				slm.addTailFilter(leParams.getTailTrimList(), 0D, removeEnds, stats);
+			}
+
+			RasterFilter filter = createEnhancedFilter(leParams, stats, renderBands, removeEnds);
+			if (filter != null)
+				getFilterList().add(filter);
+		} catch (ProcessInterruptedException e) {
+			//Si se ha interrumpido no a�adimos el filtro
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		int[] renderBands = (int[])params.getParamById("renderBands").getDefaultValue();
+		Statistics stats = (Statistics)params.getParamById("stats").getDefaultValue();
+		boolean removeEnds = ((Boolean)params.getParamById("remove").getDefaultValue()).booleanValue();
+		
+		DefaultLinearStretchParams p = null;
+
+		try {
+			if(	params.getParamById("tailtrim") != null &&
+				params.getParamById("tailtrim").getDefaultValue() != null && 
+				params.getParamById("rgb").getDefaultValue() != null) {
+				double tailtrim = ((Double)params.getParamById("tailtrim").getDefaultValue()).doubleValue();
+				boolean rgb = ((Boolean)params.getParamById("rgb").getDefaultValue()).booleanValue();
+				p = DefaultLinearStretchParams.createStandardParam(renderBands, tailtrim, stats, rgb);
+			} else {
+				//Si stretch vale null se usan los par�metros por defecto de LinearStretchParams
+				if(params.getParamById("stretchs").getDefaultValue() == null) {
+					boolean rgb = false;
+					if(params.getParamById("rgb").getDefaultValue() != null)
+						rgb = ((Boolean)params.getParamById("rgb").getDefaultValue()).booleanValue();
+					p = DefaultLinearStretchParams.createStandardParam(renderBands, 0.0, stats, rgb);
+				}
+			}
+		} catch (FileNotOpenException e) {
+			throw new FilterTypeException("", e);
+		} catch (RasterDriverException e) {
+			throw new FilterTypeException("", e);
+		}
+		addEnhancedStretchFilter(p, stats, renderBands, removeEnds);
+	}
+
+	/**
+	 * Crea un filtro de realce por tramos de forma est�tica
+	 * @param leParams Par�metros del filtro
+	 * @param stats
+	 * @param renderBands
+	 * @return
+	 */
+	public static RasterFilter createEnhancedFilter(DefaultLinearStretchParams leParams, Statistics stats, int[] renderBands, boolean removeEnds) {
+		RasterFilter filter = new LinearStretchEnhancementFloatFilter();
+		if (filter != null) {
+			filter.addParam("stats", stats);
+			filter.addParam("remove", new Boolean(false));
+			filter.addParam("renderBands", renderBands);
+			filter.addParam("stretchs", leParams);
+			filter.addParam("remove", new Boolean(removeEnds));
+		}
+
+		return filter;
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(LinearStretchEnhancementFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (LinearStretchEnhancementFilter.class.isAssignableFrom(classFilter)) {
+			int[] renderBands = { 0, 1, 2 };
+			boolean removeEnds = false;
+
+			DefaultLinearStretchParams leParams = new DefaultLinearStretchParams();
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+					((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+
+				if (((ParamImpl)params.getParam(i)).getId().equals("Remove"))
+					removeEnds = ((Boolean) ((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
+
+				if (((ParamImpl)params.getParam(i)).getId().equals("RGB"))
+					leParams.rgb = ((Boolean) ((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
+
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchInRed") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.red.stretchIn = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchInGreen") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.green.stretchIn = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchInBlue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.blue.stretchIn = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchOutRed") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof int[])
+					leParams.red.stretchOut = ((int[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchOutGreen") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof int[])
+					leParams.green.stretchOut = ((int[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchOutBlue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof int[])
+					leParams.blue.stretchOut = ((int[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+
+				
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedMin") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					leParams.red.tailTrimMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedMax") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					leParams.red.tailTrimMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenMin") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					leParams.green.tailTrimMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenMax") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					leParams.green.tailTrimMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueMin") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					leParams.blue.tailTrimMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueMax") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					leParams.blue.tailTrimMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+
+				
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchRedFunctionType") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+						leParams.red.functionType = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchRedValueFunction") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.red.valueFunction = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchGreenFunctionType") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+						leParams.green.functionType = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchGreenValueFunction") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.green.valueFunction = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchBlueFunctionType") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+						leParams.blue.functionType = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("StretchBlueValueFunction") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.blue.valueFunction = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				
+				
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedValueMin") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.red.tailTrimValueMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimRedValueMax") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.red.tailTrimValueMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenValueMin") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.green.tailTrimValueMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimGreenValueMax") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.green.tailTrimValueMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueValueMin") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.blue.tailTrimValueMin = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrimBlueValueMax") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.blue.tailTrimValueMax = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				
+				
+				if (((ParamImpl)params.getParam(i)).getId().equals("RedMaxValue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.red.maxValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("RedMinValue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.red.minValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("GreenMaxValue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.green.maxValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("GreenMinValue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.green.minValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("BlueMaxValue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.blue.maxValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+				if (((ParamImpl)params.getParam(i)).getId().equals("BlueMinValue") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+						leParams.blue.minValue = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue();
+
+				
+				if (((ParamImpl)params.getParam(i)).getId().equals("RedOffset") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.red.offset = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("GreenOffset") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.green.offset = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("BlueOffset") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.blue.offset = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("RedScale") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.red.scale = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("GreenScale") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.green.scale = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+				if (((ParamImpl)params.getParam(i)).getId().equals("BlueScale") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof double[])
+					leParams.blue.scale = ((double[]) ((ParamImpl)params.getParam(i)).getDefaultValue());
+			}
+
+			addEnhancedStretchFilter(leParams, (Statistics) getFilterList().getEnvParam("SrcStatistics"), renderBands, removeEnds);
+		}
+	}
+	
+	public RasterFilter createFilter(Params params) throws FilterTypeException {
+		int[] renderBands = null;
+		Statistics stats = null;
+		Boolean removeEnds = null;
+		
+		if(params.getParamById("renderBands") != null)
+			renderBands = (int[])params.getParamById("renderBands").getDefaultValue();
+		if(params.getParamById("stats") != null)
+			stats = (Statistics)params.getParamById("stats").getDefaultValue();
+		if(params.getParamById("remove") != null)
+			removeEnds = ((Boolean)params.getParamById("remove").getDefaultValue());
+		
+		DefaultLinearStretchParams p = null;
+
+		try {
+			if(	params.getParamById("tailtrim") != null && 
+				params.getParamById("rgb") != null &&
+				params.getParamById("tailtrim").getDefaultValue() != null && 
+				params.getParamById("rgb").getDefaultValue() != null) {
+				double tailtrim = ((Double)params.getParamById("tailtrim").getDefaultValue()).doubleValue();
+				boolean rgb = ((Boolean)params.getParamById("rgb").getDefaultValue()).booleanValue();
+				p = DefaultLinearStretchParams.createStandardParam(renderBands, tailtrim, stats, rgb);
+			} else {
+				//Si stretch vale null se usan los par�metros por defecto de LinearStretchParams
+				if(	params.getParamById("stretchs") != null &&
+					params.getParamById("stretchs").getDefaultValue() == null) {
+					p = DefaultLinearStretchParams.createStandardParam(renderBands, 0.0, stats, removeEnds.booleanValue());
+				}
+			}
+		} catch (FileNotOpenException e) {
+			throw new FilterTypeException("", e);
+		} catch (RasterDriverException e) {
+			throw new FilterTypeException("", e);
+		}
+		return createEnhancedFilter(p, stats, renderBands, removeEnds != null ? removeEnds.booleanValue() : true);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementStretchListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFloatFilter.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.DefaultStretch;
+/**
+ * Filtro de realce lineal para tipos de datos float. El realce es aplicado por intervalos.
+ * Para cada pixel se obtiene en que intervalo se encuentra y se aplica la scala y offset
+ * calculados para ese intervalo.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearStretchEnhancementFloatFilter extends LinearStretchEnhancementFilter {
+		
+	public void process(int col, int line) {
+		for (int destinationBand = 0; destinationBand < renderBands.length; destinationBand++) {
+			if(renderBands[destinationBand] >= 0) {
+				float p = raster.getElemFloat(line, col, destinationBand);
+				if (destinationBand < scaleOffsetList.length)
+					processValue(p, scaleOffsetList[destinationBand], col, line, destinationBand);
+				else
+					rasterResult.setElem(line, col, destinationBand, (byte) p);
+			}
+		}
+	}
+
+	/**
+	 * Procesa un dato del raster aplicandole el factor de escala y desplazamiento que
+	 * necesita.
+	 * @param p Valor del punto
+	 * @param data Estructura de datos con los valores de escala y desplazamiento
+	 * @param col Columna del valor dentro del raster
+	 * @param line L�nea del valor dentro del raster
+	 * @param iBand N�mero de banda del valor dentro del raster
+	 * @return true si ha podido ser procesado y false si no lo hace
+	 */
+	private void processValue(float p, DefaultStretch data, int col, int line, int iBand) {
+		if (data.scale != null) {
+			if (p > data.maxValue)
+				p = (float) data.maxValue;
+			else
+				if (p < data.minValue)
+					p = (float) data.minValue;
+
+			for (int i = 0; i < data.scale.length; i++) {
+				if ((p > data.stretchIn[i] && p <= data.stretchIn[i + 1]) || (i == 0 && p == data.stretchIn[i])) {
+					p = (float) ((((double) p) - data.stretchIn[i]) * data.scale[i] + data.offset[i]);
+					break;
+				}
+			}
+			rasterResult.setElem(line, col, iBand, (byte) (((byte) p) & 0xff));
+		}
+	}
+	
+	public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearStretchEnhancementFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementByteFilter.java	(revision 15423)
@@ -0,0 +1,56 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de realce para tipos de datos short. En el m�todo de proceso procesa
+ * un solo pixel short. Asigna su valor en relaci�n a los datos calculados en el
+ * m�todo pre() del padre.
+ *
+ * @deprecated This filter should not be used. Use <code>LinearStretchEnhancementFilter</code> instead
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearEnhancementByteFilter extends LinearEnhancementFilter {
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand++) {
+			int p = (int)(raster.getElemByte(line, col, iBand) & 0xff);
+			/*if (renderBands[iBand] < 0) {
+				rasterResult.setElem(line, col, iBand, (byte) p);
+				continue;
+			}
+			if (p > maxBandValue[renderBands[iBand]])
+				p = (int) maxBandValue[renderBands[iBand]];
+			else if (p < minBandValue[renderBands[iBand]])
+				p = (int) minBandValue[renderBands[iBand]];*/
+
+			p =  (int)(((double)p) * scale[iBand] + offset[iBand]);
+			rasterResult.setElem(line, col, iBand, (byte) p);
+		}
+		writeAlphaBand(line, col);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFloatFilter.java	(revision 15423)
@@ -0,0 +1,55 @@
+/* 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.impl.grid.filter.enhancement;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+/**
+ * Filtro de realce para tipos de datos float. En el m�todo de proceso procesa
+ * un solo pixel float. Asigna su valor en relaci�n a los datos calculados en el
+ * m�todo pre() del padre.
+ * 
+ * @deprecated This filter should not be used. Use <code>LinearStretchEnhancementFilter</code> instead
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class LinearEnhancementFloatFilter extends LinearEnhancementFilter {
+
+	public void process(int col, int line) {
+		for (int iBand = 0; iBand < numberOfBandsToProcess(); iBand++) {
+			float p = raster.getElemFloat(line, col, iBand);
+			/*if(renderBands[iBand] < 0) {
+				rasterResult.setElem(line, col, iBand, (byte)p);
+				continue;
+			}
+			if (p > maxBandValue[renderBands[iBand]])
+				p = (float) maxBandValue[renderBands[iBand]];
+			else if (p < minBandValue[renderBands[iBand]])
+				p = (float) minBandValue[renderBands[iBand]];*/
+
+			int value = (int) (((int) ((p * scale[iBand]) + offset[iBand])) & 0xff);
+			rasterResult.setElem(line, col, iBand, (byte) value);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/LinearEnhancementFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementListManager.java	(revision 15423)
@@ -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.impl.grid.filter.enhancement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.grid.filter.statistics.StatisticsListManager;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor de la pila de filtros para el filtro de realce.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @deprecated This filter should not be used. Use <code>EnhancementStretchListManager</code> instead
+ */
+public class EnhancementListManager extends AbstractRasterFilterManager {
+	private static String               ID                = "Enhancement";
+	private RasterFilterListManagerImpl filterListManager = null;
+	private Statistics                  stats             = null;
+
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public EnhancementListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, EnhancementListManager.class);
+	}
+
+	/**
+	 * Constructor
+	 * @param filterListManager
+	 */
+	public EnhancementListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+		this.filterListManager = filterListManager;
+		stats = (Statistics)getFilterList().getEnvParam("SrcStatistics");
+	}
+
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("enhanced") == 0)
+			return LinearEnhancementFilter.class;
+		return null;
+	}
+
+	/**
+	 * Asigna el objeto con las estadisticas.
+	 * @param stats
+	 */
+	public void setStatistics(Statistics stats) {
+		this.stats = stats;
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+
+	/**
+	 * A�ade un filtro de realce.
+	 * La forma de inserci�n del filtro es fija ya que la inserci�n de un realce lleva implicita
+	 * la inserci�n de un filtro de recorte de colas (tailtrim), aunque no en todos los casos.
+	 * Si ya existe un filtro de realce en la lista se obtiene la posici�n de este.
+	 * Si es necesario un recorte de colas entonces se comprueba si existe un uno reemplazandose
+	 * por el nuevo y sino se insertar� uno. Al final reemplazamos el realce que existia.
+	 *
+	 * Si por el contrario no existen realce ni trim se a�aden ambos al final de la lista.
+	 * @param removeEnds eliminar extremos en los m�ximos y m�nimos
+	 * @param stats Objeto de estadisticas asociado
+	 * @param tailTrim porcentaje de recorte de colas. Ser� un valor entre 0 y 1.
+	 * @param insertionMode Modo de inserci�n
+	 * @param renderBands bandas RGB mostradas en la visualizaci�n.
+	 * @throws FilterTypeException
+	 */
+	public void addEnhancedFilter(boolean removeEnds, Statistics stats, double tailTrim, int[] renderBands) throws FilterTypeException {
+		try {
+			if (tailTrim == 0) { // En este caso siempre es necesario el m�ximo y
+				// m�nimo
+				if (!stats.isCalculated()) {
+					try {
+						stats.calculate(RasterLibrary.statisticsScale);
+					} catch (FileNotOpenException e) {
+						// No podemos aplicar el filtro
+						return;
+					} catch (RasterDriverException e) {
+						// No podemos aplicar el filtro
+						return;
+					}
+				}
+			} else {
+				StatisticsListManager slm = new StatisticsListManager(filterListManager/*, stats*/);
+				slm.addTailFilter(tailTrim, 0D, removeEnds, stats);
+			}
+
+			RasterFilter filter = createEnhancedFilter(removeEnds, stats, tailTrim, renderBands);
+			if (filter != null)
+				getFilterList().add(filter);
+		} catch (ProcessInterruptedException e) {
+			//Si se ha interrumpido no a�adimos el filtro
+		}
+	}
+
+	public static RasterFilter createEnhancedFilter(boolean removeEnds, Statistics stats, double tailTrim, int[] renderBands) {
+		RasterFilter filter = new LinearEnhancementFloatFilter();
+		if (filter != null) {
+			filter.addParam("stats", stats);
+			if (removeEnds) {
+				filter.addParam("remove", new Boolean(true));
+			} else {
+				filter.addParam("remove", new Boolean(false));
+			}
+			filter.addParam("tailTrim", new Double(tailTrim));
+			filter.addParam("renderBands", renderBands);
+		}
+
+		return filter;
+	}
+
+	/**
+	 * Obtiene un Array de Strings a partir de una pila de filtros. Cada elemento
+	 * del array tendr� la forma de elemento=valor.
+	 */
+	public List<String> getStringsFromFilterList(List<String> filterList, RasterFilter rf) {
+		if (rf instanceof LinearEnhancementFilter) {
+			filterList.add("filter.enhanced.active=true");
+			filterList.add("filter.enhanced.tailTrim=" + ((LinearEnhancementFilter) rf).getTailTrim().toString());
+			/*StringBuffer values = new StringBuffer();
+			for (int i = 0; i < ((BaseRasterFilter) rf).getRenderBands().length; i++) {
+				values.append(((BaseRasterFilter) rf).getRenderBands()[i]);
+				if (i < ((BaseRasterFilter) rf).getRenderBands().length - 1)
+					values.append(",");
+			}
+			filterList.add("filter.enhanced.renderbands=" + values.toString());*/
+			filterList.add("filter.enhanced.remove=" + ((LinearEnhancementFilter) rf).getRemoveEnds().toString());
+		}
+
+		return filterList;
+	}
+
+	public int createFilterListFromStrings(List<String> filters, String fil, int filteri) throws FilterTypeException {
+		if (fil.startsWith("filter.enhanced.active") && RasterFilterListManagerImpl.getValue(fil).equals("true") && stats != null) {
+			filters.remove(filteri);
+			double tailTrim = 0D;
+			int[] renderBands = new int[] { 0, 0, 0 };
+
+			for (int propFilter = 0; propFilter < filters.size(); propFilter++) {
+				String elem = (String) filters.get(propFilter);
+
+				if (elem.startsWith("filter.enhanced.tailTrim")) {
+					try {
+						tailTrim = new Double(RasterFilterListManagerImpl.getValue(elem)).doubleValue();
+					} catch (NumberFormatException ex) {
+						// tailTrim sigue valiendo 0
+					}
+				}
+
+				/*if (elem.startsWith("filter.enhanced.renderbands")) {
+					String value = RasterFilterListManagerImpl.getValue(elem);
+					String[] valueList = value.split(",");
+					renderBands = new int[valueList.length];
+					for (int i = 0; i < renderBands.length; i++) {
+						try {
+							renderBands[i] = Integer.parseInt(valueList[i]);
+						} catch (NumberFormatException e) {
+							// No a�ade el valor
+						}
+					}
+				}*/
+
+				if (elem.startsWith("filter.enhanced.remove")) {
+					addEnhancedFilter(Boolean.valueOf(RasterFilterListManagerImpl.getValue(elem)).booleanValue(), stats, tailTrim, renderBands);
+					filters.remove(propFilter);
+					propFilter--;
+				}
+			}
+
+			filteri = -1;
+		}
+		return filteri;
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(LinearEnhancementFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (LinearEnhancementFilter.class.isAssignableFrom(classFilter)) {
+			boolean removeEnds = false;
+			double tailTrim = 0.0;
+			int[] renderBands = { 0, 1, 2 };
+
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("RenderBands") &&
+					((ParamImpl)params.getParam(i)).getDefaultValue() instanceof String) {
+					String[] bands = new String((String) ((ParamImpl)params.getParam(i)).getDefaultValue()).split(" ");
+					renderBands[0] = new Integer(bands[0]).intValue();
+					renderBands[1] = new Integer(bands[1]).intValue();
+					renderBands[2] = new Integer(bands[2]).intValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("RemoveEnds") &&
+					((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Boolean) {
+					removeEnds = ((Boolean) ((ParamImpl)params.getParam(i)).getDefaultValue()).booleanValue();
+					continue;
+				}
+				if (((ParamImpl)params.getParam(i)).getId().equals("TailTrim") &&
+					((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Double)
+					tailTrim = ((Double) ((ParamImpl)params.getParam(i)).getDefaultValue()).doubleValue() / 100.0;
+			}
+
+			addEnhancedFilter(removeEnds, (Statistics) getFilterList().getEnvParam("SrcStatistics"), tailTrim, renderBands);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(LinearEnhancementFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		//TODO: crear un filtro de este tipo
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/EnhancementListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessContrastListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessContrastListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessContrastListManager.java	(revision 15423)
@@ -0,0 +1,167 @@
+/* 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.impl.grid.filter.enhancement;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor de los filtros de brillo y contraste. Contiene m�todos para a�adir
+ * ambos tipos de filtro en la pila.
+ *
+ * @author Miguel �ngel Querol Carratal� 
+ */
+public class BrightnessContrastListManager extends AbstractRasterFilterManager {
+	private static String   ID = "BrightnessContrast";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public BrightnessContrastListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, BrightnessContrastListManager.class);
+	}
+
+	/**
+	 * Constructor. Asigna la lista de filtros y el manager.
+	 * @param filterListManager
+	 */
+	public BrightnessContrastListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+
+	/**
+	 * A�ade un filtro de brillo a la pila de filtros.
+	 * @param incrBrillo valor de brillo a aplicar
+	 * @param removeAll true si se desea eliminar cualquier filtro de brillo que
+	 * hubiera en la pila antes y false si se acumula sobre lo que haya
+	 * @throws FilterTypeException
+	 */
+	public void addBrightnessFilter(int incrBrillo) throws FilterTypeException {
+		RasterFilter filter = createBrightnessFilter(incrBrillo);
+
+		if (filter != null)
+			getFilterList().add(filter);
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("brightness") == 0)
+			return BrightnessFilter.class;
+		if(id.compareTo("contrast") == 0)
+			return ContrastFilter.class;
+		return null;
+	}
+
+	public static RasterFilter createBrightnessFilter(int incrBrillo) {
+		RasterFilter filter = new BrightnessByteFilter();
+
+		// Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+		if (filter != null) {
+			filter.addParam("incrBrillo", new Integer(incrBrillo));
+		}
+		return filter;
+	}
+
+	/**
+	 * A�ade un filtro de contraste a la pila de filtros.
+	 * @param incrBrillo
+	 * @throws FilterTypeException
+	 */
+	public void addContrastFilter(int incrContraste) throws FilterTypeException {
+		RasterFilter filter = createContrastFilter(incrContraste);
+
+		// Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+		if (filter != null)
+			getFilterList().add(filter);
+	}
+
+	public static RasterFilter createContrastFilter(int incrContraste) {
+		RasterFilter filter = new ContrastByteFilter();
+
+		// Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+		if (filter != null)
+			filter.addParam("incrContraste", new Integer(incrContraste));
+
+		return filter;
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(BrightnessFilter.class);
+		filters.add(ContrastFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (ContrastFilter.class.isAssignableFrom(classFilter)) {
+			int contrast = 0;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("Contrast"))
+					contrast = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+			}
+			addContrastFilter(contrast);
+		}
+		if (BrightnessFilter.class.isAssignableFrom(classFilter)) {
+			int brightness = 0;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("Brightness") && ((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+					brightness = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+			}
+			addBrightnessFilter(brightness);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(ContrastFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		if(	params.getParamById("Brightness") != null) {
+			int brightness = ((Integer) params.getParamById("Brightness").getDefaultValue()).intValue();
+			return createBrightnessFilter(brightness);
+		}
+		if(	params.getParamById("Contrast") != null) {
+			int contrast = ((Integer) params.getParamById("Contrast").getDefaultValue()).intValue();
+			return createContrastFilter(contrast);
+		}
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/enhancement/BrightnessContrastListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRasterFilterList.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRasterFilterList.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRasterFilterList.java	(revision 15423)
@@ -0,0 +1,760 @@
+/* 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.impl.grid.filter;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Stack;
+import java.util.TreeMap;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.FilterManagerException;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.grid.FilterListChangeEvent;
+import org.gvsig.fmap.dal.coverage.grid.FilterListChangeListener;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterListManager;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+/**
+ * Esta clase representa la lista de filtros que debe ser manejada desde el
+ * RasterFilterListManager.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultRasterFilterList implements RasterFilterList {
+	public static final String      PERSISTENT_NAME        = "RasterFilterList_Persistent";
+    public static final String      PERSISTENT_DESCRIPTION = "RasterFilterList Persistent";
+	private Buffer                  initialRasterBuffer    = null;
+	private Buffer                  outputRasterBuffer     = null;
+	private int                     typeFilter             = -1;
+	private TreeMap<String, Object>
+	                                environment            = new TreeMap<String, Object>();
+
+	private List<RasterFilter>        
+	                                list                   = new ArrayList<RasterFilter>();
+	private Stack<List<RasterFilter>>            
+	                                status                 = new Stack<List<RasterFilter>>();
+	/**
+	 * Array de listeners que ser�n informados cuando cambia la lista de filtros
+	 */
+	private List<FilterListChangeListener>        
+	                                filterListListener     = new ArrayList<FilterListChangeListener>();
+	private RasterFilterListManagerImpl
+                                    manager                = null;
+	
+	/**
+	 * Asigna un listener a la lista que ser� informado cuando cambie un
+	 * filtro o posici�n en la lista.
+	 * @param listener FilterListListener
+	 */
+	public void addFilterListListener(FilterListChangeListener listener) {
+		filterListListener.add(listener);
+	}
+
+	/**
+	 * M�todo llamado cuando hay un cambio en una propiedad de visualizaci�n
+	 */
+	private void callFilterListChanged(Object obj) {
+		if(filterListListener != null) {
+			for (int i = 0; i < filterListListener.size(); i++) {
+				FilterListChangeEvent ev = new FilterListChangeEvent(obj);
+				((FilterListChangeListener)filterListListener.get(i)).filterListChanged(ev);
+			}
+		}
+	}
+
+	/**
+	 * A�ade un par�metro a la lista de filtros. Estos par�metros luego pueden ser
+	 * utilizados por los managers que se registren
+	 * @param key Nombre del par�metro que coincide con el nombre de la clase.
+	 * @param value Objeto
+	 */
+	public void addEnvParam(String key, Object value) {
+		environment.put(key, value);
+	}
+
+	/**
+	 * Obtiene un par�metro de la lista de filtros.
+	 * @param key Identificador del par�metro. Coincide con el nombre de la clase del par�metro.
+	 */
+	public Object getEnvParam(String key) {
+		return environment.get(key);
+	}
+
+	/**
+	 * Controla que los tipos de entrada y salida de los filtros sean los
+	 * correctos
+	 * @throws FilterTypeException
+	 */
+	public void controlTypes() throws FilterTypeException {
+		RasterFilterListManagerImpl stackManager = new RasterFilterListManagerImpl(this);
+		stackManager.controlTypes();
+	}
+
+	/**
+	 * A�ade un filtro al final de la lista
+	 * @param filter        filtro a�adido
+	 * @throws FilterTypeException
+	 */
+	public void add(RasterFilter filter) throws FilterTypeException {
+		if (isActive(filter.getName()))
+			replace(filter, filter.getName());
+		else {
+			list.add(filter);
+			controlTypes();
+		}
+		filter.setEnv(environment);
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * Sustituye un filtro de una posici�n de la pila por otro
+	 * @param filter
+	 * @param i
+	 * @throws FilterTypeException
+	 */
+	public void replace(RasterFilter filter, String name) throws FilterTypeException {
+		boolean changed = false;
+		filter.setEnv(environment);
+		for (int i = list.size() - 1; i >= 0; i--)
+			if (((BaseRasterFilter) list.get(i)).getName().equals(name)) {
+				list.remove(i);
+				list.add(i, filter);
+				changed = true;
+			}
+
+		if (changed)
+			controlTypes();
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * A�ade un filtro en la lista en la posici�n indicada.
+	 * @param filter        filtro a�adido
+	 * @param pos	posici�n
+	 * @throws FilterTypeException
+	 */
+	public void add(RasterFilter filter, int pos) throws FilterTypeException {
+		try {
+			list.add(pos, filter);
+			controlTypes();
+		} catch (IndexOutOfBoundsException e) {
+			add(filter);
+		}
+		filter.setEnv(environment);
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * Elimina un filtro a partir de su nombre
+	 * @param name Nombre del filtro a eliminar
+	 * @throws FilterTypeException
+	 */
+	public void remove(String name) throws FilterTypeException {
+		boolean changed = false;
+		for (int i = list.size() - 1; i >= 0; i--)
+			if (((BaseRasterFilter) list.get(i)).getName().equals(name)) {
+				list.remove(i);
+				changed = true;
+			}
+		if (changed)
+			controlTypes();
+		callFilterListChanged(this);
+	}
+	
+	public void removeAll() {
+		list.clear();
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * Elimina un filtro por clase.
+	 *
+	 * @param baseFilterClass
+	 * @throws FilterTypeException
+	 */
+	public void remove(Class<?> baseFilterClass) throws FilterTypeException {
+		boolean changed = false;
+		for (int i = 0; i < lenght(); i++)
+			if (baseFilterClass.isInstance(list.get(i))) {
+				list.remove(i);
+				i--;
+				changed = true;
+			}
+		if (changed)
+			controlTypes();
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * Devuelve el tipo de dato de retorno al aplicar la pila de filtros
+	 * @return
+	 */
+	public int getOutDataType() {
+		if (list.size() > 0)
+			return ((BaseRasterFilter) list.get(list.size() - 1)).getOutRasterDataType();
+		else
+			if(outputRasterBuffer != null)
+				return outputRasterBuffer.getDataType();
+			else
+				return initialRasterBuffer.getDataType();
+	}
+
+	/**
+	 * Devuelve el raster resultado de la aplicacion de la pila de filtros
+	 * @return
+	 */
+	public Buffer getResult() {
+		return outputRasterBuffer;
+	}
+
+	/**
+	 * Obtiene la cantidad de filtros en la lista
+	 * @return N�mero de filtros apilados
+	 */
+	public int lenght() {
+		return list.size();
+	}
+
+	/**
+	 * Obtiene el filtro apilado de la posici�n i o null si el indice es incorrecto
+	 * @param i        Posici�n a acceder en la pila
+	 * @return        Filtro
+	 */
+	public RasterFilter get(int i) {
+		if (i >= list.size() || i < 0)
+			return null;
+		return (BaseRasterFilter) list.get(i);
+	}
+
+	/**
+	 * Obtiene el filtro apilado de nombre name o null si no existe
+	 * @param i       Nombre del filtro buscado
+	 * @return        Filtro
+	 */
+	public RasterFilter get(String name) {
+		for (int i = list.size() - 1; i >= 0; i--)
+			if (((BaseRasterFilter) list.get(i)).getName().equals(name))
+				return (BaseRasterFilter) list.get(i);
+		return null;
+	}
+
+	/**
+	 * Obtiene el filtro apilado que corresponde con el nombre
+	 * @param name	Nombre de filtro
+	 * @return      Filtro en caso de que exista un filtro apilado de ese tipo
+	 * o null si no hay ninguno.
+	 */
+	public RasterFilter getByName(String name) {
+		for (int i = 0; i < lenght(); i++)
+			if (((BaseRasterFilter) list.get(i)).getName().equals(name))
+				return (BaseRasterFilter) list.get(i);
+		return null;
+	}
+
+	/**
+	 * Obtiene el primer filtro de la lista que es instancia de la clase pasada por
+	 * par�metro
+	 * @param baseFilterClass Filtro base
+	 * @return RasterFilter
+	 */
+	public RasterFilter getFilterByBaseClass(Class<?> baseFilterClass) {
+		for (int i = 0; i < lenght(); i++)
+			if (baseFilterClass.isInstance(list.get(i)))
+				return (BaseRasterFilter) list.get(i);
+		return null;
+	}
+
+	/**
+	 * Obtiene el tipo del filtro de la pila de la posici�n i
+	 * @param i Posici�n a acceder en la pila
+	 * @return tipo de filtro
+	 */
+	public String getName(int i) {
+		return ((BaseRasterFilter) list.get(i)).getName();
+	}
+
+	/**
+	 * Removes all filter of this stack
+	 */
+	public void clear() {
+		list.clear();
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * Replaces a filter in the i position by another
+	 * @param filter
+	 * @param i
+	 */
+	public void replace(RasterFilter filter, int i) {
+		filter.setEnv(environment);
+		list.remove(i);
+		list.add(i, filter);
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * Moves a specific filter to anothe position
+	 * @param filter 
+	 * 			Filter to move
+	 * @param position 
+	 * 			New position
+	 * @return If the filter existed returns true else it will return false
+	 */
+	public boolean move(Class<?> filter, int position) {
+		BaseRasterFilter f = null;
+		for (int i = 0; i < list.size(); i++)
+			if(filter.isInstance(list.get(i))) {
+				f = (BaseRasterFilter) list.get(i);
+				list.remove(i);
+				break;
+			}
+		if(f != null) {
+			list.add(position, f);
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Asigna el raster de entrada inicial
+	 * @param raster
+	 */
+	public void setInitRasterBuf(Buffer raster) {
+		initialRasterBuffer = raster;
+		if(initialRasterBuffer != null)
+			typeFilter = initialRasterBuffer.getDataType();
+	}
+
+	/**
+	 * Devuelve el tipo de datos inicial de la lista
+	 * @return Tipo de dato del raster inicial
+	 */
+	public int getInitDataType() {
+		return typeFilter;
+	}
+
+	/**
+	 * Asigna el tipo de dato inicial
+	 * @param dt
+	 */
+	public void setInitDataType(int dt) {
+		this.typeFilter = dt;
+	}
+
+	/**
+	 * M�todo que devuelve true si el tipo de filtro pasado por par�metro est� en la
+	 * pila y false si no lo est�.
+	 * @param type        Tipo de par�metro a comprobar
+	 * @return true si est� en la pila y false si no lo est�
+	 */
+	public boolean isActive(String name) {
+		for (int i = list.size() - 1; i >= 0; i--)
+			if (((RasterFilter) list.get(i)).getName().equals(name))
+				return true;
+		return false;
+	}
+
+	/**
+	 * M�todo que devuelve true si el tipo de filtro pasado por par�metro est� en
+	 * la pila y false si no lo est�.
+	 *
+	 * @param filter Tipo de filtro a comprobar
+	 * @return true si est� en la pila y false si no lo est�
+	 */
+	public boolean isActive(RasterFilter filter) {
+		for (int i = list.size() - 1; i >= 0; i--)
+			if (((RasterFilter) list.get(i)).equals(filter))
+				return true;
+		return false;
+	}
+
+	/**
+	 * Devuelve la posici�n en la lista de una clase de filtro concreta
+	 *
+	 * @param c Clase a buscar en la lista
+	 * @return posici�n en la lista
+	 */
+	public int getPosition(Class<?> c) {
+		for (int i = 0; i < list.size(); i++)
+			if (c.isInstance(list.get(i)))
+				return i;
+		return -1;
+	}
+
+	/**
+	 * Aplica los filtros de la pila sobre el buffer correspondiente
+	 * @param dataType
+	 * @throws ProcessInterruptedException
+	 */
+	private void executeFilterByDataType(int dataType) throws ProcessInterruptedException, FilterAddException {
+		if(outputRasterBuffer != null && initialRasterBuffer != outputRasterBuffer) {
+			outputRasterBuffer.dispose();
+			outputRasterBuffer = null;
+		}
+
+		Buffer bufferToProcess = initialRasterBuffer;
+		for (int i = 0; i < list.size(); i++) {
+			BaseRasterFilter filter = (BaseRasterFilter) list.get(i);
+
+			// TODO: Arquitectura. Quitar el ControlTypes y en este momento
+			// cerciorarse de si el tipo del filtro es totalmente el correcto o hay
+			// que recrearlo. Ejemplo:
+			// Si el filtro que tenemos antes de preprocesar es de tipo Byte y la
+			// entrada de datos es de tipo float, reconstruir solo este filtro para
+			// que sea de tipo float
+
+			filter.addParam("raster", bufferToProcess);
+			filter.execute();
+
+			if (filter.getResult(RasterFilter.RESULT_BUFFER) != null) {
+				//Si no es el �ltimo filtro se asigna el buffer de la pr�xima iteraci�n y se libera el anterior
+				if(i < (list.size() - 1)) {
+					if(bufferToProcess != null && initialRasterBuffer != bufferToProcess)
+						bufferToProcess.dispose();
+					bufferToProcess = (Buffer) filter.getResult(RasterFilter.RESULT_BUFFER);
+				} else {
+					//Si es el �ltimo se carga el de salida
+					outputRasterBuffer = (Buffer) filter.getResult(RasterFilter.RESULT_BUFFER);
+				}
+			}
+			
+			if (i == list.size() - 1  && filter.getResult(RasterFilter.RESULT_TRANSPARENCY) != null) {
+				addEnvParam("Transparency", filter.getResult(RasterFilter.RESULT_TRANSPARENCY));
+			}
+		}
+	}
+
+	/**
+	 * Aplica los filtros sobre un RasterBuf
+	 * @return Buffer de salida
+	 * @throws ProcessInterruptedException
+	 * @throws FilterAddException 
+	 */
+	public Buffer execute() throws ProcessInterruptedException, FilterAddException {
+		if (initialRasterBuffer == null)
+			return null;
+		executeFilterByDataType(initialRasterBuffer.getDataType());
+		return initialRasterBuffer;
+	}
+
+	/**
+	 * Muestra el contenido de la pila de filtros para depuraci�n
+	 */
+	public void show() {
+		System.out.println("--------------------------------------------");
+
+		for (int i = 0; i < list.size() ; i++)
+			System.out.println("FILTRO:" + i + " NAME:" + ((BaseRasterFilter) list.get(i)).getName() + " FIL:" + ((BaseRasterFilter) list.get(i)).toString());
+	}
+
+	public void resetPercent() {
+		for (int i = 0; i < list.size(); i++)
+			((BaseRasterFilter) list.get(i)).resetPercent();
+	}
+
+	public int getPercent() {
+		int percent = 0;
+		if (list == null || list.size() == 0)
+			return 0;
+		for (int i = 0; i < list.size(); i++)
+			percent += ((BaseRasterFilter) list.get(i)).getPercent();
+
+		percent = percent / list.size();
+		return percent;
+	}
+
+	/**
+	 * Guarda el estado de la lista de filtros en una pila, que se podr�
+	 * ir recuperando con popStatus()
+	 */
+	public void pushStatus() {
+		status.push(getStatusCloned());
+	}
+
+	/**
+	 * Obtiene el estado actual de los filtros, el ArrayList devuelto es una
+	 * clonaci�n del original, asi no compartiran datos.
+	 * @return
+	 */
+	public List<RasterFilter> getStatusCloned() {
+		List<RasterFilter> newArray = new ArrayList<RasterFilter>();
+		for (int i = 0; i < list.size(); i++)
+			try {
+				newArray.add((RasterFilter)(((BaseRasterFilter) list.get(i)).clone()));
+			} catch (CloneNotSupportedException e) {
+				System.out.println("No se ha podido clonar");
+			}
+		return newArray;
+	}
+
+	/**
+	 * Saves the current status of the filters
+	 * @param newArray
+	 */
+	public void setStatus(List<RasterFilter> newArray) {
+		if(list != null)
+			list.clear();
+		if(newArray == null)
+			return;
+		for (int i = 0; i < newArray.size(); i++)
+			if(list != null)
+				list.add(newArray.get(i));
+		callFilterListChanged(this);
+	}
+
+	/**
+	 * Gets a status saved before through the call <code>pushStatus()</code>
+	 */
+	public void popStatus() {
+		if (status.size() <= 0)
+			return;
+
+		setStatus((List<RasterFilter>) status.pop());
+	}
+
+	/**
+	 * Gets a TreeMap with the environment parameters 
+	 * @return TreeMap
+	 */
+	public TreeMap<String, Object> getEnv() {
+		return environment;
+	}
+
+	/**
+	 * Sets a TreeMap with the environment parameters 
+	 * @param env
+	 */
+	public void setEnv(TreeMap<String, Object> env) {
+		this.environment = env;
+	}
+	
+	/*public void createFilterListFromStrings(List<String> f) throws FilterTypeException {
+		RasterFilterListManagerImpl.createFilterListFromStrings(this, f);
+	}*/
+	
+	public RasterFilterListManager getManagerByID(String id) throws FilterManagerException {
+		return new RasterFilterListManagerImpl(this).getManagerByID(id);
+	}
+	
+	public RasterFilterListManager getManagerByFilterClass(Class<?> c) {
+		if(manager == null)
+			manager = new RasterFilterListManagerImpl(this);
+		return manager.getManagerByFilterClass(c);
+	}
+	
+	public RasterFilterListManager getManagerByClass(Class<?> clase) {
+		Object obj = null;
+		Class<?>[] args = { RasterFilterList.class };
+		try {
+			Constructor<?> hazNuevo = clase.getConstructor(args);
+			Object[] args2 = { this };
+			obj = hazNuevo.newInstance(args2);
+		} catch (SecurityException e) {
+			e.printStackTrace();
+		} catch (NoSuchMethodException e) {
+			e.printStackTrace();
+		} catch (IllegalArgumentException e) {
+			e.printStackTrace();
+		} catch (InstantiationException e) {
+			e.printStackTrace();
+		} catch (IllegalAccessException e) {
+			e.printStackTrace();
+		} catch (InvocationTargetException e) {
+			e.printStackTrace();
+		}
+		return (RasterFilterListManager)obj;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterFilter");
+		Iterator<?> it = point.iterator();
+		while(it.hasNext()) {
+			ExtensionPoint.Extension entry = (ExtensionPoint.Extension) it.next();
+			if (entry != null) {
+				Class<?> managerClass = entry.getExtension();
+				RasterFilterListManager manager = getManagerByClass(managerClass);
+				if(manager != null) {
+					Class<?> c = manager.getFilterClassByID(id);
+					if(c != null)
+						return c;
+				}
+			}
+		}
+		return null;
+	}
+	
+	public Params createEmptyFilterParams() {
+		return new ParamsImpl();
+	}
+	
+	public List<Class<?>> getRegisteredFilterList() {
+		if(manager == null)
+			manager = new RasterFilterListManagerImpl(this);
+		return manager.getRasterFilterList();
+	}
+	
+	public List<Class<?>> getRegisteredFilterListByDataType(int dataType) {
+		if(manager == null)
+			manager = new RasterFilterListManagerImpl(this);
+		return manager.getRasterFilterListByDataType(dataType);
+	}
+	
+	public RasterFilter createEmptyFilter(String strPackage) throws FilterTypeException {
+		Class<?> filterClass = null;
+		try {
+			filterClass = Class.forName(strPackage.trim());
+		} catch (ClassNotFoundException e) {
+			throw new FilterTypeException("No puedo instanciar " + strPackage.trim());
+		}
+
+		Constructor<?> con = null;
+		try {
+			con = filterClass.getConstructor();
+		} catch (SecurityException e) {
+			throw new FilterTypeException("");
+		} catch (NoSuchMethodException e) {
+			throw new FilterTypeException("");
+		}
+
+		BaseRasterFilter newFilter = null;
+		try {
+			newFilter = (BaseRasterFilter) con.newInstance();
+		} catch (IllegalArgumentException e) {
+			throw new FilterTypeException("");
+		} catch (InstantiationException e) {
+			throw new FilterTypeException("");
+		} catch (IllegalAccessException e) {
+			throw new FilterTypeException("");
+		} catch (InvocationTargetException e) {
+			throw new FilterTypeException("");
+		}
+		return newFilter;
+	}
+
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		this.typeFilter = state.getInt("typeFilter");
+		
+		/*List<PersistencyFilterParam> listFilterUsed = state.getList("paramlist");
+		
+		ArrayList<Exception> exc = new ArrayList<Exception>();
+		for (int i = 0; i < listFilterUsed.size(); i++) {
+			try {
+				PersistencyFilterParam pfp = (PersistencyFilterParam) listFilterUsed.get(i);
+				if(pfp != null && pfp.getFilterClass() != null && pfp.getFilterParam() != null) {
+					RasterFilterListManager filterManager = getManagerByFilterClass(pfp.getFilterClass());
+					filterManager.setFilterList(this);
+					if(filterManager != null)
+						filterManager.addFilter(pfp.getFilterClass(), pfp.getFilterParam());
+				}
+			} catch (FilterTypeException e) {
+				exc.add(e);
+			}
+		}*/
+		
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("typeFilter", typeFilter);
+		
+		/*ArrayList<PersistencyFilterParam> filters = new ArrayList<PersistencyFilterParam>();
+		for (int i = 0; i < list.size(); i++) {
+			RasterFilter f = list.get(i);
+			Params uipar = f.getUIParams(f.getName());
+			PersistencyFilterParam param = new PersistencyFilterParam();
+			param.setFilterParam(uipar);
+			param.setFilterClass(f.getClass());
+			param.setFilterName(f.getName());
+			filters.add(param);
+		}
+		state.set("paramlist", filters);*/
+	}	
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DefaultRasterFilterList.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			
+			definition.addDynFieldInt("typeFilter").setMandatory(false);
+			//definition.addDynFieldList("paramlist").setClassOfItems(PersistencyFilterParam.class).setMandatory(false);
+		}
+	}
+	
+	/**
+	 * Releases buffer resources
+	 */
+	public void dispose() {
+		if (initialRasterBuffer != null)
+			initialRasterBuffer.dispose();
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	public Transparency getTransparency() {
+		return (Transparency)getEnvParam("Transparency");
+	}
+	
+	protected void finalize() throws Throwable {
+		initialRasterBuffer = null;
+		if(filterListListener != null) {
+			filterListListener.clear();
+			filterListListener = null;
+		}
+		if(status != null) {
+			status.clear();
+			status = null;
+		}
+		if(list != null) {
+			list.clear();
+			list = null;
+		}
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/DefaultRasterFilterList.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianDoubleFilter.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.impl.grid.filter.correction;
+
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+/**
+ * Filtro de Mediana que se aplica en la imagen. Toma como entrada la imagen y
+ * el lado de la ventana de filtrado.
+ * 
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class MedianDoubleFilter extends MedianFilter {
+	private double[] window = null;
+	
+	public MedianDoubleFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new double[sizeWindow];
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_DOUBLE, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	public void process(int col, int line) {
+		// Obtener el vector con la ventanas de muestras
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			for (int i = -halfSide; i <= halfSide; i++)
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemDouble(line + j, col + i, band);
+						k++;
+					}
+				}
+			// Ordenar los valores de las ventanas, se supone que usa quickSort.
+			Arrays.sort(window, 0, k);
+
+			// Extraer los elementos centrales y asignarselos al pixel (x,y)
+			rasterResult.setElem(line, col, band, window[k >> 1]);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_DOUBLE;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_DOUBLE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeByteFilter.java	(revision 15423)
@@ -0,0 +1,93 @@
+/* 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.impl.grid.filter.correction;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+
+/**
+ * Proceso que aplica el filtro de Moda a un raster de tipo byte
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ModeByteFilter extends ModeFilter {
+	private int[]                   window = null;
+	private int                     tempValue       = 0;
+
+	public ModeByteFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new int[sizeWindow];
+	}
+
+	public void process(int col, int line) {
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			count = 0;
+			for (int i = -halfSide; i <= halfSide; i++) {
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemByte(line + j, col + i, band) & 0xff;
+						if(i == -halfSide && j == -halfSide) 
+							tempValue = window[k];
+						if(tempValue == window[k])
+							count ++;
+						k++;
+					}
+				}
+			}
+
+			if(count > sizeWindow)
+				return;
+			
+			k = 1;
+			while(k < window.length) {
+				int auxCount = 0;
+				for (int i = k; i < window.length; i++) {
+					if(window[i] == window[k])
+						auxCount ++;
+				}
+				if(auxCount > count) {
+					count = auxCount;
+					tempValue = window[k];
+					if(count > sizeWindow)
+						return;
+				}
+				k++;
+			}
+			rasterResult.setElem(line, col, band, (byte) tempValue);
+		}
+		
+		writeAlphaBand(line, col);
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/package.html	(revision 15423)
@@ -0,0 +1,7 @@
+<html>
+	<body>
+		<P>
+			Filtros de correcci�n del raster
+		</P>
+	</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeManager.java	(revision 15423)
@@ -0,0 +1,125 @@
+/* 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.impl.grid.filter.correction;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+
+/**
+ * Gestor de la pila de filtros para el filtro de moda.
+ *
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ModeManager extends AbstractRasterFilterManager {
+	private static String   ID = "Moda";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public ModeManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, ModeManager.class);
+	}
+
+	/**
+	 * Constructor. Asigna la lista de filtros y el manager.
+	 * @param filterListManager
+	 */
+	public ModeManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("moda") == 0)
+			return ModeFilter.class;
+		return null;
+	}
+
+	/**
+	 * A�ade un filtro de moda a la pila de filtros.
+	 * @param sideLong
+	 * @throws FilterTypeException
+	 */
+	public void addModeFilter(int sideLong) throws FilterTypeException {
+		RasterFilter filter = new ModeByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			filter.addParam("sideLong", new Integer(sideLong));
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(ModeFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (ModeFilter.class.isAssignableFrom(classFilter)) {
+			int sideLong = 0;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("sideLong") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+					sideLong = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+			}
+			addModeFilter(sideLong);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(ModeFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		if(	params.getParamById("sideLong") != null) {
+			int sideLong = ((Integer) params.getParamById("sideLong").getDefaultValue()).intValue();
+			RasterFilter filter = new ModeByteFilter();
+			filter.addParam("sideLong", new Integer(sideLong));
+			return filter;
+		}
+		return null;
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFloatFilter.java	(revision 15423)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.correction;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+
+/**
+ * Proceso que aplica el filtro de Moda a un raster de tipo float
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ModeFloatFilter extends ModeFilter {
+	private float[]                   window = null;
+	private float                     tempValue       = 0;
+
+	public ModeFloatFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new float[sizeWindow];
+	}
+
+	public void process(int col, int line) {
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			count = 0;
+			for (int i = -halfSide; i <= halfSide; i++) {
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemFloat(line + j, col + i, band);
+						if(i == -halfSide && j == -halfSide) 
+							tempValue = window[k];
+						if(tempValue == window[k])
+							count ++;
+						k++;
+					}
+				}
+			}
+
+			if(count > sizeWindow)
+				return;
+			
+			k = 1;
+			while(k < window.length) {
+				int auxCount = 0;
+				for (int i = k; i < window.length; i++) {
+					if(window[i] == window[k])
+						auxCount ++;
+				}
+				if(auxCount > count) {
+					count = auxCount;
+					tempValue = window[k];
+					if(count > sizeWindow)
+						return;
+				}
+				k++;
+			}
+			rasterResult.setElem(line, col, band, (float) tempValue);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_FLOAT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianIntegerFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianIntegerFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianIntegerFilter.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.impl.grid.filter.correction;
+
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+/**
+ * Filtro de Mediana que se aplica en la imagen. Toma como entrada la imagen y
+ * el lado de la ventana de filtrado.
+ *
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class MedianIntegerFilter extends MedianFilter {
+	private int[] window = null;
+	
+	public MedianIntegerFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new int[sizeWindow];
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_INT, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	public void process(int col, int line) {
+		// Obtener el vector con la ventanas de muestras
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			for (int i = -halfSide; i <= halfSide; i++)
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemInt(line + j, col + i, band) & 0xff;
+						k++;
+					}
+				}
+			// Ordenar los valores de las ventanas, se supone que usa quickSort.
+			Arrays.sort(window, 0, k);
+
+			// Extraer los elementos centrales y asignarselos al pixel (x,y)
+			rasterResult.setElem(line, col, band, (int) window[k >> 1]);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_INT;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_INT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianIntegerFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFilter.java	(revision 15423)
@@ -0,0 +1,109 @@
+/* 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.impl.grid.filter.correction;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+/**
+ * Clase base para los filtros de mediana.
+ *
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ */
+public class MedianFilter extends BaseRasterFilter {
+	public static String[] names = new String[] {"median"};
+	/**
+	 * Variable para guardar el lado de la ventana de filtrado
+	 */
+	protected int                   sideWindow		= 0;
+	protected int                   sizeWindow      = 0;
+	protected int                   halfSide        = 0;
+
+
+	public MedianFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		sideWindow = ((Integer) params.get("ladoVentana")).intValue();
+		
+		//El lado de la ventana debe ser positivo e impar.
+		sideWindow = Math.abs(sideWindow);
+		if (sideWindow % 2 == 0)
+			sideWindow++;
+		sizeWindow = sideWindow * sideWindow;
+		halfSide = (sideWindow - 1) >> 1;
+	}
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	public String getGroup() {
+		return "espaciales";
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public int getOutRasterDataType() {
+		return 0;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		if(params != null) {
+			Object obj = params.get("ladoVentana");
+			if(obj != null && obj instanceof Integer) {
+				sideWindow = ((Integer)obj).intValue();
+				sideWindow = Math.abs(sideWindow);
+			}
+		}
+		Params params = new ParamsImpl();
+		params.setParam("ladoVentana",
+				new Integer(sideWindow),
+				Params.SLIDER,
+				new String[] {"1", "7", "0", "1", "25" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		return params;
+	}
+
+	public void process(int x, int y) {
+	}
+	
+	/**
+	 * Obtiene el tama�o del lado de la ventana
+	 * @return entero que representa el tama�o del lado de la 
+	 * ventana en p�xeles
+	 */
+	public int getSideWindow() {
+		return sideWindow;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianShortFilter.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.impl.grid.filter.correction;
+
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+/**
+ * Filtro de Mediana que se aplica en la imagen. Toma como entrada la imagen y
+ * el lado de la ventana de filtrado.
+ *
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class MedianShortFilter extends MedianFilter {
+	private	short[] window = null;
+	
+	public MedianShortFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new short[sideWindow];
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_SHORT, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	public void process(int col, int line) {
+		// Obtener el vector con la ventanas de muestras
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			for (int i = -halfSide; i <= halfSide; i++)
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemShort(line + j, col + i, band);
+						k++;
+					}
+				}
+			// Ordenar los valores de las ventanas, se supone que usa quickSort.
+			Arrays.sort(window, 0, k);
+
+			// Extraer los elementos centrales y asignarselos al pixel (x,y)
+			rasterResult.setElem(line, col, band, window[k >> 1]);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_SHORT;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianListManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianListManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianListManager.java	(revision 15423)
@@ -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.impl.grid.filter.correction;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterTypeException;
+import org.gvsig.fmap.dal.coverage.grid.AbstractRasterFilterManager;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilter;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.raster.impl.grid.filter.RasterFilterListManagerImpl;
+import org.gvsig.raster.impl.store.ParamImpl;
+/**
+ * Gestor de la pila de filtros para el filtro de mediana.
+ *
+ * @author Diego Guerrero Sevilla  <diego.guerrero@uclm.es>
+ */
+public class MedianListManager extends AbstractRasterFilterManager {
+	private static String   ID = "Median";
+	
+	/**
+	 * Default constructor. Sets the filter list.
+	 * @param filterList
+	 */
+	public MedianListManager(RasterFilterList filterList) {
+		super(filterList);
+	}
+	
+	public String getManagerID() {
+		return ID;
+	}
+
+	public static void register() {
+		AbstractRasterFilterManager.register(ID, MedianListManager.class);
+	}
+	
+	/**
+	 * Constructor. Asigna la lista de filtros y el manager.
+	 * @param filterListManager
+	 */
+	public MedianListManager(RasterFilterListManagerImpl filterListManager) {
+		super(filterListManager.getFilterList());
+	}
+	
+	public boolean isDataTypeSupported(int dataType) {
+		return true;
+	}
+	
+	public Class<?> getFilterClassByID(String id) {
+		if(id.compareTo("median") == 0)
+			return MedianFilter.class;
+		return null;
+	}
+
+	/**
+	 * A�ade un filtro de mediana a la pila de filtros.
+	 * @param ladoVentana
+	 * @throws FilterTypeException
+	 */
+	public void addMedianFilter(int ladoVentana) throws FilterTypeException {
+		RasterFilter filter = new MedianByteFilter();
+
+		//Cuando el filtro esta creado, tomamos los valores y lo a�adimos a la pila
+
+		if (filter != null) {
+			filter.addParam("ladoVentana", new Integer(ladoVentana));
+			getFilterList().add(filter);
+		}
+	}
+
+	public List<Class<?>> getRasterFilterList() {
+		List<Class<?>> filters = new ArrayList<Class<?>>();
+		filters.add(MedianFilter.class);
+		return filters;
+	}
+
+	public void addFilter(Class<?> classFilter, Params params) throws FilterTypeException {
+		if (MedianFilter.class.isAssignableFrom(classFilter)) {
+			int ladoVentana = 0;
+			for (int i = 0; i < params.getNumParams(); i++) {
+				if (((ParamImpl)params.getParam(i)).getId().equals("ladoVentana") &&
+						((ParamImpl)params.getParam(i)).getDefaultValue() instanceof Integer)
+					ladoVentana = ((Integer) ((ParamImpl)params.getParam(i)).getDefaultValue()).intValue();
+			}
+			addMedianFilter(ladoVentana);
+		}
+	}
+	
+	public void addFilter(Params params) throws FilterTypeException {
+		addFilter(MedianFilter.class, params);
+	}
+	
+	public RasterFilter createFilter(Params params) {
+		if(	params.getParamById("ladoVentana") != null) {
+			int ladoVentana = ((Integer) params.getParamById("ladoVentana").getDefaultValue()).intValue();
+			RasterFilter filter = new MedianByteFilter();
+			filter.addParam("ladoVentana", new Integer(ladoVentana));
+			return filter;
+		}
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianListManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeDoubleFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeDoubleFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeDoubleFilter.java	(revision 15423)
@@ -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.impl.grid.filter.correction;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+
+/**
+ * Proceso que aplica el filtro de Moda a un raster de tipo double
+ * 
+ * 23/07/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ModeDoubleFilter extends ModeFilter {
+	private double[]                   window = null;
+	private double                     tempValue       = 0;
+
+	public ModeDoubleFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new double[sizeWindow];
+	}
+
+	public void process(int col, int line) {
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			count = 0;
+			for (int i = -halfSide; i <= halfSide; i++) {
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemDouble(line + j, col + i, band);
+						if(i == -halfSide && j == -halfSide) 
+							tempValue = window[k];
+						if(tempValue == window[k])
+							count ++;
+						k++;
+					}
+				}
+			}
+
+			if(count > sizeWindow)
+				return;
+			
+			k = 1;
+			while(k < window.length) {
+				int auxCount = 0;
+				for (int i = k; i < window.length; i++) {
+					if(window[i] == window[k])
+						auxCount ++;
+				}
+				if(auxCount > count) {
+					count = auxCount;
+					tempValue = window[k];
+					if(count > sizeWindow)
+						return;
+				}
+				k++;
+			}
+			rasterResult.setElem(line, col, band, (double) tempValue);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_DOUBLE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeDoubleFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeIntFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeIntFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeIntFilter.java	(revision 15423)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.correction;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+
+/**
+ * Proceso que aplica el filtro de Moda a un raster de tipo entero
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ModeIntFilter extends ModeFilter {
+	private int[]                   window          = null;
+	private int                     tempValue       = 0;
+
+	public ModeIntFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new int[sizeWindow];
+	}
+
+	public void process(int col, int line) {
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			count = 0;
+			for (int i = -halfSide; i <= halfSide; i++) {
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemInt(line + j, col + i, band);
+						if(i == -halfSide && j == -halfSide) 
+							tempValue = window[k];
+						if(tempValue == window[k])
+							count ++;
+						k++;
+					}
+				}
+			}
+
+			if(count > sizeWindow)
+				return;
+			
+			k = 1;
+			while(k < window.length) {
+				int auxCount = 0;
+				for (int i = k; i < window.length; i++) {
+					if(window[i] == window[k])
+						auxCount ++;
+				}
+				if(auxCount > count) {
+					count = auxCount;
+					tempValue = window[k];
+					if(count > sizeWindow)
+						return;
+				}
+				k++;
+			}
+			rasterResult.setElem(line, col, band, (int) tempValue);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_INT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeIntFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianByteFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianByteFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianByteFilter.java	(revision 15423)
@@ -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.impl.grid.filter.correction;
+
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+/**
+ * Filtro de Mediana que se aplica en la imagen. Toma como entrada la imagen y
+ * el lado de la ventana de filtrado.
+ *
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class MedianByteFilter extends MedianFilter {
+	private int[] window = null;
+
+	public MedianByteFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new int[sizeWindow];
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_BYTE, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	public void process(int col, int line) {
+		// Obtener el vector con la ventanas de muestras
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			for (int i = -halfSide; i <= halfSide; i++)
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemByte(line + j, col + i, band) & 0xff;
+						k++;
+					}
+				}
+			// Ordenar los valores de las ventanas, se supone que usa quickSort.
+			Arrays.sort(window, 0, k);
+
+			// Extraer los elementos centrales y asignarselos al pixel (x,y)
+			rasterResult.setElem(line, col, band, (byte) window[k >> 1]);
+		}
+		
+		writeAlphaBand(line, col);
+	}
+
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_BYTE;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianByteFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFloatFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFloatFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFloatFilter.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.impl.grid.filter.correction;
+
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+/**
+ * Filtro de Mediana que se aplica en la imagen. Toma como entrada la imagen y
+ * el lado de la ventana de filtrado.
+ * 
+ * @author Diego Guerrero Sevilla <diego.guerrero@uclm.es>
+ */
+public class MedianFloatFilter extends MedianFilter {
+
+	public MedianFloatFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		rasterResult = DefaultRasterManager.getInstance().createBuffer(Buffer.TYPE_FLOAT, raster.getWidth(), raster.getHeight(), raster.getBandCount(), true);
+	}
+
+	public void process(int col, int line) {
+		float[] ventana = new float[sizeWindow];
+
+		// Obtener el vector con la ventanas de muestras
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			for (int i = -halfSide; i <= halfSide; i++)
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						ventana[k] = raster.getElemFloat(line + j, col + i, band);
+						k++;
+					}
+				}
+			// Ordenar los valores de las ventanas, se supone que usa quickSort.
+			Arrays.sort(ventana, 0, k);
+
+			// Extraer los elementos centrales y asignarselos al pixel (x,y)
+			rasterResult.setElem(line, col, band, ventana[k >> 1]);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return RasterBuffer.TYPE_FLOAT;
+	}
+
+	public int getOutRasterDataType() {
+		return RasterBuffer.TYPE_FLOAT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/MedianFloatFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFilter.java	(revision 15423)
@@ -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.impl.grid.filter.correction;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.grid.filter.BaseRasterFilter;
+import org.gvsig.raster.impl.store.ParamsImpl;
+
+/**
+ * Clase base para los filtros de moda.
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ModeFilter extends BaseRasterFilter {
+	public static String[]          names           = new String[] {"moda"};
+	/**
+	 * Variable para guardar el lado de la ventana de filtrado
+	 */
+	protected int                   sideWindow		= 0;
+	protected int                   sizeWindow      = 0;
+	protected int                   halfSide        = 0;
+	protected int                   count           = 0;
+
+
+	public ModeFilter() {
+		super();
+		setName(names[0]);
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		
+		sideWindow = ((Integer) params.get("sideLong")).intValue();
+		
+		//El lado de la ventana debe ser positivo e impar.
+		sideWindow = Math.abs(sideWindow);
+		if (sideWindow % 2 == 0)
+			sideWindow++;
+		sizeWindow = sideWindow * sideWindow;
+		halfSide = (sideWindow - 1) >> 1;
+		
+		createBufferResult(raster.getDataType(), raster.getBandCount());
+	}
+
+	public void post() {
+		// En caso de que nadie apunte a raster, se liberar� su memoria.
+		raster = null;
+	}
+
+	public String getGroup() {
+		return "espaciales";
+	}
+
+	public int getInRasterDataType() {
+		return 0;
+	}
+
+	public String[] getNames() {
+		return names;
+	}
+
+	public int getOutRasterDataType() {
+		return 0;
+	}
+
+	public Params getUIParams(String nameFilter) {
+		if(params != null) {
+			Object obj = params.get("sideLong");
+			if(obj != null && obj instanceof Integer) {
+				sideWindow = ((Integer)obj).intValue();
+				sideWindow = Math.abs(sideWindow);
+			}
+		}
+		Params params = new ParamsImpl();
+		params.setParam("sideLong",
+				new Integer(sideWindow),
+				Params.SLIDER,
+				new String[] {"1", "10", "0", "1", "5" }); //min, max, valor defecto, intervalo peque�o, intervalo grande;
+		return params;
+	}
+
+	public void process(int x, int y) {
+	}
+	
+	/**
+	 * Obtiene el tama�o del lado de la ventana
+	 * @return entero que representa el tama�o del lado de la 
+	 * ventana en p�xeles
+	 */
+	public int getSideWindow() {
+		return sideWindow;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeShortFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeShortFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeShortFilter.java	(revision 15423)
@@ -0,0 +1,91 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.grid.filter.correction;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+
+/**
+ * Proceso que aplica el filtro de Moda a un raster de tipo short
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ModeShortFilter extends ModeFilter {
+	private short[]          window = null;
+	private short            tempValue       = 0;
+
+	public ModeShortFilter() {
+		super();
+	}
+
+	public void pre() throws FilterAddException {
+		super.pre();
+		window = new short[sizeWindow];
+	}
+
+	public void process(int col, int line) {
+		for (int band = 0; band < numberOfBandsToProcess(); band++) {
+			int k = 0;
+			count = 0;
+			for (int i = -halfSide; i <= halfSide; i++) {
+				for (int j = -halfSide; j <= halfSide; j++) {
+					if ((col + i >= 0) && (line + j >= 0) && (col + i < width) && (line + j < height)) {
+						window[k] = raster.getElemShort(line + j, col + i, band);
+						if(i == -halfSide && j == -halfSide) 
+							tempValue = window[k];
+						if(tempValue == window[k])
+							count ++;
+						k++;
+					}
+				}
+			}
+
+			if(count > sizeWindow)
+				return;
+			
+			k = 1;
+			while(k < window.length) {
+				int auxCount = 0;
+				for (int i = k; i < window.length; i++) {
+					if(window[i] == window[k])
+						auxCount ++;
+				}
+				if(auxCount > count) {
+					count = auxCount;
+					tempValue = window[k];
+					if(count > sizeWindow)
+						return;
+				}
+				k++;
+			}
+			rasterResult.setElem(line, col, band, (short) tempValue);
+		}
+	}
+
+	public int getInRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+
+	public int getOutRasterDataType() {
+		return Buffer.TYPE_SHORT;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/filter/correction/ModeShortFilter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridCellImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridCellImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridCellImpl.java	(revision 15423)
@@ -0,0 +1,115 @@
+/* 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.impl.grid;
+
+import org.gvsig.fmap.dal.coverage.datastruct.GridCell;
+
+/**
+ * 
+ * @author Victor Olaya (volaya@ya.com)
+ */
+@SuppressWarnings("unchecked")
+public class GridCellImpl implements GridCell, Comparable {
+
+	private int m_iX, m_iY;
+	private double m_dValue;
+	
+	public GridCellImpl(int iX, int iY, double dValue){
+		
+		m_iX = iX;
+		m_iY = iY;
+		m_dValue = dValue;
+		
+	}
+	
+	public double getValue() {
+		
+		return m_dValue;
+		
+	}
+	public void setValue(double dValue) {
+		
+		m_dValue = dValue;
+		
+	}
+	
+	public int getX() {
+		
+		return m_iX;
+		
+	}
+	
+	public void setX(int iX) {
+		
+		m_iX = iX;
+		
+	}
+	
+	public int getY() {
+		
+		return m_iY;
+		
+	}
+	
+	public void setY(int iY) {
+		
+		m_iY = iY;
+		
+	}
+	
+	 public int compareTo(Object cell) throws ClassCastException {
+		 
+		 if (!(cell instanceof GridCellImpl)){
+			 throw new ClassCastException();
+		 }
+		 
+		 double dValue = ((GridCellImpl) cell).getValue();
+		 double dDif = this.m_dValue - dValue;   
+		 
+		 if (dDif > 0.0){
+			 return 1;
+		 }
+		 else if (dDif < 0.0){
+			 return -1;
+		 }
+		 else{
+			 return 0;
+		 }
+	 
+	 }
+	 	 
+	 public boolean equals(Object obj){
+		 
+		 if (obj instanceof GridCellImpl){
+			 GridCellImpl cell = (GridCellImpl) obj; 
+			 return (m_iX == cell.getX() &&
+					 m_iY == cell.getY() &&
+					 m_dValue == cell.getValue()); 
+		 }
+		 else{
+			 return false;
+		 }
+		 
+	 }
+	
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridCellImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridImpl.java	(revision 15423)
@@ -0,0 +1,1243 @@
+/* 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.impl.grid;
+
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GridCell;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FilterAddException;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.grid.Grid;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.BasicStats;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList;
+import org.gvsig.raster.impl.store.QueryableRaster;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
+
+/**
+ * Clase que representa una rejilla de datos raster. Este tipo de grid tiene el interfaz necesario
+ * de acceso a la informaci�n raster para aplicaciones de analisis raster. Contiene m�todos de acceso al
+ * dato tanto en lectura como en escritura y encapsula operaciones entre grids. Adem�s contiene
+ * objetos que contienen las caracter�sticas asociadas a ese grid. Sobre un grid pueden
+ * aplicarse tambi�n operaciones de filtrado.
+ *
+ * Podemos crear un Grid de cinco formas distitas:
+ * <UL>
+ * <LI>A partir de una fuente de datos (cargada en el constructor). Se har� una petici�n del extent pasado por par�metro con las bandas seleccionadas por par�metro.</LI>
+ * <LI>A partir de un extensi�n de capa, una extensi�n de vista, un tipo de dato y un n�mero de datos
+ * crea un Grid vacio util para escritura.</LI>
+ * <LI>A partir de una fuente de datos (cargados). Datasource se usa como buffer de datos cargados y se selecciona si queremos el reader interpolado.</LI>
+ * <LI>A partir de una fuente de datos (cargada en el constructor). Se har� una petici�n del extent completo de la fuente con las bandas seleccionadas por par�metro.</LI>
+ * <LI>A partir de una fuente de datos (cargada en el constructor). Se har� una petici�n del extent completo de la fuente con todas las bandas disponibles.</LI>
+ * </UL>
+ *
+ * @author Victor Olaya (volaya@ya.com)
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GridImpl implements Grid {
+
+	public final static double 		DEG_45_IN_RAD = Math.PI / 180. * 45.;
+	public final static double 		DEG_90_IN_RAD = Math.PI / 180. * 90.;
+	public final static double 		DEG_180_IN_RAD = Math.PI ;
+	public final static double 		DEG_270_IN_RAD = Math.PI / 180. * 270.;
+	public final static double 		DEG_360_IN_RAD = Math.PI * 2.;
+
+	/* neighbor's address*/                               /* N  NE   E  SE   S  SW   W  NW */
+	private final static int 		m_iOffsetX []=        {  0,  1,  1,  1,  0, -1, -1, -1};
+	private final static int		m_iOffsetY []=        {  1,  1,  0, -1, -1, -1,  0,  1};
+
+	private double 					m_dDist[];
+	public double 					_2DX, _6DX, _DX_2, _4DX_2;
+
+	private int[] 					bands = null;
+	private int 					dataType = Buffer.TYPE_UNDEFINED;
+
+	private Buffer			        rasterBuf = null;
+	private GridReader 				reader = null;
+	private GridWriter 				writer = null;
+	private GridExtent 				windowExtent = null;
+	private GridExtent 				layerExtent = null;
+	private GridStatistic			statistic = null;
+	private ColorTable  			palette = null;
+	private RasterFilterList		filterList = null;
+
+	/**
+	 * Crea un grid a partir de un RasterDataset. Usa el extent de la fuente de datos como
+	 * extent completo y el extent pasado como par�metro como extensi�n de ventana.
+	 *
+	 * Cuando se construye el reader se carga el buffer con la extensi�n definida en windowExtent
+	 * y las bandas especificadas en bands.
+	 *
+	 * @param IRasterDataSource datasets que proporcionan los datos
+	 * @param bands n�mero de bandas requeridas
+	 * @param windowExtent Extensi�n de la ventana. Si este par�metro es null se usar� el
+	 * mismo que el de la capa.
+	 */
+	public GridImpl(RasterDataStore datasource, int[] bands, GridExtent windowExtent)
+			throws RasterBufferInvalidException {
+		double cellSize[] = calcCellSize(datasource, 
+											datasource.getWidth(),
+											datasource.getHeight());
+		layerExtent = new GridExtentImpl(datasource.getExtent(),
+											cellSize[0],
+											cellSize[1]);
+		if(datasource.getDataType() != null)
+			dataType = datasource.getDataType()[0];
+		this.bands = bands;
+
+		if(windowExtent == null)
+			this.windowExtent = layerExtent;
+		else
+			this.windowExtent = windowExtent;
+
+		if (this.windowExtent.fitsIn(layerExtent))
+			reader = new GridNotInterpolated(datasource, layerExtent, this.windowExtent, bands);
+		else
+			reader = new GridInterpolated(datasource, layerExtent, this.windowExtent, bands);
+		rasterBuf = datasource.getLastBuffer();
+		writer = new GridWriter(layerExtent, dataType, rasterBuf);
+
+		init(datasource);
+	}
+
+	/**
+	 * Carga el buffer de datos desde el reader para poder escribir sobre los datos de
+	 * la ventana original. Esto es �til cuando el GridWriter se crea asociado a un raster
+	 * pero el buffer est� vacio, por ejemplo en el caso de crear un GridInterpolated. Un
+	 * GridInterpolated no carga ning�n buffer en memoria sino que accede a los datos en disco
+	 * a medida que se le van solicitando. Por ello, no es posible modificarlos sino cargamos
+	 * un buffer con los datos previamente.
+	 */
+	public void loadWriterData() throws GridException {
+		rasterBuf = DefaultRasterManager.getInstance().createBuffer(dataType, reader.getNX(), reader.getNY(), bands.length, true);
+		writer = new GridWriter(windowExtent, dataType, rasterBuf);
+		int x = 0, y = 0;
+		try{
+			switch(rasterBuf.getDataType()) {
+			case Buffer.TYPE_BYTE: for (x = 0; x < getNX(); x++)
+				for (y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (reader.getCellValueAsByte(x, y)));
+									break;
+			case Buffer.TYPE_SHORT:for (x = 0; x < getNX(); x++)
+				for (y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (reader.getCellValueAsShort(x, y)));
+									break;
+			case Buffer.TYPE_INT: 	for (x = 0; x < getNX(); x++)
+				for (y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (reader.getCellValueAsInt(x, y)));
+									break;
+			case Buffer.TYPE_FLOAT:for (x = 0; x < getNX(); x++)
+				for (y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (reader.getCellValueAsFloat(x, y)));
+									break;
+			case Buffer.TYPE_DOUBLE:for (x = 0; x < getNX(); x++)
+				for (y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (reader.getCellValueAsDouble(x, y)));
+									 break;
+			}
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer de datos no v�lido " + x + " " + y, e);
+		} catch (OutOfGridException e1) {
+			throw new GridException("Acceso fuera de los l�mites del Grid " + x + " " + y, e1);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Acceso al grid no v�lido " + x + " " + y, e);
+		}
+	}
+
+	/**
+	 * Crea un grid vacio a partir de un extent y un tipo de datos. Se crea un buffer vacio en el
+	 * que puede escribirse a trav�s del writer. Los datos escritos pueden ser consultados con el
+	 * reader. No tiene una fuente de datos asociada ya que es un grid vacio basicamente para
+	 * escritura.
+	 * @param layerExtent Tama�o completo de la capa
+	 * @param windowExtent Ventana de datos.
+	 * @param dataType Tipo de datos del buffer
+	 * @param bands n�mero de bandas requeridas y orden de dibujado en el buffer
+	 */
+	public GridImpl(GridExtent layerExtent,
+					GridExtent windowExtent,
+					int dataType,
+					int[] bands) throws RasterBufferInvalidException {
+		this.windowExtent = windowExtent;
+		this.layerExtent = layerExtent;
+		this.dataType = dataType;
+
+		rasterBuf = DefaultRasterManager.getInstance().createBuffer(dataType, layerExtent.getNX(), layerExtent.getNY(), bands.length, true);
+
+		if (windowExtent.fitsIn(layerExtent))
+			reader = new GridNotInterpolated(rasterBuf, layerExtent, windowExtent, bands);
+		else
+			reader = new GridInterpolated(rasterBuf, layerExtent, windowExtent, bands);
+		writer = new GridWriter(layerExtent, dataType, rasterBuf);
+		init(null);
+	}
+
+	/**
+	 * Crea un grid a partir de un BufferFactory. El buffer debe estar cargado de datos y el extent
+	 * de este viene definido en el par�metro windowExtent.
+	 * @param bufferFactory Fuente de datos
+	 * @param windowExtent	Extent de los datos cargados en bufferFactory
+	 * @param notInterp Si es true fuerza a que el reader sea sin interpolaci�n. Si es false decide si
+	 * el reader es interpolado o no a partir de los extents de capa y la ventana seleccionada.
+	 */
+	public GridImpl(Buffer buf, RasterDataStore datasource, boolean notInterp) {
+		double cellSize[] = calcCellSize(datasource, 
+										datasource.getWidth(),
+										datasource.getHeight());
+		this.layerExtent = new GridExtentImpl(datasource.getExtent(),
+											cellSize[0],
+											cellSize[1]);
+		if(datasource.getDataType() != null)
+			dataType = datasource.getDataType()[0];
+		
+		if(datasource instanceof QueryableRaster)
+			bands = ((QueryableRaster)datasource).getDrawableBands();
+		else {
+			bands = new int[datasource.getBandCount()];
+			for (int i = 0; i < bands.length; i++) 
+				bands[i] = i;
+		}
+			
+
+		this.windowExtent = new GridExtentImpl(	new ExtentImpl(buf.getDataExtent()),
+											cellSize[0],
+											cellSize[1]);
+
+		rasterBuf = buf;
+
+		if(notInterp)
+			reader = new GridNotInterpolated(rasterBuf, layerExtent, windowExtent, bands);
+		else if (windowExtent.fitsIn(layerExtent))
+			reader = new GridNotInterpolated(rasterBuf, layerExtent, windowExtent, bands);
+		else
+			reader = new GridInterpolated(rasterBuf, layerExtent, windowExtent, bands);
+		writer = new GridWriter(layerExtent, dataType, rasterBuf);
+		init(datasource);
+	}
+
+	/**
+	 * Crea un grid a partir de un BufferFactory. Se har� una petici�n del extent completo de la fuente.
+	 * bufferFactory tiene asociada una fuente de datos pero se ignorar� si tiene el buffer lleno. La instanciaci�n
+	 * de GridNotInterpolated har� que se haga la petici�n para cargar raster completo.
+	 * @param bufferFactory Fuente de datos
+	 * @param bands n�mero de bandas requeridas y orden de dibujado en el buffer
+	 */
+	public GridImpl(RasterDataStore datasource, int[] bands)
+			throws RasterBufferInvalidException{
+		//La petici�n es del raster completo
+		double cellSize[] = calcCellSize(datasource, 
+											datasource.getWidth(),
+											datasource.getHeight());
+		windowExtent = layerExtent = new GridExtentImpl(datasource.getExtent(),
+													cellSize[0],
+													cellSize[1]);
+		if(datasource.getDataType() != null)
+			dataType = datasource.getDataType()[0];
+		this.bands = bands;
+
+		reader = new GridNotInterpolated(datasource, layerExtent, windowExtent, bands);
+		rasterBuf = datasource.getLastBuffer();
+		writer = new GridWriter(windowExtent, dataType, rasterBuf);
+
+		init(datasource);
+	}
+
+	/**
+	 * Crea un grid a partir de un BufferFactory. Se har� una petici�n del extent completo de la fuente.
+	 * bufferFactory tiene asociada una fuente de datos pero se ignorar� si tiene el buffer lleno. La instanciaci�n
+	 * de GridNotInterpolated har� que se haga la petici�n para cargar raster completo. El buffer se cargar�
+	 * con todas las bandas disponibles.
+	 * @param datasource Fuente de datos
+	 */
+	public GridImpl(RasterDataStore datasource) throws RasterBufferInvalidException {
+		//La petici�n es del raster completo
+		double cellSize[] = calcCellSize(	datasource, 
+											datasource.getWidth(),
+											datasource.getHeight());
+		windowExtent = layerExtent = new GridExtentImpl(datasource.getExtent(),
+													cellSize[0],
+													cellSize[1]);
+		if(datasource.getDataType() != null)
+			dataType = datasource.getDataType()[0];
+
+		bands = new int[datasource.getBandCount()];
+		for(int i = 0; i < datasource.getBandCount(); i ++)
+			bands[i] = i;
+		reader = new GridNotInterpolated(datasource, layerExtent, windowExtent, bands);
+		rasterBuf = datasource.getLastBuffer();
+		writer = new GridWriter(windowExtent, dataType, rasterBuf);
+
+		init(datasource);
+	}
+
+	/**
+	 * Calcula el tama�o de celda a partir de un dataset, un ancho y un alto en pixeles
+	 * @return
+	 */
+	private double[] calcCellSize(RasterDataStore mDataset, double w, double h) {
+		double dCellsize[] = new double[2];
+		try {
+			Extent e = mDataset.getExtent();
+			dCellsize[0] = (e.getLRX() - e.getULX()) / w;
+			dCellsize[1] = (e.getLRY() - e.getULY()) / h;
+
+			return dCellsize;
+		} catch (NullPointerException e) {
+			dCellsize[0] = 1;
+			dCellsize[1] = 1;
+			return dCellsize;
+		}
+	}
+
+	/**
+	 * Selecciona la forma de obtener datos con o sin interpolaci�n. Si pasamos el par�metro
+	 * false al aplicar un m�todo de consulta de datos este ser� aplicado sin interpolaci�n.
+	 * @param interpolation
+	 */
+	public void switchToInterpolationMethod(boolean interpolation){
+		//GridExtent layer = new GridExtent(0, 0, rasterBuf.getWidth(), rasterBuf.getHeight(), 1);
+		if(interpolation)
+			reader = new GridInterpolated(rasterBuf, layerExtent, windowExtent, bands);
+		else
+			reader = new GridNotInterpolated(rasterBuf, layerExtent, windowExtent, bands);
+		init(null);
+	}
+
+	/**
+	 * Inicializaci�n de constantes
+	 */
+	private void init(RasterDataStore ds) {
+		int i;
+		Transparency transparency = null;
+
+		double dCellSize = getCellSize();
+
+		statistic = new GridStatistic(this);
+		if (ds == null) {
+			ColorInterpretation ci = new DataStoreColorInterpretation(rasterBuf.getBandCount());
+			transparency = new DataStoreTransparency(ci);
+		}
+		else {
+			transparency = ds.getTransparency().cloneTransparency();
+			this.palette = new DataStoreColorTable(ds.getColorTable());
+		}
+		filterList = new DefaultRasterFilterList();
+		if (ds != null) {
+			filterList.addEnvParam("SrcStatistics", ds.getStatistics());
+		}
+		filterList.addEnvParam("Transparency", transparency);
+		if(rasterBuf != null)
+			filterList.setInitRasterBuf(rasterBuf);
+
+		m_dDist = new double[8];
+
+		for (i = 0; i < 8; i++)
+			m_dDist[i] = Math.sqrt ( m_iOffsetX[i] * dCellSize * m_iOffsetX[i] * dCellSize
+									+ m_iOffsetY[i] * dCellSize * m_iOffsetY[i] * dCellSize );
+
+		_2DX = dCellSize * 2.0;
+		_6DX = dCellSize * 6.0;
+		_DX_2 = dCellSize * dCellSize;
+		_4DX_2 = 4.0 * _DX_2;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.grid.Grid#getBandCount()
+	 */
+	public int getBandCount() {
+		if(rasterBuf != null)
+			return rasterBuf.getBandCount();
+		return 0;
+	}
+
+	//************* Write Services *********************
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assign(byte)
+	 */
+	public void assign(byte value)throws GridException {
+		try {
+			writer.assign(value);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Error wrinting buffer");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assign(short)
+	 */
+	public void assign(short value)throws GridException {
+		try {
+			writer.assign(value);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Error wrinting buffer");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assign(int)
+	 */
+	public void assign(int value)throws GridException {
+		try {
+			writer.assign(value);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Error wrinting buffer");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assign(float)
+	 */
+	public void assign(float value)throws GridException {
+		try {
+			writer.assign(value);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Error wrinting buffer");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assign(double)
+	 */
+	public void assign(double value)throws GridException {
+		try {
+			writer.assign(value);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Error wrinting buffer");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assign(org.gvsig.fmap.dataaccess.BufferFactory)
+	 */
+	public void assign(RasterDataStore dSource) throws GridException {
+		Grid window = null;
+		try {
+			window = new GridImpl(dSource, bands, windowExtent);
+			write(window);
+			writer.setNoDataValue(window.getNoDataValue());
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Error writing buffer");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assign(org.gvsig.fmap.grid.Grid)
+	 */
+	public void assign(Grid driver) throws GridException {
+		if (driver.getGridExtent().equals(layerExtent)) {
+			write(driver);
+			writer.setNoDataValue(driver.getNoDataValue());
+		}
+	}
+
+	/**
+	 * Sobreescribe los datos del grid actual con los datos del grid pasado por par�metro
+	 * @param g Grid desde donde se obtienen los datos
+	 */
+	private void write(Grid g) throws GridException {
+		try{
+			switch(rasterBuf.getDataType()){
+			case Buffer.TYPE_BYTE: for (int x = 0; x < g.getNX(); x++)
+				for (int y = 0; y < g.getNY(); y++)
+					writer.setCellValue(x, y, g.getCellValueAsByte(x, y));
+									break;
+			case Buffer.TYPE_SHORT:for (int x = 0; x < g.getNX(); x++)
+				for (int y = 0; y < g.getNY(); y++)
+					writer.setCellValue(x, y, g.getCellValueAsShort(x, y));
+									break;
+			case Buffer.TYPE_INT: 	for (int x = 0; x < g.getNX(); x++)
+				for (int y = 0; y < g.getNY(); y++)
+					writer.setCellValue(x, y, g.getCellValueAsInt(x, y));
+									break;
+			case Buffer.TYPE_FLOAT:for (int x = 0; x < g.getNX(); x++)
+				for (int y = 0; y < g.getNY(); y++)
+					writer.setCellValue(x, y, g.getCellValueAsFloat(x, y));
+									break;
+			case Buffer.TYPE_DOUBLE:for (int x = 0; x < g.getNX(); x++)
+				for (int y = 0; y < g.getNY(); y++)
+					writer.setCellValue(x, y, g.getCellValueAsDouble(x, y));
+									break;
+			}
+		} catch (OutOfGridException e) {
+			throw new GridException("");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#assignNoData()
+	 */
+	public void assignNoData(){
+		try {
+			if(!rasterBuf.getNoDataValue().isDefined())
+				return;
+			
+			switch(rasterBuf.getDataType()){
+			case Buffer.TYPE_BYTE: writer.assign((byte)rasterBuf.getNoDataValue().getValue().byteValue());break;
+			case Buffer.TYPE_SHORT: writer.assign((short)rasterBuf.getNoDataValue().getValue().shortValue());break;
+			case Buffer.TYPE_INT: writer.assign((int)rasterBuf.getNoDataValue().getValue().intValue());break;
+			case Buffer.TYPE_FLOAT: writer.assign((float)rasterBuf.getNoDataValue().getValue().floatValue());break;
+			case Buffer.TYPE_DOUBLE: writer.assign(rasterBuf.getNoDataValue().getValue().doubleValue());break;
+			}
+		} catch (RasterBufferInvalidAccessException e) {
+			//No hacemos nada. El tipo de dato al que se accede no es controlado por el usuario por lo
+			//que no le mandamos la excepci�n hacia arriba.
+			e.printStackTrace();
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#setCellValue(int, int, byte)
+	 */
+	public void setCellValue(int x, int y, byte value)throws OutOfGridException{
+		writer.setCellValue(x, y, value);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#setCellValue(int, int, short)
+	 */
+	public void setCellValue(int x, int y, short value)throws OutOfGridException{
+		writer.setCellValue(x, y, value);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#setCellValue(int, int, int)
+	 */
+	public void setCellValue(int x, int y, int value)throws OutOfGridException{
+		writer.setCellValue(x, y, value);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#setCellValue(int, int, float)
+	 */
+	public void setCellValue(int x, int y, float value)throws OutOfGridException{
+		writer.setCellValue(x, y, value);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#setCellValue(int, int, double)
+	 */
+	public void setCellValue(int x, int y, double value)throws OutOfGridException{
+		writer.setCellValue(x, y, value);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#add(org.gvsig.fmap.grid.Grid)
+	 */
+	public void add(Grid g) throws GridException {
+		if (g.getGridExtent().equals(getGridExtent())) {
+			boolean interp = (reader instanceof GridInterpolated);
+			switchToInterpolationMethod(false);
+			try{
+				switch(rasterBuf.getDataType()){
+				case Buffer.TYPE_BYTE: for (int x = 0; x < g.getNX(); x++)
+					for (int y = 0; y < g.getNY(); y++)
+						writer.setCellValue(x, y, reader.getCellValueAsByte(x, y) + g.getCellValueAsByte(x,y));
+										break;
+				case Buffer.TYPE_SHORT:for (int x = 0; x < g.getNX(); x++)
+					for (int y = 0; y < g.getNY(); y++)
+						writer.setCellValue(x, y, reader.getCellValueAsShort(x, y) + g.getCellValueAsShort(x,y));
+										break;
+				case Buffer.TYPE_INT: 	for (int x = 0; x < g.getNX(); x++)
+					for (int y = 0; y < g.getNY(); y++)
+						writer.setCellValue(x, y, reader.getCellValueAsInt(x, y) + g.getCellValueAsInt(x,y));
+										break;
+				case Buffer.TYPE_FLOAT:for (int x = 0; x < g.getNX(); x++)
+					for (int y = 0; y < g.getNY(); y++)
+						writer.setCellValue(x, y, reader.getCellValueAsFloat(x, y) + g.getCellValueAsFloat(x,y));
+										break;
+				case Buffer.TYPE_DOUBLE:for (int x = 0; x < g.getNX(); x++)
+					for (int y = 0; y < g.getNY(); y++)
+						writer.setCellValue(x, y, reader.getCellValueAsDouble(x, y) + g.getCellValueAsDouble(x,y));
+										break;
+				}
+			} catch (OutOfGridException e) {
+				throw new GridException("");
+			} catch (RasterBufferInvalidAccessException e1) {
+				throw new GridException("");
+			} catch (RasterBufferInvalidException e) {
+				throw new GridException("");
+			}
+			switchToInterpolationMethod(interp);
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#addToCellValue(int, int, byte)
+	 */
+	public void addToCellValue(int x, int y, byte value)
+		throws GridException {
+		try {
+			writer.setCellValue(x, y, (byte)(reader.getCellValueAsByte(x, y) + value));
+		} catch (OutOfGridException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#addToCellValue(int, int, short)
+	 */
+	public void addToCellValue(int x, int y, short value)
+		throws GridException {
+		try {
+			writer.setCellValue(x, y, (short)(reader.getCellValueAsShort(x, y) + value));
+		} catch (OutOfGridException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#addToCellValue(int, int, int)
+	 */
+	public void addToCellValue(int x, int y, int value)
+		throws GridException {
+		try {
+			writer.setCellValue(x, y, (reader.getCellValueAsInt(x, y) + value));
+		} catch (OutOfGridException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#addToCellValue(int, int, float)
+	 */
+	public void addToCellValue(int x, int y, float value)
+		throws GridException {
+		try {
+			writer.setCellValue(x, y, (reader.getCellValueAsFloat(x, y) + value));
+		} catch (OutOfGridException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#addToCellValue(int, int, double)
+	 */
+	public void addToCellValue(int x, int y, double value)
+		throws GridException {
+		try {
+			writer.setCellValue(x, y, (reader.getCellValueAsDouble(x, y) + value));
+		} catch (OutOfGridException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#multiply(double)
+	 */
+	public void multiply(double value) throws GridException {
+		boolean interp = (reader instanceof GridInterpolated);
+		switchToInterpolationMethod(false);
+		try{
+			switch(rasterBuf.getDataType()){
+			case Buffer.TYPE_BYTE: for (int x = 0; x < getNX(); x++)
+				for (int y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (byte)(reader.getCellValueAsByte(x, y) * value));
+									break;
+			case Buffer.TYPE_SHORT:for (int x = 0; x < getNX(); x++)
+				for (int y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (short)(reader.getCellValueAsShort(x, y) * value));
+									break;
+			case Buffer.TYPE_INT: 	for (int x = 0; x < getNX(); x++)
+				for (int y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (int)(reader.getCellValueAsInt(x, y) * value));
+									break;
+			case Buffer.TYPE_FLOAT:for (int x = 0; x < getNX(); x++)
+				for (int y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (float)(reader.getCellValueAsFloat(x, y) * value));
+									break;
+			case Buffer.TYPE_DOUBLE:for (int x = 0; x < getNX(); x++)
+				for (int y = 0; y < getNY(); y++)
+					writer.setCellValue(x, y, (reader.getCellValueAsDouble(x, y) * value));
+									break;
+			}
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer de datos no v�lido", e);
+		} catch (OutOfGridException e1) {
+			throw new GridException("Acceso fuera de los l�mites del Grid", e1);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Acceso al grid no v�lido", e);
+		}
+		//Restauramos el reader que hab�a
+		switchToInterpolationMethod(interp);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#setNoDataValue(double)
+	 */
+	public void setNoDataValue(NoData dNoDataValue) {
+		writer.setNoDataValue(dNoDataValue);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IWritableGrid#setNoData(int, int)
+	 */
+	public void setNoData(int x, int y){
+		writer.setNoData(x, y);
+	}
+
+	//************* Query Services *********************
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#isNoDataValue(double)
+	 */
+	public boolean isNoDataValue(double noDataValue){
+		return (reader.getNoDataValue() == noDataValue);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#isInGrid(int, int)
+	 */
+	public boolean isInGrid(int x, int y){
+		return reader.isCellInGrid(x, y);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getCellSize()
+	 */
+	public double getCellSize() {
+		return reader.getCellSize();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getCellValueAsByte(int, int)
+	 */
+	public byte getCellValueAsByte(int x, int y)throws GridException {
+		try {
+			return  reader.getCellValueAsByte(x, y);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Position: (" + x + "," + y + ") not valid");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer not valid");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getCellValueAsShort(int, int)
+	 */
+	public short getCellValueAsShort(int x, int y)throws GridException {
+		try {
+			return reader.getCellValueAsShort(x, y);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Position: (" + x + "," + y + ") not valid");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer not valid");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getCellValueAsInt(int, int)
+	 */
+	public int getCellValueAsInt(int x, int y)throws GridException {
+		try {
+			return reader.getCellValueAsInt(x, y);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Position: (" + x + "," + y + ") not valid");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer not valid");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getCellValueAsFloat(int, int)
+	 */
+	public float getCellValueAsFloat(int x, int y)throws GridException {
+		try {
+			return reader.getCellValueAsFloat(x, y);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Position: (" + x + "," + y + ") not valid");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer not valid");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getCellValueAsDouble(int, int)
+	 */
+	public double getCellValueAsDouble(int x, int y)throws GridException {
+		try {
+			return reader.getCellValueAsDouble(x, y);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Position: (" + x + "," + y + ") not valid");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer not valid");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getCellValueAsDouble(int, int)
+	 */
+	public double getCellValue(int x, int y)throws GridException {
+		try {
+			return reader.getCellValue(x, y);
+		} catch (RasterBufferInvalidAccessException e) {
+			throw new GridException("Position: (" + x + "," + y + ") not valid");
+		} catch (RasterBufferInvalidException e) {
+			throw new GridException("Buffer not valid");
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getNoDataValue()
+	 */
+	public NoData getNoDataValue() {
+		return rasterBuf.getNoDataValue();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#setInterpolationMethod(int)
+	 */
+	public void setInterpolationMethod(int iMethod){
+		if (reader instanceof GridInterpolated)
+			((GridInterpolated) reader).setInterpolationMethod(iMethod);
+		else{
+			this.switchToInterpolationMethod(true);
+			((GridInterpolated) reader).setInterpolationMethod(iMethod);
+		}
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getNX()
+	 */
+	public int getNX(){
+		return reader.getNX();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getNY()
+	 */
+	public int getNY(){
+		return reader.getNY();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getLayerNX()
+	 */
+	public int getLayerNX(){
+		return layerExtent.getNX();
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getLayerNY()
+	 */
+	public int getLayerNY(){
+		return layerExtent.getNY();
+	}
+
+	public int getDataType(){
+		return dataType;
+	}
+
+	private boolean getSubMatrix3x3(int x, int y, double subMatrix[])
+		throws GridException {
+		int	i;
+		int iDir;
+		double	z, z2;
+
+		z = getCellValueAsDouble(x, y);
+
+		if(isNoDataValue(z))
+			return false;
+		else {
+			//SubMatrix[4]	= 0.0;
+			for(i = 0; i < 4; i++) {
+				iDir = 2 * i;
+				z2 = getCellValueAsDouble(x + m_iOffsetX[iDir], y + m_iOffsetY[iDir]);
+				if( !isNoDataValue(z2))
+					subMatrix[i] =  z2 - z;
+				else {
+					z2 = getCellValueAsDouble(x + m_iOffsetX[(iDir + 4) % 8], y + m_iOffsetY[(iDir  + 4) % 8]);
+					if( !isNoDataValue(z2))
+						subMatrix[i] = z - z2;
+					else
+						subMatrix[i] = 0.0;
+				}
+			}
+
+			return true;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.grid.IQueryableGrid#getSlope(int, int)
+	 */
+	public double getSlope(int x, int y)throws GridException {
+		double	zm[], G, H;
+
+		zm = new double[4];
+
+		try {
+			if( getSubMatrix3x3(x, y, zm) ) {
+				G = (zm[0] - zm[2]) / _2DX;
+				H = (zm[1] - zm[3]) / _2DX;
+				return Math.atan(Math.sqrt(G * G + H * H));
+			} else
+				return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue;
+		} catch (GridException e) {
+			throw new GridException("Problems accesing 3x3 submatrix");
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.grid.IQueryableGrid#getAspect(int, int)
+	 */
+	public double getAspect(int x, int y)throws GridException {
+		double	zm[], G, H, dAspect;
+		zm = new double[4];
+
+		try {
+			if( getSubMatrix3x3(x, y, zm) ) {
+				G = (zm[0] - zm[2]) / _2DX;
+				H = (zm[1] - zm[3]) / _2DX;
+				if(G != 0.0)
+					dAspect = DEG_180_IN_RAD + Math.atan2(H, G);
+				else
+					dAspect = H > 0.0 ? DEG_270_IN_RAD : (H < 0.0 ? DEG_90_IN_RAD : -1.0);
+				return dAspect;
+			}
+			else
+				return rasterBuf.getNoDataValue().isDefined() ? rasterBuf.getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue;
+		} catch (GridException e) {
+			throw new GridException("Problems accesing 3x3 submatrix");
+		}
+	}
+
+	public static int getXOffsetInDir(int iDir){
+		return m_iOffsetX[iDir];
+	}
+
+	public static int getYOffsetInDir(int iDir){
+		return m_iOffsetY[iDir];
+	}
+
+	public double getDistToNeighborInDir(int iDir){
+		return m_dDist[iDir];
+	}
+
+	public static double getUnitDistToNeighborInDir(int iDir){
+		return( (iDir % 2 != 0) ? Math.sqrt(2.0)  : 1.0 );
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getDirToNextDownslopeCell(int, int)
+	 */
+	public int getDirToNextDownslopeCell(int x, int y)throws GridException{
+		return getDirToNextDownslopeCell(x, y, true);
+	}
+
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.fmap.grid.IQueryableGrid#getDirToNextDownslopeCell(int, int, boolean)
+	 */
+	public int getDirToNextDownslopeCell(int x, int y, boolean bForceDirToNoDataCell)
+		throws GridException{
+
+		int		i, iDir;
+		double	z, z2, dSlope, dMaxSlope;
+
+		z = getCellValueAsDouble(x, y);
+
+		if(isNoDataValue(z))
+			return -1;
+
+		dMaxSlope = 0.0;
+		for(iDir=-1, i=0; i<8; i++) {
+			z2 = getCellValueAsDouble(x + m_iOffsetX[i], y + m_iOffsetY[i]);
+			if(isNoDataValue(z2)) {
+				if (bForceDirToNoDataCell)
+					return i;
+				else
+					return -1;
+			}
+			else {
+				dSlope	= (z - z2) / getDistToNeighborInDir(i);
+				if( dSlope > dMaxSlope ) {
+					iDir = i;
+					dMaxSlope = dSlope;
+				}
+			}
+		}
+		return iDir;
+	}
+
+	public GridCell[] getSortedArrayOfCells()throws GridException {
+		int i;
+		int iX,iY;
+		int iNX =  getNX();
+		int iCells = getNX() * getNY();
+		GridCell [] cells = null;
+
+		cells = new GridCellImpl[iCells];
+
+		for (i = 0; i < iCells; i++) {
+			iX = i % iNX;
+			iY = i / iNX;
+			cells[i] = getGridCell(iX, iY);
+		}
+
+		Arrays.sort(cells);
+		return cells;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.grid.Grid#getGridCell(int, int)
+	 */
+	public GridCell getGridCell(int iX, int iY) throws GridException {
+		switch(getDataType()){
+		case Buffer.TYPE_BYTE: return new GridCellImpl(iX, iY, getCellValueAsByte(iX, iY));
+		case Buffer.TYPE_SHORT: return new GridCellImpl(iX, iY, getCellValueAsShort(iX, iY));
+		case Buffer.TYPE_INT: return new GridCellImpl(iX, iY, getCellValueAsInt(iX, iY)); 
+		case Buffer.TYPE_FLOAT: return new GridCellImpl(iX, iY, getCellValueAsFloat(iX, iY));
+		case Buffer.TYPE_DOUBLE: return new GridCellImpl(iX, iY, getCellValueAsDouble(iX, iY));
+		}
+		return null;
+	}
+
+	/**
+	 * Obtiene la lista de paletas asociadas al grid
+	 * @return Lista de objetos GridPalette
+	 */
+	public ColorTable getPalette() {
+		return palette;
+	}
+
+	/**
+	 * Obtiene el n�mero de bandas del grid o 0 si no tiene buffer de
+	 * datos asociado.
+	 * @return N�mero de bandas
+	 */
+	public int calculateStatistics() {
+		if(rasterBuf != null)
+			return rasterBuf.getBandCount();
+		return 0;
+	}
+
+	/**
+	 * Asigna la lista de paletas asociadas al grid
+	 * @param palette Lista de objetos GridPalette
+	 */
+	public void setPalette(ColorTable palette) {
+		this.palette = palette;
+	}
+
+	/**
+	 * Obtiene la lista de filtros.
+	 * @return Lista de filtros.
+	 */
+	public RasterFilterList getFilterList(){
+		return filterList;
+	}
+
+	/**
+	 * Asigna la lista de filtros
+	 * @param filterList
+	 */
+	public void setFilterList(RasterFilterList filterList) {
+		this.filterList = filterList;
+	}
+
+	/**
+	 *Aplica la lista de filtros sobre el buffer
+	 * @throws FilterAddException 
+	 * @throws InterruptedException
+	 */
+	public void applyFilters() throws ProcessInterruptedException, FilterAddException {
+		if (filterList == null)
+			return;
+
+		filterList.setInitRasterBuf(rasterBuf);
+
+		filterList.addEnvParam("GridExtent", getGridExtent());
+		filterList.addEnvParam("WindowExtent", getWindowExtent());
+
+		filterList.execute();
+		if(filterList.getResult() != null)
+			rasterBuf = (RasterBuffer) filterList.getResult();
+		dataType = rasterBuf.getDataType();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.grid.Grid#getRasterBuf()
+	 */
+	public Buffer getRasterBuf() {
+		return rasterBuf;
+	}
+	
+	/**
+	 * Obtiene el objeto que calcula las estad�sticas del Grid
+	 * @return IBasicStats
+	 */
+	public BasicStats getStatistics() {
+		return statistic;
+	}
+
+	/**
+	 * Asigna la banda sobre la que se realizan las operaciones. Por defecto es la banda 0
+	 * con lo que para el uso de MDTs no habr� que modificar este valor.
+	 * @param band Banda sobre la que se realizan las operaciones.
+	 */
+	public void setBandToOperate(int band) {
+		if(writer != null)
+			writer.setBandToOperate(band);
+		if(reader != null)
+			reader.setBandToOperate(band);
+		if(statistic != null)
+			statistic.setBandToOperate(band);
+	}
+
+	/**
+	 * Obtiene el extent de la ventana seleccionada para petici�n de datos
+	 * @return GridExtent
+	 */
+	public GridExtent getWindowExtent() {
+		return windowExtent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.grid.Grid#getGridExtent()
+	 */
+	public GridExtent getGridExtent() {
+		return layerExtent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.tools.dispose.Disposable#dispose()
+	 */
+	public void dispose() {
+		if (rasterBuf != null)
+			rasterBuf.dispose();
+		if(reader != null)
+			reader.dispose();
+		if(writer != null)
+			writer.dispose();
+		if(statistic != null)
+			statistic.dispose();
+		//if (filterList != null)
+			//filterList.free();
+		if (writer != null)
+			writer.dispose();
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		bands = null;
+		rasterBuf = null;
+		reader = null;
+		writer = null;
+		windowExtent = null;
+		layerExtent = null;
+		statistic = null;
+		palette = null;
+		filterList = null;
+		super.finalize();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridReader.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridReader.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridReader.java	(revision 15423)
@@ -0,0 +1,270 @@
+/* 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.impl.grid;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+
+/**
+ * Clase abstracta para lectura de datos de un grid. Esta puede ser creada a partir de
+ * una fuente de datos (BufferFactory) o a partir de un buffer de datos (RasterBuffer).
+ * Tiene las operaciones b�sicas de consulta.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public abstract class GridReader {
+	
+	protected RasterDataStore 	dataStore     = null;
+	protected Buffer 		    rasterBuf      = null;
+	protected int 				dataType       = Buffer.TYPE_UNDEFINED;
+	protected int[]				bands          = null;
+	protected int				bandToOperate  = 0;
+	protected NoData            defaultNoData  = null;
+	
+	/**
+	 * Extent de la ventana que corresponde al Grid 
+	 */
+	GridExtent                  windowExtent   = null;
+	/**
+	 * Extent completo de la capa
+	 */
+	GridExtent                  layerExtent    = null;
+	
+	/**
+	 * Crea un objeto lector a partir de un buffer de datos y el extent.
+	 * @param rb Buffer de datos
+	 * @param layerExtent extent de la capa completa
+	 * @param windowExtent Extent
+	 * @param bands N�mero de bandas del origen
+	 */
+	public GridReader(	Buffer rb, 
+						GridExtent layerExtent,
+						GridExtent windowExtent,
+						int[] bands){
+		rasterBuf = rb;
+		dataType = rb.getDataType();
+		this.bands = bands;
+		this.windowExtent = windowExtent;
+		this.layerExtent = layerExtent;
+	}
+	
+	/**
+	 * Crea un objeto lector a partir de una fuente de datos y el extent.
+	 * @param rb Buffer de datos
+	 * @param layerExtent extent de la capa completa
+	 * @param windowExtent Extent
+	 * @param bands N�mero de bandas del origen
+	 */
+	public GridReader(	RasterDataStore ds,
+						GridExtent layerExtent,
+					   	GridExtent windowExtent,
+						int[] bands){
+		
+		dataStore = ds;
+		rasterBuf = ds.getLastBuffer();
+		if(dataStore.getDataType() != null)
+			dataType = dataStore.getDataType()[0];
+		this.bands = bands;
+		this.windowExtent = windowExtent;
+		this.layerExtent = layerExtent;
+	}
+	
+	/**
+	 * Obtiene el valor de tipo byte de una celda. La posici�n x e y de la celda a 
+	 * recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Valor de tipo byte contenido en la posici�n especificada
+	 */
+	public abstract byte getCellValueAsByte(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo short de una celda. La posici�n x e y de la celda a 
+	 * recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Valor de tipo short contenido en la posici�n especificada
+	 */
+	public abstract short getCellValueAsShort(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo int de una celda. La posici�n x e y de la celda a 
+	 * recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Valor de tipo int contenido en la posici�n especificada
+	 */
+	public abstract int getCellValueAsInt(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo float de una celda. La posici�n x e y de la celda a 
+	 * recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Valor de tipo float contenido en la posici�n especificada
+	 */
+	public abstract float getCellValueAsFloat(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo double de una celda. La posici�n x e y de la celda a 
+	 * recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Valor de tipo double contenido en la posici�n especificada
+	 */
+	public abstract double getCellValueAsDouble(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo double de una celda. La posici�n x e y de la celda a 
+	 * recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Valor de tipo double contenido en la posici�n especificada
+	 */
+	public abstract double getCellValue(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo byte de una celda en todas las bandas. 
+	 * La posici�n x e y de la celda a recuperar est� definida en los par�metros. 
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Array de tipo byte con el contenido de las bandas en la posici�n especificada
+	 */
+	public abstract byte[] getBandsValuesAsByte(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException;
+	
+	/**
+	 * Obtiene el valor de tipo short de una celda en todas las bandas. 
+	 * La posici�n x e y de la celda a recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Array de tipo short con el contenido de las bandas en la posici�n especificada
+	 */
+	public abstract short[] getBandsValuesAsShort(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo int de una celda en todas las bandas. 
+	 * La posici�n x e y de la celda a recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Array de tipo int con el contenido de las bandas en la posici�n especificada
+	 */
+	public abstract int[] getBandsValuesAsInt(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo float de una celda en todas las bandas. 
+	 * La posici�n x e y de la celda a recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Array de tipo float con el contenido de las bandas en la posici�n especificada
+	 */
+	public abstract float[] getBandsValuesAsFloat(int x, int y) throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	/**
+	 * Obtiene el valor de tipo double de una celda en todas las bandas. 
+	 * La posici�n x e y de la celda a recuperar est� definida en los par�metros
+	 * @param x Posici�n X del valor que queremos recuperar
+	 * @param y Posici�n Y del valor que queremos recuperar
+	 * @return Array de tipo double con el contenido de las bandas en la posici�n especificada
+	 */
+	public abstract double[] getBandsValuesAsDouble(int x, int y)  throws RasterBufferInvalidAccessException, RasterBufferInvalidException ;
+	
+	public boolean isNoDataValue (double dValue) {
+		if( rasterBuf != null && 
+			rasterBuf.getNoDataValue() != null && 
+			rasterBuf.getNoDataValue().isDefined())
+			return (dValue == rasterBuf.getNoDataValue().getValue().doubleValue());
+		else {
+			if( defaultNoData != null && 
+				defaultNoData.isDefined())
+				return (dValue == defaultNoData.getValue().doubleValue());
+		}
+		return false;
+	}
+	
+	public double getNoDataValue() {
+		if( rasterBuf != null && 
+			rasterBuf.getNoDataValue() != null && 
+			rasterBuf.getNoDataValue().isDefined())
+			return rasterBuf.getNoDataValue().getValue().doubleValue();
+		else {
+			if( defaultNoData != null && 
+				defaultNoData.isDefined())
+				return defaultNoData.getValue().doubleValue();
+		}
+		return -99999D;
+	}
+	
+	public int getNY() {
+		return windowExtent.getNY();
+	}
+	
+	public int getNX() {
+		return windowExtent.getNX();
+	}
+	
+	public double getCellSize(){
+		return windowExtent.getCellSize();
+	}
+	
+	public GridExtent getGridExtent(){
+		return windowExtent;
+	}
+	
+	public boolean isCellInGrid(int iX, int iY){
+		return (iX >= 0 && iX < getNX() && iY >= 0 && iY < getNY());
+	}
+	
+	/**
+	 * Asigna la banda sobre la que se realizan las operaciones. Por defecto es la banda 0
+	 * con lo que para el uso de MDTs no habr� que modificar este valor.
+	 * @param band Banda sobre la que se realizan las operaciones.
+	 */
+	public void setBandToOperate(int band){
+		this.bandToOperate = band;
+	}
+	
+	public void dispose() {
+		if(rasterBuf != null)
+			rasterBuf.dispose();
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		dataStore      = null;
+		rasterBuf      = null;
+		bands          = null;
+		defaultNoData  = null;
+		super.finalize();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/GridReader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsReader.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsReader.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsReader.java	(revision 15423)
@@ -0,0 +1,265 @@
+/* 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.impl.grid.roi;
+
+import java.awt.Color;
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+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.ValidateDataParametersException;
+import org.gvsig.fmap.dal.feature.Feature;
+import org.gvsig.fmap.dal.feature.FeatureSet;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.FeatureType;
+import org.gvsig.fmap.dal.store.shp.SHPStoreParameters;
+import org.gvsig.fmap.dal.store.shp.SHPStoreProvider;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.fmap.geom.primitive.NullGeometry;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.roi.ROIReader;
+import org.gvsig.tools.dispose.DisposableIterator;
+
+
+public class VectorialROIsReader implements ROIReader {
+	private HashMap<String, ROI>   rois         = null;
+	private RasterDataStore        store        = null;
+	private Envelope               bbox         = null;
+	private FeatureStore[]         featureStore = null;
+
+	public VectorialROIsReader(
+			FeatureStore featureStore,
+			RasterDataStore store,
+			IProjection projection) {
+		Rectangle2D e = store.getExtent().toRectangle2D();
+		try {
+			bbox = GeometryLocator.getGeometryManager().createEnvelope(
+					e.getX(), e.getY(), e.getMaxX(), e.getMaxY(), SUBTYPES.GEOM2D);
+		} catch (CreateEnvelopeException e1) {
+			LoggerFactory.getLogger(VectorialROIsReader.class).error("Error creating the envelope", e);
+		}
+
+		this.store = store;
+		this.featureStore = new FeatureStore[1];
+		this.featureStore[0] = featureStore;
+	}
+
+	/**
+	 * Constructor using the envelope of the raster layer
+	 * @param filename
+	 * @param store
+	 * @param projection
+	 * @throws InvalidROIsShpException
+	 * @throws FileNotExistsException
+	 */
+	public VectorialROIsReader(
+			String filename,
+			RasterDataStore store,
+			IProjection projection) throws ROIException, FileNotExistsException {
+		Rectangle2D e = store.getExtent().toRectangle2D();
+		try {
+			Envelope env = GeometryLocator.getGeometryManager().createEnvelope(
+					e.getX(), e.getY(), e.getMaxX(), e.getMaxY(), SUBTYPES.GEOM2D);
+			init(filename, store, projection, env);
+		} catch (CreateEnvelopeException e1) {
+			LoggerFactory.getLogger(VectorialROIsReader.class).error("Error creating the envelope", e);
+		}
+	}
+
+	public VectorialROIsReader(
+			String filename,
+			RasterDataStore store,
+			IProjection projection,
+			Envelope bbox) throws ROIException, FileNotExistsException {
+		init(filename, store, projection, bbox);
+	}
+
+	public void init(
+			String filename,
+			RasterDataStore store,
+			IProjection projection,
+			Envelope bbox) throws ROIException, FileNotExistsException {
+		this.store = store;
+		this.bbox = bbox;
+		File file = new File(filename);
+		if(file.exists()) {
+			this.featureStore = new FeatureStore[1];
+			this.featureStore[0] = openOneROIFile(file, projection);
+		} else {
+			file = new File(filename + ".shp");
+			if(file.exists()) {
+				this.featureStore = new FeatureStore[1];
+				this.featureStore[0] = openOneROIFile(file, projection);
+			} else {
+				this.featureStore = openThreeROIFiles(filename, projection);
+			}
+		}
+
+	}
+
+	private FeatureStore[] openThreeROIFiles(String filename, IProjection projection) throws ROIException, FileNotExistsException {
+		FeatureStore[] featureStore = new FeatureStore[3];
+		if(filename.endsWith(".shp")) {
+			filename = filename.substring(0, filename.lastIndexOf(".shp"));
+		}
+		File file = new File(filename + "_polygons.shp");
+		boolean existsAtLeastOne = false;
+		if(file.exists()) {
+			featureStore[0] = openOneROIFile(file, projection);
+			existsAtLeastOne = true;
+		}
+
+		file = new File(filename + "_points.shp");
+		if(file.exists()) {
+			featureStore[1] = openOneROIFile(file, projection);
+			existsAtLeastOne = true;
+		}
+
+		file = new File(filename + "_polylines.shp");
+		if(file.exists()) {
+			featureStore[2] = openOneROIFile(file, projection);
+			existsAtLeastOne = true;
+		}
+
+		if(!existsAtLeastOne)
+			throw new FileNotExistsException("file not found");
+		return featureStore;
+	}
+
+	private FeatureStore openOneROIFile(File file, IProjection projection) throws ROIException {
+		DataManager datamanager = DALLocator.getDataManager();
+		SHPStoreParameters params = null;
+		try {
+			params = (SHPStoreParameters)datamanager.createStoreParameters(SHPStoreProvider.NAME);
+			params.setCRS(projection);
+		} catch (InitializeException e) {
+			throw new ROIException(e.getMessage(), e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new ROIException(e.getMessage(), e);
+		}
+		params.setFile(file);
+		DataManager dataManager = DALLocator.getDataManager();
+		try {
+			return (FeatureStore)dataManager.openStore(params.getDataStoreName(), params);
+		} catch (ValidateDataParametersException e) {
+			throw new ROIException(e.getMessage(), e);
+		} catch (InitializeException e) {
+			throw new ROIException(e.getMessage(), e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new ROIException(e.getMessage(), e);
+		}
+	}
+
+	public List<ROI> read(List<ROI> existingROIs) throws ROIException {
+		for (int i = 0; i < this.featureStore.length; i++) {
+			try {
+				existingROIs = read(existingROIs, this.featureStore[i]);
+			} catch (InvalidROIsShpException e) {
+				throw new ROIException("", e);
+			} catch (DataException e) {
+				throw new ROIException("", e);
+			}
+		}
+		return existingROIs;
+	}
+
+	@SuppressWarnings("deprecation")
+	public List<ROI> read(List<ROI> existingROIs, FeatureStore featureStore) throws InvalidROIsShpException, DataException {
+		FeatureType featureType = featureStore.getDefaultFeatureType();
+		long id = System.currentTimeMillis();
+
+		int nameFieldIndex = featureType.getIndex("name");
+		int rFiledIndex = featureType.getIndex("R");
+		int gFiledIndex = featureType.getIndex("G");
+		int bFiledIndex = featureType.getIndex("B");
+
+		if (existingROIs != null) {
+			rois = new HashMap<String, ROI>();
+			for (int i = 0; i < existingROIs.size(); i++) {
+				VectorialROIImpl roi = (VectorialROIImpl)existingROIs.get(i);
+				rois.put(roi.getName(), roi);
+			}
+		}
+		String roiName;
+		int r = 255, g = 0, b = 0;
+		FeatureSet set = null;
+		DisposableIterator features = null;
+		try {
+			set = featureStore.getFeatureSet();
+			features = set.fastIterator();
+			String defaultROIName = "ROI";
+			while (features.hasNext()) {
+				Feature feature = (Feature) features.next();
+
+				if(feature.getDefaultGeometry() == null ||
+				   feature.getDefaultGeometry() instanceof NullGeometry)
+					continue;
+				if(feature.getDefaultGeometry() != null &&
+				   !feature.getDefaultGeometry().getEnvelope().intersects(bbox))
+					continue;
+
+				if(nameFieldIndex >= 0)
+					roiName = feature.getString(nameFieldIndex).toString();
+				else {
+					roiName = defaultROIName + "-" + (id++);
+				}
+				VectorialROIImpl roi = null;
+				if (!rois.containsKey(roiName)) {
+					roi = new VectorialROIImpl(store);
+					roi.setName(roiName);
+					if(rFiledIndex >= 0)
+						r = ((Number) feature.get(rFiledIndex)).intValue();
+					if(gFiledIndex >= 0)
+						g = ((Number) feature.get(gFiledIndex)).intValue();
+					if(bFiledIndex >= 0)
+						b = ((Number) feature.get(bFiledIndex)).intValue();
+					roi.setColor(new Color(r, g, b));
+					rois.put(roi.getName(), roi);
+				} else
+					roi = (VectorialROIImpl) rois.get(roiName);
+				roi.addGeometry(feature.getDefaultGeometry());
+			}
+		} finally {
+			if (features != null)
+				features.dispose();
+			if (set != null)
+				set.dispose();
+		}
+		return new ArrayList<ROI>(rois.values());
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsReader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/RasterROI.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/RasterROI.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/RasterROI.java	(revision 15423)
@@ -0,0 +1,181 @@
+/* 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.impl.grid.roi;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.OutOfGridException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.grid.Grid;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.raster.roi.AbstractROI;
+import org.gvsig.tools.ToolsLocator;
+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;
+
+/**
+ * Clase que representa una regi�n de interes conformada por
+ * un raster. 
+ * 
+ * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
+ * @deprecated This class is not implemented yet
+ *
+ */
+public class RasterROI extends AbstractROI {
+	
+	/**
+	 * Grid que define el ROI a modo de m�scara
+	 * (NO_DATA -> no isInGrid)
+	 */
+	private Grid maskGrid = null;
+
+	public RasterROI(RasterDataStore store) {
+		super(store);
+		/*int bands[] = {1};
+		try {
+			maskGrid = new GridImpl(store.getExtent(), store.getExtent(), Buffer.TYPE_INT, bands);
+			getGridExtent().setXRange(maskGrid.getGridExtent().getMin().getX(), maskGrid.getGridExtent().getMax().getX());
+			getGridExtent().setYRange(maskGrid.getGridExtent().getMin().getY(), maskGrid.getGridExtent().getMax().getY());
+			for (int x = 0; x < maskGrid.getNX();x++)
+				for (int y = 0; y<maskGrid.getNY();y++)
+					maskGrid.setNoData(x, y);
+		} catch (RasterBufferInvalidException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}*/
+	}
+
+	public boolean isInsideOfPolygon(int x, int y) {
+		try {
+			return (maskGrid.isInGrid(x, y) && !maskGrid.isNoDataValue(getValue(x, y)));
+		} catch (GridException e) {
+			return false;
+		}
+		
+	}
+
+	/**
+	 * 
+	 * @return Grid que define la ROI
+	 */
+	public Grid getMaskGrid() {
+		return maskGrid;
+	}
+	
+	/**
+	 * Obtiene un valor de una celda del grid independientemente del tipo de dato.
+	 * @param x Posici�n en X
+	 * @param y Posici�n en Y
+	 * @return Valor de la celda en formato double
+	 * @throws RasterBufferInvalidAccessException 
+	 * @throws RasterBufferInvalidAccessException
+	 */
+	private double getValue(int x, int y) throws GridException {
+		switch(getMaskGrid().getDataType()) {
+		case Buffer.TYPE_BYTE:return (double)(getMaskGrid().getCellValueAsByte(x, y));
+		case Buffer.TYPE_SHORT:return (double)(getMaskGrid().getCellValueAsShort(x, y));
+		case Buffer.TYPE_INT:return (double)(getMaskGrid().getCellValueAsInt(x, y));
+		case Buffer.TYPE_FLOAT:return (double)getMaskGrid().getCellValueAsFloat(x, y);
+		case Buffer.TYPE_DOUBLE:return (double)getMaskGrid().getCellValueAsDouble(x, y);
+		}
+		return 0;
+	}
+	
+	/**
+	 * A�ade el pixel con coordenadas <code>x</code>,<code>y</code> (coordenadas pixel) al ROI
+	 * 
+	 * @param x
+	 * @param y
+	 */
+	public void addPoint(int x, int y) {
+		try {
+			maskGrid.setCellValue(x, y, 1);
+			getStatistic().setCalculated(false);
+			((ROIStatistic)getStatistic()).setAdvancedStatisticCalculated(false);
+		} catch (OutOfGridException e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+		}
+	}
+	
+	/**
+	 * Excluye al pixel con coordenadas <code>x</code>,<code>y</code> de su participaci�n en la ROI.
+	 * 
+	 * @param x
+	 * @param y
+	 */
+	public void removePoint(int x, int y){
+			maskGrid.setNoData(x, y);
+			getStatistic().setCalculated(false);
+			((ROIStatistic)getStatistic()).setAdvancedStatisticCalculated(false);
+	}
+	
+	/**
+	 * Excluye a todos los p�xeles de la ROI
+	 *
+	 */
+	public void clear(){
+		for(int x = 0; x < maskGrid.getNX(); x++)
+			for(int y = 0; y < maskGrid.getNY(); y++)
+				maskGrid.setNoData(x, y);
+		getStatistic().setCalculated(false);
+		((ROIStatistic)getStatistic()).setAdvancedStatisticCalculated(false);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.grid.roi.ROI#isInside(double, double, double, double)
+	 */
+	public boolean isInside(double x, double y, double w, double h) {
+		return false;
+	}
+
+	@Override
+	public void loadFromState(PersistentState state)
+	throws PersistenceException {
+		super.loadFromState(state);
+		this.maskGrid = (Grid)state.get("maskGrid");
+	}
+
+	@Override
+	public void saveToState(PersistentState state) throws PersistenceException {
+		super.saveToState(state);
+		state.set("maskGrid", maskGrid);
+	}	
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					RasterROI.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			definition.addDynFieldObject("maskGrid").setClassOfValue(RasterROI.class).setMandatory(true);
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/RasterROI.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/InvalidROIsShpException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/InvalidROIsShpException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/InvalidROIsShpException.java	(revision 15423)
@@ -0,0 +1,46 @@
+/* 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.impl.grid.roi;
+
+import org.gvsig.tools.exception.BaseException;
+
+public class InvalidROIsShpException extends BaseException {
+
+	private static final long serialVersionUID = 5095144339285844477L;
+
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public InvalidROIsShpException(String msg){
+		super(msg, "", 0);
+	}
+	
+	/**
+	 * Constructor. Asigna el texto de la excepci�n
+	 * @param msg
+	 */
+	public InvalidROIsShpException(String msg, Throwable e){
+		super(msg, e, "", 0);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/InvalidROIsShpException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/ROIStatistic.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/ROIStatistic.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/ROIStatistic.java	(revision 15423)
@@ -0,0 +1,408 @@
+/* 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.impl.grid.roi;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.exception.RasterBufferInvalidAccessException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.roi.AbstractROI;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Estad�sticas asociadas a una ROI.
+ * 
+ * Diego Guerrero Sevilla (diego.guerrero@uclm.es)
+ *
+ */
+public class ROIStatistic implements Statistics {
+	private static final Logger logger                       = LoggerFactory.getLogger(ROIStatistic.class);
+	private AbstractROI         roi                          = null;
+	private long[] 				values                       = null;
+	private double[] 			max                          = null;
+	private double[] 			min                          = null;
+	private double[] 			mean                         = null;
+	private double[] 			variance                     = null;
+	private boolean 			statisticsCalculated         = false;
+	private boolean 			advancedStatisticsCalculated = false;
+	private Buffer              fullBuffer                   = null;
+	//protected int				bandToOperate                = 0;
+	
+	/**
+	 *  Matriz de varianza covarianza
+	 */
+	private double [][]         varCov = null;
+	
+	public ROIStatistic(AbstractROI roi) {
+		this.roi = roi;
+	}
+	
+	private Buffer getFullBuffer() {
+		if(fullBuffer == null) {
+			RasterManager rManager = RasterLocator.getManager();
+			RasterQuery query = rManager.createQuery();
+			query.setAllDrawableBands();
+			query.setReadOnly(true);
+			try {
+				query.setAreaOfInterest();
+				fullBuffer = roi.getStore().query(query);
+			} catch (QueryException e) {
+				logger.debug("Error reading buffer", e);
+			} catch (ProcessInterruptedException e) {
+				logger.debug("Carga interrumpida", e);
+			} 
+		}
+		return fullBuffer;
+	}
+		
+	/**
+	 * Calcula las estad�sticas b�sicas (Max, Min, Media, Varianza).
+	 * 
+	 * @throws RasterBufferInvalidAccessException
+	 */
+	public void calculate(double scale) throws RasterDriverException {
+		int x, y;
+		double z;
+		int bandCount = roi.getStore().getBandCount();
+		values = new long[bandCount];
+		mean = new double[bandCount];
+		min = new double[bandCount];
+		max = new double[bandCount];
+		variance = new double[bandCount];
+		
+		for (int iBand = 0; iBand < bandCount; iBand++) {
+			mean[iBand]	= 0.0;
+			variance[iBand]	= 0.0;
+			values[iBand]	= 0;
+		}
+		//int oldBandToOperate = bandToOperate;
+		statisticsCalculated = true;
+
+		for (int iBand = 0; iBand < bandCount; iBand++) {
+			for (y = 0; y < getFullBuffer().getHeight(); y++){
+				for (x = 0; x < getFullBuffer().getWidth(); x++){
+					z = getValue(x, y, iBand);
+					if(roi.getStore().getNoDataValue().getValue().doubleValue() != z)	{
+						if( values[iBand] == 0 )
+							min[iBand] = max[iBand] = z;
+						else if( min[iBand] > z )
+							min[iBand]	= z;
+						else if( max[iBand] < z )
+							max[iBand]	= z;
+
+						mean[iBand]	+= z;
+						variance[iBand] += z * z;
+						values[iBand]++;
+					}
+				}
+			}
+		}
+		
+		for (int iBand = 0; iBand < bandCount; iBand++) {
+			if( values[iBand] > 0 ){
+				mean[iBand]	/= (double) values[iBand];
+				variance[iBand] = variance[iBand] / (double) values[iBand] - mean[iBand] * mean[iBand];
+			}
+		}
+		//bandToOperate = oldBandToOperate;
+		statisticsCalculated = true;
+	}
+	
+	/**
+	 * Calculo de estadisticas avanzadas (Matriz varianza- covarianza).
+	 */
+	 public void calculateAdvanced() throws GridException {
+		 	if (!isCalculated())
+				try {
+					calculate(1);
+				} catch (RasterDriverException e) {
+					throw new GridException("", e);
+				}
+			
+			int bandCount = roi.getBandCount();
+			double dSum[][] = new double[bandCount][bandCount];
+			double iValues[][] = new double[bandCount][bandCount];
+			varCov = new double[bandCount][bandCount];
+			double valorBandai = 0, valorBandaj = 0;
+			
+			for (int iBand = 0; iBand < bandCount; iBand++)
+				for (int jBand = 0; jBand < bandCount; jBand++){
+					dSum[iBand][jBand] = 0;
+					iValues[iBand][jBand] = 0;
+			}
+			
+			for (int k = 0; k < getFullBuffer().getHeight(); k++) {
+				for (int l = 0; l < getFullBuffer().getWidth(); l++) {
+					for (int i = 0; i < bandCount; i++) {
+						for (int j = i; j < bandCount; j++) {
+							valorBandai = getValue(l, k, i);
+							valorBandaj =  getValue(l, k, j);
+							if (roi.getStore().getNoDataValue().getValue().doubleValue() != valorBandai && 
+								roi.getStore().getNoDataValue().getValue().doubleValue() != valorBandaj) {
+								valorBandai = valorBandai - mean[i];
+								valorBandaj = valorBandaj - mean[j];
+								dSum[i][j] += valorBandai*valorBandaj;
+								iValues[i][j]++;
+							}
+						}
+					}
+				}
+			}
+			
+			// Asigno el valor a la matriz
+			for (int iBand = 0; iBand < bandCount; iBand++) 
+				for (int jBand = 0; jBand < bandCount; jBand++)
+					if (iValues[iBand][jBand] > 1)
+						varCov[iBand][jBand] = dSum[iBand][jBand] / (double)(iValues[iBand][jBand]);	
+					else
+						varCov[iBand][jBand] = roi.getStore().getNoDataValue().getValue().doubleValue();
+			
+			// Completar parte simetrica de la matriz
+			for (int i = 0; i < bandCount; i++) {
+				for (int j = 0; j < bandCount; j++) {
+					if(j < i)
+						varCov[i][j] = varCov[j][i];
+				}
+			}
+			advancedStatisticsCalculated = true;
+	}
+
+	private double getValue(int j, int i, int band) {
+		double val = 0;
+		Buffer b = getFullBuffer();
+		if(b.getDataType() == Buffer.TYPE_BYTE) {
+			val = (double)b.getElemByte(j, i, band);
+			return val;
+		}
+		if(b.getDataType() == Buffer.TYPE_DOUBLE) {
+			val = (double)b.getElemDouble(j, i, band);
+			return val;
+		}
+		if(b.getDataType() == Buffer.TYPE_FLOAT) {
+			val = (double)b.getElemFloat(j, i, band);
+			return val;
+		}
+		if(b.getDataType() == Buffer.TYPE_INT) {
+			val = (double)b.getElemInt(j, i, band);
+			return val;
+		}
+		if(b.getDataType() == Buffer.TYPE_SHORT) {
+			val = (double)b.getElemShort(j, i, band);
+			return val;
+		}
+		NoData nd = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(1, Buffer.TYPE_DOUBLE);
+		return nd.getValue().doubleValue();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getMaximun()
+	 */
+	public double getMaximun() {
+		double m = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < max.length; i++)
+			m = Math.max(m, max[i]);
+		return m;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getMean()
+	 */
+	public double[] getMean() {
+		return mean;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getMinimun()
+	 */
+	public double getMinimun() {
+		double m = Double.MAX_VALUE;
+		for (int i = 0; i < min.length; i++)
+			m = Math.min(m, min[i]);
+		return m;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getMin()
+	 */
+	public double[] getMin() {
+		return min;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getMax()
+	 */
+	public double[] getMax() {
+		return max;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#isCalculated()
+	 */
+	public boolean isCalculated() {
+		return statisticsCalculated;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#setCalculated(boolean)
+	 */
+	public void setCalculated(boolean calc) {
+		statisticsCalculated = calc;
+		advancedStatisticsCalculated = calc;
+	}
+
+	/**
+	 * Obtiene la varianza
+	 * @return Varianza
+	 */
+	public double[] getVariance() {
+		return variance;
+	}
+	
+	/**
+	* Devuelve la matriz de varianza-covarianza, si no se encuentra calculada se calcula
+	* @retrun Matriz de varianza-covarianza
+	*/
+	public double[][] getVarianceCovarianceMatrix() {
+		return varCov;
+	}
+	 
+	public boolean isAdvancedStatisticsCalculated() {
+		return advancedStatisticsCalculated;
+		
+	}
+
+	public void setAdvancedStatisticCalculated(
+			boolean advancedStatisticCalculated) {
+		this.advancedStatisticsCalculated = advancedStatisticCalculated;
+	}
+
+	/**
+	 * 
+	 * @return n�mero de celdas del ROI.
+	 */
+	public long[] getNumberOfCells() {
+		return values;
+	}
+
+	public void forceToRecalc() {
+		
+	}
+
+	public int getBandCount() {
+		return 0;
+	}
+	
+	public void setBandCount(int bandCount) {
+	}
+
+	public double[] getMaxByteUnsigned() {
+		return null;
+	}
+
+	public double getMaximunByteUnsigned() {
+		return 0;
+	}
+
+	public double[] getMinByteUnsigned() {
+		return null;
+	}
+
+	public double getMinimunByteUnsigned() {
+		return 0;
+	}
+
+	public int getPercent() {
+		return 0;
+	}
+
+	public double[] getSecondMax() {
+		return null;
+	}
+
+	public double[] getSecondMaxByteUnsigned() {
+		return null;
+	}
+
+	public double[] getSecondMin() {
+		return null;
+	}
+
+	public double[] getSecondMinByteUnsigned() {
+		return null;
+	}
+
+	public int getTailTrimCount() {
+		return 0;
+	}
+
+	public Object getTailTrimValue(double percent) {
+		return null;
+	}
+
+	public void setTailTrimValue(double percent, Object valueByBand) {
+		
+	}
+	
+	public Object[] getTailTrimValue(int pos) {
+		return null;
+	}
+
+	public void resetPercent() {
+		
+	}
+
+	public Statistics cloneStatistics() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getNumberOfValues()
+	 */
+	public long[] getNumberOfValues() {
+		return values;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#setNumberOfValues(long[])
+	 */
+	public void setNumberOfValues(long[] values) {
+		this.values = values;
+	}
+ 
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/ROIStatistic.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsWriter.java	(revision 15423)
@@ -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.impl.grid.roi;
+
+import java.io.File;
+import java.util.Iterator;
+import java.util.List;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.feature.EditableFeature;
+import org.gvsig.fmap.dal.feature.EditableFeatureAttributeDescriptor;
+import org.gvsig.fmap.dal.feature.EditableFeatureType;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.fmap.dal.feature.NewFeatureStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.roi.ROIWriter;
+import org.gvsig.tools.dataTypes.DataTypes;
+
+/**
+ * Clase dedicada a la escritura de ROIs en formato en disco (formato shape).
+ *
+ * Si las ROIs a escribir incluyen distintos tipos de geometr�as la escritura se
+ * realizar� en distintos shape files, uno para poligonos, otro para polil�neas y
+ * otro para puntos.
+ *
+ * @author Diego Guerrero (diego.guerrero@uclm.es)
+ *
+ */
+public class VectorialROIsWriter implements ROIWriter {
+	private String 			baseFilename 		= null;
+	private IProjection 	projection 			= null;
+	private FeatureStore 	surfaceFS			= null;
+	private FeatureStore 	pointFS				= null;
+	private FeatureStore 	curveFS				= null;
+
+
+	/**
+	 * Constructor.
+	 *
+	 * @param baseFilename ruta base para formar los nombres de fichero (ruta/prefijo)
+	 * @param projection CRS de las geometr�as.
+	 */
+	public VectorialROIsWriter(String baseFilename, IProjection projection) {
+		this.baseFilename = baseFilename;
+		this.projection = projection;
+	}
+	
+	public void write(List<ROI> rois) {
+		if(rois.size() > 0)
+			if(!(rois.get(0) instanceof VectorialROIImpl))
+				return;
+				
+		boolean monoType = true;
+		int geometryType = -1;
+		List<Geometry> geometries = null;
+
+		Object values[] = new Object[4];
+
+		if (baseFilename.endsWith(".shp"))
+			baseFilename = baseFilename.replaceAll(".shp", "");
+
+		for (int i = 0; i < rois.size(); i++) {
+			geometries = ((VectorialROIImpl)rois.get(i)).getGeometries();
+			for (Iterator<Geometry> iterator = geometries.iterator(); iterator.hasNext();) {
+				if (geometryType < 0)
+					geometryType = ((Geometry) iterator.next()).getType();
+				else
+					if (geometryType != ((Geometry) iterator.next()).getType()) {
+						monoType = false;
+						break;
+					}
+			}
+		}
+
+		if (monoType) {
+			create(baseFilename + ".shp", projection, geometryType);
+		} else {
+			create(baseFilename + "_polygons" + ".shp", projection, Geometry.TYPES.SURFACE);
+			create(baseFilename + "_points" + ".shp", projection, Geometry.TYPES.POINT);
+			create(baseFilename + "_polylines" + ".shp", projection, Geometry.TYPES.CURVE);
+		}
+
+		for (int i = 0; i < rois.size(); i++) {
+			geometries = ((VectorialROIImpl)rois.get(i)).getGeometries();
+			values[0] = rois.get(i).getName();
+			values[1] = new Integer(rois.get(i).getColor().getRed());
+			values[2] = new Integer(rois.get(i).getColor().getGreen());
+			values[3] = new Integer(rois.get(i).getColor().getBlue());
+
+
+			for (Iterator<Geometry> iterator = geometries.iterator(); iterator.hasNext();) {
+				Geometry geometry = (Geometry) iterator.next();
+				addFeature(geometry, values);
+			}
+		}
+		try {
+			if (surfaceFS != null)
+				surfaceFS.finishEditing();
+			if (pointFS != null)
+				pointFS.finishEditing();
+			if (curveFS != null)
+				curveFS.finishEditing();
+		} catch (DataException e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	private void addFeature(Geometry geom, Object[] values) {
+		try {
+			switch (geom.getType()) {
+			case Geometry.TYPES.SURFACE:
+				if (surfaceFS != null) {
+					EditableFeature ef = surfaceFS.createNewFeature();
+					ef.set("name", values[0]);
+					ef.set("R", values[1]);
+					ef.set("G", values[2]);
+					ef.set("B", values[3]);
+					ef.set("GEOMETRY", geom);
+					surfaceFS.insert(ef);
+				}
+				break;
+
+			case Geometry.TYPES.POINT:
+				if (pointFS != null){
+					EditableFeature ef=pointFS.createNewFeature();
+					ef.set("name", values[0]);
+					ef.set("R", values[1]);
+					ef.set("G", values[2]);
+					ef.set("B", values[3]);
+					ef.set("GEOMETRY", geom);
+					pointFS.insert(ef);
+				}
+				break;
+
+			case Geometry.TYPES.CURVE:
+				if (curveFS != null){
+					EditableFeature ef=curveFS.createNewFeature();
+					ef.set("name", values[0]);
+					ef.set("R", values[1]);
+					ef.set("G", values[2]);
+					ef.set("B", values[3]);
+					ef.set("GEOMETRY", geom);
+					curveFS.insert(ef);
+				}
+				break;
+
+			default:
+				return;
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	@SuppressWarnings("deprecation")
+	private void create(String filename, IProjection crs, int geometryType) {
+		File newFile=new File(filename);
+		try {
+			DataManager datamanager = DALLocator.getDataManager();
+			FilesystemServerExplorerParameters explorerParams;
+
+			explorerParams = (FilesystemServerExplorerParameters) datamanager.createServerExplorerParameters(FilesystemServerExplorer.NAME);
+
+			explorerParams.setRoot(newFile.getParent());
+			FilesystemServerExplorer explorer=(FilesystemServerExplorer) datamanager.createServerExplorer(explorerParams);
+			NewFeatureStoreParameters newParams = (NewFeatureStoreParameters) explorer.getAddParameters(newFile);
+			
+			EditableFeatureType featureType = getFeatureType(newParams);
+			EditableFeatureAttributeDescriptor efad=featureType.add("GEOMETRY", org.gvsig.fmap.geom.DataTypes.GEOMETRY);
+			efad.setGeometryType(geometryType);
+			efad.setSRS(crs);
+			featureType.setDefaultGeometryAttributeName("GEOMETRY");
+
+			explorer.add(newParams.getDataStoreName(), newParams, true);
+
+			switch (geometryType) {
+			case Geometry.TYPES.SURFACE:
+				surfaceFS = (FeatureStore) datamanager.createStore(newParams);
+				surfaceFS.edit(FeatureStore.MODE_APPEND);
+				break;
+
+			case Geometry.TYPES.POINT:
+				pointFS = (FeatureStore) datamanager.createStore(newParams);
+				pointFS.edit(FeatureStore.MODE_APPEND);
+				break;
+
+			case Geometry.TYPES.CURVE:
+				curveFS = (FeatureStore) datamanager.createStore(newParams);
+				curveFS.edit(FeatureStore.MODE_APPEND);
+				break;
+
+			default:
+				return;
+			}
+		} catch (Exception e) {
+			e.printStackTrace();
+		}
+
+	}
+
+	private EditableFeatureType getFeatureType(NewFeatureStoreParameters newParams) {
+		EditableFeatureType eft = (EditableFeatureType)newParams.getDefaultFeatureType();
+
+		eft.add("name", DataTypes.STRING, 20);
+
+		eft.add("R", DataTypes.INT, 4);
+
+		eft.add("G", DataTypes.INT, 4);
+
+		eft.add("B", DataTypes.INT, 4);
+
+		return eft;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIsWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIImpl.java	(revision 15423)
@@ -0,0 +1,197 @@
+/* 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.impl.grid.roi;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import java.util.List;
+
+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.store.RasterDataStore;
+import org.gvsig.fmap.geom.Geometry;
+import org.gvsig.raster.roi.AbstractROI;
+import org.gvsig.raster.roi.VectorialROI;
+import org.gvsig.tools.ToolsLocator;
+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;
+
+/**
+ * Clase que representa una regi�n de interes conformada por
+ * elementos vectoriales.
+ *
+ * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
+ *
+ */
+public class VectorialROIImpl extends AbstractROI implements VectorialROI {
+
+	/**
+	 * Array de geometr�as (IGeometry) que definen el ROI.
+	 */
+	private ArrayList<Geometry>		geometries   = null;
+
+	public VectorialROIImpl(RasterDataStore store) {
+		super(store);
+		geometries = new ArrayList<Geometry>();
+	}
+
+	public boolean isInside(double x, double y, double w, double h) {
+		if((x + w) < getROIExtent().minX() || x > getROIExtent().maxX() || (y - h) > getROIExtent().maxY() || y < getROIExtent().minY())
+			return false;
+		for (int i = 0; i < geometries.size(); i++) {
+			Rectangle2D celda = new Rectangle2D.Double(x, y, w, h);
+			if(((Geometry)geometries.get(i)).intersects(celda))
+				return true;
+		}
+		return false;
+	}
+
+	public boolean isInsideOfPolygon(int x, int y) {
+		double newX = x - xOffset;
+		double newY = y - yOffset;
+		//Comprobaci�n de que el punto cae dentro de los l�mites de la bbox de las geometr�as
+		if (newX < 0 || newX > getROIPxWidth() || newY < 0 || newY > getROIPxHeight()) 
+			return false;
+
+		Point2D p = getStore().rasterToWorld(new Point2D.Double(x, y));
+		for (int i = 0; i < geometries.size(); i++){
+			if(((Geometry)geometries.get(i)).contains(p.getX(), p.getY()))
+				return true;
+		}
+		return false;
+	}
+
+	/**
+	 * A�ade una geometr�a a la ROI
+	 *
+	 * @param geometry
+	 */
+	public void addGeometry(Geometry geometry){
+		RasterManager rManager = RasterLocator.getManager();
+		geometries.add(geometry);
+
+		Rectangle2D geometryBounds = geometry.getBounds();
+		if(getROIExtent() == null)
+			roiExtent = rManager.getDataStructFactory().createExtent(
+					geometryBounds.getMinX(), 
+					geometryBounds.getMaxY(), 
+					geometryBounds.getMaxX(), 
+					geometryBounds.getMinY());
+		else
+			roiExtent = rManager.getDataStructFactory().createExtent(
+									Math.min(geometryBounds.getMinX(), getROIExtent().minX()),
+									Math.max(geometryBounds.getMaxY(), getROIExtent().maxY()),
+									Math.max(geometryBounds.getMaxX(), getROIExtent().maxX()),
+									Math.min(geometryBounds.getMinY(), getROIExtent().minY()));
+
+		double minX = geometryBounds.getMinX() - Math.abs(geometryBounds.getMinX() - getStoreExtent().getMin().getX()) % getCellSize();
+		double minY = (geometryBounds.getMinY()) - (Math.abs(geometryBounds.getMinY() - getStoreExtent().getMin().getY())) % getCellSize();
+		double maxX = (geometryBounds.getMaxX()  + getCellSize()) - Math.abs(geometryBounds.getMaxX() - getStoreExtent().getMin().getX()) % getCellSize();
+		double maxY = (geometryBounds.getMaxY() + getCellSize()) - (Math.abs(geometryBounds.getMaxY() - getStoreExtent().getMin().getY())) % getCellSize();
+
+		if (geometries.size() > 1) {
+			minX = Math.min(minX, getROIExtent().getMin().getX());
+			minY = Math.min(minY, getROIExtent().getMin().getY());
+			maxX = Math.max(maxX, getROIExtent().getMax().getX());
+			maxY = Math.max(maxY, getROIExtent().getMax().getY());
+		}
+
+		xOffset = (int)((minX - getStoreExtent().getMin().getX()) / getCellSize());
+		yOffset = (int)((getStoreExtent().getMax().getY()- maxY) / getCellSize());
+		getStatistic().setCalculated(false);
+	}
+
+	/**
+	 * Eliminar la geometr�a con �ndice <code>index</code> de la ROI
+	 *
+	 * @param index indice de la geometr�a a eliminar
+	 */
+	public void deleteGeometry(int index){
+		geometries.remove(index);
+		getStatistic().setCalculated(false);
+	}
+
+	/**
+	 * Elimina todas las geometr�as que definen la ROI.
+	 *
+	 */
+	public void clear(){
+		geometries.clear();
+		getStatistic().setCalculated(false);
+	}
+
+	/**
+	 *
+	 * @return ArryList con las geometr�as que definen la ROI
+	 */
+	public List<Geometry> getGeometries() {
+		return geometries;
+	}
+
+	
+	/**
+	 * @deprecated The regions of interest should not be persisted
+	 */
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+	throws PersistenceException {
+		super.loadFromState(state);
+		List<Geometry> aux = state.getList("geometries");
+		this.geometries = new ArrayList<Geometry>();
+		this.geometries.addAll(aux);
+		
+		roiExtent = (Extent)state.get("extent");
+	}
+
+	/**
+	 * @deprecated The regions of interest should not be persisted
+	 */
+	public void saveToState(PersistentState state) throws PersistenceException {
+		super.saveToState(state);
+		state.set("geometries", geometries);		
+		state.set("extent", getROIExtent());
+	}	
+
+	/**
+	 * @deprecated The regions of interest should not be persisted
+	 */
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					VectorialROIImpl.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			definition.addDynFieldList("geometries").setClassOfItems(Geometry.class).setMandatory(false);
+			definition.addDynFieldObject("extent").setClassOfValue(Extent.class).setMandatory(true);
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/grid/roi/VectorialROIImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/images/Download_Warning.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/images/Download_Warning.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/images/forbidden.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/images/forbidden.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/images/download.jpg
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/images/download.jpg
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterService.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterService.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterService.java	(revision 15423)
@@ -0,0 +1,136 @@
+/* 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.impl;
+
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.net.URL;
+import java.util.Date;
+import java.util.regex.Pattern;
+
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.RasterMessageException;
+import org.gvsig.fmap.dal.coverage.RasterService;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Default {@link RasterService} implementation.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class DefaultRasterService implements RasterService {
+
+    private static final Logger LOG =
+        LoggerFactory.getLogger(DefaultRasterService.class);
+
+    private static final String DEFAULT_FORTUNE_COOKIE_URL =
+        "http://www.fullerdata.com/FortuneCookie/FortuneCookie.asmx/GetFortuneCookie";
+
+    private String message = null;
+    private RasterManager manager;
+    private Date date = null;
+    private String url;
+
+    /**
+     * {@link DefaultRasterService} constructor with a
+     * {@link RasterManager}.
+     * 
+     * @param manager
+     *            to use in the service
+     */
+    public DefaultRasterService(RasterManager manager) {
+        this(manager, DEFAULT_FORTUNE_COOKIE_URL);
+    }
+
+    /**
+     * {@link DefaultRasterService} constructor with a
+     * {@link RasterManager}.
+     * 
+     * @param manager
+     *            to use in the service
+     */
+    public DefaultRasterService(RasterManager manager, String url) {
+        this.manager = manager;
+        this.url = url;
+    }
+
+    public String getMessage() throws RasterMessageException {
+        if (this.message == null) {
+            try {
+                this.message = getMessageFromUrl();
+            } catch (IOException e) {
+                throw new RasterMessageException(e);
+            }
+            this.date = new Date();
+        }
+        return this.message;
+    }
+
+    /**
+     * Gets a Raster message from an external service through a URL.
+     * 
+     * @return the message
+     */
+    private String getMessageFromUrl() throws IOException {
+        LOG.debug("Getting the Raster message from the url: {}",
+            this.url);
+
+        URL url = new URL(this.url);
+        StringBuffer message = new StringBuffer();
+        BufferedReader in =
+            new BufferedReader(new InputStreamReader(url.openStream()));
+        String str;
+        // Create a pattern to match breaks
+        Pattern p = Pattern.compile("\\<[^\\>]+\\>");
+
+        StringBuffer data = null;
+
+        if (LOG.isDebugEnabled()) {
+            data = new StringBuffer();
+        }
+
+        while ((str = in.readLine()) != null) {
+            if (LOG.isDebugEnabled()) {
+                data.append(str).append('\n');
+            }
+            message.append(p.matcher(str).replaceAll("\n"));
+        }
+        in.close();
+
+        LOG.debug("Raster message response:\n{}", data);
+
+        return message.toString();
+    }
+
+    public RasterManager getManager() {
+        return this.manager;
+    }
+
+    public Date getDate() {
+        return this.date;
+    }
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterService.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultDataServerWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultDataServerWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultDataServerWriter.java	(revision 15423)
@@ -0,0 +1,224 @@
+/* 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.impl.buffer;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+/**
+ * <code>WriterBufferServer</code> sirve los datos desde un IBuffer para el
+ * driver de escritura. El driver de escritura que va a volcar un
+ * <code>IBuffer</code> a imagen en disco va solicitando los datos por bloques
+ * a medida que va salvando los anteriores. Esta clase es la encargada de hacer
+ * la divisi�n en bloques del buffer a volcar e ir sirviendolos a medida que el
+ * driver pide m�s datos.
+ * </P>
+ * <P>
+ * Implementa el interfaz <code>DataServerWriter</code> que es el que define
+ * m�todos necesarios para el driver. Adem�s es una tarea incrementable por lo
+ * que deber� implementar el interfaz <code>IIncrementable</code> para poder
+ * mostrar el dialogo de incremento de tarea.
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultDataServerWriter implements DataServerWriter {
+	private Buffer       buffer      = null;
+	private int          row         = 0;
+	/**
+	 * Tama�o de bloque. Este se asignar� en la primera petici�n
+	 */
+	private int          block       = 0;
+
+	private double       percent     = 0;
+	private double       increment   = 0;
+	private int          nBand       = 0;
+
+	/**
+	 * Crea un nuevo <code>WriterBufferServer</code>
+	 */
+	public DefaultDataServerWriter() {
+	}
+
+	/**
+	 * Crea un nuevo <code>WriterBufferServer</code> con el buffer de datos.
+	 * @param buffer
+	 */
+	public DefaultDataServerWriter(Buffer buffer) {
+		setBuffer(buffer, -1);
+	}
+
+	public void setBuffer(Buffer buffer, int nband) {
+		this.buffer = buffer;
+		nBand = nband;
+		row = 0;
+		block = 0;
+		percent = 0;
+		increment = 0;
+	}
+	
+	public Buffer getBuffer() {
+		return buffer;
+	}
+	
+	public void setBand(int nband) {
+		this.nBand = nband;
+	}
+
+	public int[] readARGBData(int sizeX, int sizeY, int nBand) {
+		return null;
+	}
+
+	/**
+	 * Acciones de inicializaci�n para la lectura de de un bloque
+	 * @param sizeY Tama�o en Y del bloque
+	 */
+	private void initRead(int sizeY) {
+		//Si es la primera linea se asigna el tama�o de bloque y el incremento
+		if (row == 0) {
+			block = sizeY;
+			//nblocks = (int)Math.ceil(((double) buffer.getHeight() / (double) sizeY));
+			increment = 100D / ((double) buffer.getHeight() / (double) sizeY);
+		}
+	}
+
+	public byte[][] readByteData(int sizeX, int sizeY) {
+		initRead(sizeY);
+		percent += increment;
+		int len = buffer.getWidth() * sizeY;
+		int nbands = (nBand < 0) ? buffer.getBandCount() : 1;
+		byte[][] b = new byte[nbands][len];
+		if(nBand < 0) {
+			for (int iBand = 0; iBand < nbands; iBand++)
+				for (int j = row; j < (row + sizeY); j++)
+					for (int i = 0; i < buffer.getWidth(); i++)
+						b[iBand][(j % block) * buffer.getWidth() + i] = buffer.getElemByte(j, i, iBand);
+		} else {
+			for (int j = row; j < (row + sizeY); j++)
+				for (int i = 0; i < buffer.getWidth(); i++)
+					b[0][(j % block) * buffer.getWidth() + i] = buffer.getElemByte(j, i, nBand);
+		}
+		row += sizeY;
+		return b;
+	}
+
+	public short[][] readShortData(int sizeX, int sizeY) {
+		initRead(sizeY);
+		percent += increment;
+		int len = buffer.getWidth() * sizeY;
+		int nbands = (nBand < 0) ? buffer.getBandCount() : 1;
+		short[][] b = new short[nbands][len];
+		if(nBand < 0) {
+			for (int iBand = 0; iBand < nbands; iBand++)
+				for (int j = row; j < (row + sizeY); j++)
+					for (int i = 0; i < buffer.getWidth(); i++)
+						b[iBand][(j % block) * buffer.getWidth() + i] = buffer.getElemShort(j, i, iBand);
+		} else {
+			for (int j = row; j < (row + sizeY); j++)
+				for (int i = 0; i < buffer.getWidth(); i++)
+					b[0][(j % block) * buffer.getWidth() + i] = buffer.getElemShort(j, i, nBand);
+		}
+		row += sizeY;
+		return b;
+	}
+
+	public int[][] readIntData(int sizeX, int sizeY) {
+		initRead(sizeY);
+		percent += increment;
+		int len = buffer.getWidth() * sizeY;
+		int nbands = (nBand < 0) ? buffer.getBandCount() : 1;
+		int[][] b = new int[nbands][len];
+		if(nBand < 0) {
+			for (int iBand = 0; iBand < buffer.getBandCount(); iBand++)
+				for (int j = row; j < (row + sizeY); j++)
+					for (int i = 0; i < buffer.getWidth(); i++)
+						b[iBand][(j % block) * buffer.getWidth() + i] = buffer.getElemInt(j, i, iBand);
+		} else {
+			for (int j = row; j < (row + sizeY); j++)
+				for (int i = 0; i < buffer.getWidth(); i++)
+					b[0][(j % block) * buffer.getWidth() + i] = buffer.getElemInt(j, i, nBand);
+		}
+		row += sizeY;
+		return b;
+	}
+
+	public float[][] readFloatData(int sizeX, int sizeY) {
+		initRead(sizeY);
+		percent += increment;
+		int len = buffer.getWidth() * sizeY;
+		int nbands = (nBand < 0) ? buffer.getBandCount() : 1;
+		float[][] b = new float[nbands][len];
+		if(nBand < 0) {
+			for (int iBand = 0; iBand < buffer.getBandCount(); iBand++)
+				for (int j = row; j < (row + sizeY); j++)
+					for (int i = 0; i < buffer.getWidth(); i++)
+						b[iBand][(j % block) * buffer.getWidth() + i] = buffer.getElemFloat(j, i, iBand);
+		} else {
+			for (int j = row; j < (row + sizeY); j++)
+				for (int i = 0; i < buffer.getWidth(); i++)
+					b[0][(j % block) * buffer.getWidth() + i] = buffer.getElemFloat(j, i, nBand);
+		}
+		
+		row += sizeY;
+		return b;
+	}
+
+	public double[][] readDoubleData(int sizeX, int sizeY) {
+		initRead(sizeY);
+		percent += increment;
+		int len = buffer.getWidth() * sizeY;
+		int nbands = (nBand < 0) ? buffer.getBandCount() : 1;
+		double[][] b = new double[nbands][len];
+		if(nBand < 0) {
+			for (int iBand = 0; iBand < buffer.getBandCount(); iBand++)
+				for (int j = row; j < (row + sizeY); j++)
+					for (int i = 0; i < buffer.getWidth(); i++)
+						b[iBand][(j % block) * buffer.getWidth() + i] = buffer.getElemDouble(j, i, iBand);
+		} else {
+			for (int j = row; j < (row + sizeY); j++)
+				for (int i = 0; i < buffer.getWidth(); i++)
+					b[0][(j % block) * buffer.getWidth() + i] = buffer.getElemDouble(j, i, nBand);
+		}
+		row += sizeY;
+		return b;
+	}
+
+	/**
+	 * Obtiene el porcentaje de incremento de la lectura de datos
+	 * @return
+	 */
+	public int getPercent() {
+		return Math.min((int)percent, 100);
+	}
+
+	public Buffer getSource() {
+		return buffer;
+	}
+
+	public void dispose() {
+		if(buffer != null)
+			buffer.dispose();
+	}
+
+	public void setPercent(int value) {
+		
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultDataServerWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/SpiRasterQuery.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/SpiRasterQuery.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/SpiRasterQuery.java	(revision 15423)
@@ -0,0 +1,124 @@
+package org.gvsig.raster.impl.buffer;
+
+import java.awt.Rectangle;
+
+import org.gvsig.fmap.dal.DataQuery;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.cache.tile.provider.TileListener;
+import org.gvsig.timesupport.Time;
+import org.gvsig.tools.task.TaskStatus;
+
+/**
+ * Raster query interface for providers. 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface SpiRasterQuery extends DataQuery {
+	
+	public int getType();
+		
+	public int[] getDrawableBands();
+	
+	public boolean isSupersamplingOptionActive();
+	
+	public int getAlphaBandNumber();
+	
+	public NoData getNoDataValueToFill();
+	
+	public int getAdjustedX();
+
+	public int getAdjustedY();
+	
+	public int getAdjustedWidth();
+
+	public int getAdjustedHeight();
+	
+	/**
+	 * Gets the adjusted window of the request in pixel coordinates
+	 */
+	public Rectangle getAdjustedRequestPxWindow();
+	
+	/**
+	 * Gets the window of the request in pixel coordinates
+	 */
+	 public Rectangle getRequestPxWindow();
+	
+	/**
+	  * Gets a bounding box of a request in world coordinates without adjust to the layer limits.
+	  */
+	 public Extent getRequestBoundingBox();
+	
+	/**
+	 * Gets a bounding box of a request in world coordinates adjusted to the bounding box of the source.
+	 */
+	public Extent getAdjustedRequestBoundingBox();
+	
+	public int getBufWidth();
+
+	public int getBufHeight();
+
+	public int getAdjustedBufWidth();
+
+	public int getAdjustedBufHeight();
+	
+	public TileListener getTileListener();
+	
+	public Time getTime();
+	
+	public int getTileRow();
+
+	public int getTileCol();
+
+	public int getResolutionLevel();
+	
+	/**
+	 * Gets the task status
+	 */
+	public TaskStatus getTaskStatus();
+	
+	public boolean requestIsPixelCoordinates();
+	
+	public boolean requestIsInWorldCoordinates();
+	
+	public BandList getBandList();
+	
+	public void setBandList(BandList bandList);
+
+	/**
+	 * Buffer loaded by the provider and created by the store
+	 * @return
+	 */
+	public Buffer getBufferForProviders();
+	
+	/**
+	  * The buffer is always built by the <code>DataStore</code> but in some cases
+	  * it's necessary assign the result because the buffer has changed. In any case, It's 
+	  * advisable not to do it because the buffer for providers is replaced and next uses 
+	  * of this query would return an error.
+	  * @return
+	  */
+	public void setBufferResult(Buffer buffer);
+	
+	public CacheStruct getCacheStruct();
+
+	public void setCacheStruct(CacheStruct cacheStruct);
+
+	public boolean requestIsTiled();
+	
+	 /**
+	  * The buffer won't be built internally when all parameters will be calculated.
+	  * Uses this call carefully. The provider must know that <code>getBufferForProviders</code>
+	  * will return null.
+	  */
+	public void dontBuildBuffer();
+	
+	public Buffer createBuffer(RasterDataStore store) throws QueryException;
+	
+	public RasterQuery clone();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/SpiRasterQuery.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterMemoryBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterMemoryBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterMemoryBuffer.java	(revision 15423)
@@ -0,0 +1,1231 @@
+/* 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.impl.buffer;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Band;
+
+/**
+ * Implementaci�n del buffer de datos en memoria. Contiene las operaciones necesarias
+ * para acceso a datos raster implementando Buffer y su almacenamiento de datos est� basado
+ * en arrays tridimensionales. Existe un array para cada tipo de dato pero al instanciarse
+ * solo se usar� uno de ellos, el que corresponda al tipo de dato del raster manejado. 
+ * Esto quiere decir que cada RasterMemoryBuffer solo puede contener bandas de un solo tipo de
+ * dato donde la variable dataType especificar� de que tipo de dato se trata.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterMemoryBuffer extends RasterBuffer {
+	private ByteBand[]      byteBuf = null;
+    private ShortBand[]     shortBuf = null;
+    private IntBand[]       intBuf = null;
+    private FloatBand[]     floatBuf = null;
+    private DoubleBand[]    doubleBuf = null;
+    
+    public class ByteBand extends RasterBand {
+    	public byte[][] 	buf = null;
+    	
+    	public ByteBand(int height, int width, boolean malloc) {
+    		super(height, width);
+    		if(malloc)
+    			buf = new byte[height][width];
+    	}
+
+		public Object getLine(int line) {
+			return buf[line];
+		}
+		
+		public void setLine(int line, Object value) {
+			buf[line] = (byte[])value;
+		}
+		
+		public Object getBuf() {
+			return buf;
+		}
+		
+		public void dispose() {
+			buf = null;
+		}
+		
+		protected void finalize() throws Throwable {
+			buf = null;
+			super.finalize();
+		}
+    }
+    
+    public class ShortBand extends RasterBand{
+    	public short[][] 	buf = null;
+    	
+    	public ShortBand(int height, int width, boolean malloc){
+    		super(height, width);
+    		if(malloc)
+    			buf = new short[height][width];
+    	}
+    	
+    	public Object getLine(int line) {
+			return buf[line];
+		}
+    	
+		public void setLine(int line, Object value){
+			buf[line] = (short[])value;
+		}
+		
+		public Object getBuf(){
+			return buf;
+		}
+		
+		public void dispose() {
+			buf = null;
+		}
+		
+		protected void finalize() throws Throwable {
+			buf = null;
+			super.finalize();
+		}
+    }
+
+	public class IntBand extends RasterBand{
+		public int[][] 	buf = null;
+		
+		public IntBand(int height, int width, boolean malloc){
+			super(height, width);
+			if(malloc)
+    			buf = new int[height][width];
+    	}
+		
+		public Object getLine(int line) {
+			return buf[line];
+		}
+		
+		public void setLine(int line, Object value){
+			buf[line] = (int[])value;
+		}
+		
+		public Object getBuf(){
+			return buf;
+		}
+		
+		public void dispose() {
+			buf = null;
+		}
+		
+		protected void finalize() throws Throwable {
+			buf = null;
+			super.finalize();
+		}
+	}
+
+	public class FloatBand extends RasterBand{
+		public float[][] 	buf = null;
+		
+		public FloatBand(int height, int width, boolean malloc){
+			super(height, width);
+			if(malloc)
+    			buf = new float[height][width];
+    	}
+		
+		public Object getLine(int line) {
+			return buf[line];
+		}
+		
+		public void setLine(int line, Object value){
+			buf[line] = (float[])value;
+		}
+		
+		public Object getBuf(){
+			return buf;
+		}
+		
+		public void dispose() {
+			buf = null;
+		}
+		
+		protected void finalize() throws Throwable {
+			buf = null;
+			super.finalize();
+		}
+	}
+
+	public class DoubleBand extends RasterBand{
+		public double[][] 	buf = null;
+		
+		public DoubleBand(int height, int width, boolean malloc){
+			super(height, width);
+			if(malloc)
+    			buf = new double[height][width];
+    	}
+		
+		public Object getLine(int line) {
+			return buf[line];
+		}
+		
+		public void setLine(int line, Object value){
+			buf[line] = (double[])value;
+		}
+		
+		public Object getBuf(){
+			return buf;
+		}
+		
+		public void dispose() {
+			buf = null;
+		}
+		
+		protected void finalize() throws Throwable {
+			buf = null;
+			super.finalize();
+		}
+	}
+	
+    /**
+     * Constructor
+     */
+    public RasterMemoryBuffer() {
+    	
+    }
+    
+    public boolean isBandSwitchable() {
+    	return true;
+    }
+    
+    /**
+     * Constructor
+     * @param dataType Tipo de dato
+     * @param width Ancho
+     * @param height Alto
+     * @param bandNr Banda
+     * @param orig
+     */
+    public RasterMemoryBuffer(int dataType, int width, int height, int bandNr, boolean malloc) {
+    	if(malloc)
+    		malloc(dataType, width, height, bandNr);
+    	else
+    		loadVariables(dataType, width, height, bandNr);
+    }
+
+    public void malloc(int dataType, int width, int height, int bandNr) {
+    	this.dataType = dataType;
+        this.width = width;
+        this.height = height;
+        this.nBands = bandNr;
+
+        if (dataType == TYPE_BYTE) {
+            byteBuf = new ByteBand[bandNr];
+            for(int i = 0; i < bandNr; i++)
+            	byteBuf[i] = new ByteBand(height, width, true);
+        } else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT)) {
+            shortBuf = new ShortBand[bandNr];
+            for(int i = 0; i < bandNr; i++)
+            	shortBuf[i] = new ShortBand(height, width, true);
+        } else if (dataType == TYPE_INT) {
+            intBuf = new IntBand[bandNr];
+            for(int i = 0; i < bandNr; i++)
+            	intBuf[i] = new IntBand(height, width, true);
+        } else if (dataType == TYPE_FLOAT) {
+            floatBuf = new FloatBand[bandNr];
+            for(int i = 0; i < bandNr; i++)
+            	floatBuf[i] = new FloatBand(height, width, true);
+        } else if (dataType == TYPE_DOUBLE) {
+            doubleBuf = new DoubleBand[bandNr];
+            for(int i = 0; i < bandNr; i++)
+            	doubleBuf[i] = new DoubleBand(height, width, true);
+        }
+
+    }
+
+    public void mallocOneBand(int dataType, int width, int height, int band){
+    	this.dataType = dataType;
+        this.width = width;
+        this.height = height;
+        
+        if (dataType == TYPE_BYTE) {
+        	if(byteBuf == null)
+        		byteBuf = new ByteBand[nBands];
+            byteBuf[band] = new ByteBand(height, width, true);
+        } else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT)) {
+        	if(shortBuf == null)
+        		shortBuf = new ShortBand[nBands];
+            shortBuf[band] = new ShortBand(height, width, true);
+        } else if (dataType == TYPE_INT) {
+        	if(intBuf == null)
+        		intBuf = new IntBand[nBands];
+            intBuf[band] = new IntBand(height, width, true);
+        } else if (dataType == TYPE_FLOAT) {
+        	if(floatBuf == null)
+        		floatBuf = new FloatBand[nBands];
+            floatBuf[band] = new FloatBand(height, width, true);
+        } else if (dataType == TYPE_DOUBLE) {
+        	if(doubleBuf == null)
+        		doubleBuf = new DoubleBand[nBands];
+            doubleBuf[band] = new DoubleBand(height, width, true);
+        }
+    }
+    
+    /**
+     * Carga las variables del rasterBuf
+     * @param dataType Tipo de dato
+     * @param width Ancho
+     * @param height Alto
+     * @param bandNr Banda
+     * @param orig
+     */
+    private void loadVariables(int dataType, int width, int height, int bandNr) {
+    	this.dataType = dataType;
+        this.width = width;
+        this.height = height;
+        this.nBands = bandNr;
+
+        if (dataType == TYPE_BYTE) {
+        	byteBuf = new ByteBand[bandNr];
+        	for(int i = 0; i < bandNr; i ++)
+        		byteBuf[i] = new ByteBand(height, 0, true);
+        } else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT)) {
+        	shortBuf = new ShortBand[bandNr];
+        	for(int i = 0; i < bandNr; i ++)
+        		shortBuf[i] = new ShortBand(height, 0, true);
+        } else if (dataType == TYPE_INT) {
+        	intBuf = new IntBand[bandNr];
+        	for(int i = 0; i < bandNr; i ++)
+        		intBuf[i] = new IntBand(height, 0, true);
+        } else if (dataType == TYPE_FLOAT) {
+        	floatBuf = new FloatBand[bandNr];
+        	for(int i = 0; i < bandNr; i ++)
+        		floatBuf[i] = new FloatBand(height, 0, true);
+        } else if (dataType == TYPE_DOUBLE) {
+        	doubleBuf = new DoubleBand[bandNr];
+        	for(int i = 0; i < bandNr; i ++)
+        		doubleBuf[i] = new DoubleBand(height, 0, true);
+        }
+
+    }
+
+    public int getWidth() {
+        return width;
+    }
+
+    public int getHeight() {
+        return height;
+    }
+
+    public int getBandCount() {
+        return nBands;
+    }
+
+    /**
+     * Obtiene el tipo de dato. Los tipos de dato posibles est�n definidos en IRaster.
+     * @return tipo de datos
+     */
+	public int getDataType() {
+		return dataType;
+	}
+	
+	/**
+	 * Asigna el tipo de dato. Los tipos de dato posibles est�n definidos en IRaster.
+	 * @param dataType Tipo de dato del buffer
+	 */
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+
+    /**
+     * Obtiene el tama�o del tipo de dato en bytes
+     * @return Tipo de dato
+     */
+    public int getDataSize() {
+        if (dataType == TYPE_BYTE) {
+            return 1;
+        } else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT)) {
+            return 2;
+        } else if (dataType == TYPE_INT) {
+            return 4;
+        }else if (dataType == TYPE_FLOAT) {
+            return 8;
+        }else if (dataType == TYPE_DOUBLE) {
+            return 16;
+        }
+
+        return 0;
+    }
+
+    /**
+     * Obtiene el tama�o del buffer
+     * @return tama�o del buffer
+     */
+    public long sizeof() {
+        return getDataSize() * width * height * nBands;
+    }
+
+    //***********************************************
+    //Obtiene una linea de datos con todas las bandas
+    
+    public byte[][] getLineByte(int line) {
+    	byte[][] r = new byte[nBands][];
+    	for(int Band = 0; Band < nBands; Band ++)
+    		r[Band] = (byte[])byteBuf[Band].getLine(line);
+    	return r;
+    }
+
+    public short[][] getLineShort(int line) {
+    	short[][] r = new short[nBands][];
+    	for(int Band = 0; Band < nBands; Band ++)
+    		r[Band] = (short[])shortBuf[Band].getLine(line);
+    	return r;
+    }
+
+    public int[][] getLineInt(int line) {
+    	int[][] r = new int[nBands][];
+    	for(int Band = 0; Band < nBands; Band ++)
+    		r[Band] = (int[])intBuf[Band].getLine(line);
+    	return r;
+    }
+        
+    public float[][] getLineFloat(int line) {
+    	float[][] r = new float[nBands][];
+    	for(int Band = 0; Band < nBands; Band ++)
+    		r[Band] = (float[])floatBuf[Band].getLine(line);
+    	return r;
+    }
+    
+    public double[][] getLineDouble(int line) {
+    	double[][] r = new double[nBands][];
+    	for(int Band = 0; Band < nBands; Band ++)
+    		r[Band] = (double[])doubleBuf[Band].getLine(line);
+    	return r;
+    }
+
+    //***********************************************
+    //Asigna una linea de datos a todas las bandas
+    
+    public void setLineByte(byte[][] data, int line) {
+    	for(int Band = 0; Band < nBands; Band ++)
+    		byteBuf[Band].setLine(line, data[Band]);
+    }
+
+    public void setLineShort(short[][] data, int line) {
+    	for(int Band = 0; Band < nBands; Band ++)
+    		shortBuf[Band].setLine(line, data[Band]);
+    }
+
+    public void setLineInt(int[][] data, int line) {
+    	for(int Band = 0; Band < nBands; Band ++)
+    		intBuf[Band].setLine(line, data[Band]);
+    }
+        
+    public void setLineFloat(float[][] data, int line) {
+    	for(int Band = 0; Band < nBands; Band ++)
+    		floatBuf[Band].setLine(line, data[Band]);
+    }
+    
+    public void setLineDouble(double[][] data, int line) {
+    	for(int Band = 0; Band < nBands; Band ++)
+    		doubleBuf[Band].setLine(line, data[Band]);
+    }
+    
+    //***********************************************
+    //Obtiene una linea de datos de una banda
+    
+    public byte[] getLineFromBandByte(int line, int band) {
+        return (byte[])byteBuf[band].getLine(line);
+    }
+
+    public short[] getLineFromBandShort(int line, int band) {
+        return (short[])shortBuf[band].getLine(line);
+    }
+
+    public int[] getLineFromBandInt(int line, int band) {
+        return (int[])intBuf[band].getLine(line);
+    }
+        
+    public float[] getLineFromBandFloat(int line, int band) {
+        return (float[])floatBuf[band].getLine(line);
+    }
+    
+    public double[] getLineFromBandDouble(int line, int band) {
+        return (double[])doubleBuf[band].getLine(line);
+    }
+        
+    //***********************************************
+    //Asigna una linea de datos a una banda
+    
+    public void setLineInBandByte(byte[] data, int line, int band) {
+        byteBuf[band].setLine(line, data);
+    }
+
+    public void setLineInBandShort(short[] data, int line, int band) {
+        shortBuf[band].setLine(line, data);
+    }
+
+    public void setLineInBandInt(int[] data, int line, int band) {
+        intBuf[band].setLine(line, data);
+    }
+        
+    public void setLineInBandFloat(float[] data, int line, int band) {
+        floatBuf[band].setLine(line, data);
+    }
+    
+    public void setLineInBandDouble(double[] data, int line, int band) {
+        doubleBuf[band].setLine(line, data);
+    }
+    
+    //***********************************************    
+    //Obtiene un elemento de la matriz
+    
+    public byte getElemByte(int line, int col, int band) {
+        return byteBuf[band].buf[line][col];
+    }
+    
+    public short getElemShort(int line, int col, int band) {
+        return shortBuf[band].buf[line][col];
+    }
+    
+    public int getElemInt(int line, int col, int band) {
+        return intBuf[band].buf[line][col];
+    }
+    
+    public float getElemFloat(int line, int col, int band) {
+        return floatBuf[band].buf[line][col];
+    }
+    
+    public double getElemDouble(int line, int col, int band) {
+        return doubleBuf[band].buf[line][col];
+    }
+    
+    //**********************************************    
+    //Asigna un elemento de la matriz
+    
+    public void setElem(int line, int col, int band, byte data) {
+    	byteBuf[band].buf[line][col] = data;
+    }
+    
+    public void setElem(int line, int col, int band, short data) {
+    	shortBuf[band].buf[line][col] = data;
+    }
+    
+    public void setElem(int line, int col, int band, int data) {
+    	intBuf[band].buf[line][col] = data;
+    }
+    
+    public void setElem(int line, int col, int band, float data) {
+    	floatBuf[band].buf[line][col] = data;
+    }
+    
+    public void setElem(int line, int col, int band, double data) {
+    	doubleBuf[band].buf[line][col] = data;
+    }
+    
+    //***********************************************
+    //Copia un elemento de todas la bandas en el buffer pasado por par�metro
+    
+    public void getElemByte(int line, int col, byte[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            data[Band] = byteBuf[Band].buf[line][col];
+    }
+    
+    public void getElemShort(int line, int col, short[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            data[Band] = shortBuf[Band].buf[line][col];
+    }
+    
+    public void getElemInt(int line, int col, int[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            data[Band] = intBuf[Band].buf[line][col];
+    }  
+    
+    public void getElemFloat(int line, int col, float[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            data[Band] = floatBuf[Band].buf[line][col];
+    }
+    
+    public void getElemDouble(int line, int col, double[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            data[Band] = doubleBuf[Band].buf[line][col];
+    }
+
+    //***********************************************
+    //Asigna un elemento a todas la bandas en el buffer pasado por par�metro
+    
+    public void setElemByte(int line, int col, byte[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            byteBuf[Band].buf[line][col] = data[Band];
+    }
+    
+    public void setElemShort(int line, int col, short[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            shortBuf[Band].buf[line][col] = data[Band];
+    }
+    
+    public void setElemInt(int line, int col, int[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            intBuf[Band].buf[line][col] = data[Band];
+    }
+
+    public void setElemFloat(int line, int col, float[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            floatBuf[Band].buf[line][col] = data[Band];
+    }
+    
+    public void setElemDouble(int line, int col, double[] data) {
+    	for (int Band = 0; (Band < nBands && Band < data.length); Band++)
+            doubleBuf[Band].buf[line][col] = data[Band];
+    }
+    
+    //***********************************************
+    //Obtiene una banda entera
+    
+    public Band getBand(int band){
+    	if (dataType == TYPE_BYTE) {
+    		return byteBuf[band];
+        } else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT)) {
+        	return shortBuf[band];
+        } else if (dataType == TYPE_INT) {
+        	return intBuf[band];
+        }else if (dataType == TYPE_FLOAT) {
+        	return floatBuf[band];
+        }else if (dataType == TYPE_DOUBLE) {
+        	return doubleBuf[band];
+        }
+    	return null;
+    }
+    
+    /*
+     *  (non-Javadoc)
+     * @see org.gvsig.fmap.driver.Buffer#getBandBuffer(int)
+     */
+    public Buffer getBandBuffer(int Band){
+    	RasterMemoryBuffer rmb = new RasterMemoryBuffer(dataType, width, height, 1, false);
+    	if (dataType == TYPE_BYTE) 
+    		rmb.byteBuf[0].buf = byteBuf[Band].buf;
+        else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT))
+        	rmb.shortBuf[0].buf = shortBuf[Band].buf;
+        else if (dataType == TYPE_INT)
+        	rmb.intBuf[0].buf = intBuf[Band].buf;
+        else if (dataType == TYPE_FLOAT)
+        	rmb.floatBuf[0].buf = floatBuf[Band].buf;
+        else if (dataType == TYPE_DOUBLE)
+        	rmb.doubleBuf[0].buf = doubleBuf[Band].buf;
+    	return rmb;
+    }
+    //***********************************************
+    //Inicializa una banda a un valor pasado por par�metro
+    
+    public void assign(int band, byte value) {
+    	for(int line = 0; line < height; line ++)
+    		for(int col = 0; col < width; col ++)
+    			byteBuf[band].buf[line][col] = value;
+    }
+    
+    public void assign(int band, short value) {
+    	for(int line = 0; line < height; line ++)
+    		for(int col = 0; col < width; col ++)
+    			shortBuf[band].buf[line][col] = value;
+    }
+    
+    public void assign(int band, int value) {
+    	for(int line = 0; line < height; line ++)
+    		for(int col = 0; col < width; col ++)
+    			intBuf[band].buf[line][col] = value;
+    }
+
+    public void assign(int band, float value) {
+    	for(int line = 0; line < height; line ++)
+    		for(int col = 0; col < width; col ++)
+    			floatBuf[band].buf[line][col] = value;
+    }
+    
+    public void assign(int band, double value) {
+    	for(int line = 0; line < height; line ++)
+    		for(int col = 0; col < width; col ++)
+    			doubleBuf[band].buf[line][col] = value;
+    }
+    
+    //***********************************************
+    //Crea un buffer banda inicializado con el valor pasado por par�metro
+    
+
+    public Band createBand(byte defaultValue){
+    	switch(getDataType()){
+    	case RasterBuffer.TYPE_BYTE:ByteBand bb = new ByteBand(width, height, false);
+    								bb.buf = createByteBand(width, height, defaultValue);
+    								return bb;
+    	case RasterBuffer.TYPE_SHORT:	ShortBand sb = new ShortBand(width, height, false);
+										sb.buf = createShortBand(width, height, defaultValue);
+										return sb;
+    	case RasterBuffer.TYPE_INT:	IntBand ib = new IntBand(width, height, false);
+									ib.buf = createIntBand(width, height, defaultValue);
+									return ib;
+    	case RasterBuffer.TYPE_FLOAT:	FloatBand fb = new FloatBand(width, height, false);
+										fb.buf = createFloatBand(width, height, defaultValue);
+										return fb;
+    	case RasterBuffer.TYPE_DOUBLE:	DoubleBand db = new DoubleBand(width, height, false);
+										db.buf = createDoubleBand(width, height, defaultValue);
+										return db;
+    	}
+    	return null;
+    }
+
+    public byte[][] createByteBand(int width, int height, byte defaultValue){
+    	byte[][] band = new byte[height][width];
+    	if(defaultValue != 0){
+	    	for(int line = 0; line < height; line ++)
+	    		for(int col = 0; col < width; col ++)
+	    			band[line][col] = defaultValue;
+    	}
+    	return band;
+    }
+    
+    public short[][] createShortBand(int width, int height, short defaultValue){
+    	short[][] band = new short[height][width];
+    	if(defaultValue != 0){
+	    	for(int line = 0; line < height; line ++)
+	    		for(int col = 0; col < width; col ++)
+	    			band[line][col] = defaultValue;
+    	}
+    	return band;
+    }
+    
+    public int[][] createIntBand(int width, int height, int defaultValue){
+    	int[][] band = new int[height][width];
+    	if(defaultValue != 0){
+	    	for(int line = 0; line < height; line ++)
+	    		for(int col = 0; col < width; col ++)
+	    			band[line][col] = defaultValue;
+    	}
+    	return band;
+    }
+    
+    public float[][] createFloatBand(int width, int height, float defaultValue){
+    	float[][] band = new float[height][width];
+    	if(defaultValue != 0){
+	    	for(int line = 0; line < height; line ++)
+	    		for(int col = 0; col < width; col ++)
+	    			band[line][col] = defaultValue;
+    	}
+    	return band;
+    }
+    
+    public double[][] createDoubleBand(int width, int height, double defaultValue){
+    	double[][] band = new double[height][width];
+    	if(defaultValue != 0){
+	    	for(int line = 0; line < height; line ++)
+	    		for(int col = 0; col < width; col ++)
+	    			band[line][col] = defaultValue;
+    	}
+    	return band;
+    }
+    
+    //***********************************************
+    //A�ade una banda entera. Los datos son asignados por referencia
+
+    private void addBandByte(int pos, Band data) {
+    	if(pos < 0)
+    		return;
+    	ByteBand[] tmp = null;
+    	if(pos >= byteBuf.length){
+    		tmp = new ByteBand[pos + 1];
+    		for(int Band = 0; Band < byteBuf.length; Band ++)
+    			tmp[Band] = byteBuf[Band];
+    		tmp[pos] = (ByteBand)data;
+    	}else{
+    		tmp = new ByteBand[byteBuf.length + 1];
+    		for(int Band = 0; Band < pos; Band ++)
+    			tmp[Band] = byteBuf[Band];
+    		tmp[pos] = (ByteBand)data;
+    		for(int Band = pos + 1; Band <= byteBuf.length; Band ++)
+    			tmp[Band] = byteBuf[Band - 1];
+    	}
+    	nBands = tmp.length;
+    	byteBuf = tmp;
+    }
+    
+    private void addBandShort(int pos, Band data) {
+    	if(pos < 0)
+    		return;
+    	ShortBand[] tmp = null;
+    	if(pos >= shortBuf.length){
+    		tmp = new ShortBand[pos + 1];
+    		for(int Band = 0; Band < shortBuf.length; Band ++)
+    			tmp[Band] = shortBuf[Band];
+    		tmp[pos] = (ShortBand)data;
+    	}else{
+    		tmp = new ShortBand[shortBuf.length + 1];
+    		for(int Band = 0; Band < pos; Band ++)
+    			tmp[Band] = shortBuf[Band];
+    		tmp[pos] = (ShortBand)data;
+    		for(int Band = pos + 1; Band < shortBuf.length; Band ++)
+    			tmp[Band] = shortBuf[Band - 1];
+    	}
+    	nBands = tmp.length;
+    	shortBuf = tmp;
+    }
+    
+    private void addBandInt(int pos, Band data) {
+    	if(pos < 0)
+    		return;
+    	IntBand[] tmp = null;
+    	if(pos >= intBuf.length){
+    		tmp = new IntBand[pos + 1];
+    		for(int Band = 0; Band < intBuf.length; Band ++)
+    			tmp[Band] = intBuf[Band];
+    		tmp[pos] = (IntBand)data;
+    	}else{
+    		tmp = new IntBand[intBuf.length + 1];
+    		for(int Band = 0; Band < pos; Band ++)
+    			tmp[Band] = intBuf[Band];
+    		tmp[pos] = (IntBand)data;
+    		for(int Band = pos + 1; Band < intBuf.length; Band ++)
+    			tmp[Band] = intBuf[Band - 1];
+    	}
+    	nBands = tmp.length;
+    	intBuf = tmp;
+    }
+    
+    private void addBandFloat(int pos, Band data) {
+    	if(pos < 0)
+    		return;
+    	FloatBand[] tmp = null;
+    	if(pos >= floatBuf.length){
+    		tmp = new FloatBand[pos + 1];
+    		for(int Band = 0; Band < floatBuf.length; Band ++)
+    			tmp[Band] = floatBuf[Band];
+    		tmp[pos] = (FloatBand)data;
+    	}else{
+    		tmp = new FloatBand[floatBuf.length + 1];
+    		for(int Band = 0; Band < pos; Band ++)
+    			tmp[Band] = floatBuf[Band];
+    		tmp[pos] = (FloatBand)data;
+    		for(int Band = pos + 1; Band < floatBuf.length; Band ++)
+    			tmp[Band] = floatBuf[Band - 1];
+    	}
+    	nBands = tmp.length;
+    	floatBuf = tmp;
+    }
+    
+    private void addBandDouble(int pos, Band data) {
+    	if(pos < 0)
+    		return;
+    	DoubleBand[] tmp = null;
+    	if(pos >= doubleBuf.length){
+    		tmp = new DoubleBand[pos + 1];
+    		for(int Band = 0; Band < doubleBuf.length; Band ++)
+    			tmp[Band] = doubleBuf[Band];
+    		tmp[pos] = (DoubleBand)data;
+    	}else{
+    		tmp = new DoubleBand[doubleBuf.length + 1];
+    		for(int Band = 0; Band < pos; Band ++)
+    			tmp[Band] = doubleBuf[Band];
+    		tmp[pos] = (DoubleBand)data;
+    		for(int Band = pos + 1; Band < doubleBuf.length; Band ++)
+    			tmp[Band] = doubleBuf[Band - 1];
+    	}
+    	nBands = tmp.length;
+    	doubleBuf = tmp;
+    }
+    
+    //***********************************************
+    //Reemplaza una banda entera. Los datos son reemplazados por referencia
+    
+   /* public void replaceBandByte(int pos, byte[][] data) {
+    	if(pos >= byteBuf.length)
+    		return;
+    	byteBuf[pos] = data;
+    }
+    
+    public void replaceBandShort(int pos, short[][] data) {
+    	if(pos >= shortBuf.length)
+    		return;
+    	shortBuf[pos] = data;
+    }
+    
+    public void replaceBandInt(int pos, int[][] data) {
+    	if(pos >= intBuf.length)
+    		return;
+    	intBuf[pos] = data;
+    }
+    
+    public void replaceBandFloat(int pos, float[][] data) {
+    	if(pos >= floatBuf.length)
+    		return;
+    	floatBuf[pos] = data;
+    }
+    
+    public void replaceBandDouble(int pos, double[][] data) {
+    	if(pos >= doubleBuf.length)
+    		return;
+    	doubleBuf[pos] = data;
+    }*/
+    
+    /**
+     * Replica la banda de una posici�n sobre otra. Si la banda de destino no existe
+     * se crea nueva. Si la posici�n de la banda de destino est� intercalada entre bandas 
+     * que ya existen las otras se desplazan hacia abajo, NO se machacan los datos de ninguna.
+     * Los datos se replican por referencia por lo que al modificar la banda original las
+     * del resto quedar�n afectadas.   
+     * @param orig. Posici�n de la banda de origen. 
+     * @param dest. Posici�n de la banda destino
+     */   
+    public void replicateBand(int orig, int dest){
+    	switch(getDataType()){
+    	case RasterBuffer.TYPE_BYTE:	if(orig >= byteBuf.length)
+											return;
+										addBandByte(dest, getBand(orig));
+										break;
+    	case RasterBuffer.TYPE_SHORT:	if(orig >= shortBuf.length)
+    										return;
+    									addBandShort(dest, getBand(orig));
+    									break;
+    	case RasterBuffer.TYPE_INT: 	if(orig >= intBuf.length)
+											return;
+										addBandInt(dest, getBand(orig));
+										break;
+    	case RasterBuffer.TYPE_FLOAT:	if(orig >= floatBuf.length)
+											return;
+										addBandFloat(dest, getBand(orig));
+										break;
+    	case RasterBuffer.TYPE_DOUBLE:	if(orig >= doubleBuf.length)
+											return;
+										addBandDouble(dest, getBand(orig));
+										break;
+    	}
+    }
+    
+    public void switchBands(int[] bandPosition){
+    	if(bandPosition.length != this.getBandCount())
+    		return;
+    	for(int i = 0; i < bandPosition.length; i++)
+    		if(bandPosition[i] >=  bandPosition.length || bandPosition[i] < 0)
+    			return;
+    	
+    	switch (getDataType()) {
+    	case RasterBuffer.TYPE_BYTE:
+    		ByteBand[] bufB = new ByteBand[this.getBandCount()];
+    		for(int i = 0; i < bandPosition.length; i++)
+    			bufB[i] = byteBuf[bandPosition[i]];
+    		byteBuf = bufB;
+    		break;
+    	case RasterBuffer.TYPE_DOUBLE:
+    		DoubleBand[] bufD = new DoubleBand[this.getBandCount()];
+    		for(int i = 0; i < bandPosition.length; i++)
+    			bufD[i] = doubleBuf[bandPosition[i]];
+    		doubleBuf = bufD;
+    		break;    		
+    	case RasterBuffer.TYPE_FLOAT:
+    		FloatBand[] bufF = new FloatBand[this.getBandCount()];
+    		for(int i = 0; i < bandPosition.length; i++)
+    			bufF[i] = floatBuf[bandPosition[i]];
+    		floatBuf = bufF;
+    		break;     		
+    	case RasterBuffer.TYPE_INT:
+    		IntBand[] bufI = new IntBand[this.getBandCount()];
+    		for(int i = 0; i < bandPosition.length; i++)
+    			bufI[i] = intBuf[bandPosition[i]];
+    		intBuf = bufI;
+    		break;     		
+    	case RasterBuffer.TYPE_USHORT:
+    	case RasterBuffer.TYPE_SHORT:
+    		ShortBand[] bufS = new ShortBand[this.getBandCount()];
+    		for(int i = 0; i < bandPosition.length; i++)
+    			bufS[i] = shortBuf[bandPosition[i]];
+    		shortBuf = bufS;
+    		break; 
+    	}
+    }
+    
+    public void copyBand(int nBand, Band band) {
+    	switch (band.getDataType()) {
+    	case RasterBuffer.TYPE_BYTE:
+    		byteBuf[nBand] = new ByteBand(band.getHeight(), band.getWidth(), true);
+    		byte[][] bb = ((ByteBand)band).buf;
+    		for(int i = 0; i < bb.length; i ++)
+    			for(int j = 0; j < bb[i].length; j ++)
+    				byteBuf[nBand].buf[i][j] = bb[i][j];
+    		break;
+    	case RasterBuffer.TYPE_DOUBLE:
+    		doubleBuf[nBand] = new DoubleBand(band.getHeight(), band.getWidth(), true);
+    		double[][] db = ((DoubleBand)band).buf;
+    		for(int i = 0; i < db.length; i ++)
+    			for(int j = 0; j < db[i].length; j ++)
+    				doubleBuf[nBand].buf[i][j] = db[i][j];    		
+    		break;    		
+    	case RasterBuffer.TYPE_FLOAT:
+    		floatBuf[nBand] = new FloatBand(band.getHeight(), band.getWidth(), true);
+    		float[][] fb = ((FloatBand)band).buf;
+    		for(int i = 0; i < fb.length; i ++)
+    			for(int j = 0; j < fb[i].length; j ++)
+    				floatBuf[nBand].buf[i][j] = fb[i][j];
+    		break;     		
+    	case RasterBuffer.TYPE_INT:
+    		intBuf[nBand] = new IntBand(band.getHeight(), band.getWidth(), true);
+    		int[][] ib = ((IntBand)band).buf;
+    		for(int i = 0; i < ib.length; i ++)
+    			for(int j = 0; j < ib[i].length; j ++)
+    				intBuf[nBand].buf[i][j] = ib[i][j];
+    		break;     		
+    	case RasterBuffer.TYPE_USHORT:
+    	case RasterBuffer.TYPE_SHORT:
+    		shortBuf[nBand] = new ShortBand(band.getHeight(), band.getWidth(), true);
+    		short[][] sb = ((ShortBand)band).buf;
+    		for(int i = 0; i < sb.length; i ++)
+    			for(int j = 0; j < sb[i].length; j ++)
+    				shortBuf[nBand].buf[i][j] = sb[i][j];
+    		break; 
+    	}
+	}
+
+	public void assignBand(int nBand, Band band) {
+		switch (getDataType()) {
+    	case RasterBuffer.TYPE_BYTE:
+    		byteBuf[nBand] = ((ByteBand)band);
+    		break;
+    	case RasterBuffer.TYPE_DOUBLE:
+    		doubleBuf[nBand] = ((DoubleBand)band);  		
+    		break;    		
+    	case RasterBuffer.TYPE_FLOAT:
+    		floatBuf[nBand] = ((FloatBand)band);
+    		break;     		
+    	case RasterBuffer.TYPE_INT:
+    		intBuf[nBand] = ((IntBand)band);
+    		break;     		
+    	case RasterBuffer.TYPE_USHORT:
+    	case RasterBuffer.TYPE_SHORT:
+    		shortBuf[nBand] = ((ShortBand)band);
+    		break; 
+    	}
+	}
+    
+    public Buffer cloneBuffer(){
+    	boolean malloc = false;
+    	if(byteBuf != null || shortBuf != null || intBuf != null || floatBuf != null || doubleBuf != null)
+			malloc = true;
+    	RasterMemoryBuffer rmb = new RasterMemoryBuffer(dataType, width, height, nBands, malloc);
+    	for(int Band = 0; Band < nBands; Band ++){
+    		for(int row = 0; row < height; row ++){
+    			for(int col = 0; col < width; col ++){
+    				if(byteBuf != null)
+    					rmb.setElem(row, col, Band, getElemByte(row, col, Band));
+    				if(shortBuf != null)
+    					rmb.setElem(row, col, Band, getElemShort(row, col, Band));
+    				if(intBuf != null)
+    					rmb.setElem(row, col, Band, getElemInt(row, col, Band));
+    				if(floatBuf != null)
+    					rmb.setElem(row, col, Band, getElemFloat(row, col, Band));
+    				if(doubleBuf != null)
+    					rmb.setElem(row, col, Band, getElemDouble(row, col, Band));
+    			}
+    		}
+    	}
+    	    	
+    	return rmb;
+    }
+    
+    public void interchangeBands(int band1, int band2){
+    	switch (getDataType()) {
+    	case RasterBuffer.TYPE_BYTE:
+    		ByteBand auxByte = byteBuf[band1];
+    		byteBuf[band1] = byteBuf[band2];
+    		byteBuf[band2] = auxByte;
+    		break;
+    	case RasterBuffer.TYPE_DOUBLE:
+    		DoubleBand auxDouble = doubleBuf[band1];
+    		doubleBuf[band1] = doubleBuf[band2];
+    		doubleBuf[band2] = auxDouble;
+    		break;    		
+    	case RasterBuffer.TYPE_FLOAT:
+    		FloatBand auxFloat = floatBuf[band1];
+    		floatBuf[band1] = floatBuf[band2];
+    		floatBuf[band2] = auxFloat;
+    		break;     		
+    	case RasterBuffer.TYPE_INT:
+    		IntBand auxInt = intBuf[band1];
+    		intBuf[band1] = intBuf[band2];
+    		intBuf[band2] = auxInt;
+    		break;     		
+    	case RasterBuffer.TYPE_USHORT:
+    	case RasterBuffer.TYPE_SHORT:
+    		ShortBand auxShort = shortBuf[band1];
+    		shortBuf[band1] = shortBuf[band2];
+    		shortBuf[band2] = auxShort;
+    		break; 
+    	}
+    }
+        
+    /**
+     * Convierte un tipo de dato a cadena
+     * @param type Tipo de dato
+     * @return cadena  que representa el tipo de dato
+     */
+    public static String typesToString(int type) {
+        switch (type) {
+        case RasterBuffer.TYPE_IMAGE:
+            return new String("Image");
+
+        case RasterBuffer.TYPE_BYTE:
+            return new String("Byte");
+
+        case RasterBuffer.TYPE_DOUBLE:
+            return new String("Double");
+
+        case RasterBuffer.TYPE_FLOAT:
+            return new String("Float");
+
+        case RasterBuffer.TYPE_INT:
+        	return new String("Integer");
+        	
+        case RasterBuffer.TYPE_USHORT:
+        case RasterBuffer.TYPE_SHORT:
+            return new String("Short");
+        }
+
+        return null;
+    }
+    
+	private ByteBand 	byteNotValid;
+    private ShortBand 	shortNotValid;
+    private IntBand 	intNotValid;
+    private FloatBand	floatNotValid;
+    private DoubleBand	doubleNotValid;
+    
+    public void assignBandToNotValid(int Band) {
+    	switch(getDataType()){
+    	case Buffer.TYPE_BYTE: if(byteNotValid == null) {
+    								byteNotValid = new ByteBand(getHeight(), getWidth(), true);
+    								for(int i = 0 ; i < getWidth(); i ++)
+    									for(int j = 0 ; j < getHeight(); j ++)
+    										byteNotValid.buf[j][i] = (byte)getNotValidValue();
+    							}
+    							byteBuf[Band] = byteNotValid;
+    							break;
+    	case Buffer.TYPE_SHORT: if(shortNotValid == null) {
+					    			shortNotValid = new ShortBand(getHeight(), getWidth(), true);
+					    			for(int i = 0 ; i < getWidth(); i ++)
+					    				for(int j = 0 ; j < getHeight(); j ++)
+					    					shortNotValid.buf[j][i] = (short)getNotValidValue();
+					    			}
+					    		  shortBuf[Band] = shortNotValid;
+					    		  break;
+    	case Buffer.TYPE_INT:	if(intNotValid == null) {
+									intNotValid = new IntBand(getHeight(), getWidth(), true);
+									for(int i = 0 ; i < getWidth(); i ++)
+										for(int j = 0 ; j < getHeight(); j ++)
+											intNotValid.buf[j][i] = (int)getNotValidValue();
+								}
+								intBuf[Band] = intNotValid;
+								break;
+    	case Buffer.TYPE_FLOAT:	if(floatNotValid == null) {
+										floatNotValid = new FloatBand(getHeight(), getWidth(), true);
+										for(int i = 0 ; i < getWidth(); i ++)
+											for(int j = 0 ; j < getHeight(); j ++)
+												floatNotValid.buf[j][i] = (float)getNotValidValue();
+									}
+									floatBuf[Band] = floatNotValid;
+									break;
+    	case Buffer.TYPE_DOUBLE:	if(doubleNotValid == null) {
+										doubleNotValid = new DoubleBand(getHeight(), getWidth(), true);
+										for(int i = 0 ; i < getWidth(); i ++)
+											for(int j = 0 ; j < getHeight(); j ++)
+												doubleNotValid.buf[j][i] = (double)getNotValidValue();
+									}
+									doubleBuf[Band] = doubleNotValid;
+									break;
+    	}
+    }
+    
+    public boolean isReadOnlyBuffer() {
+    	return false;
+    }
+    
+	/**
+	 * Libera el buffer de memoria
+	 */
+	public void dispose() {
+		if(byteBuf != null) {
+			for (int i = 0; i < byteBuf.length; i++) {
+				byteBuf[i].dispose();
+				byteBuf[i] = null;
+			}
+			byteBuf = null;
+		}
+		if(shortBuf != null) {
+			for (int i = 0; i < shortBuf.length; i++) {
+				shortBuf[i].dispose();
+				shortBuf[i] = null;
+			}
+			shortBuf = null;
+		}
+		if(intBuf != null) {
+			for (int i = 0; i < intBuf.length; i++) {
+				intBuf[i].dispose();
+				intBuf[i] = null;
+			}
+			intBuf = null;
+		}
+		if(floatBuf != null) {
+			for (int i = 0; i < floatBuf.length; i++) {
+				floatBuf[i].dispose();	
+				floatBuf[i] = null;
+			}
+			floatBuf = null;
+		}
+		if(doubleBuf != null) {
+			for (int i = 0; i < doubleBuf.length; i++) {
+				doubleBuf[i].dispose();
+				doubleBuf[i] = null;
+			}
+			doubleBuf = null;
+		}
+	}
+	
+	protected void finalize() throws Throwable {
+		if(byteBuf != null) {
+			for (int i = 0; i < byteBuf.length; i++) {
+				byteBuf[i] = null;
+			}
+			byteBuf = null;
+		}
+		if(shortBuf != null) {
+			for (int i = 0; i < shortBuf.length; i++) {
+				shortBuf[i] = null;
+			}
+			shortBuf = null;
+		}
+		if(intBuf != null) {
+			for (int i = 0; i < intBuf.length; i++) {
+				intBuf[i] = null;
+			}
+			intBuf = null;
+		}
+		if(floatBuf != null) {
+			for (int i = 0; i < floatBuf.length; i++) {
+				floatBuf[i] = null;
+			}
+			floatBuf = null;
+		}
+		if(doubleBuf != null) {
+			for (int i = 0; i < doubleBuf.length; i++) {
+				doubleBuf[i] = null;
+			}
+			doubleBuf = null;
+		}
+		super.finalize();
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterMemoryBuffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBuffer.java	(revision 15423)
@@ -0,0 +1,808 @@
+/* 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.impl.buffer.cache;
+
+import java.awt.geom.Rectangle2D;
+import java.io.IOException;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.coverage.dataset.AbstractBuffer;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Band;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.WarpException;
+import org.gvsig.fmap.dal.coverage.process.IncrementableTask;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.raster.impl.buffer.BufferHistogramComputer;
+import org.gvsig.raster.impl.buffer.BufferInterpolation;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.visitor.Visitor;
+
+/**
+ * Esta clase representa una p�gina de cache.Cada p�gina de cach� est� compuesta por
+ * varios objetos PageBandBuffer donde cada uno es una p�gina que corresponde a una 
+ * banda de raster cacheada. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class PageBuffer extends AbstractBuffer implements Buffer {
+	private PageBandBuffer[]    pageBandBuffer       = null;
+	private double[]            limits               = null;
+	private HistogramComputer   histogramComputer    = null;
+	private BufferInterpolation interp               = null;
+	
+	/**
+	 * Constructor
+	 * @param dataType
+	 * @param width
+	 * @param height
+	 * @param bandNr
+	 * @param malloc
+	 */
+	public PageBuffer(int dataType, int width, int height, int bandNr, boolean malloc, int nHddPags) {
+		pageBandBuffer = new PageBandBuffer[bandNr];
+		for (int i = 0; i < pageBandBuffer.length; i++)
+			pageBandBuffer[i] = new PageBandBuffer(dataType, width, height, 1, malloc, i);
+	}
+	
+	public boolean isBandSwitchable() {
+		return false;
+	}
+	
+	/**
+	 * Asigna la lista de paginas de disco
+	 * @param hddList Lista de p�ginas de disco
+	 */
+	public void setHddPages(HddPage[] hddList) {
+		for (int i = 0; i < pageBandBuffer.length; i++)
+			pageBandBuffer[i].setHddPages(hddList);
+	}
+	
+	/**
+	 * Carga una p�gina especificada en el par�metro nPag con los datos necesarios.
+	 * Para esto recorre todas las bandas de la p�gina llamando al load de cada una.
+	 *   
+	 * @param nPag N�mero de p�gina a cargar
+	 */
+	public void loadPage(int nPag) {
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			try {
+				pageBandBuffer[i].loadPage(nPag);
+			} catch (ProcessInterruptedException e) {
+				//Cuando se cancela la carga de una p�gina salimos al acabar la p�gina anterior
+				break; 
+			}
+		}
+	}
+	
+	/**
+	 * Salva una p�gina especificada en el par�metro nPag a disco. 
+	 * Para esto recorre todas las bandas de la p�gina llamando al save de cada una.
+	 *   
+	 * @param nPag N�mero de p�gina a salvar
+	 * @throws IOException
+	 */
+	public void savePage(int nPag) throws IOException {
+		for (int i = 0; i < pageBandBuffer.length; i++)
+			pageBandBuffer[i].savePage(nPag);
+	}
+	
+	public void assign(int band, byte value) {
+		pageBandBuffer[band].assign(0, value);
+	}
+
+	public void assign(int band, short value) {
+		pageBandBuffer[band].assign(0, value);
+	}
+
+	public void assign(int band, int value) {
+		pageBandBuffer[band].assign(0, value);
+	}
+
+	public void assign(int band, float value) {
+		pageBandBuffer[band].assign(0, value);
+	}
+
+	public void assign(int band, double value) {
+		pageBandBuffer[band].assign(0, value);
+	}
+
+	public void assignBand(int nBand, Band band) {
+	}
+
+	public void assignBandToNotValid(int Band) {
+	}
+
+	public Buffer cloneBuffer() {
+		return null;
+	}
+
+	public void copyBand(int nBand, Band band) {
+	}
+
+	public Band createBand(byte defaultValue) {
+		return null;
+	}
+
+	public Band getBand(int nBand) {
+		return null;
+	}
+
+	public Buffer getBandBuffer(int nBand) {
+		return null;
+	}
+
+	public int getBandCount() {
+		return pageBandBuffer[0].getBandCount();
+	}
+	
+	public int getDataType() {
+		return pageBandBuffer[0].getDataType();
+	}
+
+	public void setDataType(int dataType) {
+	
+	}
+	
+	public int getBlockHeight() {
+		return pageBandBuffer[0].getHeight();
+	}
+	
+	public int getHeight() {
+		return pageBandBuffer[0].getHeight();
+	}
+	
+	public int getWidth() {
+		return pageBandBuffer[0].getWidth();
+	}
+
+	public NoData getNoDataValue() {
+		return pageBandBuffer[0].getNoDataValue();
+	}
+
+	public double getNotValidValue() {
+		return pageBandBuffer[0].getNotValidValue();
+	}
+	
+	public byte getElemByte(int line, int col, int band) {
+		return pageBandBuffer[band].getElemByte(line, col, 0);
+	}
+
+	public short getElemShort(int line, int col, int band) {
+		return pageBandBuffer[band].getElemShort(line, col, 0);
+	}
+	
+	public int getElemInt(int line, int col, int band) {
+		return pageBandBuffer[band].getElemInt(line, col, 0);
+	}
+
+	public float getElemFloat(int line, int col, int band) {
+		return pageBandBuffer[band].getElemFloat(line, col, 0);
+	}
+	
+	public double getElemDouble(int line, int col, int band) {
+		return pageBandBuffer[band].getElemDouble(line, col, 0);
+	}
+
+	public void getElemByte(int line, int col, byte[] data) {
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			data[i] = pageBandBuffer[i].getElemByte(line, col, 0);
+	}
+	
+	public void getElemShort(int line, int col, short[] data) {
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			data[i] = pageBandBuffer[i].getElemShort(line, col, 0);
+	}
+
+	public void getElemInt(int line, int col, int[] data) {
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			data[i] = pageBandBuffer[i].getElemInt(line, col, 0);
+	}
+
+	public void getElemFloat(int line, int col, float[] data) {
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			data[i] = pageBandBuffer[i].getElemFloat(line, col, 0);
+	}
+
+	public void getElemDouble(int line, int col, double[] data) {
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			data[i] = pageBandBuffer[i].getElemDouble(line, col, 0);
+	}
+	
+	public byte[][] getLineByte(int line) {
+		byte[][] b = new byte[pageBandBuffer.length][];
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			b[i] = pageBandBuffer[i].getLineByte(line)[0];
+		return b;
+	}
+
+	public double[][] getLineDouble(int line) {
+		double[][] d = new double[pageBandBuffer.length][];
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			d[i] = pageBandBuffer[i].getLineDouble(line)[0];
+		return d;
+	}
+
+	public float[][] getLineFloat(int line) {
+		float[][] f = new float[pageBandBuffer.length][];
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			f[i] = pageBandBuffer[i].getLineFloat(line)[0];
+		return f;
+	}
+
+	public int[][] getLineInt(int line) {
+		int[][] in = new int[pageBandBuffer.length][];
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			in[i] = pageBandBuffer[i].getLineInt(line)[0];
+		return in;
+	}
+
+	public short[][] getLineShort(int line) {
+		short[][] s = new short[pageBandBuffer.length][];
+		for (int i = 0; i < pageBandBuffer.length; i++) 
+			s[i] = pageBandBuffer[i].getLineShort(line)[0];
+		return s;
+	}
+	
+	public byte[] getLineFromBandByte(int line, int band) {
+		return pageBandBuffer[band].getLineFromBandByte(line, 0);
+	}
+
+	public double[] getLineFromBandDouble(int line, int band) {
+		return pageBandBuffer[band].getLineFromBandDouble(line, 0);
+	}
+
+	public float[] getLineFromBandFloat(int line, int band) {
+		return pageBandBuffer[band].getLineFromBandFloat(line, 0);
+	}
+
+	public int[] getLineFromBandInt(int line, int band) {
+		return pageBandBuffer[band].getLineFromBandInt(line, 0);
+	}
+
+	public short[] getLineFromBandShort(int line, int band) {
+		return pageBandBuffer[band].getLineFromBandShort(line, 0);
+	}
+	
+	public void interchangeBands(int band1, int band2) {
+	}
+
+	public void mallocOneBand(int dataType, int width, int height, int band) {
+	}
+
+	public void replicateBand(int orig, int dest) {
+	}
+
+	public void setElem(int line, int col, int band, byte data) {
+		pageBandBuffer[band].setElem(line, col, 0, data);
+	}
+
+	public void setElem(int line, int col, int band, short data) {
+		pageBandBuffer[band].setElem(line, col, 0, data);
+	}
+
+	public void setElem(int line, int col, int band, int data) {
+		pageBandBuffer[band].setElem(line, col, 0, data);
+	}
+
+	public void setElem(int line, int col, int band, float data) {
+		pageBandBuffer[band].setElem(line, col, 0, data);
+	}
+
+	public void setElem(int line, int col, int band, double data) {
+		pageBandBuffer[band].setElem(line, col, 0, data);
+	}
+	
+	public void setElemByte(int line, int col, byte[] data) {
+		byte[] b = new byte[1];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			b[0] = data[i];
+			pageBandBuffer[i].setElemByte(line, col, b);
+		}
+	}
+
+	public void setElemDouble(int line, int col, double[] data) {
+		double[] b = new double[1];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			b[0] = data[i];
+			pageBandBuffer[i].setElemDouble(line, col, b);
+		}
+	}
+
+	public void setElemFloat(int line, int col, float[] data) {
+		float[] b = new float[1];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			b[0] = data[i];
+			pageBandBuffer[i].setElemFloat(line, col, b);
+		}
+	}
+
+	public void setElemInt(int line, int col, int[] data) {
+		int[] b = new int[1];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			b[0] = data[i];
+			pageBandBuffer[i].setElemInt(line, col, b);
+		}
+	}
+
+	public void setElemShort(int line, int col, short[] data) {
+		short[] b = new short[1];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			b[0] = data[i];
+			pageBandBuffer[i].setElemShort(line, col, b);
+		}
+	}
+	
+	public void setLineByte(byte[][] data, int line) {
+		byte[][] bAux = new byte[1][];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			bAux[0] = data[i];
+			pageBandBuffer[i].setLineByte(bAux, line);
+		}
+	}
+
+	public void setLineDouble(double[][] data, int line) {
+		double[][] bAux = new double[1][];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			bAux[0] = data[i];
+			pageBandBuffer[i].setLineDouble(bAux, line);
+		}
+	}
+
+	public void setLineFloat(float[][] data, int line) {
+		float[][] bAux = new float[1][];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			bAux[0] = data[i];
+			pageBandBuffer[i].setLineFloat(bAux, line);
+		}
+	}
+	
+	public void setLineInt(int[][] data, int line) {
+		int[][] bAux = new int[1][];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			bAux[0] = data[i];
+			pageBandBuffer[i].setLineInt(bAux, line);
+		}
+	}
+
+	public void setLineShort(short[][] data, int line) {
+		short[][] bAux = new short[1][];
+		for (int i = 0; i < pageBandBuffer.length; i++) {
+			bAux[0] = data[i];
+			pageBandBuffer[i].setLineShort(bAux, line);
+		}
+	}
+
+	public void setLineInBandByte(byte[] data, int line, int band) {
+		pageBandBuffer[band].setLineInBandByte(data, line, 0);
+	}
+
+	public void setLineInBandDouble(double[] data, int line, int band) {
+		pageBandBuffer[band].setLineInBandDouble(data, line, 0);
+	}
+
+	public void setLineInBandFloat(float[] data, int line, int band) {
+		pageBandBuffer[band].setLineInBandFloat(data, line, 0);
+	}
+
+	public void setLineInBandInt(int[] data, int line, int band) {
+		pageBandBuffer[band].setLineInBandInt(data, line, 0);
+	}
+
+	public void setLineInBandShort(short[] data, int line, int band) {
+		pageBandBuffer[band].setLineInBandShort(data, line, 0);
+	}
+
+	public void setNoDataValue(NoData nd) {
+		for (int i = 0; i < pageBandBuffer.length; i++)
+			pageBandBuffer[0].setNoDataValue(nd);
+	}
+
+	public void setNotValidValue(double value) {
+	}
+
+	public void switchBands(int[] bands) {
+	}
+
+	public double getMinimum() {
+		if(limits == null)
+			try {
+				limits = getLimits();
+			} catch (ProcessInterruptedException e) {
+				return 0;
+			}
+		return limits[0];
+	}
+
+	public double getMaximum() {
+		if(limits == null)
+			try {
+				limits = getLimits();
+			} catch (ProcessInterruptedException e) {
+				return 0;
+			}
+		return limits[1];
+	}
+	
+	public double[] getLimits() throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		double max = Double.NEGATIVE_INFINITY;
+		double secondMax = max;
+		double min = Double.MAX_VALUE;
+		double secondMin = min;
+		double value = 0;
+
+		switch (getDataType()) {
+			case Buffer.TYPE_BYTE:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) (getElemByte(r, c, i) & 0xff);
+							if (value > max) {
+								if (max != value)
+									secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value)
+									secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_SHORT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemShort(r, c, i);
+							if (value > max) {
+								if (max != value)
+									secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value)
+									secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_INT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemInt(r, c, i);
+							if (value > max) {
+								if (max != value)
+									secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value)
+									secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_FLOAT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemFloat(r, c, i);
+							if (value > max) {
+								if (max != value)
+									secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value)
+									secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_DOUBLE:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = getElemDouble(r, c, i);
+							if (value > max) {
+								if (max != value)
+									secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value)
+									secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+		}
+		// Si no existe un secondMax lo igualo al maximo existente
+		if (secondMax == Double.NEGATIVE_INFINITY)
+			secondMax = max;
+		// Si no existe un secondMin lo igualo al minimo existente
+		if (secondMin == Double.MAX_VALUE)
+			secondMin = min;
+
+		double[] values = new double[2];
+		values[0] = min;
+		values[1] = max;
+		values[2] = secondMin;
+		values[3] = secondMax;
+		return values;
+	}
+	
+	public double[][] getAllBandsLimits() throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		double max[] = new double[getBandCount()];
+		double min[] = new double[getBandCount()];
+		double value = 0;
+
+		for (int i = 0; i < getBandCount(); i++) {
+			max[i] = Double.NEGATIVE_INFINITY;
+			min[i] = Double.MAX_VALUE;
+		}
+
+		switch (getDataType()) {
+			case Buffer.TYPE_BYTE:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) (getElemByte(r, c, i) & 0xff);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_SHORT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemShort(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_INT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemInt(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_FLOAT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemFloat(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_DOUBLE:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = getElemDouble(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+		}
+		double[][] values = new double[2][getBandCount()];
+
+		for (int i = 0; i < getBandCount(); i++) {
+			values[0][i] = min[i];
+			values[1][i] = max[i];
+		}
+		return values;
+	}
+
+	public HistogramComputer getHistogramComputer() {
+		if(histogramComputer == null)
+			histogramComputer = new BufferHistogramComputer(this);
+		return histogramComputer;
+	}
+
+	public boolean isInside(int x, int y) {
+		 if (x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
+				return false;
+			return true;
+	}
+	
+	public boolean isReadOnlyBuffer() {
+		return false;
+	}
+	
+	public boolean isCached() {
+		return false;
+	}
+	
+	public IncrementableTask getIncrementableTask(int type) {
+		switch (type) {
+		case INCREMENTABLE_INTERPOLATION:
+			return getBufferInterpolation();
+		case INCREMENTABLE_HISTOGRAM:
+			return getHistogramComputer();
+		}
+		return null;
+	}
+	
+	/**
+	 * Gets the buffer interpolation
+	 * @return
+	 */
+	private BufferInterpolation getBufferInterpolation() {
+		if(interp == null)
+			interp = new BufferInterpolation(this);
+		return interp;
+	}
+	
+	public Buffer getAdjustedWindow(int w, int h, int interpolationMethod) throws ProcessInterruptedException {
+		getBufferInterpolation();
+		if (w == getWidth() && h == getHeight())
+			return this;
+		Buffer rasterBuf = null;
+		switch (interpolationMethod) {
+			case Buffer.INTERPOLATION_NearestNeighbour:
+				rasterBuf = interp.adjustRasterNearestNeighbourInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_Bilinear:
+				rasterBuf = interp.adjustRasterBilinearInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_InverseDistance:
+				rasterBuf = interp.adjustRasterInverseDistanceInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_BicubicSpline:
+				rasterBuf = interp.adjustRasterBicubicSplineInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_BSpline:
+				rasterBuf = interp.adjustRasterBSplineInterpolation(w, h);
+				break;
+		}
+		if (rasterBuf != null)
+			return rasterBuf;
+		else
+			return this;
+	}
+
+	public Rectangle2D getDataExtent() {
+		return null;
+	}
+
+	public void setDataExtent(Rectangle2D r) {
+	}
+	
+	public RasterDataStore getStore() {
+		return null;
+	}
+
+	public void setStore(RasterDataStore store) {
+	}
+	
+	public void addDrawableBands(int[] db) {}
+	
+	//****************************************************
+	//*********Implementing DataSet methods***************
+	//****************************************************
+
+	public boolean isFromStore(DataStore store) {
+		return false;
+	}
+
+	//****************************************************
+	//*********Implementing Visitable methods*************
+	//****************************************************
+	
+	public void accept(Visitor visitor) throws BaseException {
+		
+	}
+	
+	//****************************************************
+	//*********Implementing Disposable methods************
+	//****************************************************
+	
+	public void dispose() {
+		if(pageBandBuffer != null) {
+			for (int i = 0; i < pageBandBuffer.length; i++) { 
+				pageBandBuffer[i].dispose();
+			}
+		}
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	protected void finalize() throws Throwable {
+		limits               = null;
+		histogramComputer    = null;
+		if(pageBandBuffer != null) {
+			for (int i = 0; i < pageBandBuffer.length; i++) { 
+				pageBandBuffer[i] = null;
+			}
+			pageBandBuffer = null;
+		}
+		limits = null;
+		super.finalize();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBuffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/WriterBufferCompleteServer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/WriterBufferCompleteServer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/WriterBufferCompleteServer.java	(revision 15423)
@@ -0,0 +1,160 @@
+/* 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.impl.buffer.cache;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+
+/**
+ * Sirve los datos desde un Buffer para el driver de escritura de bloques de 
+ * cach�. La altura servida ser� igual a la del bloque de cache.
+ * 
+ * @deprecated Esta clase fue creada para que CacheDataServer salvara sus datos a tif. 
+ * Se ha cambiado por la escritura de los bytes en disco porque era m�s �ptimo. 
+ * 
+ * NO DEBE BORRARSE porque se usa para test pero no deber�a utilizarse para el trabajo
+ * normal de escritura.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WriterBufferCompleteServer implements DataServerWriter {
+	private Buffer 		buffer = null;
+	private int         nband  = -1;
+
+	public WriterBufferCompleteServer(Buffer buffer){
+		this.buffer = buffer;
+	}
+
+	public int[] readARGBData(int sizeX, int sizeY, int nBand) {
+		return null;
+	}
+
+	public byte[][] readByteData(int sizeX, int sizeY) {
+		int len = buffer.getWidth() * buffer.getHeight();
+		byte[][] b = new byte[buffer.getBandCount()][len];
+		int init = 0;
+		int end = buffer.getBandCount();
+		if(nband >= 0) {
+			init = nband;
+			end = nband + 1;
+		}
+		for(int iBand = init; iBand < end; iBand ++)
+			for(int j = 0; j < buffer.getHeight(); j ++)
+				for(int i = 0; i < buffer.getWidth(); i ++)
+					b[iBand][j * buffer.getWidth() + i] = buffer.getElemByte(j, i, iBand);
+		return b;
+	}
+
+	public short[][] readShortData(int sizeX, int sizeY) {
+		int len = buffer.getWidth() * buffer.getHeight();
+		short[][] b = new short[buffer.getBandCount()][len];
+		int init = 0;
+		int end = buffer.getBandCount();
+		if(nband >= 0) {
+			init = nband;
+			end = nband + 1;
+		}
+		for(int iBand = init; iBand < end; iBand ++)
+			for(int j = 0; j < buffer.getHeight(); j ++)
+				for(int i = 0; i < buffer.getWidth(); i ++)
+					b[iBand][j * buffer.getWidth() + i] = buffer.getElemShort(j, i, iBand);
+		return b;
+	}
+
+	public int[][] readIntData(int sizeX, int sizeY) {
+		int len = buffer.getWidth() * buffer.getHeight();
+		int[][] b = new int[buffer.getBandCount()][len];
+		int init = 0;
+		int end = buffer.getBandCount();
+		if(nband >= 0) {
+			init = nband;
+			end = nband + 1;
+		}
+		for(int iBand = init; iBand < end; iBand ++)
+			for(int j = 0; j < buffer.getHeight(); j ++)
+				for(int i = 0; i < buffer.getWidth(); i ++)
+					b[iBand][j * buffer.getWidth() + i] = buffer.getElemInt(j, i, iBand);
+		return b;
+	}
+
+	public float[][] readFloatData(int sizeX, int sizeY) {
+		int len = buffer.getWidth() * buffer.getHeight();
+		float[][] b = new float[buffer.getBandCount()][len];
+		int init = 0;
+		int end = buffer.getBandCount();
+		if(nband >= 0) {
+			init = nband;
+			end = nband + 1;
+		}
+		for(int iBand = init; iBand < end; iBand ++)
+			for(int j = 0; j < buffer.getHeight(); j ++)
+				for(int i = 0; i < buffer.getWidth(); i ++)
+					b[iBand][j * buffer.getWidth() + i] = buffer.getElemFloat(j, i, iBand);
+		return b;
+	}
+
+	public double[][] readDoubleData(int sizeX, int sizeY) {
+		int len = buffer.getWidth() * buffer.getHeight();
+		double[][] b = new double[buffer.getBandCount()][len];
+		int init = 0;
+		int end = buffer.getBandCount();
+		if(nband >= 0) {
+			init = nband;
+			end = nband + 1;
+		}
+		for(int iBand = init; iBand < end; iBand ++)
+			for(int j = 0; j < buffer.getHeight(); j ++)
+				for(int i = 0; i < buffer.getWidth(); i ++)
+					b[iBand][j * buffer.getWidth() + i] = buffer.getElemDouble(j, i, iBand);
+		return b;
+	}
+
+	public void setBuffer(Buffer buffer, int nband) {
+		this.buffer = buffer;
+		this.nband = nband;
+	}
+	
+	public Buffer getBuffer() {
+		return buffer;
+	}
+	
+	public void setBand(int nband) {
+		this.nband = nband;
+	}
+	
+	public int getPercent() {
+		return 0;
+	}
+
+	public void setAlphaBuffer(Buffer alphaBuffer) {
+	}
+
+	public void dispose() {
+	}
+
+	public Buffer getSource() {
+		return buffer;
+	}
+
+	public void setPercent(int value) {
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/WriterBufferCompleteServer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/ICacheDataSource.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/ICacheDataSource.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/ICacheDataSource.java	(revision 15423)
@@ -0,0 +1,68 @@
+/* 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.impl.buffer.cache;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+
+/**
+ * Interfaz que debe implementar una fuente de datos de un cache. Las fuentes
+ * de datos deben interpretar la estructura de la cache para que cuando se les
+ * solicite una p�gina de la cach� sepan que extent de la fuente de datos deben
+ * cargar en el buffer. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface ICacheDataSource{	
+	/**
+	 * Carga una p�gina especificada en el par�metro nPag con los datos necesarios. La
+	 * petici�n que ha de hacerse se calcula previamente con la estructura de la cach�.
+	 *   
+	 * @param nPag N�mero de p�gina a cargar
+	 * @param pageBuffer Buffer de datos a cargar.
+	 */
+	public void loadPage(PageBandBuffer pageBuffer) throws ProcessInterruptedException;
+	
+	/**
+	 * Salva una p�gina especificada en el par�metro nPag a disco. La
+	 * petici�n que ha de hacerse se calcula previamente con la estructura de la cach�.
+	 *   
+	 * @param nPag N�mero de p�gina a salvar
+	 * @param pageBuffer Buffer de datos a salvar.
+	 * @throws IOException
+	 */
+	public void savePage(PageBandBuffer pageBuffer)throws IOException;
+	
+	/**
+	 * Elimina la fuente de datos de disco
+	 * @throws IOException
+	 */
+	public void delete()throws IOException;
+	
+	/**
+	 * Obtiene la ruta a la fuente de datos
+	 * @return Cadena con la ruta a la fuente de datos
+	 */
+	public String getPath();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/ICacheDataSource.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheStruct.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheStruct.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheStruct.java	(revision 15423)
@@ -0,0 +1,432 @@
+/* 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.impl.buffer.cache;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+
+/**
+ * Esta clase representa la estructura en memoria de la cache. Contiene el n�mero de p�ginas 
+ * as� como los subconjuntos en las que se divide. Tendr� tambi�n datos como en ancho y alto de
+ * cada p�gina y tama�o en memoria de esta. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class CacheStruct {
+	//******************* PARAMETERS ***************************
+	/**
+	 * Tama�o aproximado de cach� en Megas. Si este valor es alto cabr�n muchas p�ginas en memoria 
+	 * a la vez y si es bajo cabr�n pocas. Hay que tener en cuenta que al instanciar se convertira en bytes
+	 * para su mejor tratamiento. Al llamar al constructor esta variable contendr� el tama�o exacto
+	 * de la cache en bytes. El tama�o aqu� especificado es aproximado. Este variar� dependiendo de los
+	 * par�metros del raster a cachear ya que las p�ginas deben tener una altura potencia de 2.
+	 */
+	private long cacheSize = RasterLibrary.cacheSize;
+	/**
+	 * Tama�o m�ximo de la p�gina en Megas. Hay que tener en cuenta que al instanciar se convertira en bytes
+	 * para su mejor tratamiento. Al llamar al constructor esta variable contendr� el tama�o exacto
+	 * de la p�gina en bytes
+	 */
+	private double pageSize = RasterLibrary.pageSize;
+	/**
+	 * N�mero de p�ginas que tiene cada conjunto
+	 */
+	private int pagsPerGroup = RasterLibrary.pagsPerGroup;
+	//****************** END PARAMETERS ************************
+		
+	private int[] possibleHeights = {2, 4, 8, 16, 32, 64, 128, 256, 512, 1024, 2048, 4096, 8192, 16384, 32768, 65536};
+		
+	/**
+	 * Altura de la p�gina de cada banda en l�neas.
+	 */
+	private int hPag = 1;
+	/**
+	 * Para extraer el desplazamiento de una direcci�n (l�nea de raster) hay que hacer una operaci�n And con 
+	 * con la altura de la p�gina -1. Por ejemplo, una p�gina de 16 l�neas de altura el desplazamiento ser�
+	 * 16 - 1 = 15 porque 15 en binario es 1111.
+	 * 
+	 * Si queremos acceder a la linea del raster n�mero 83 (1010011) realizando la operaci�n And con el valor del
+	 * desplazamiento obtenemos (0001111 & 1010011 = 0000011), es decir el valor 3 en decimal. Esto quiere decir
+	 * que la l�nea 83 del raster es la 3 de su p�gina. 
+	 */
+	private int offset = 1;
+	/**
+	 * N�mero de p�ginas en cach�
+	 */
+	private int nPags = 0;
+	/**
+	 * N�mero de estructuras PageBandBuffer que tendr� el objeto PageBuffer. Cada una de estas
+	 * corresponde a una banda del buffer cacheada.
+	 */
+	private int nPageBandBuffers = 0;
+	/**
+	 * N�mero de grupos
+	 */
+	private int nGroups = 0;
+	/**
+	 * N�mero de bits para el desplazamiento de una p�gina. Por ejemplo, una p�gina de 64 l�neas
+	 * tendr� un bitsPag = 6
+	 */
+	private int bitsPag = 0;
+	/**
+	 * N�mero total de p�ginas en las que se divide el raster
+	 */
+	private int nTotalPags = 0;
+	/**
+	 * Tama�o de cache por banda del raster (cacheSize / NBandas)
+	 */
+	private long cacheSizePerBand = 0;
+	/**
+	 * Tama�o de p�gina por banda del raster (pagSize / NBandas)
+	 */
+	private long pageSizePerBand = 0;
+	/**
+	 * Tipo de dato de la cach�
+	 */
+	private int	dataType = 0;
+	
+	/**
+	 * Calcula los par�metros del tama�o de cach� y de p�gina, asi como la altura de las mismas y el n�mero
+	 * de grupos que salen en cach�.
+	 * @param nBands N�mero de bandas del raster
+	 * @param dataType Tipo de dato de la imagen
+	 * @param dataSourceWidth ancho de cada l�nea completa del raster.
+	 */
+	public CacheStruct(int nBands, int dataType, int dataSourceWidth, int dataSourceHeight){
+		init(nBands, dataType, dataSourceWidth, dataSourceHeight);
+	}
+	
+	/**
+	 * Constructor de una sola banda y sin el calculo de par�metros. Estos deben ser asignados
+	 * posteriorimente. Esta llamada es usada en casos especiales de creaci�n de buffers cacheados.
+	 */
+	public CacheStruct() {
+	}
+	
+	/**
+	 * Constructor solo para test. No utilizar con un uso normal de la librer�a
+	 * Calcula los par�metros del tama�o de cach� y de p�gina, asi como la altura de las mismas y el n�mero
+	 * de grupos que salen en cach�.
+	 * @param nBands N�mero de bandas del raster
+	 * @param dataType Tipo de dato de la imagen
+	 * @param dataSourceWidth ancho de cada l�nea completa del raster.
+	 */
+	public CacheStruct(int nBands, int dataType, int dataSourceWidth, int dataSourceHeight, long cacheSize, long pageSize){
+		this.cacheSize = cacheSize;
+		this.pageSize = pageSize;
+		init(nBands, dataType, dataSourceWidth, dataSourceHeight);
+	}
+	
+	private void init(int nBands, int dataType, int dataSourceWidth, int dataSourceHeight){
+		this.nPageBandBuffers = nBands;
+		this.dataType = dataType;
+		
+		//Pasamos los megas a bytes
+		cacheSize = cacheSize * 1048576;
+		pageSize = pageSize * 1048576;
+		
+		cacheSizePerBand = (long)(cacheSize / nBands);
+		pageSizePerBand = (long)(pageSize / nBands);
+				
+		//int dataSize = 0;
+		int dataSizePerBand = 0;
+		if (dataType == Buffer.TYPE_BYTE){
+			dataSizePerBand = 1;
+		} else if ((dataType == Buffer.TYPE_SHORT) | (dataType == Buffer.TYPE_USHORT)) {
+			dataSizePerBand = 2;
+        } else if (dataType == Buffer.TYPE_INT) {
+        	dataSizePerBand = 4;
+        } else if (dataType == Buffer.TYPE_FLOAT) {
+        	dataSizePerBand = 4;
+        } else if (dataType == Buffer.TYPE_DOUBLE) {
+        	dataSizePerBand = 8;
+        }
+		//dataSize = dataSizePerBand * nBands;
+				
+		//La altura de la p�gina depende del ancho de esta y del tipo de dato
+		for(int i = (possibleHeights.length - 1); i >= 0; i --){
+			long size = (long)dataSourceWidth * (long)possibleHeights[i] * (long)dataSizePerBand; 
+			if(size <= pageSizePerBand){
+				hPag = possibleHeights[i];
+				break;
+			}
+		}
+		//Calculamos el tama�o de p�gina en bytes 
+		pageSizePerBand = dataSourceWidth * hPag * dataSizePerBand;
+		
+		//Calculamos el n�mero de p�ginas que tendr� el buffer completo
+		nPags = (int)(cacheSizePerBand / pageSizePerBand);
+				
+		while((nPags % pagsPerGroup) != 0)
+			nPags ++;	
+		
+		//Recalculamos el tama�o de la cach�
+		cacheSizePerBand = (long)(pageSizePerBand * nPags);
+		
+		//Calculamos el n�mero de grupos de cach�
+		nGroups = (int)(nPags / pagsPerGroup);
+		
+		int h = hPag; 
+		while(h > 1){
+			h >>= 1;
+			bitsPag ++;
+		}
+		
+		//Calculamos el n�mero total de p�ginas en cach�
+		nTotalPags = (int)(dataSourceHeight / hPag);
+		if((dataSourceHeight % hPag) != 0)
+			nTotalPags ++;
+		
+		offset = hPag - 1;
+		
+		cacheSize = cacheSizePerBand * nBands;
+		pageSize = pageSizePerBand * nBands;
+	}
+
+	/**
+	 * Obtiene el tama�o de cach� en Bytes
+	 * @return Tama�o de cach� en Bytes
+	 */
+	public long getCacheSize() {
+		return cacheSize;
+	}
+
+	/**
+	 * Obtiene la altura de la p�gina de cache en l�neas. 
+	 * @return N�mero de l�neas de altura de p�gina.
+	 */
+	public int getHPag() {
+		return hPag;
+	}
+	
+	/**
+	 * Asigna la altura de la p�gina de cache en l�neas. 
+	 * @param N�mero de l�neas de altura de p�gina.
+	 */
+	public void setHPag(int hPag){
+		this.hPag = hPag;
+	}
+
+	/**
+	 * Obtiene el n�mero de bandas
+	 * @return N�mero de bandas
+	 */
+	public int getNBands() {
+		return nPageBandBuffers;
+	}
+	
+	/**
+	 * Asigna el n�mero de bandas
+	 * @param N�mero de bandas
+	 */
+	public void setNBands(int nBands){
+		this.nPageBandBuffers = nBands;
+	}
+
+	/**
+	 * Obtiene el n�mero de p�ginas de la cach�
+	 * @return N�mero total de p�ginas de la cach�
+	 */
+	public int getNPags() {
+		return nPags;
+	}
+	
+	/**
+	 * Asigna el n�mero de p�ginas de la cach�
+	 * @param N�mero total de p�ginas de la cach�
+	 */
+	public void setNPags(int nPags) {
+		this.nPags = nPags;
+	}
+
+	/**
+	 * Obtiene el tama�o de p�gina en bytes
+	 * @return Tama�o de p�gina en bytes
+	 */
+	public long getPagSize() {
+		return (long)pageSize;
+	}
+		
+	/**
+	 * Obtiene el n�mero de p�ginas que contiene cada grupo.
+	 * @return N�mero de p�ginas de un grupo.
+	 */
+	public int getPagsPerGroup() {
+		return pagsPerGroup;
+	}
+
+	/**
+	 * Obtiene el n�mero de grupos de cach�
+	 * @return N�mero de grupos
+	 */
+	public int getNGroups() {
+		return nGroups;
+	}
+	
+	/**
+	 * Asigna el n�mero de grupos de cach�
+	 * @param nGroups N�mero de grupos
+	 */
+	public void setNGroups(int nGroups){
+		this.nGroups = nGroups;
+	}
+	
+	/**
+	 * Obtiene el n�mero total de p�ginas del raster
+	 * @return N�mero total de p�ginas
+	 */
+	public int getNTotalPags() {
+		return nTotalPags;
+	}
+	
+	/**
+	 * Asigna el n�mero total de p�ginas del raster
+	 * @param N�mero total de p�ginas
+	 */
+	public void setNTotalPags(int nPags){
+		this.nTotalPags = nPags;
+	}
+	
+	/**
+	 * Obtiene el n�mero de bits por p�gina para poder calcular el desplazamiento binario
+	 * de la direcci�n de acceso de la petici�n. Es decir si se solicita un dato en la l�nea
+	 * 36 (en decimal) del raster 100100(en binario) y el desplazamiento es 4 bits el n�mero de 
+	 * p�gina resultante ser� 10(en binario) 2 (en decimal)
+	 * @return N�mero de bits por p�gina.
+	 */
+	public int getBitsPag() {
+		return bitsPag;
+	}
+	
+	/**
+	 * Asigna el n�mero de bits por p�gina para poder calcular el desplazamiento binario
+	 * de la direcci�n de acceso de la petici�n. Es decir si se solicita un dato en la l�nea
+	 * 36 (en decimal) del raster 100100(en binario) y el desplazamiento es 4 bits el n�mero de 
+	 * p�gina resultante ser� 10(en binario) 2 (en decimal)
+	 * @param bitsPag
+	 */
+	public void setBitsPag(int bitsPag){
+		this.bitsPag = bitsPag;
+	}
+
+	/**
+	 * Obtiene el valor del desplazamiento
+	 * Para extraer el desplazamiento de una direcci�n (l�nea de raster) hay que hacer una operaci�n And con 
+	 * con la altura de la p�gina -1. Por ejemplo, una p�gina de 16 l�neas de altura el desplazamiento ser�
+	 * 16 - 1 = 15 porque 15 en binario es 1111.
+	 * 
+	 * Si queremos acceder a la linea del raster n�mero 83 (1010011) realizando la operaci�n And con el valor del
+	 * desplazamiento obtenemos (0001111 & 1010011 = 0000011), es decir el valor 3 en decimal. Esto quiere decir
+	 * que la l�nea 83 del raster es la 3 de su p�gina. 
+	 * @return valor del desplazamiento
+	 */
+	public int getOffset() {
+		return offset;
+	}
+
+	/**
+	 * Asigna el valor del desplazamiento.
+	 * Para extraer el desplazamiento de una direcci�n (l�nea de raster) hay que hacer una operaci�n And con 
+	 * con la altura de la p�gina -1. Por ejemplo, una p�gina de 16 l�neas de altura el desplazamiento ser�
+	 * 16 - 1 = 15 porque 15 en binario es 1111.
+	 * 
+	 * Si queremos acceder a la linea del raster n�mero 83 (1010011) realizando la operaci�n And con el valor del
+	 * desplazamiento obtenemos (0001111 & 1010011 = 0000011), es decir el valor 3 en decimal. Esto quiere decir
+	 * que la l�nea 83 del raster es la 3 de su p�gina. 
+	 * @param offset valor del desplazamiento
+	 */
+	public void setOffset(int offset){
+		this.offset = offset;
+	}
+
+	/**
+	 * Obtiene el tama�o de la cach� por cada banda del raster. Hay que tener en
+	 * cuenta que cada banda se trata como una estructura de datos en memoria distinta
+	 * para poder hacer switch con las bandas de una forma sencilla
+	 * @return long con el tama�o de cache por banda
+	 */
+	public long getCacheSizePerBand() {
+		return cacheSizePerBand;
+	}
+
+	/**
+	 * Asigna el tama�o de la cach� por cada banda del raster. Hay que tener en
+	 * cuenta que cada banda se trata como una estructura de datos en memoria distinta
+	 * para poder hacer switch con las bandas de una forma sencilla
+	 * @param long con el tama�o de cache por banda
+	 */
+	public void setCacheSizePerBand(long cacheSizePerBand) {
+		this.cacheSizePerBand = cacheSizePerBand;
+	}
+
+	/**
+	 * Obtiene el tama�o de una p�gina de cach� correspondiente a una banda
+	 * @return tama�o de una p�gina de cach� correspondiente a una banda
+	 */
+	public long getPagSizePerBand() {
+		return pageSizePerBand;
+	}
+
+	/**
+	 * Asigna el tama�o de una p�gina de cach� correspondiente a una banda
+	 * @param tama�o de una p�gina de cach� correspondiente a una banda
+	 */
+	public void setPagSizePerBand(long pagSizePerBand) {
+		this.pageSizePerBand = pagSizePerBand;
+	}
+	
+	/**
+	 * Imprime la informaci�n de estructura de cach�
+	 */
+	public void show(){
+		System.out.println("Cache (total size):" + cacheSize);
+		System.out.println("Page (total size):" + pageSize);
+		System.out.println("Cache (size per band):" + cacheSizePerBand);
+		System.out.println("Page (size per band):" + pageSizePerBand);
+		
+		System.out.println("Number of Pags del raster:" + nTotalPags);
+		System.out.println("Number of Pags de cache:" + nPags);
+		System.out.println("Number of Bands:" + nPageBandBuffers);
+		System.out.println("Number of Groups:" + nGroups);
+		System.out.println("Pages per group:" + pagsPerGroup);
+		System.out.println("bits per pag:" + bitsPag);
+		System.out.println("Page Height (in lines):" + hPag);
+	}
+
+	/**
+	 * Obtiene el tipo de dato
+	 * @return Tipo de dato
+	 */
+	public int getDataType() {
+		return dataType;
+	}
+
+	/**
+	 * Asigna el tipo de dato
+	 * @param dataType
+	 */
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheStruct.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterReadOnlyBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterReadOnlyBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterReadOnlyBuffer.java	(revision 15423)
@@ -0,0 +1,610 @@
+/* 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.impl.buffer.cache;
+
+import java.awt.Rectangle;
+import java.awt.geom.Point2D;
+import java.io.FileNotFoundException;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Band;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.store.QueryableRaster;
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterReadOnlyBuffer extends RasterBuffer {
+	/**
+	 * Pagina cargada
+	 */
+	private Buffer            page              = null;
+	private Buffer            secondPage        = null;
+	/**
+	 * N�mero de p�gina cargada en Buffer
+	 */
+	private int                loadedPage       = -1;
+	private int                loadedSecondPage = -1;
+	
+
+	private int                heightLastPage   = 0;
+	
+	private RasterDataStore   datasource       = null;
+	
+	private int                bitsPag          = 0;
+	/**
+	 * N�mero de p�ginas
+	 */
+	private int                nPages           = 0;
+	/**
+	 * Lista de bandas
+	 */
+	private BandList           bandList         = null;
+	private int[]              drawableBands    = null;
+	/**
+	 * Extensi�n asociada al buffer
+	 */
+	private int                minX = 0, minY = 0, maxX = 0, maxY = 0;
+	/**
+	 * Query para las cargas de p�ginas. Lleva asociado un IRasterDatasource de un raster
+	 * de disco. 
+	 */
+	private RasterQuery        query            = null;
+	
+	
+	/**
+	 * Para extraer el desplazamiento de una direcci�n (l�nea de raster) hay que hacer una operaci�n And con 
+	 * con la altura de la p�gina -1. Por ejemplo, una p�gina de 16 l�neas de altura el desplazamiento ser�
+	 * 16 - 1 = 15 porque 15 en binario es 1111.
+	 * 
+	 * Si queremos acceder a la linea del raster n�mero 83 (1010011) realizando la operaci�n And con el valor del
+	 * desplazamiento obtenemos (0001111 & 1010011 = 0000011), es decir el valor 3 en decimal. Esto quiere decir
+	 * que la l�nea 83 del raster es la 3 de su p�gina. 
+	 */
+	private int            offset = 1;
+	
+	private int            bufWidth, bufHeight;
+	private int            blockHeight  = RasterLibrary.blockHeight;
+	
+	/**
+	 * Constructor. Asigna las variables de inicializaci�n y crea la estructura de 
+	 * la cach� con los datos pasados.
+	 * @param dataType Tipo de dato
+	 * @param width Ancho
+	 * @param height Alto
+	 * @param bandNr Banda
+	 * @param orig
+	 * @throws RasterDriverException 
+	 * @throws NotSupportedExtensionException 
+	 * @throws FileNotFoundException 
+	 */
+	public RasterReadOnlyBuffer(int dataType, int width, int height, int nBand) {
+		this.dataType = dataType;
+		this.width = width;
+		this.height = height;
+		this.nBands = nBand;	
+	}
+	
+	/**
+	 * Asigna los parametros relativos al buffer. Estos son el nombre del fichero asociado 
+	 * y la extensi�n asignada
+	 * @param fileName Nombre del fichero asociado
+	 * @param ext Extensi�n
+	 */
+	public void setBufferParams(QueryableRaster q, Extent ext, BandList bandList) 
+		throws InvalidSetViewException, FileNotExistsException, NotSupportedExtensionException {
+		this.bandList = bandList;
+		this.datasource = (RasterDataStore)q;
+				
+		if(	ext.minX() < datasource.getExtent().minX() || ext.minY() < datasource.getExtent().minY() ||
+			ext.maxX() > datasource.getExtent().maxX() || ext.maxY() > datasource.getExtent().maxY())
+			throw new InvalidSetViewException("");
+		
+		Point2D p1 = datasource.worldToRaster(new Point2D.Double(minX, maxY));
+		Point2D p2 = datasource.worldToRaster(new Point2D.Double(maxX, minY));
+		adjustPoints(p1, p2);
+		this.minX = (int)p1.getX();
+		this.minY = (int)p1.getY();
+		this.maxX = (int)p2.getX();
+		this.maxY = (int)p2.getY();
+		
+		init();
+	}
+	
+	private void adjustPoints(Point2D ul, Point2D lr) {
+		double a = (ul.getX() - (int)ul.getX());
+		double b = (ul.getY() - (int)ul.getY());
+		ul.setLocation(	(a > 0.99 || a < 0.005) ? Math.round(ul.getX()) : ul.getX(), 
+						(b > 0.99 || b < 0.005) ? Math.round(ul.getY()) : ul.getY());
+		lr.setLocation(	(a > 0.99 || a < 0.005) ? Math.round(lr.getX()) : lr.getX(), 
+						(b > 0.99 || b < 0.005) ? Math.round(lr.getY()) : lr.getY());
+	}
+			
+	/**
+	 * Asigna los parametros relativos al buffer. Estos son el nombre del fichero asociado 
+	 * y la extensi�n asignada
+	 * @param dataStore Dataset del fichero asociado
+	 * @param minX Coordenada pixel X m�nima
+	 * @param minY Coordenada pixel Y m�nima
+	 * @param maxX Coordenada pixel X m�xima
+	 * @param maxY Coordenada pixel Y m�xima
+	 * @exception InvalidSetViewException
+	 * @exception FileNotExistsException
+	 * @exception NotSupportedExtensionException
+	 */
+	public void setBufferParams(QueryableRaster q, int minX, int minY, int maxX, int maxY, BandList bandList) 
+		throws InvalidSetViewException, FileNotExistsException, NotSupportedExtensionException {
+		this.bandList = bandList;
+		this.datasource = (RasterDataStore)q;
+		
+		this.minX = minX;
+		this.minY = minY;
+		this.maxX = maxX;
+		this.maxY = maxY;
+		
+		if(Math.abs(maxX - minX) != width || Math.abs(maxY - minY) != height) {
+			bufWidth = width;
+			bufHeight = height;
+		}
+					
+		init();
+	}
+		
+	/**
+	 * Acciones de inicializaci�n. 
+	 * Crear el buffer de memoria y la lista de bandas, as� comno los bits empleados
+	 * por cada p�gina de memoria y el desplazamiento que supone para el calculo
+	 * de direcciones.
+	 */
+	private void init() {
+		//Calculo de los bits por p�gina
+		int h = blockHeight; 
+		while(h > 1) {
+			h >>= 1;
+			bitsPag ++;
+		}
+		
+		//Calculo del desplazamiento
+		offset = blockHeight - 1;    
+		
+		//Creamos el bufferFactory asociado a la carga de p�ginas. Cada p�gina se fuerza
+		//a que sea cargada en memoria.
+		query = DefaultRasterManager.getInstance().createQuery();
+		query.setMemoryBuffer(true);
+		query.setDrawableBands(bandList.getDrawableBands());
+		
+		nPages = (int)Math.ceil((double)height / (double)blockHeight);
+		//double aux = ((double)height / (double)RasterLibrary.blockHeight);
+		//heightLastPage = (int)((aux - (int)aux) * RasterLibrary.blockHeight);
+		if(height % blockHeight == 0)
+			heightLastPage = blockHeight;
+		else {
+			double aux = ((double)height / (double)blockHeight);
+			heightLastPage = (int)((aux - (int)aux) * blockHeight);
+		}
+		
+		drawableBands = new int[datasource.getBandCount()];
+		for (int i = 0; i < drawableBands.length; i++) 
+			drawableBands[i] = i;
+	}
+	
+	public void addDrawableBands(int[] db) {
+		if(db == null || db.length > this.bandList.getBandCount())
+			return;
+		this.bandList.setDrawableBands(db);
+		query = DefaultRasterManager.getInstance().createQuery();
+		query.setMemoryBuffer(true);
+		query.setDrawableBands(bandList.getDrawableBands());
+	}
+	
+	public int getBandCount() {
+		return this.bandList.getDrawableBandsCount();
+	}
+	
+	/**
+	 * Calcula la extensi�n de las p�ginas en coordenadas del mundo real
+	 * @param dataset Dataset
+	 * @param nPages N�mero de p�ginas en que se divide el raster
+	 * @deprecated
+	 * @return Extensi�n de cada p�gina
+	 */
+	public Extent[] calcExtentPages(AbstractRasterProvider dataset, int nPages) {
+		Extent datasetExtent = dataset.getExtent();
+		double h = (blockHeight * dataset.getExtent().height()) / dataset.getHeight();
+		Extent[] ext = new Extent[nPages];
+		
+		double minX = datasetExtent.getMin().getX();
+		double maxX = datasetExtent.getMax().getX();
+		double maxY = datasetExtent.getMax().getY();
+		double minY = maxY - h;
+		for (int i = 0; i < ext.length; i++) {
+			ext[i] = new ExtentImpl(minX, maxY, maxX, minY);
+			maxY = minY;
+			minY -= h;
+			if(minY < datasetExtent.minY())
+				minY = datasetExtent.minY();
+		}
+		return ext;
+	}
+	
+	public void malloc(int dataType, int width, int height, int bandNr) {
+	}
+
+	public boolean isBandSwitchable() {
+		return false;
+	}
+	
+	private Buffer queryPage(int pag) throws ProcessInterruptedException, QueryException {
+		int w = maxX - minX + 1;
+		int h = maxY - minY + 1;
+		
+		if((minX + w) > datasource.getWidth())
+			w = (int)(datasource.getWidth() - minX);
+		
+		if(bufWidth == 0 && bufHeight == 0) {
+			if(pag == nPages - 1) {
+				Rectangle r = new Rectangle(minX, (blockHeight * pag) + minY, w, heightLastPage);
+				query.setAreaOfInterest(r);
+			} else { 
+				Rectangle r = new Rectangle(minX, (blockHeight * pag) + minY, w, blockHeight);
+				query.setAreaOfInterest(r);
+			}
+		} else {
+			int hPage = (int)Math.round((blockHeight * h) / (double)bufHeight);
+			if(pag == nPages - 1) {
+				int hLastPage = 0;
+				if(heightLastPage == bufHeight) {
+					hLastPage = h;
+					hPage = 0;
+				} else
+					hLastPage = (int)Math.round((heightLastPage * h) / (double)bufHeight);
+				int newMiY = (hPage * pag) + minY;
+				if((newMiY + hLastPage) > datasource.getHeight())
+					hLastPage = (int)(datasource.getHeight() - newMiY);
+				Rectangle r = new Rectangle(minX, newMiY, w, hLastPage);
+				query.setAreaOfInterest(r, bufWidth, heightLastPage);
+			} else { 
+				Rectangle r = new Rectangle(minX, (hPage * pag) + minY, w, hPage);
+				query.setAreaOfInterest(r, bufWidth, blockHeight);
+			}
+		}
+		return datasource.query(query);
+	}
+
+	/**
+	 * Carga las p�ginas de memoria cuando hay un fallo en el acceso al dato
+	 * @param pag N�mero de p�gina a cargar
+	 */
+	private void loadPage(int pag) {
+		try {
+			if(page == null) {
+				page = queryPage(pag);
+				loadedPage = pag;
+				if((pag + 1) < nPages) {
+					secondPage = queryPage(pag + 1);//datasource.query(query);
+					loadedSecondPage = pag + 1;
+				}
+			} else {
+				if(pag == loadedSecondPage)
+					switchPage();
+				else {
+					switchPage();
+					page = 	queryPage(pag);
+					loadedPage = pag;
+				}
+			}
+
+		} catch (ProcessInterruptedException e) {
+
+		} catch (QueryException e) {
+
+		} finally {
+			//Al interrumpir la carga de datos de un buffer o producirse una excepci�n page quedar� como null. 
+			//Tenemos que asignarle alg�n valor para que las �ltimas consultas no den error.
+			if(page ==  null) {
+				page = DefaultRasterManager.getInstance().createBuffer(dataType, width, height, nBands, true);
+				loadedPage = pag;
+			}
+		}
+	}
+
+
+	/**
+	 * Intercambia las dos p�ginas de memoria
+	 */
+	private void switchPage() {
+		Buffer aux = secondPage;
+		secondPage = page;
+		page = aux;
+		int auxint = loadedSecondPage;
+		loadedSecondPage = loadedPage;
+		loadedPage = auxint;
+	}
+			 
+	//*********************************************************
+	
+	public byte[][] getLineByte(int line) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineByte(line & offset);
+	}
+
+	public short[][] getLineShort(int line) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineShort(line & offset);
+	}
+
+	public int[][] getLineInt(int line) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineInt(line & offset);
+	}
+
+	public float[][] getLineFloat(int line) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineFloat(line & offset);
+	}
+
+	public double[][] getLineDouble(int line) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineDouble(line & offset);
+	}
+
+	//*********************************************************
+	
+	public byte[] getLineFromBandByte(int line, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineFromBandByte(line & offset, band);
+	}
+
+	public short[] getLineFromBandShort(int line, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineFromBandShort(line & offset, band);
+	}
+
+	public int[] getLineFromBandInt(int line, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineFromBandInt(line & offset, band);
+	}
+
+	public float[] getLineFromBandFloat(int line, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineFromBandFloat(line & offset, band);
+	}
+
+	public double[] getLineFromBandDouble(int line, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getLineFromBandDouble(line & offset, band);
+	}
+
+	//*********************************************************
+	
+	public byte getElemByte(int line, int col, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getElemByte(line & offset, col, band);
+	}
+
+	public short getElemShort(int line, int col, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getElemShort(line & offset, col, band);
+	}
+
+	public int getElemInt(int line, int col, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getElemInt(line & offset, col, band);
+	}
+
+	public float getElemFloat(int line, int col, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getElemFloat(line & offset, col, band);
+	}
+
+	public double getElemDouble(int line, int col, int band) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		return page.getElemDouble(line & offset, col, band);
+	}
+	
+	//*********************************************************
+
+	public void getElemByte(int line, int col, byte[] data) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		page.getElemByte(line & offset, col, data);
+	}
+
+	public void getElemShort(int line, int col, short[] data) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		page.getElemShort(line & offset, col, data);
+	}
+
+	public void getElemInt(int line, int col, int[] data) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		page.getElemInt(line & offset, col, data);
+	}
+
+	public void getElemFloat(int line, int col, float[] data) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		page.getElemFloat(line & offset, col, data);
+	}
+
+	public void getElemDouble(int line, int col, double[] data) {
+		int pag = line >> bitsPag;
+		if(pag != loadedPage)
+			loadPage(pag);
+		page.getElemDouble(line & offset, col, data);
+	}
+	
+	//***********************************************
+	//Obtiene una banda entera
+
+	public Band getBand(int band){
+		return null;
+	}
+
+	public Buffer getBandBuffer(int Band){
+		return null;
+	}
+
+	public void replicateBand(int orig, int dest) {
+	}
+
+	public void switchBands(int[] bandPosition){
+
+	}
+
+	//*********************************************************
+
+	public Buffer cloneBuffer(){
+		return null;
+	}
+
+	public void mallocOneBand(int dataType, int width, int height, int band) {
+
+	}
+
+	public void copyBand(int nBand, Band band) {
+				
+	}
+
+	public void assignBand(int nBand, Band band) {
+				
+	}
+
+	public Band createBand(byte defaultValue) {
+		
+		return null;
+	}
+
+	public void assignBandToNotValid(int Band) {}
+	public void assign(int band, byte value) {}
+	public void assign(int band, short value) {}
+	public void assign(int band, int value) {}
+	public void assign(int band, float value) {}
+	public void assign(int band, double value) {}
+	public void interchangeBands(int band1, int band2) {}
+	public void setElem(int line, int col, int band, byte data) {}
+	public void setElem(int line, int col, int band, short data) {}
+	public void setElem(int line, int col, int band, int data) {}
+	public void setElem(int line, int col, int band, float data) {}
+	public void setElem(int line, int col, int band, double data) {}
+	public void setElemByte(int line, int col, byte[] data) {}
+	public void setElemDouble(int line, int col, double[] data) {}
+	public void setElemFloat(int line, int col, float[] data) {}
+	public void setElemInt(int line, int col, int[] data) {}
+	public void setElemShort(int line, int col, short[] data) {}
+	public void setLineByte(byte[][] data, int line) {}
+	public void setLineDouble(double[][] data, int line) {}
+	public void setLineFloat(float[][] data, int line) {}
+	public void setLineInBandByte(byte[] data, int line, int band) {}
+	public void setLineInBandDouble(double[] data, int line, int band) {}
+	public void setLineInBandFloat(float[] data, int line, int band) {}
+	public void setLineInBandInt(int[] data, int line, int band) {}
+	public void setLineInBandShort(short[] data, int line, int band) {}
+	public void setLineInt(int[][] data, int line) {}
+	public void setLineShort(short[][] data, int line) {}
+
+	public boolean isReadOnlyBuffer() {
+		return true;
+	}
+	
+	public boolean isCached() {
+		return true;
+	}
+	
+	public int getBlockHeight() {
+		return RasterLibrary.blockHeight;
+	}
+	
+	public void dispose() {
+		if(page != null) {
+			page.dispose();
+		}
+		if(secondPage != null) {
+			secondPage.dispose();
+		}
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+	
+	protected void finalize() throws Throwable {
+		page = null;
+		secondPage = null;
+		query            = null;
+		drawableBands    = null;
+		bandList         = null;
+		datasource       = null;
+		super.finalize();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterReadOnlyBuffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/LRUAlgorithm.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/LRUAlgorithm.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/LRUAlgorithm.java	(revision 15423)
@@ -0,0 +1,226 @@
+/* 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.impl.buffer.cache;
+
+import java.io.IOException;
+
+/*
+ * TODO: OPTIMIZACION: Trabajo de optimizaci�n en la velocidad e acceso a cach�.
+ * TODO: FUNCIONALIDAD: Acabar de implementar los m�todos de acceso a datos, intercambio de bandas, etc...
+ */
+/**
+ * Esta clase contiene el algoritmo de reemplazo de trozos de cach� LRU
+ *   
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class LRUAlgorithm {
+
+	private Cache cache = null;
+	
+	/**
+	 * Constructor. Asigna la cach� para poder aplicar el algoritmo.
+	 * @param cache
+	 */
+	public LRUAlgorithm(Cache cache){
+		this.cache = cache;
+	}
+	
+	/**
+	 * Asigna el objeto cach�.
+	 * @param cache 
+	 */
+	public void setCache(Cache cache) {
+		this.cache = cache;
+	}
+	
+	/**
+	 * Funci�n que controla para cada l�nea si la p�gina a la que accede est� cacheada o no
+	 * . Es la encargada de realizar los reemplazos o cargar la p�gina en el buffer de "p�gina
+	 * actualmente accedida" (accessPage de la clase Cache)
+	 * @param line L�nea del raster a la que se est� accediendo
+	 * @param readOnly ser� true si el acceso que se est� realizando es de lectura y false si se
+	 * est� escribiendo alg�n dato
+	 */
+	public void cacheAccess(int line, boolean readOnly)throws InvalidPageNumberException{
+		int pag = line >> cache.getBitsPag();			
+		if(cache.isInCache(pag)) {
+			if(cache.getNumberInAccessPage() != pag)
+				loadPage(pag, readOnly);
+		} else {
+			replacePage(pag + 1, readOnly, false);
+			replacePage(pag, readOnly, true);
+		}
+	}
+	
+	/**
+	 * Carga la p�gina desde cach� al buffer actualmente en uso. Esta operaci�n no lleva
+	 * cambio de datos sino que solo es un cambio de punteros. La secuencia de operaciones es:
+	 * <UL>
+	 * <LI>Cargar la p�gina como accedida</LI>
+	 * <LI>Asignar n�mero a la p�gina accedida</LI>
+	 * <LI>Actualizar la antig�edad de accesos.Se incrementar� uno en todas las p�ginas del 
+	 * conjunto y se pondr� a 0 la p�gina accedida.</LI>
+	 * <LI>Poner a 0 el valor de lastAccess de la p�gina cargada. Esto hace que tenga m�nima 
+	 * prioridad en la politica de reemplazamiento.</LI>
+	 * <LI>Poner a false el flag de p�gina modificada si el par�metro readOnly es false.</LI>
+	 * </UL>
+	 * @param nPag N�mero de p�gina del raster a la que se intenta acceder.
+	 * @param readOnly ser� true si el acceso que se est� realizando es de lectura y false si se
+	 * est� escribiendo alg�n dato. 
+	 */
+	private void loadPage(int nPag, boolean readOnly)throws InvalidPageNumberException{
+		PageBuffer buf = cache.getPageBufferFromNumberRasterPage(nPag);
+		int[] cacheGroupPage = cache.getNumberGroupFromNumberRasterPage(nPag);
+		if(buf != null && cacheGroupPage != null){ //Comprueba que el n�mero de p�gina sea correcto para la cach�.
+			cache.setAccessPage(buf, nPag);
+			cache.updateLastAccess(cacheGroupPage[0]);
+			cache.setZeroInLastAccess(cacheGroupPage[0], cacheGroupPage[1]);
+			if(!readOnly)
+				cache.setModify(cacheGroupPage[0], cacheGroupPage[1]);
+		}else
+			throw new InvalidPageNumberException("");
+		//System.out.println("LOAD: "+nPag);
+	}
+	
+	/**
+	 * <P>
+	 * Cuando se accede a una p�gina que no est� cacheada necesitamos cargarla en cach� antes de 
+	 * acceder a ella. Si hay un hueco libre en su conjunto se meter� en este pero sino habr� 
+	 * que reemplazar una ocupada. Para esto habr� que localizar el conjunto donde va 
+	 * destinada y luego la posici�n del conjunto donde se cargar� localizando cual es el 
+	 * elemento del conjunto que hace m�s tiempo que se accedi�.
+	 * </P>
+	 * <P>
+	 * Si el elemento es insertado en un hueco la secuencia es la siguiente:
+	 * </P>
+	 * <UL>
+	 * <LI>Obtenemos la siguiente p�gina vacia.</LI>
+	 * <LI>La cargamos de datos.</LI>
+	 * <LI>Se asigna como p�gina accedida</LI>
+	 * <LI>Ponemos true en su posici�n en el vector cacheada</LI>
+	 * <LI>Asignamos el n�mero de p�gina de raster que hemos cargado en esa posici�n de la cach�.</LI>
+	 * <LI>Incrementamos en 1 todos los valores de �ltimo acceso de las p�ginas del grupo.</LI>
+	 * <LI>Ponemos a 0 su �ltimo acceso</LI>
+	 * <LI>Si el acceso es para escritura ponemos el flag de p�gina modificada a true.</LI>
+	 * </UL>
+	 * <P>
+	 * Si se reemplaza una p�gina la secuencia es la siguiente:
+	 * </P>
+	 * <UL>
+	 *  <LI>Incrementamos en 1 todos los valores de �ltimo acceso de las p�ginas del grupo y 
+	 *  obtenemos la posici�n de la p�gina de reemplazo.</LI>
+	 * <LI>Ponemos a false la p�gina que va a sacarse de cach�</LI>
+	 * <LI>Si ha sido modificada la p�gina que va a sacarse de cach� se vuelca a disco</LI>
+	 * <LI>Ponemos el flag de modificada para la p�gina sacada a disco a false.</LI>
+	 * <LI>Cargamos la p�gina de cach� de datos.</LI>
+	 * <LI>Asignamos el n�mero de p�gina de raster que hemos cargado en esa posici�n de la cach�.</LI>
+	 * <LI>Se asigna como p�gina accedida</LI>
+	 * <LI>Ponemos true en su posici�n en el vector cacheada</LI>
+	 * <LI>Ponemos a 0 su �ltimo acceso</LI>
+	 * <LI>Si el acceso es para escritura ponemos el flag de p�gina modificada a true.</LI>
+	 * </UL>
+	 * @param nPag N�mero de p�gina que est� siendo accedida
+	 * @param readOnly ser� true si el acceso que se est� realizando es de lectura y false si se
+	 * est� escribiendo alg�n dato. 
+	 * @param n ser� true si el acceso se est� haciendo a la p�gina n y false si se est� haciendo a
+	 * la n+1. 
+	 */
+	private void replacePage(int nPag, boolean readOnly, boolean n){
+		int group = nPag % cache.getNGroups();
+		
+		if(nPag >= cache.getNTotalPags())
+			return;
+		
+		//Insertamos en un hueco
+		
+		if(insertInAHole(group, readOnly, nPag, n))
+			return;
+				
+		//Reemplazamos una existente
+		
+		int posInGroupPageToReplace = cache.updateLastAccess(group); //Se actualizan los indices y se obtiene la p�gina a reemplazar
+		
+		cache.setZeroInLastAccess(group, posInGroupPageToReplace);
+		int rasterPageToReplace = cache.getRasterPageNumberInPosition(group, posInGroupPageToReplace);
+				
+		//Sacamos la antigua
+		cache.setPageAsNotLoadInCache(rasterPageToReplace);
+		if(cache.isModified(group, posInGroupPageToReplace)){
+			try {
+				cache.savePage(group, posInGroupPageToReplace, rasterPageToReplace); 	//Volcamos disco 
+				cache.unsetModify(group, posInGroupPageToReplace);
+			} catch (IOException e) {
+				System.err.println("No se ha podido salvar la p�gina de cach�.");
+				e.printStackTrace();
+			}
+		}
+		
+		//Insertamos la nueva
+		cache.loadPage(group, posInGroupPageToReplace, nPag);	//Cargamos de nuevo el buffer
+		cache.setRasterPageNumberInPosition(group, posInGroupPageToReplace, nPag);
+		cache.setPageAsLoadInCache(nPag);		//Pone true en su posici�n en el vector cacheada
+		PageBuffer pb = cache.getPageBuffer(group, posInGroupPageToReplace);
+		
+		if(n){
+			if(!readOnly)
+				cache.setModify(group, posInGroupPageToReplace);
+			cache.setAccessPage(pb, nPag);  	//Asigna como accedida
+		}
+		//System.out.println("REPLACE: "+nPag);
+	}
+	
+	/**
+	 * Comprueba si hay alg�n hueco en el que insertar y si es as� se inserta en el y devuelve
+	 * true. 
+	 * @param group conjunto donde hay que buscar para la inserci�n
+	 * @param readOnly si es true la operaci�n es de solo consulta y si es false la operaci�n 
+	 * est� modificando alg�n valor de la p�gina a insertar
+	 * @param nPag N�mero de p�gina a cargar
+	 * @return true si se ha insertado en un hueco y false si no se ha insertado
+	 */
+	private boolean insertInAHole(int group, boolean readOnly, int nPag, boolean n) {
+		PageBuffer pb = null;
+		for(int i = 0; i < cache.getPagsPerGroup(); i++) {
+			if(cache.getLastAccess()[group][i] == -1) {
+
+				//Pone true en su posici�n en el vector cacheada
+				pb = cache.getPageBuffer(group, i);
+				cache.loadPage(group, i, nPag);					//Sube la p�gina a cach�
+				cache.setRasterPageNumberInPosition(group, i, nPag);//Asigna el n�mero de p�g a una posici�n de cach�
+				cache.setPageAsLoadInCache(nPag);
+				cache.updateLastAccess(group);
+				cache.setZeroInLastAccess(group, i);
+				if(n){ //La n+1 no se carga como accedida ni se pone a 0 su contador de �ltima accedida	
+					if(!readOnly)
+						cache.setModify(group, i);
+					cache.setAccessPage(pb, nPag);  //Asigna como accedida
+				}				
+				//System.out.println("INSERT: "+nPag);
+				return true;
+			}
+		}
+		return false;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/LRUAlgorithm.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/InvalidPageNumberException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/InvalidPageNumberException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/InvalidPageNumberException.java	(revision 15423)
@@ -0,0 +1,35 @@
+/* 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.impl.buffer.cache;
+
+/**
+ * Excepci�n lanzada cuando el n�mero de p�gina al que se intenta acceder no es valido.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class InvalidPageNumberException extends Exception{
+	private static final long serialVersionUID = -4312548276663417111L;
+
+	public InvalidPageNumberException(String msg){
+		super(msg);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/InvalidPageNumberException.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBandBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBandBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBandBuffer.java	(revision 15423)
@@ -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.impl.buffer.cache;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.raster.impl.buffer.RasterMemoryBuffer;
+
+/**
+ * Esta clase representa una p�gina de cache. Una p�gina no es m�s que un buffer de datos
+ * con todas sus funcionalidades con un uso especifico, el de ser una p�gina. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class PageBandBuffer extends RasterMemoryBuffer {
+
+	/**
+	 * N�mero de banda que corresponde a este PageBandBuffer
+	 */
+	private int numBand = 0;
+	private HddPage[] hddPages = null;
+	
+	/**
+	 * Constructor.
+	 * @param dataType Tipo de dato
+	 * @param width Ancho de p�gina
+	 * @param height Alto de p�gina
+	 * @param bandNr N�mero de bandas
+	 * @param malloc true para reservar de memoria en el buffer 
+	 */
+	public PageBandBuffer(int dataType, int width, int height, int bandNr, boolean malloc, int numBand){
+		super(dataType, width, height, bandNr, malloc);
+		this.numBand = numBand;
+	}
+	
+	/**
+	 * Asigna la lista de paginas de disco
+	 * @param hddList Lista de p�ginas de disco
+	 */
+	public void setHddPages(HddPage[] hddList){
+		this.hddPages = hddList;
+	}
+	
+	/**
+	 * Carga una p�gina especificada en el par�metro nPag con los datos necesarios.
+	 * Para esto utiliza el dataSource.
+	 *   
+	 * @param nPag N�mero de p�gina a cargar
+	 */
+	public void loadPage(int nPag) throws ProcessInterruptedException {
+		hddPages[nPag].getDataServer(numBand).loadPage(this);
+	}
+	
+	/**
+	 * Salva una p�gina especificada en el par�metro nPag a disco. 
+	 * Para esto utiliza el dataSource
+	 *   
+	 * @param nPag N�mero de p�gina a salvar
+	 * @throws IOException
+	 */
+	public void savePage(int nPag) throws IOException{
+		hddPages[nPag].getDataServer(numBand).savePage(this);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/PageBandBuffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/HddPage.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/HddPage.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/HddPage.java	(revision 15423)
@@ -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.impl.buffer.cache;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.raster.impl.provider.RasterProvider;
+
+
+/**
+ * Esta clase representa una p�gina de disco. Una p�gina de disco tendr� un n�mero de
+ * p�gina asociado y un servidor de datos de disco por cada banda. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class HddPage {
+	/**
+	 * Objeto que guarda y recupera trozos de cache de disco.
+	 */
+	private ICacheDataSource[] dataSource = null;
+	//private int nPag = 0;
+	
+	/**
+	 * Constructor: crea un objeto dataSource.
+	 * @param nPag N�mero de p�gina
+	 * @param nBands N�mero de bandas del dataset
+	 * @throws RasterDriverException 
+	 * @throws NotSupportedExtensionException 
+	 * @throws FileNotFoundException 
+	 */
+	public HddPage(int nPag, RasterProvider provider, Extent extent) throws FileNotFoundException, NotSupportedExtensionException, RasterDriverException{
+		//this.nPag = nPag;
+		dataSource = new CacheDataFromDriverServer[1];
+		dataSource[0] = new CacheDataFromDriverServer(provider, nPag, extent);	
+	}
+	
+	/**
+	 * Limpia los trozos de cach� en disco. Despu�s del llamar a este 
+	 * m�todo no puede volver a usarse esta cach�.
+	 * @throws IOException 
+	 */
+	public void deletePage(int nBands) throws IOException {
+		for (int i = 0; i < nBands; i++)
+			deleteBand(i);
+	}
+		
+	/**
+	 * Constructor: crea un objeto dataSource para cada banda. Para todos los datasource de un 
+	 * mismo HddPage se usa el mismo identificador.
+	 * @param nPag N�mero de p�gina
+	 * @param nBands N�mero de bandas del dataset
+	 */
+	public HddPage(int nPag, int nBands){
+		//this.nPag = nPag;
+		dataSource = new CacheDataServer[nBands];
+		for (int iBand = 0; iBand < nBands; iBand++)
+			dataSource[iBand] = new CacheDataServer(Long.toString(System.currentTimeMillis()), iBand, nPag);	
+	}
+	
+	/**
+	 * Obtiene el servidor de datos de disco para una banda de la p�gina de
+	 * disco actual
+	 * @param nBand N�mero de banda
+	 * @return Servidor de datos de disco
+	 */
+	public ICacheDataSource getDataServer(int nBand){
+		if(nBand >= 0 && nBand < dataSource.length)
+			return dataSource[nBand];
+		return null;
+	}
+	
+	/**
+	 * Elimina una banda de la cach�. Antes salva a disco todos los trozos cacheados e inicializa
+	 * las estructuras de control de cach�. 
+	 * @param nBand N�mero de banda a eliminar
+	 * @throws IOException 
+	 */
+	public void deleteBand(int nBand) throws IOException{
+		if(nBand >= 0 && nBand < dataSource.length)
+			dataSource[nBand].delete();
+	}
+	
+	/**
+	 * Asigna una banda de disco a todas las p�ginas.
+	 * @param cacheDataSource Fuente de las p�ginas. Es la referencia a disco de ellas.
+	 */
+	public void assignBand(int nBand, ICacheDataSource cacheDataSource){
+		if(nBand >= 0 && nBand < dataSource.length)
+			dataSource[nBand] = cacheDataSource;
+	}
+	
+	/**
+	 * Obtiene la fuente de datos que corresponde a una banda.
+	 * @param nBand Banda a recuperar
+	 * @return ICacheDataSource 
+	 */
+	public ICacheDataSource getBandDataSource(int nBand){
+		return dataSource[nBand];
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/HddPage.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/package.html	(revision 15423)
@@ -0,0 +1,4 @@
+<html>
+	<body>Clases para la gesti�n del cacheado de datos.
+</body>
+</html>

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/package.html
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/Cache.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/Cache.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/Cache.java	(revision 15423)
@@ -0,0 +1,766 @@
+/* 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.impl.buffer.cache;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+
+/**
+ * <P>
+ * Esta clase representa a la cache raster. Consta de una ser�e de p�ginas (CachePages)
+ * que son buffers con los bloques de datos cacheados en un instante dado. Esta cache tiene 
+ * una estructura en forma de array donde cada elemento es una p�gina de cach�. Las p�ginas 
+ * se agrupan en bloques de N p�ginas denominados grupos. La variable nelemsGroup contiene 
+ * el n�mero de p�ginas de cada grupo.
+ * </P>
+ * <P>
+ * La politica de reemplazo es que una p�gina siempre va a un conjunto determinado por el calculo
+ * cto = pag % nelemsGroup. Si hay hueco vac�o en el grupo se a�adir� en el siguiente hueco pero
+ * si hay que reeplazar se reeplazar� la p�gina que m�s tiempo haga su �ltimo acceso. 
+ * </P>
+ * <P>
+ * Esta cach� lleva el control de que p�ginas est�n cargadas a trav�s de un array de de booleanos
+ * donde cada elemento representa a una p�gina de datos del raster. Si el elemento en la posici�n
+ * N de dicho array es true significa que la p�gina est� cacheada. Si es false no lo estar�. 
+ * </P>
+ * <P>
+ * La p�gina de datos actualmente accedida debe estar cacheada por lo que est� clase debe llevar
+ * el control de que p�gina se est� accediendo o a sido accedida por �ltima vez. La variable que
+ * nos dice que p�gina est� siendo accedida es loadPage y pageBuffer ser� la variable que apunta
+ * al buffer de esta p�gina. Cuando se cambia de p�gina en un acceso estas dos variables deben
+ * cambiar a sus nuevos valores.
+ * </P>
+ * <P>
+ * Otro par�metro que controla esta clase es que p�gina de cada grupo ha sido accedido con mayor 
+ * frecuencia. Esto es �til porque siempre se reemplaza la p�gina de un grupo que haga m�s tiempo
+ * que haya sido accedida bajo la premisa de que "las p�ginas con accesos recientes tienen mayor 
+ * probabilidad de volver a ser usadas". Esto es controlado por la variable lastAccess que es
+ * usada para implementar el algoritmo LRU. Cada vez que una p�gina de un grupo es accedida su 
+ * contador de lastAccess se pone a 0. El resto de contadores de las p�ginas del grupo se incrementa
+ * en uno. Siempre se sustituye la p�gina del grupo con valor m�s grande en el contador.
+ * </P>
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class Cache{
+	/**
+	 * Cada elemento es una p�gina del raster y dice si est� cacheada o no.
+	 */
+	private boolean[] cacheada = null;
+	/**
+	 * N�mero de p�gina cargada en accessPage.
+	 */
+	private int numberInAccessPage = -1;
+	/**
+	 * Buffer de datos de la p�gina actualmente accedida.
+	 */
+	private PageBuffer accessPage = null;
+	/**
+	 * P�ginas de cach�
+	 */
+	private PageBuffer[] page = null;
+	/**
+	 * Cada elemento del array es una p�gina de cach� y contiene el n�mero de p�gina cargada en 
+	 * esa posici�n.
+	 */
+	private int[]	pageNumberInCache = null;
+	/**
+	 * P�ginas de la cach�.
+	 */
+	private CacheStruct cacheStruct = null;
+	/**
+	 * �ltimo acceso a las p�ginas de cada grupo.
+	 */
+	private int[][] lastAccess = null;
+	/**
+	 * Cada elemento representa una p�gina de cach� y dice si esta ha sido modificada desde que
+	 * fu� cargada en cach� o no.
+	 */
+	private boolean[] modified = null;
+	/**
+	 * P�ginas de disco
+	 */
+	private HddPage[] hddPage = null;
+	
+	/**
+	 * Inicializamos la variables. Para ello creamos el objeto Cache que contendr� todos los 
+	 * par�metros necesarios para crear el array que controla los accesos m�s recientes y el
+	 * array que dice si una p�gina est� en memoria o no.
+	 * @param nBands N�mero de bandas
+	 * @param dataType Tipo de dato de la p�gina
+	 * @param dataSourceWidth ancho de la fuente de datos
+	 * @param driverParam par�metro para el driver
+	 */
+	public Cache(int nBands, int dataType, int dataSourceWidth, int dataSourceHeight, Object driverParam)  throws FileNotFoundException, NotSupportedExtensionException, RasterDriverException {
+		if(driverParam instanceof String) {
+			File file = new File(((String)driverParam));
+			if(!file.exists())
+				throw new FileNotFoundException("I can't make read only cache structure.");
+		} else 
+			return;
+		
+		init(nBands, dataType, dataSourceWidth, dataSourceHeight);
+		
+		//Creamos las estructuras de las p�ginas de disco
+		hddPage = new HddPage[cacheStruct.getNTotalPags()];
+				
+		RasterProvider provider = AbstractRasterProvider.singleDatasetInstance(null, (String)driverParam);
+		Extent[] extentList = calcExtentPages(provider, hddPage.length);
+		
+		for (int iPage = 0; iPage < hddPage.length; iPage++)
+			hddPage[iPage] = new HddPage(iPage, provider, extentList[iPage]);
+		
+		//Creamos las p�ginas de memoria
+		for(int i = 0; i < cacheStruct.getNPags(); i++) {
+		  page[i] = new PageBuffer(dataType, dataSourceWidth, cacheStruct.getHPag(), nBands, true, i);
+		  page[i].setHddPages(hddPage);
+		}
+	}
+	
+	/**
+	 * Calcula la extensi�n de las p�ginas en coordenadas del mundo real
+	 * @param dataset Dataset
+	 * @param nPages N�mero de p�ginas en que se divide el raster
+	 * @return Extensi�n de cada p�gina
+	 */
+	private Extent[] calcExtentPages(RasterProvider provider, int nPages) {
+		Extent datasetExtent = provider.getExtent();
+		double h = cacheStruct.getHPag() * (provider.getExtent().height() / provider.getHeight());
+		Extent[] ext = new Extent[nPages];
+		
+		double minX = datasetExtent.getMin().getX();
+		double maxX = datasetExtent.getMax().getX();
+		double maxY = datasetExtent.getMax().getY();
+		double minY = maxY - h;
+		for (int i = 0; i < ext.length; i++) {
+			ext[0] = new ExtentImpl(minX, maxY, maxX, minY);
+			maxY = minY;
+			minY -= h;
+		}
+		return ext;
+	}
+	
+	/**
+	 * Inicializamos la variables. Para ello creamos el objeto Cache que contendr� todos los 
+	 * par�metros necesarios para crear el array que controla los accesos m�s recientes y el
+	 * array que dice si una p�gina est� en memoria o no.
+	 * @param nBands N�mero de bandas
+	 * @param dataType Tipo de dato de la p�gina
+	 * @param dataSourceWidth ancho de la fuente de datos
+	 */
+	public Cache(int nBands, int dataType, int dataSourceWidth, int dataSourceHeight) {
+		init(nBands, dataType, dataSourceWidth, dataSourceHeight);
+		
+		//Creamos las estructuras de las p�ginas de disco
+		hddPage = new HddPage[cacheStruct.getNTotalPags()];
+		for (int iPage = 0; iPage < hddPage.length; iPage++)
+			hddPage[iPage] = new HddPage(iPage, getNBands());
+		
+		//Creamos las p�ginas de memoria
+		for(int i = 0; i < cacheStruct.getNPags(); i++) {
+		  page[i] = new PageBuffer(dataType, dataSourceWidth, cacheStruct.getHPag(), nBands, true, i);
+		  page[i].setHddPages(hddPage);
+		}
+	}
+	
+	/**
+	 * Contructor
+	 * @param cacheStruct
+	 */
+	public Cache(CacheStruct cacheStruct, int dataSourceWidth) {
+		this.cacheStruct = cacheStruct;
+		
+		//Inicializamos la antig�edad de acceso  
+		lastAccess = new int[cacheStruct.getNGroups()][cacheStruct.getPagsPerGroup()];
+		
+		//Creamos el buffer de la cach�
+		page = new PageBuffer[cacheStruct.getNPags()];
+		pageNumberInCache = new int[cacheStruct.getNPags()];
+		modified = new boolean[cacheStruct.getNPags()];
+		cacheada = new boolean[cacheStruct.getNTotalPags()];
+		
+		//Creamos las estructuras de las p�ginas de disco
+		hddPage = new HddPage[cacheStruct.getNTotalPags()];
+		for (int iPage = 0; iPage < hddPage.length; iPage++)
+			hddPage[iPage] = new HddPage(iPage, getNBands());
+		
+		//Creamos las p�ginas de memoria
+		for(int i = 0; i < cacheStruct.getNPags(); i++) {
+		  page[i] = new PageBuffer(cacheStruct.getDataType(), dataSourceWidth, cacheStruct.getHPag(), cacheStruct.getNBands(), true, i);
+		  page[i].setHddPages(hddPage);
+		}
+		
+		initStructs();
+	}
+	
+	/**
+	 * 
+	 * @param nBands
+	 * @param dataType
+	 * @param dataSourceWidth
+	 * @param dataSourceHeight
+	 */
+	private void init(int nBands, int dataType, int dataSourceWidth, int dataSourceHeight) {
+		//Creamos la estructura de la cach�
+		cacheStruct = new CacheStruct(nBands, dataType, dataSourceWidth, dataSourceHeight);
+		
+		//Inicializamos la antig�edad de acceso  
+		lastAccess = new int[cacheStruct.getNGroups()][cacheStruct.getPagsPerGroup()];
+		
+		//Creamos el buffer de la cach�
+		page = new PageBuffer[cacheStruct.getNPags()];
+		pageNumberInCache = new int[cacheStruct.getNPags()];
+		modified = new boolean[cacheStruct.getNPags()];
+		cacheada = new boolean[cacheStruct.getNTotalPags()];
+		
+		this.initStructs();
+	}
+		
+	/**
+	 * Inicializa las estructuras de mantenimiento de cach�. Estas son array de paginas
+	 * accedidas por �ltima vez, numeros de p�gina cargadas en cada posici�n de cach�, 
+	 * array con la informaci�n de p�gina modificada y array que dice si una p�gina de disco
+	 * est� cacheada o no.
+	 */
+	private void initStructs() {
+		for(int i = 0; i < cacheStruct.getNGroups(); i ++)
+			for(int j = 0; j < cacheStruct.getPagsPerGroup(); j ++)
+				lastAccess[i][j] = -1;
+		
+		for(int i = 0; i < cacheada.length; i++)
+			cacheada[i] = false;
+		
+		for(int i = 0; i < cacheStruct.getNPags(); i++){
+			pageNumberInCache[i] = -1;
+			modified[i] = false;
+		}
+	}
+	
+	/**
+	 * Limpia los trozos de cach� en disco. Despu�s del llamar a este 
+	 * m�todo no puede volver a usarse esta cach�.
+	 * @throws IOException 
+	 */
+	public void clearCache(int nBands) throws IOException {
+		if(hddPage == null)
+			return;
+		for (int i = 0; i < hddPage.length; i++) 
+			hddPage[i].deletePage(nBands);
+	}
+	
+	/**
+	 * Obtiene el n�mero de bits por p�gina para poder calcular el desplazamiento binario
+	 * de la direcci�n de acceso de la petici�n. Es decir si se solicita un dato en la l�nea
+	 * 36 (en decimal) del raster 100100(en binario) y el desplazamiento es 4 bits el n�mero de 
+	 * p�gina resultante ser� 10(en binario) 2 (en decimal)
+	 * @return
+	 */
+	public int getBitsPag() {
+		return cacheStruct.getBitsPag();
+	}
+
+	/**
+	 * Obtiene la altura de la p�gina de cache en l�neas. 
+	 * @return N�mero de l�neas de altura de p�gina.
+	 */
+	public int getHPag() {
+		return cacheStruct.getHPag();
+	}
+	
+	/**
+	 * Array de booleanos donde cada elemento es una p�gina del raster y dice si la p�gina 
+	 * est� cacheada o no.
+	 * @return true si la p�gina est� en cach� y false si no lo est�
+	 */
+	public boolean isInCache(int nPag) {
+		if(nPag < 0 || nPag >= cacheada.length)
+			return false;
+		return cacheada[nPag];
+	}
+	
+	/**
+	 * Marca una p�gina como cargada en cach�.
+	 * @param nPag N�mero de p�gina a marcar.
+	 */
+	public void setPageAsLoadInCache(int nPag) {
+		if(nPag < 0 || nPag >= cacheada.length)
+			return;
+		cacheada[nPag] = true;
+	}
+	
+	/**
+	 * Desmarca una p�gina como cargada en cach�.
+	 * @param nPag N�mero de p�gina a desmarcar.
+	 */
+	public void setPageAsNotLoadInCache(int nPag) {
+		if(nPag < 0 || nPag >= cacheada.length)
+			return;
+		cacheada[nPag] = false;
+	}
+	
+	/**
+	 * Obtiene el n�mero de p�gina del raster cargada en una p�gina de cach� especificada
+	 * en el par�metro. 
+	 * @param nCachePage N�mero de p�gina de cach� de la que se quiere saber que p�gina del 
+	 * raster hay cargada.
+	 * @return N�mero de p�gina del raster
+	 */
+	public int getRasterPageNumberInPosition(int nCachePage) {
+		return pageNumberInCache[nCachePage];
+	}
+	
+	/**
+	 * Obtiene el n�mero de p�gina del raster cargada en una p�gina de cach� especificada
+	 * en el par�metro. 
+	 * @param group Grupo en el que se encuentra la p�gina
+	 * @param posInGroup Posici�n dentro del grupo en el que est� la p�gina
+	 * @return N�mero de p�gina del raster
+	 */
+	public int getRasterPageNumberInPosition(int group, int posInGroup) {
+		return pageNumberInCache[group * getPagsPerGroup() + posInGroup];
+	}
+	
+	/**
+	 * Asigna el n�mero de p�gina del raster cargada en una p�gina de cach� especificada.
+	 * @param nCachePage N�mero de p�gina de cach� 
+	 * @param nRasterPage N�mero de p�gina de raster a asignar
+	 */
+	public void setRasterPageNumberInPosition(int nCachePage, int nRasterPage) {
+		pageNumberInCache[nCachePage] = nRasterPage;
+	}
+	
+	/**
+	 * Asigna el n�mero de p�gina del raster cargada en una p�gina de cach� especificada.
+	 * @param nCachePage N�mero de p�gina de cach� 
+	 * @param nRasterPage N�mero de p�gina de raster a asignar
+	 */
+	public void setRasterPageNumberInPosition(int group, int posInGroup, int nRasterPage) {
+		pageNumberInCache[group * getPagsPerGroup() + posInGroup] = nRasterPage;
+	}
+	
+	/**
+	 * Obtiene el n�mero de p�gina de cach� donde est� cargada la p�gina del raster
+	 * que se ha pasado por par�metro.
+	 * @param pag P�gina del raster
+	 * @return N�mero de p�gina del raster
+	 */
+	public int getNumberCachePageFromNumberRasterPage(int pag) {
+		int group = pag % getNGroups(); 
+		for(int i = 0; i < getPagsPerGroup(); i++)
+			if(pageNumberInCache[group + i] == pag)
+				return (group * getPagsPerGroup() + i);
+		return -1;
+	}
+	
+	/**
+	 * Obtiene el n�mero de p�gina de cach� (en formato grupo/p�gina dentro del grupo) 
+	 * donde est� cargada la p�gina del raster que se ha pasado por par�metro.
+	 * @param pag P�gina del raster
+	 * @return N�mero de p�gina del raster
+	 */
+	public int[] getNumberGroupFromNumberRasterPage(int pag) {
+		int group = pag % getNGroups();
+		for(int i = 0; i < getPagsPerGroup(); i++)
+			if(pageNumberInCache[(group * getPagsPerGroup()) + i] == pag)
+				return new int[]{group, i};
+		return null;
+	}
+	
+	/**
+	 * Obtiene el array que contiene los valores de la antig�edad del acceso dentro del
+	 * grupo. La primera dimensi�n del array corresponde al n�mero de grupo y la segunda
+	 * a los elementos del grupo. El elemento del grupo con un acceso m�s reciente tendr� 
+	 * un n�mero menor y el de mayor valor ser� el candidato para la sustituci�n en el pr�ximo
+	 * remplazamiento.
+	 * @return Array bidimensional con los valores de antig�edad.
+	 */
+	public int[][] getLastAccess() {
+		return lastAccess;
+	}
+
+	/**
+	 * Asigna un cero en la posici�n del array que contiene la antig�edad de acceso dentro 
+	 * del grupo. Esta operaci�n se realiza cada vez que se accede a un dato del la p�gina 
+	 * cacheada y significa que es la p�gina m�s recientemente accedida.
+	 * @param group N�mero de grupo
+	 * @param posInGroup Posici�n de la p�gina dentro del grupo.
+	 */
+	public void setZeroInLastAccess(int group, int posInGroup) {
+		lastAccess[group][posInGroup] = 0;
+	}
+	
+	/**
+	 * Obtiene el n�mero de p�gina cargada en el buffer
+	 * @return Entero con el n�mero de p�gina
+	 */
+	public int getNumberInAccessPage() {
+		return numberInAccessPage;
+	}
+
+	/**
+	 * Obtiene el n�mero de p�ginas que tiene cada grupo
+	 * @return Entero con el n�mero de p�ginas por grupo 
+	 */
+	public int getPagsPerGroup() {
+		return cacheStruct.getPagsPerGroup();
+	}
+
+	/**
+	 * Obtiene la p�gina de datos de la posici�n pag
+	 * @param pag N�mero de p�gina de cach� a recuperar
+	 * @return PageBuffer correspondiente a la p�gina recuperada
+	 */
+	public PageBuffer getPageBufferFromNumberCachePage(int pag) {
+		return page[pag];
+	}
+	
+	/**
+	 * Obtiene la p�gina de datos a partir del n�mero de p�gina de raster
+	 * @param pag N�mero de p�gina raster a recuperar
+	 * @return PageBuffer correspondiente a la p�gina recuperada o null si no est� en cach�
+	 */
+	public PageBuffer getPageBufferFromNumberRasterPage(int pag) {
+		int group = pag % getNGroups();
+		for(int i = 0; i < getPagsPerGroup(); i++)
+			if(pageNumberInCache[group * getPagsPerGroup() + i] == pag)
+				return page[group * getPagsPerGroup() + i];
+		return null;
+	}
+	
+	/**
+	 * Obtiene la p�gina de datos del grupo definido en el par�metro group y de la 
+	 * posici�n pag dentro de ese grupo.
+	 * @param group Grupo de la p�gina requerida
+	 * @param pag N�mero de p�gina dentro del grupo
+	 * @return PageBuffer correspondiente a la p�gina recuperada
+	 */
+	public PageBuffer getPageBuffer(int group, int posInGroup) {
+		return page[group * getPagsPerGroup() + posInGroup];
+	}
+	
+	/**
+	 * Obtiene la p�gina de datos actualmente accedida
+	 * @return PageBuffer correspondiente a la p�gina que se est� accediendo
+	 */
+	public PageBuffer getAccessPage() {
+		return accessPage;
+	}
+	
+	/**
+	 * Asigna el buffer de la p�gina accedida por referencia
+	 * @param pb
+	 */
+	public void setAccessPage(PageBuffer pb, int pagNumber) {
+		accessPage = pb;
+		numberInAccessPage = pagNumber;
+	}
+	
+	/**
+	 * Consulta si una p�gina de cach� ha sido modificada desde que se carg� en cach� o no.
+	 * @param nCachePag N�mero de p�gina de cach� (posici�n de esta)
+	 * @return true si ha sido modificada y false si no lo ha sido.
+	 */
+	public boolean isModified(int nCachePag) {
+		return modified[nCachePag];
+	}
+
+	/**
+	 * Consulta si una p�gina de cach� ha sido modificada desde que se carg� en cach� o no.
+	 * @param group Grupo en el que se encuentra la p�gina
+	 * @param posInGroup Posici�n dentro del grupo en el que est� la p�gina
+	 * @return true si ha sido modificada y false si no lo ha sido.
+	 */
+	public boolean isModified(int group, int posInGroup) {
+		return modified[group * getPagsPerGroup() + posInGroup];
+	}
+
+	/**
+	 * Pone como modificada una p�gina de cach�
+	 * @param nCachePag N�mero de p�gina de cach� (posici�n de esta)
+	 */
+	public void setModify(int nCachePag) {
+		modified[nCachePag] = true;	
+	}
+	
+	/**
+	 * Pone como modificada una p�gina de cach�
+	 * @param group Grupo en el que se encuentra la p�gina
+	 * @param posInGroup Posici�n dentro del grupo en el que est� la p�gina
+	 */
+	public void setModify(int group, int posInGroup) {
+		modified[group * getPagsPerGroup() + posInGroup] = true;	
+	}
+	
+	/**
+	 * Pone como no modificada una p�gina de cach�
+	 * @param nCachePag N�mero de p�gina de cach� (posici�n de esta)
+	 */
+	public void unsetModify(int nCachePag) {
+		modified[nCachePag] = false;	
+	}
+	
+	/**
+	 * Pone como no modificada una p�gina de cach�
+	 * @param group Grupo en el que se encuentra la p�gina
+	 * @param posInGroup Posici�n dentro del grupo en el que est� la p�gina
+	 */
+	public void unsetModify(int group, int posInGroup) {
+		modified[group * getPagsPerGroup() + posInGroup] = false;	
+	}
+	
+	/**
+	 * Obtiene el n�mero de p�ginas de la cach�
+	 * @return N�mero total de p�ginas de la cach�
+	 */
+	public int getNPags() {
+		return cacheStruct.getNPags();
+	}
+	
+	/**
+	 * Obtiene el n�mero de bandas
+	 * @return N�mero de bandas
+	 */
+	public int getNBands() {
+		return cacheStruct.getNBands();
+	}
+	
+	/**
+	 * Obtiene la estructura de ca cach�
+	 * @return CacheStruct
+	 */
+	public CacheStruct getCacheStruct() {
+		return cacheStruct;
+	}
+	
+	/**
+	 * Asigna la estructura de ca cach�
+	 * @param CacheStruct
+	 */
+	public void setCacheStruct(CacheStruct cacheStruct) {
+		this.cacheStruct = cacheStruct;
+	}
+	
+	/**
+	 * Obtiene el n�mero de grupos de cach�
+	 * @return N�mero de grupos
+	 */
+	public int getNGroups() {
+		return cacheStruct.getNGroups();
+	}
+	
+	/**
+	 * Obtiene el n�mero total de p�ginas del raster
+	 * @return N�mero total de p�ginas
+	 */
+	public int getNTotalPags() {
+		return cacheStruct.getNTotalPags();
+	}
+	
+	/**
+	 * Obtiene el array con los n�meros de p�gina que hay cargados
+	 * en cada bloque de cache
+	 * @return array con los n�mero de p�gina
+	 */
+	public int[] getPageNumberInCache() {
+		return this.pageNumberInCache;
+	}
+	
+	/**
+	 * Para extraer el desplazamiento de una direcci�n (l�nea de raster) hay que hacer una operaci�n And con 
+	 * con la altura de la p�gina -1. Por ejemplo, una p�gina de 16 l�neas de altura el desplazamiento ser�
+	 * 16 - 1 = 15 porque 15 en binario es 1111.
+	 * 
+	 * Si queremos acceder a la linea del raster n�mero 83 (1010011) realizando la operaci�n And con el valor del
+	 * desplazamiento obtenemos (0001111 & 1010011 = 0000011), es decir el valor 3 en decimal. Esto quiere decir
+	 * que la l�nea 83 del raster es la 3 de su p�gina. 
+	 * @return valor del desplazamiento
+	 */
+	public int getOffset() {
+		return cacheStruct.getOffset();
+	}
+	
+	/**
+	 * Convierte una p�gina dentro de un grupo de la cach� en un n�mero de 
+	 * p�gina de cach�. Por ejemplo, en una cach� de 10 grupos y 5 p�ginas por grupo
+	 * la p�gina 2 del grupo 4 devolver� el 23 (5 * 4 + 3 = 23) teniendo en cuenta que
+	 * la p�gina y el grupo cero tambi�n cuentan.  
+	 * @param group
+	 * @param pageInGroup
+	 * @return
+	 */
+	public int convertPageInGroupToPageInCache(int group, int pageInGroup) {
+		return (group * cacheStruct.getPagsPerGroup() + pageInGroup);
+	}
+
+	/**
+	 * Actualiza los �ltimos accesos del grupo pasado por par�metro. Se incrementar� 
+	 * uno en todas las p�ginas del conjunto a excepci�n de las que valen -1 ya que 
+	 * esto significa que no hay p�gina cargada en dicha posici�n.
+	 * @param group N�mero de grupo a actualizar sus accesos
+	 * @return La posici�n del elemento del grupo con valor m�ximo. Este elemento 
+	 * es el candidato para el reemplazo.
+	 */
+	public int updateLastAccess(int group) {
+		int max = Integer.MIN_VALUE;
+		int posMax = 0;
+		for(int i = 0; i < getPagsPerGroup(); i++) {
+			if(getLastAccess()[group][i] >= 0)
+				getLastAccess()[group][i] ++;
+			
+			if(getLastAccess()[group][i] > max) {
+				max = getLastAccess()[group][i];
+				posMax = i;
+			}
+		}
+		return posMax;
+	}
+	
+	/**
+	 * Obtiene la posici�n del grupo de la p�gina a reemplazar, es decir la de m�ximo valor
+	 * en el vector lastAccess.
+	 * @param group N�mero de grupo a obtener la p�gina de reemplazo
+	 * @return La posici�n del elemento del grupo con valor m�ximo. Este elemento 
+	 * es el candidato para el reemplazo.
+	 */
+	public int posInGroupPagToReplace(int group) {
+		int max = Integer.MIN_VALUE;
+		int posMax = 0;
+		for(int i = 0; i < getPagsPerGroup(); i++) {
+			if(getLastAccess()[group][i] > max) {
+				max = getLastAccess()[group][i];
+				posMax = i;
+			}
+		}
+		return posMax;
+	} 
+	
+	/**
+	 * Carga una p�gina especificada en el par�metro nPag con los datos necesarios. La
+	 * petici�n que ha de hacerse se calcula previamente con la estructura de la cach�.
+	 *   
+	 * @param group Grupo sobre el que se carga la p�gina nPag
+	 * @param posInGroupPageToReplace Posici�n dentro del grupo sobre el que se carga la p�gina
+	 * @param nPag P�gina a cargar
+	 */
+	public void loadPage(int group, int posInGroupPageToReplace, int nPag) {
+		page[group * getPagsPerGroup() + posInGroupPageToReplace].loadPage(nPag);
+	}
+	
+	/**
+	 * Salva una p�gina especificada en el par�metro nPag a disco. La
+	 * petici�n que ha de hacerse se calcula previamente con la estructura de la cach�.
+	 *   
+	 * @param group Grupo del que se salva la p�gina nPag
+	 * @param posInGroupPageToReplace Posici�n dentro del grupo del que se salva la p�gina
+	 * @param nPag P�gina a salvar
+	 * @throws IOException
+	 */
+	public void savePage(int group, int posInGroupPageToReplace, int nPag) throws IOException {
+		page[group * getPagsPerGroup() + posInGroupPageToReplace].savePage(nPag);
+	}
+
+	/**
+	 * Salva a disco todas las p�ginas en memoria cach� e inicializa estructuras de datos.
+	 * 
+	 * @throws IOException
+	 */
+	public void resetCache() throws IOException {
+		for (int iCachePage = 0; iCachePage < page.length; iCachePage++) { 
+			if(modified[iCachePage])
+				page[iCachePage].savePage(this.getRasterPageNumberInPosition(iCachePage));
+		}
+		initStructs();
+	}
+	
+	/**
+	 * Elimina una banda de la cach�. Antes salva a disco todos los trozos cacheados e inicializa
+	 * las estructuras de control de cach�. 
+	 * @param nBand N�mero de banda a eliminar
+	 * @throws IOException 
+	 */
+	public void deleteBand(int nBand) throws IOException {
+		resetCache();
+		for (int iPage = 0; iPage < hddPage.length; iPage++)
+			hddPage[iPage].deleteBand(nBand);
+	}
+	
+	/**
+	 * Asigna una banda de disco a todas las p�ginas.
+	 * @param cacheDataSource Fuente de las p�ginas. Es la referencia a disco de ellas.
+	 * @throws IOException 
+	 */
+	public void assignBand(int nBand, ICacheDataSource[] cacheDataSource) throws IOException {
+		resetCache();
+		for (int iPage = 0; iPage < hddPage.length; iPage++)
+			hddPage[iPage].assignBand(nBand, cacheDataSource[iPage]);
+	}
+	
+	/**
+	 * Obtiene la fuente de datos de una banda de una p�gina de disco.
+	 * @param nPage P�gina de la que se quiere la banda
+	 * @param nBand Banda de la que se quiere la fuente de datos
+	 * @return HddPage
+	 */
+	public ICacheDataSource getHddPage(int nPage, int nBand) {
+		return hddPage[nPage].getBandDataSource(nBand);
+	}
+	
+	/**
+	 * Consulta si alguna p�gina de memoria tiene modificaciones para volcar a disco
+	 * @return true si hay alguna p�gina con modificaciones y false si no la hay
+	 */
+	public boolean anyPageModified() {
+		for (int iPage = 0; iPage < modified.length; iPage++) {
+			if(modified[iPage])
+				return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Imprime la informaci�n de estructura de cach�
+	 */
+	public void show() {
+		cacheStruct.show();
+		System.out.println("Cacheada:");
+		for(int i = 0; i < cacheada.length; i++)
+			System.out.print(i + "=" + cacheada[i]+" ");
+		System.out.println();
+		System.out.println("LastAccess:");
+		for(int i = 0; i < cacheStruct.getNGroups(); i++) {
+			System.out.println("Grupo " + i +":");
+			for(int j = 0; j < cacheStruct.getPagsPerGroup(); j++)
+				System.out.println("elem " + j + " : " + "Page " + pageNumberInCache[i * cacheStruct.getPagsPerGroup() + j] + " : " + lastAccess[i][j]);
+		
+		}
+	}
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/Cache.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataFromDriverServer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataFromDriverServer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataFromDriverServer.java	(revision 15423)
@@ -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.impl.buffer.cache;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.store.RasterQuery;
+import org.gvsig.raster.impl.buffer.SpiRasterQuery;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.store.DefaultRasterStore;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Servidor de datos de cach�. Esta clase es la encargada de recuperar las p�ginas
+ * cuando le son solicitadas. Implementar� el interfaz ICacheDataSource, aunque esta
+ * clase se encargar� de servir p�ginas de solo lectura. Las p�ginas son servidas directamente desde
+ * un RasterDataset y un objeto de este tipo representa a una sola p�gina, por lo que tendr� asociado
+ * el extent correspondiente al trozo de p�gina que sirve.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class CacheDataFromDriverServer implements ICacheDataSource {
+	private Logger                          log           = LoggerFactory.getLogger(CacheDataFromDriverServer.class);
+	private AbstractRasterProvider          provider      = null;
+	private Extent                          pageExtent    = null;
+
+	/**
+	 * Constructor.
+	 * Crea el identificador para todos los trozos de cach� que se guardar�n en disco.
+	 * @param id Identificador de fichero. Si este es null se calcula uno autom�ticamente
+	 * @param numBand N�mero de banda
+	 * @param numPag N�mero de p�gina
+	 * @throws RasterDriverException
+	 * @throws NotSupportedExtensionException
+	 */
+	public CacheDataFromDriverServer(RasterProvider provider, int numPag, Extent extent) {
+		if(provider instanceof AbstractRasterProvider)
+			this.provider = (AbstractRasterProvider)provider;
+		pageExtent = extent;
+	}
+
+	public void loadPage(PageBandBuffer pageBuffer) throws ProcessInterruptedException {
+		//Creamos un BandList con todas las bandas del fichero
+		/*BandList bandList = new BandListImpl();
+		for(int i = 0; i < provider.getBandCount();i++) {
+			try {
+				DatasetBand band = new DatasetBandImpl(provider.getURIByBand(i), i, provider.getDataType()[i], provider.getBandCount());
+				bandList.addBand(band, i);
+			} catch(BandNotFoundInListException ex) {
+				//No a�adimos la banda
+			}
+		}*/
+		try {
+			DefaultRasterStore store = new DefaultRasterStore();
+			store.setProvider(provider);
+
+			RasterQuery q = RasterLocator.getManager().createQuery();
+			q.setAreaOfInterest(pageExtent, pageBuffer.getWidth(), pageBuffer.getHeight());
+			q.setAllDrawableBands();
+			q.setBufferForProviders(pageBuffer);
+
+			provider.getDataSet((SpiRasterQuery)q);
+			//dataset.getWindow(pageExtent, bandList, pageBuffer);
+		} catch (RasterDriverException e) {
+			log.debug("Error loading the PageBandBuffer", e);
+		} catch (QueryException e) {
+			log.debug("Error loading the PageBandBuffer", e);
+		}
+	}
+
+	public void savePage(PageBandBuffer pageBuffer) throws IOException {
+		//Read Only
+	}
+
+	public void delete() {
+		//Read Only
+	}
+
+	public String getPath() {
+		if(provider != null) {
+            URI uriOfFirstProvider = provider.getURIOfFirstProvider();
+            if("FILE".equalsIgnoreCase(uriOfFirstProvider.getScheme())){
+                return new File(uriOfFirstProvider).getAbsolutePath();
+            } else {
+                return uriOfFirstProvider.getPath();
+            }
+        }
+		return null;
+	}
+}
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataFromDriverServer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataServer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataServer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataServer.java	(revision 15423)
@@ -0,0 +1,438 @@
+/* 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.impl.buffer.cache;
+
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.io.BufferedInputStream;
+import java.io.BufferedOutputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+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.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.store.DefaultRasterStore;
+import org.gvsig.raster.impl.store.ParamImpl;
+
+/**
+ * Servidor de datos de cach�. Esta clase es la encargada de volcar a disco las
+ * p�ginas de cach� y recuperar las cuando le son solicitadas. Por ello debe
+ * implementar el interfaz ICacheDataSource con dos m�todos loadPage y savePage.
+ * 
+ * Ambos a partir del n�mero de p�gina recuperaran o salvaran de/a disco una p�gina.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class CacheDataServer implements ICacheDataSource {
+	
+	/**
+	 * Directorio temporal para la cach�. Si gastamos el mismo que andami este se ocupar� de gestionar su
+	 * destrucci�n al cerrar gvSIG.
+	 */
+	private String     tempDirectoryPath  = null;
+	private String     id                 = null;        // Identificador de fichero.
+    private FileUtils  file               = RasterLocator.getManager().getFileUtils();
+
+	 
+	/**
+	 * Constructor. 
+	 * Crea el identificador para todos los trozos de cach� que se guardar�n en disco. 
+	 * @param id Identificador de fichero. Si este es null se calcula uno autom�ticamente
+	 * @param numBand N�mero de banda
+	 * @param numPag N�mero de p�gina
+	 */
+	public CacheDataServer(String id, int numBand, int numPag) {
+		tempDirectoryPath = file.getTemporalPath();
+		setName(id, numBand, numPag);
+	}
+
+	/**
+	 * Crea el identificador para todos los trozos de cach� que se guardar�n en disco. 
+	 * @param id Identificador de fichero. Si este es null se calcula uno autom�ticamente
+	 * @param numBand N�mero de banda
+	 * @param numPag N�mero de p�gina
+	 */
+	public void setName(String id, int numBand, int numPag) {
+		String oldFileName = tempDirectoryPath + File.separator + this.id;
+
+		if (id == null)
+			this.id = Long.toString(System.currentTimeMillis()) + "-" + numPag + "-" + numBand;
+		else
+			this.id = id + "-" + numPag + "-" + numBand;
+
+		String newFileName = tempDirectoryPath + File.separator + this.id;
+		File newFile = new File(newFileName);
+		File oldFile = new File(oldFileName);
+		if (oldFile.exists())
+			oldFile.renameTo(newFile);
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.gvsig.fmap.dataaccess.cache.ICacheDataSource#loadPage(int, org.gvsig.fmap.dataaccess.cache.PageBuffer)
+	 */
+	public void loadPage(PageBandBuffer pageBuffer) {
+		String inFileName = tempDirectoryPath + File.separator + id;
+
+		File file = new File(inFileName);
+		if (!file.exists())
+			return;
+
+		DataInputStream dis;
+		try {
+			dis = new DataInputStream(new BufferedInputStream(new FileInputStream(file)));
+			read(dis, pageBuffer);
+			dis.close();
+		} catch (FileNotFoundException e) {
+			return;
+		} catch (IOException ex) {
+			// TODO: EXCEPTION: Lanzar IO y FileNotFound
+			ex.printStackTrace();
+			return;
+		} 
+	}
+
+	public void savePage(PageBandBuffer pageBuffer) throws IOException {
+		tempDirectoryPath = file.getTemporalPath();
+		String fileName = tempDirectoryPath + File.separator + id;
+
+		File f = new File(fileName);
+		DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f)));
+		save(dos, pageBuffer);
+		dos.close();
+	}
+	
+	public void delete() {
+		String fileName = tempDirectoryPath + File.separator + id;
+		File f = new File(fileName);
+		if (f.exists()) {
+			f.delete();
+		}
+	}
+	
+	public String getPath() {
+		return tempDirectoryPath + File.separator + id;
+	}
+	
+	//TODO: TEST: Implementar y probar el cacheado para tipos de datos != de byte
+	/**
+	 * Tilea un raster en disco para que sea accesible por la cach�.
+	 * @param fileName Nombre del fichero a tilear
+	 * @param pageLines N�mero de l�neas de cada tile
+	 * @throws IOException
+	 * @throws RasterDriverException 
+	 * @throws NotSupportedExtensionException 
+	 * @throws QueryException 
+	 */
+	public void cachear(String fileName, int pageLines)
+			throws IOException, NotSupportedExtensionException, RasterDriverException, ProcessInterruptedException, QueryException {
+		if (id == null)
+			id = Long.toString(System.currentTimeMillis());
+
+		AbstractRasterProvider provider = AbstractRasterProvider.singleDatasetInstance(null, fileName);
+
+		int pages = (int) Math.ceil(provider.getHeight() / pageLines);
+
+		tempDirectoryPath = file.getTemporalPath();
+
+		//PageBandBuffer pageBuffer = new PageBandBuffer(provider.getDataType()[0], (int)provider.getWidth(), pageLines, provider.getBandCount(), true, 0);
+		Buffer pageBuffer = null;
+		DefaultRasterStore store = new DefaultRasterStore();
+		store.setProvider(provider);
+		int y = 0;
+		for (int i = 0; i < pages; i++) {
+			RasterQuery q = RasterLocator.getManager().createQuery();
+			q.setAreaOfInterest(new Rectangle((int)0, y, (int)provider.getWidth(), pageLines));
+			q.setAllDrawableBands();
+			pageBuffer = store.query(q);
+			
+			//grf.getWindow(0, y, pageBuffer.getWidth(), pageBuffer.getHeight(), bandList, pageBuffer);
+			String outFileName = tempDirectoryPath + File.separator + id + "-" + i;
+
+			File f = new File(outFileName);
+			DataOutputStream dos = new DataOutputStream(new BufferedOutputStream(new FileOutputStream(f)));
+			save(dos, pageBuffer);
+			dos.close();
+			y += pageLines;
+		}
+		
+		//Solo para pruebas
+		//convertFromByteFileToTif(grf, pageBuffer, pageLines);
+	}
+	
+	/**
+	 * Funci�n para pruebas.
+	 * Convierte los ficheros generados por la funci�n cachear en ficheros tif para comprobar que est�n
+	 * bien generados.
+	 * @param grf
+	 * @param pageBuffer
+	 * @param pageLines
+	 * @throws IOException
+	 * @deprecated Este m�todo no se usa pero es necesario para testeo
+	 */
+	public void convertFromByteFileToTif(AbstractRasterProvider grf, PageBandBuffer pageBuffer, int pageLines)throws IOException, ProcessInterruptedException {
+		int w = pageBuffer.getWidth();
+		int h = pageBuffer.getHeight();
+		int pages = (int) Math.ceil(grf.getHeight() / pageLines);
+
+		RasterWriter grw = null;
+		PageBandBuffer pageBuffer2 = new PageBandBuffer(grf.getDataType()[0], (int)grf.getWidth(), pageLines, grf.getBandCount(), true, 0);
+		for (int i = 0; i < pages; i++) {
+			String inFileName = tempDirectoryPath + File.separator + id + "-" + i;
+			File f = new File(inFileName);
+			DataInputStream dis = new DataInputStream(new BufferedInputStream(new FileInputStream(f)));
+			byte[] b;
+			switch (pageBuffer.getDataType()) {
+				case 0:
+					b = new byte[pageBuffer.getWidth() * pageBuffer.getHeight() * pageBuffer.getBandCount()];
+					dis.readFully(b);
+					for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++) {
+						for (int line = 0; line < pageBuffer.getHeight(); line++) {
+							byte[] linea = new byte[w];
+							for (int d = 0; d < linea.length; d++)
+								linea[d] = b[(iBand * w * h) + (line * w) + d];
+							pageBuffer2.setLineInBandByte(linea, line, iBand);
+						}
+					}
+					break;
+			}
+			dis.close();
+			DataServerWriter dataWriter1 = new WriterBufferCompleteServer(pageBuffer2);
+			try {
+				RasterWriter writer = DefaultRasterManager.getInstance().createWriter(inFileName + ".tif");
+				Params params = writer.getParams();
+				int newPosBlockSize = 7;
+				ParamImpl p = (ParamImpl)params.getParamById("blocksize");
+				for (int j = 0; j < p.getList().length; j++) {
+					if (p.getList()[i].equals(String.valueOf(pageLines)))
+						newPosBlockSize = j;
+				}
+				params.changeParamValue("blocksize", new Integer(newPosBlockSize));
+				grw = DefaultRasterManager.getInstance().createWriter(dataWriter1, 
+												inFileName + ".tif", 
+												pageBuffer2.getBandCount(),
+												new AffineTransform(),
+												pageBuffer2.getWidth(), 
+												pageBuffer2.getHeight(), 
+												pageBuffer2.getDataType(), 
+												params,
+												null);
+			} catch (NotSupportedExtensionException e) {
+				e.printStackTrace();
+			} catch (RasterDriverException e) {
+				e.printStackTrace();
+			}
+			grw.dataWrite();
+			grw.writeClose();
+		}
+	}
+	
+	/**
+	 * Salva un PageBuffer sobre un stream DataOutpuStream dependiendo del tipo de dato del 
+	 * buffer.
+	 * @param dos DataOutputStream 
+	 * @param pageBuffer PageBuffer
+	 * @throws IOException
+	 */
+	private void save(DataOutputStream dos, Buffer pageBuffer) throws IOException {
+		switch (pageBuffer.getDataType()) {
+			case Buffer.TYPE_BYTE:
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++)
+					for (int line = 0; line < pageBuffer.getHeight(); line++)
+//						for(int col = 0; col < pageBuffer.getWidth(); col ++)
+//							dos.writeByte(pageBuffer.getElemByte(line, col, iBand));
+						dos.write(pageBuffer.getLineFromBandByte(line, iBand));
+				break;
+			case Buffer.TYPE_SHORT:
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++)
+					for (int line = 0; line < pageBuffer.getHeight(); line++)
+						for (int col = 0; col < pageBuffer.getWidth(); col++)
+							dos.writeShort(pageBuffer.getElemShort(line, col, iBand));
+				break;
+			case Buffer.TYPE_INT:
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++)
+					for (int line = 0; line < pageBuffer.getHeight(); line++)
+						for (int col = 0; col < pageBuffer.getWidth(); col++)
+							dos.writeInt(pageBuffer.getElemInt(line, col, iBand));
+				break;
+			case Buffer.TYPE_FLOAT:
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++)
+					for (int line = 0; line < pageBuffer.getHeight(); line++)
+						for (int col = 0; col < pageBuffer.getWidth(); col++)
+							dos.writeFloat(pageBuffer.getElemFloat(line, col, iBand));
+				break;
+			case Buffer.TYPE_DOUBLE:
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++)
+					for (int line = 0; line < pageBuffer.getHeight(); line++)
+						for (int col = 0; col < pageBuffer.getWidth(); col++)
+							dos.writeDouble(pageBuffer.getElemDouble(line, col, iBand));
+				break;
+		}
+	}
+	
+	/**
+	 * Carga un PageBuffer desde un stream DataInputStream dependiendo del tipo de dato del 
+	 * buffer.
+	 * @param dis DataInputStream
+	 * @param pageBuffer PageBuffer
+	 * @throws IOException
+	 */
+	private void read(DataInputStream dis, PageBandBuffer pageBuffer) throws IOException {
+		int w = pageBuffer.getWidth();
+		int h = pageBuffer.getHeight();
+		int wxh = w * h;
+		int j = 0;
+		switch (pageBuffer.getDataType()) {
+			case Buffer.TYPE_BYTE:
+				byte[] b = new byte[pageBuffer.getWidth() * pageBuffer.getHeight() * pageBuffer.getBandCount()];
+				dis.readFully(b);
+				// while(j < b.length){ b[j] = dis.readByte(); j ++; }
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++) {
+					for (int line = 0; line < pageBuffer.getHeight(); line++) {
+						byte[] linea = new byte[w];
+						for (int d = 0; d < linea.length; d++)
+							linea[d] = b[(iBand * wxh) + (line * w) + d];
+						pageBuffer.setLineInBandByte(linea, line, iBand);
+					}
+				}
+				break;
+			case Buffer.TYPE_SHORT:
+				short[] s = new short[pageBuffer.getWidth() * pageBuffer.getHeight() * pageBuffer.getBandCount()];
+				while (j < s.length) {
+					s[j] = dis.readShort();
+					j++;
+				}
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++) {
+					for (int line = 0; line < pageBuffer.getHeight(); line++) {
+						short[] linea = new short[w];
+						for (int x = 0; x < linea.length; x++)
+							linea[x] = s[(iBand * wxh) + (line * w) + x];
+						pageBuffer.setLineInBandShort(linea, line, iBand);
+					}
+				}
+				break;
+			case Buffer.TYPE_INT:
+				int[] i = new int[pageBuffer.getWidth() * pageBuffer.getHeight() * pageBuffer.getBandCount()];
+				while (j < i.length) {
+					i[j] = dis.readInt();
+					j++;
+				}
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++) {
+					for (int line = 0; line < pageBuffer.getHeight(); line++) {
+						int[] linea = new int[w];
+						for (int x = 0; x < linea.length; x++)
+							linea[x] = i[(iBand * wxh) + (line * w) + x];
+						pageBuffer.setLineInBandInt(linea, line, iBand);
+					}
+				}
+				break;
+			case Buffer.TYPE_FLOAT:
+				float[] f = new float[pageBuffer.getWidth() * pageBuffer.getHeight() * pageBuffer.getBandCount()];
+				while (j < f.length) {
+					f[j] = dis.readFloat();
+					j++;
+				}
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++) {
+					for (int line = 0; line < pageBuffer.getHeight(); line++) {
+						float[] linea = new float[w];
+						for (int x = 0; x < linea.length; x++)
+							linea[x] = f[(iBand * wxh) + (line * w) + x];
+						pageBuffer.setLineInBandFloat(linea, line, iBand);
+					}
+				}
+				break;
+			case Buffer.TYPE_DOUBLE:
+				double[] d = new double[pageBuffer.getWidth() * pageBuffer.getHeight() * pageBuffer.getBandCount()];
+				while (j < d.length) {
+					d[j] = dis.readDouble();
+					j++;
+				}
+				for (int iBand = 0; iBand < pageBuffer.getBandCount(); iBand++) {
+					for (int line = 0; line < pageBuffer.getHeight(); line++) {
+						double[] linea = new double[w];
+						for (int x = 0; x < linea.length; x++)
+							linea[x] = d[(iBand * wxh) + (line * w) + x];
+						pageBuffer.setLineInBandDouble(linea, line, iBand);
+					}
+				}
+				break;
+		}
+	}
+	
+	//---------------------------------------------------------------
+	//TILEADO A BASE DE TIFF: Desechado porque es muy lento
+	
+	/*public void loadPage(int nPag, PageBuffer pageBuffer) {
+		String fileName =  tempDirectoryPath + File.separator + id + "-" + nPag + ".tif";
+		File file = new File(id);
+		if(!file.exists())
+			return; //El trozo no ha sido volcado a disco por lo que no se carga.
+		
+		GeoRasterFile grf = GeoRasterFile.openFile(null, fileName);
+		
+		//Creamos un BandList con todas las bandas del fichero
+		BandList bandList = new BandList();
+		for(int i = 0; i < grf.getBandCount();i++){
+			try{
+				Band band = new Band(grf.getName(), i, grf.getDataType());
+				bandList.addBand(band, i);
+			}catch(BandFoundInListException ex){
+				//No a�adimos la banda
+			}
+		}
+		grf.getWindowRaster(0, 0, grf.getWidth(), grf.getHeight(), bandList, pageBuffer);
+	}*/
+
+	
+	/*public void savePage(int nPag, PageBuffer pageBuffer) throws IOException {
+		createTempDirectory();
+		String fileName =  tempDirectoryPath + File.separator + id + "-" + nPag + ".tif";
+		IDataWriter dataWriter = new WriterBufferServer(pageBuffer);
+		GeoRasterWriter grw = GeoRasterWriter.getWriter(dataWriter, 
+														fileName, 
+														pageBuffer.getHeight(), //Block size 
+														pageBuffer.getBandCount(),
+														new Extent(0, 0, pageBuffer.getWidth() - 1, pageBuffer.getHeight() - 1), 
+														0, 
+														pageBuffer.getWidth(), 
+														pageBuffer.getHeight(), 
+														pageBuffer.getDataType());
+		grw.dataWrite();
+		grw.writeClose();
+		
+	}*/
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/CacheDataServer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterCache.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterCache.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterCache.java	(revision 15423)
@@ -0,0 +1,771 @@
+/* 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.impl.buffer.cache;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Band;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.raster.impl.buffer.RasterBand;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+
+/*
+ * TODO: OPTIMIZACION: Trabajo de optimizaci�n en la velocidad e acceso a cach�.
+ * TODO: FUNCIONALIDAD: Acabar de implementar los m�todos de acceso a datos, intercambio de bandas, etc...
+ */
+/**
+ * Esta clase representa un buffer de datos cacheado. El estar en cache significa que
+ * solo una parte de los datos estar�n en memoria y que gestiona, dependiendo de las
+ * peticiones, que partes hay que cargar a memoria y en que momento. Para esto el buffer
+ * no se llena de golpe sino que utiliza una clase que sirve los datos desde la fuente.
+ * Esta clase servidora de datos debe implementar el interfaz ICacheDatasetSourcepara
+ * servir datos de la forma requerida.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterCache extends RasterBuffer {
+
+	private Cache 			cache    = null;
+	private LRUAlgorithm  	lru      = null;
+	private int             lastLine = -1;
+
+	//TODO: FUNCIONALIDAD: Intercambio de bandas para el buffer cacheado
+
+	 public class CacheBand extends RasterBand {
+		 public ICacheDataSource[] cacheDataServer = null;
+
+		 public CacheBand(int height, int width){
+			 super(height, width);
+		 }
+
+		 public Object getLine(int line) {
+			 return null;
+		 }
+
+		 public void setLine(int line, Object value) {
+
+		 }
+
+		 public Object getBuf() {
+			 return null;
+		 }
+
+		 public void setFileName(int numBand){
+			for (int i = 0; i < cacheDataServer.length; i++)
+				((CacheDataServer)cacheDataServer[i]).setName(null, numBand, i);
+		 }
+
+		 public void dispose() {
+			 for (int i = 0; i < cacheDataServer.length; i++) {
+				 cacheDataServer[i] = null;
+			 }
+			 cacheDataServer = null;
+		 }
+	}
+
+    /**
+     * Constructor. Asigna las variables de inicializaci�n y crea la estructura de
+     * la cach� con los datos pasados.
+     * @param dataType Tipo de dato del buffer
+     * @param width Ancho del buffer
+     * @param height Alto del buffer
+     * @param nBands N�mero de bandas del buffer
+     */
+	public RasterCache(int dataType, int width, int height, int nBands){
+		cache = new Cache(nBands, dataType, width, height);
+		lru = new LRUAlgorithm(cache);
+
+    	this.dataType = dataType;
+        this.width = width;
+        this.height = height;
+        this.nBands = nBands;
+	}
+
+	/**
+	 * Limpia los trozos de cach� en disco. Despu�s del llamar a este
+	 * m�todo no puede volver a usarse esta cach�.
+	 * @throws IOException
+	 */
+	public void clearCache() throws IOException {
+		cache.clearCache(this.nBands);
+	}
+
+    public boolean isBandSwitchable(){
+    	return true;
+    }
+
+	public void malloc(int dataType, int width, int height, int bandNr) {
+	}
+
+	/**
+	 * Obtiene la cach�
+	 * @return
+	 */
+	public Cache getCache() {
+		return cache;
+	}
+
+	/**
+	 * Asigna la cache
+	 * @param cache
+	 */
+	public void setCache(Cache cache) {
+		this.cache = cache;
+		this.lru.setCache(cache);
+	}
+
+//*********************************************************
+
+	public byte[][] getLineByte(int line) {
+        if (exists(line)) {
+            return cache.getAccessPage()
+                .getLineByte((line & cache.getOffset()));
+        }
+        return null;
+	}
+
+	public short[][] getLineShort(int line) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineShort(
+                (line & cache.getOffset()));
+        }
+        return null;
+	}
+
+	public int[][] getLineInt(int line) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineInt((line & cache.getOffset()));
+        }
+        return null;
+	}
+
+	public float[][] getLineFloat(int line) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineFloat(
+                (line & cache.getOffset()));
+        }
+        return null;
+	}
+
+	public double[][] getLineDouble(int line) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineDouble(
+                (line & cache.getOffset()));
+        }
+        return null;
+	}
+
+	//*********************************************************
+
+	public void setLineByte(byte[][] data, int line) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineByte(data, (line & cache.getOffset()));
+        }
+	}
+
+	public void setLineShort(short[][] data, int line) {
+        if (exists(line)) {
+            cache.getAccessPage()
+                .setLineShort(data, (line & cache.getOffset()));
+        }
+	}
+
+	public void setLineInt(int[][] data, int line) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineInt(data, (line & cache.getOffset()));
+        }
+	}
+
+	public void setLineFloat(float[][] data, int line) {
+        if (exists(line)) {
+            cache.getAccessPage()
+                .setLineFloat(data, (line & cache.getOffset()));
+        }
+	}
+
+	public void setLineDouble(double[][] data, int line) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineDouble(data, (line & cache.getOffset()));
+        }
+	}
+
+	//*********************************************************
+
+	public byte[] getLineFromBandByte(int line, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineFromBandByte(
+                (line & cache.getOffset()), band);
+        }
+        return null;
+	}
+
+	public short[] getLineFromBandShort(int line, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineFromBandShort(
+                (line & cache.getOffset()), band);
+        }
+        return null;
+	}
+
+	public int[] getLineFromBandInt(int line, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineFromBandInt(
+                (line & cache.getOffset()), band);
+        }
+        return null;
+	}
+
+	public float[] getLineFromBandFloat(int line, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineFromBandFloat(
+                (line & cache.getOffset()), band);
+        }
+        return null;
+	}
+
+	public double[] getLineFromBandDouble(int line, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getLineFromBandDouble(
+                (line & cache.getOffset()), band);
+        }
+        return null;
+	}
+
+	//*********************************************************
+
+	public void setLineInBandByte(byte[] data, int line, int band) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineInBandByte(data,
+                (line & cache.getOffset()), band);
+        }
+	}
+
+	public void setLineInBandShort(short[] data, int line, int band) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineInBandShort(data,
+                (line & cache.getOffset()), band);
+        }
+	}
+
+	public void setLineInBandInt(int[] data, int line, int band) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineInBandInt(data,
+                (line & cache.getOffset()), band);
+        }
+	}
+
+	public void setLineInBandFloat(float[] data, int line, int band) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineInBandFloat(data,
+                (line & cache.getOffset()), band);
+        }
+	}
+
+	public void setLineInBandDouble(double[] data, int line, int band) {
+        if (exists(line)) {
+            cache.getAccessPage().setLineInBandDouble(data,
+                (line & cache.getOffset()), band);
+        }
+	}
+
+	//*********************************************************
+
+	public byte getElemByte(int line, int col, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getElemByte(
+                (line & cache.getOffset()), col, band);
+		}
+        return getNoDataValue().isDefined() ? getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue; // No leemos el dato
+	}
+
+	public short getElemShort(int line, int col, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getElemShort(
+                (line & cache.getOffset()), col, band);
+		}
+        return getNoDataValue().isDefined() ? getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue; // No leemos el dato
+	}
+
+	public int getElemInt(int line, int col, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getElemInt((line & cache.getOffset()),
+                col, band);
+		}
+        return getNoDataValue().isDefined() ? getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue; // No leemos el dato
+	}
+
+	public float getElemFloat(int line, int col, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getElemFloat(
+                (line & cache.getOffset()), col, band);
+		}
+        return getNoDataValue().isDefined() ? getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue; // No leemos el dato
+	}
+
+	public double getElemDouble(int line, int col, int band) {
+        if (exists(line)) {
+            return cache.getAccessPage().getElemDouble(
+                (line & cache.getOffset()), col, band);
+		}
+        return getNoDataValue().isDefined() ? getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue; // No leemos el dato
+	}
+
+	//*********************************************************
+
+	public void setElem(int line, int col, int band, byte data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElem((line & cache.getOffset()), col,
+                band, data);
+        }
+	}
+
+	public void setElem(int line, int col, int band, short data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElem((line & cache.getOffset()), col,
+                band, data);
+        }
+	}
+
+	public void setElem(int line, int col, int band, int data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElem((line & cache.getOffset()), col,
+                band, data);
+        }
+	}
+
+	public void setElem(int line, int col, int band, float data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElem((line & cache.getOffset()), col,
+                band, data);
+        }
+	}
+
+	public void setElem(int line, int col, int band, double data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElem((line & cache.getOffset()), col,
+                band, data);
+        }
+	}
+
+	//*********************************************************
+
+	public void getElemByte(int line, int col, byte[] data) {
+        if (!exists(line)) {
+			for (int iBand = 0; iBand < data.length; iBand++)
+	            data[iBand] =  getNoDataValue().isDefined() ? getNoDataValue().getValue().byteValue() : RasterLibrary.defaultByteNoDataValue;
+		}
+		cache.getAccessPage().getElemByte((line & cache.getOffset()), col, data);
+	}
+
+	public void getElemShort(int line, int col, short[] data) {
+        if (!exists(line)) {
+			for (int iBand = 0; iBand < data.length; iBand++)
+	            data[iBand] =  getNoDataValue().isDefined() ? getNoDataValue().getValue().shortValue() : RasterLibrary.defaultShortNoDataValue;
+		}
+		cache.getAccessPage().getElemShort((line & cache.getOffset()), col, data);
+	}
+
+	public void getElemInt(int line, int col, int[] data) {
+        if (!exists(line)) {
+			for (int iBand = 0; iBand < data.length; iBand++)
+	            data[iBand] =  getNoDataValue().isDefined() ? getNoDataValue().getValue().intValue() : RasterLibrary.defaultIntegerNoDataValue;
+		}
+		cache.getAccessPage().getElemInt((line & cache.getOffset()), col, data);
+	}
+
+	public void getElemFloat(int line, int col, float[] data) {
+        if (!exists(line)) {
+			for (int iBand = 0; iBand < data.length; iBand++)
+	            data[iBand] = getNoDataValue().isDefined() ? getNoDataValue().getValue().floatValue() : RasterLibrary.defaultFloatNoDataValue;;
+		}
+		cache.getAccessPage().getElemFloat((line & cache.getOffset()), col, data);
+	}
+
+	public void getElemDouble(int line, int col, double[] data) {
+        if (!exists(line)) {
+			for (int iBand = 0; iBand < data.length; iBand++)
+	            data[iBand] =  getNoDataValue().isDefined() ? getNoDataValue().getValue().doubleValue() : RasterLibrary.defaultDoubleNoDataValue;;
+		}
+		cache.getAccessPage().getElemDouble((line & cache.getOffset()), col, data);
+	}
+
+	//*********************************************************
+
+    private boolean exists(int line) {
+        // Store the last line checked so we don't check it again for each
+        // pixel of the same line
+        if (line != lastLine) {
+            try {
+                lru.cacheAccess(line, false);
+                this.lastLine = line;
+            } catch (InvalidPageNumberException e) {
+                return false;
+            }
+        }
+        return true;
+    }
+
+    public void setElemByte(int line, int col, byte[] data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElemByte((line & cache.getOffset()), col,
+                data);
+        }
+    }
+
+    public void setElemShort(int line, int col, short[] data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElemShort((line & cache.getOffset()), col,
+                data);
+        }
+    }
+
+    public void setElemInt(int line, int col, int[] data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElemInt((line & cache.getOffset()), col,
+                data);
+        }
+    }
+
+    public void setElemFloat(int line, int col, float[] data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElemFloat((line & cache.getOffset()), col,
+                data);
+        }
+    }
+
+    public void setElemDouble(int line, int col, double[] data) {
+        if (exists(line)) {
+            cache.getAccessPage().setElemDouble((line & cache.getOffset()),
+                col, data);
+        }
+    }
+
+    public Buffer getBandBuffer(int Band){
+    	RasterCache rasterCache = new RasterCache(getDataType(), getWidth(), getHeight(), 1);
+    	CacheStruct cs = new CacheStruct();
+    	cs.setHPag(cache.getCacheStruct().getHPag());
+    	cs.setOffset(cache.getCacheStruct().getOffset());
+    	cs.setNPags(cache.getCacheStruct().getNPags());
+    	cs.setNBands(1);
+    	cs.setNGroups(cache.getCacheStruct().getNGroups());
+    	cs.setBitsPag(cache.getCacheStruct().getBitsPag());
+    	cs.setNTotalPags((int)(getHeight() / cache.getCacheStruct().getHPag()));
+    	cs.setDataType(cache.getCacheStruct().getDataType());
+
+    	Cache c = new Cache(cs, getWidth());
+    	rasterCache.setCache(c);
+
+    	Band band = getBand(Band);
+    	rasterCache.assignBand(0, band);
+    	return rasterCache;
+    }
+
+	public void replicateBand(int orig, int dest) {
+	}
+
+    public void switchBands(int[] bandPosition){
+
+    }
+
+	//*********************************************************
+
+	public void assign(int band, byte value) {
+		for(int line = 0; line < height; line ++){
+			boolean beginLine = true;  //Para acelerar solo comprobar� si la p�gina est� en cach� cada vez que empieza una l�nea
+    		for(int col = 0; col < width; col ++){
+    			try {
+    				if(beginLine){
+    					lru.cacheAccess(line, false);
+    					beginLine = false;
+    				}
+    			} catch (InvalidPageNumberException e) {return;}
+    			cache.getAccessPage().setElem((line & cache.getOffset()), col, band, value);
+    		}
+		}
+	}
+
+	public void assign(int band, short value) {
+		for(int line = 0; line < height; line ++){
+			boolean beginLine = true;  //Para acelerar solo comprobar� si la p�gina est� en cach� cada vez que empieza una l�nea
+    		for(int col = 0; col < width; col ++){
+    			try {
+    				if(beginLine){
+    					lru.cacheAccess(line, false);
+    					beginLine = false;
+    				}
+    			} catch (InvalidPageNumberException e) {return;}
+    			cache.getAccessPage().setElem((line & cache.getOffset()), col, band, value);
+    		}
+		}
+	}
+
+	public void assign(int band, int value) {
+		for(int line = 0; line < height; line ++){
+			boolean beginLine = true;  //Para acelerar solo comprobar� si la p�gina est� en cach� cada vez que empieza una l�nea
+    		for(int col = 0; col < width; col ++){
+    			try {
+    				if(beginLine){
+    					lru.cacheAccess(line, false);
+    					beginLine = false;
+    				}
+    			} catch (InvalidPageNumberException e) {return;}
+    			cache.getAccessPage().setElem((line & cache.getOffset()), col, band, value);
+    		}
+		}
+	}
+
+	public void assign(int band, float value) {
+		for(int line = 0; line < height; line ++){
+			boolean beginLine = true;  //Para acelerar solo comprobar� si la p�gina est� en cach� cada vez que empieza una l�nea
+    		for(int col = 0; col < width; col ++){
+    			try {
+    				if(beginLine){
+    					lru.cacheAccess(line, false);
+    					beginLine = false;
+    				}
+    			} catch (InvalidPageNumberException e) {return;}
+    			cache.getAccessPage().setElem((line & cache.getOffset()), col, band, value);
+    		}
+		}
+	}
+
+	public void assign(int band, double value) {
+		for(int line = 0; line < height; line ++){
+			boolean beginLine = true;  //Para acelerar solo comprobar� si la p�gina est� en cach� cada vez que empieza una l�nea
+    		for(int col = 0; col < width; col ++){
+    			try {
+    				if(beginLine){
+    					lru.cacheAccess(line, false);
+    					beginLine = false;
+    				}
+    			} catch (InvalidPageNumberException e) {return;}
+    			cache.getAccessPage().setElem((line & cache.getOffset()), col, band, value);
+    		}
+		}
+	}
+
+    public Buffer cloneBuffer(){
+    	return null;
+    }
+
+	public void interchangeBands(int band1, int band2) {
+		Band b1 = getBand(band1);
+		Band b2 = getBand(band2);
+
+		try {
+			cache.assignBand(band2, ((CacheBand)b1).cacheDataServer);
+			cache.assignBand(band1, ((CacheBand)b2).cacheDataServer);
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+	}
+
+    public void mallocOneBand(int dataType, int width, int height, int band) {
+
+	}
+
+    public Band getBand(int band) {
+    	CacheBand cb = new CacheBand(getHeight(), getWidth());
+    	cb.cacheDataServer = new CacheDataServer[cache.getNTotalPags()];
+
+    	try {
+			cache.resetCache();
+		} catch (IOException e) {
+			//TODO: EXCEPCIONES: Modificar el manejo de excepciones de RasterBuffer para q lance las apropiadas con cach�
+			return null;
+		}
+    	for (int iPage = 0; iPage < cache.getNTotalPags(); iPage++)
+    		cb.cacheDataServer[iPage] = cache.getHddPage(iPage, band);
+
+    	return cb;
+    }
+
+	public void copyBand(int nBand, Band band) {
+		FileUtils fileUtils = RasterLocator.getManager().getFileUtils();
+		if(band instanceof CacheBand){
+			CacheBand cb = new CacheBand(band.getHeight(), band.getWidth());
+			cb.cacheDataServer = new CacheDataServer[((CacheBand)band).cacheDataServer.length];
+
+			for (int iPage = 0; iPage < cb.cacheDataServer.length; iPage++) {
+				cb.cacheDataServer[iPage] = new CacheDataServer(null, nBand, iPage);
+				String path = ((CacheBand)band).cacheDataServer[iPage].getPath();
+				File f = new File(path);
+				if(f.exists()){
+					try {
+						fileUtils.copyFile(path, cb.cacheDataServer[iPage].getPath());
+					} catch (FileNotFoundException e) {
+						//TODO: EXCEPCIONES: Modificar el manejo de excepciones de RasterBuffer para q lance las apropiadas con cach�
+						e.printStackTrace();
+					} catch (IOException e) {
+						e.printStackTrace();
+					}
+				}
+			}
+			try {
+				cache.deleteBand(nBand);
+				cache.assignBand(nBand, cb.cacheDataServer);
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+		}
+	}
+
+	public void assignBand(int nBand, Band band) {
+		if(band instanceof CacheBand) {
+			//((CacheBand)band).setFileName(nBand);
+			try {
+				cache.deleteBand(nBand);
+				cache.assignBand(nBand, ((CacheBand)band).cacheDataServer);
+			} catch (IOException e) {
+				//TODO: EXCEPCIONES: Modificar el manejo de excepciones de RasterBuffer para q lance las apropiadas con cach�
+				return;
+			}
+
+		}
+	}
+
+	public Band createBand(byte defaultValue) {
+		PageBandBuffer pageBuffer = new PageBandBuffer(getDataType(), getWidth(), cache.getHPag(), 1, true, 0);
+		Band band = null;
+		try {
+			band = createBand(pageBuffer);
+		} catch (IOException e) {
+			return null;
+		}
+		loadPage(new Byte(defaultValue), pageBuffer);
+		return band;
+	}
+
+	public void assignBandToNotValid(int Band) {
+		PageBandBuffer pageBuffer = new PageBandBuffer(getDataType(), getWidth(), cache.getHPag(), 1, true, 0);
+
+		switch(getDataType()){
+    	case Buffer.TYPE_BYTE: 	loadPage(new Byte((byte)getNotValidValue()), pageBuffer);break;
+    	case Buffer.TYPE_SHORT:	loadPage(new Short((short)getNotValidValue()), pageBuffer);break;
+    	case Buffer.TYPE_INT:		loadPage(new Integer((int)getNotValidValue()), pageBuffer);break;
+    	case Buffer.TYPE_FLOAT:	loadPage(new Float((float)getNotValidValue()), pageBuffer);break;
+    	case Buffer.TYPE_DOUBLE:	loadPage(new Double((double)getNotValidValue()), pageBuffer);break;
+    	}
+
+		try {
+			CacheBand cb = (CacheBand)createBand(pageBuffer);
+			cb.setFileName(Band);
+			assignBand(Band, cb);
+		} catch (IOException e) {
+			//TODO: EXCEPCIONES: Modificar el manejo de excepciones de RasterBuffer para q lance las apropiadas con cach�
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Creaci�n de una banda a partir de una pagina de cache cargada con datos.
+	 * @param pageBuffer Pagina de cache cargada de datos
+	 * @param numBand N�mero de banda a la que representa
+	 * @return Band
+	 * @throws IOException
+	 */
+	private Band createBand(PageBandBuffer pageBuffer) throws IOException{
+		CacheDataServer[] ds = new CacheDataServer[cache.getNTotalPags()];
+		for (int i = 0; i < cache.getNTotalPags(); i++) {
+			ds[i] = new CacheDataServer(null, 0, i);
+			ds[i].savePage(pageBuffer);
+		}
+		CacheBand band = new CacheBand(getHeight(), getWidth());
+		band.cacheDataServer = ds;
+		return band;
+	}
+
+	/**
+	 * Carga la p�gina con el valor pasado por par�metro. El valor ser� del mismo tipo de dato
+	 * que el buffer actual.
+	 * @param value Valor a inicializar
+	 * @param pageBuffer P�gina
+	 */
+	private void loadPage(Object value, PageBandBuffer pageBuffer){
+		switch(getDataType()){
+    	case Buffer.TYPE_BYTE: for(int i = 0 ; i < getWidth(); i ++)
+    								for(int j = 0 ; j < cache.getHPag(); j ++)
+    									pageBuffer.setElem(j, i, 0, ((Byte)value).byteValue());
+    							break;
+    	case Buffer.TYPE_SHORT: for(int i = 0 ; i < getWidth(); i ++)
+									for(int j = 0 ; j < cache.getHPag(); j ++)
+										pageBuffer.setElem(j, i, 0, ((Short)value).shortValue());
+								 break;
+    	case Buffer.TYPE_INT:	for(int i = 0 ; i < getWidth(); i ++)
+									for(int j = 0 ; j < cache.getHPag(); j ++)
+										pageBuffer.setElem(j, i, 0, ((Integer)value).intValue());
+								break;
+    	case Buffer.TYPE_FLOAT:for(int i = 0 ; i < getWidth(); i ++)
+									for(int j = 0 ; j < cache.getHPag(); j ++)
+										pageBuffer.setElem(j, i, 0, ((Float)value).floatValue());
+									break;
+    	case Buffer.TYPE_DOUBLE:for(int i = 0 ; i < getWidth(); i ++)
+									for(int j = 0 ; j < cache.getHPag(); j ++)
+										pageBuffer.setElem(j, i, 0, ((Double)value).doubleValue());
+								 break;
+    	}
+	}
+
+	public boolean isReadOnlyBuffer() {
+		return false;
+	}
+
+	public boolean isCached() {
+		return true;
+	}
+
+	public int getBlockHeight() {
+		return cache.getHPag();
+	}
+
+	public void dispose() {
+		if(cache != null) {
+			if(cache.getAccessPage() != null)
+				cache.getAccessPage().dispose();
+			for (int i = 0; i < cache.getNPags(); i++) {
+				if(cache.getPageBufferFromNumberCachePage(i) != null)
+					cache.getPageBufferFromNumberCachePage(i).dispose();
+			}
+			try {
+				clearCache();
+			} catch (IOException e) {
+			}
+			cache = null;
+		}
+		lru = null;
+	}
+
+	protected void finalize() throws Throwable {
+		cache = null;
+		lru = null;
+		super.finalize();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/cache/RasterCache.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBand.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBand.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBand.java	(revision 15423)
@@ -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.impl.buffer;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Band;
+
+
+
+public abstract class RasterBand implements Band {	
+	public double 			noDataValue = -99999;
+    protected int 			width;
+    protected int 			height;
+    protected int 			dataType;
+    
+    /**
+     * Constructor a llamar desde las clases hijas
+     * @param width
+     * @param height
+     */
+    public RasterBand(int height, int width){
+    	this.width = width;
+		this.height = height;
+    }
+    
+    public int getWidth() {
+        return width;
+    }
+
+    public int getHeight() {
+        return height;
+    }
+
+	public int getDataType() {
+		return dataType;
+	}
+	
+	
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+
+    /**
+     * Obtiene el tama�o del tipo de dato en bytes
+     * @return Tipo de dato
+     */
+    public int getDataSize() {
+        if (dataType == TYPE_BYTE) {
+            return 1;
+        } else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT)) {
+            return 2;
+        } else if (dataType == TYPE_INT) {
+            return 4;
+        }else if (dataType == TYPE_FLOAT) {
+            return 8;
+        }else if (dataType == TYPE_DOUBLE) {
+            return 16;
+        }
+
+        return 0;
+    }
+
+    /**
+     * Obtiene el tama�o del buffer
+     * @return tama�o del buffer
+     */
+    public int sizeof() {
+        return getDataSize() * width * height;
+    }
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBand.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferHistogramComputer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferHistogramComputer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferHistogramComputer.java	(revision 15423)
@@ -0,0 +1,153 @@
+/* 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.impl.buffer;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+
+
+/**
+ * This class computes the histogram for a <code>Buffer</code>
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class BufferHistogramComputer implements HistogramComputer {
+	private BufferHistogram             histogram            = null;
+	private Buffer                      buffer               = null;
+	protected int			            progressHistogram    = 0;
+	private double[]                    limits               = null;
+	private boolean                     refresh              = false;
+	@SuppressWarnings("unused")
+	private double                      scale                = 1;
+	
+	/**
+	 * Constructor
+	 * @param dataset
+	 */
+	public BufferHistogramComputer(Buffer buffer) {
+		this.buffer = buffer;
+	}
+	
+	public void setScaleHistogram(double scale) {
+		this.scale = scale;
+	}
+	
+	public BufferHistogram getBufferHistogram()
+	throws ProcessInterruptedException, HistogramException {
+		if(histogram == null || refresh) {
+			RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+			progressHistogram = 0;
+			double[][] limits = buffer.getAllBandsLimits();
+
+			BufferHistogramImpl hist = new BufferHistogramImpl(buffer.getBandCount(), limits[0], limits[1], buffer.getDataType());
+
+			for (int iBand = 0; iBand < buffer.getBandCount(); iBand++) {
+				for (int row = 0; row < buffer.getHeight(); row++) {
+					switch(buffer.getDataType()) {
+					case Buffer.TYPE_BYTE:
+						for (int col = 0; col < buffer.getWidth(); col++) 
+							hist.incrementPxValue(iBand, (double)(buffer.getElemByte(row, col, iBand)));
+						break;
+					case Buffer.TYPE_SHORT:
+						for (int col = 0; col < buffer.getWidth(); col++) 
+							hist.incrementPxValue(iBand, (double)(buffer.getElemShort(row, col, iBand)));
+						break;
+					case Buffer.TYPE_INT:
+						for (int col = 0; col < buffer.getWidth(); col++) 
+							hist.incrementPxValue(iBand, (double)(buffer.getElemInt(row, col, iBand)));
+						break;
+					case Buffer.TYPE_FLOAT:
+						for (int col = 0; col < buffer.getWidth(); col++) 
+							hist.incrementPxValue(iBand, (double)buffer.getElemFloat(row, col, iBand));
+						break;
+					case Buffer.TYPE_DOUBLE:
+						for (int col = 0; col < buffer.getWidth(); col++) 
+							hist.incrementPxValue(iBand, buffer.getElemDouble(row, col, iBand));
+						break;
+					}
+
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+
+					progressHistogram = ((iBand * buffer.getHeight() + row) * 100) /(buffer.getHeight() * buffer.getBandCount());
+				}
+			}
+			progressHistogram = 100;
+			histogram = hist;
+		}
+		return histogram;
+	}
+
+	public void resetPercent() {
+		progressHistogram = 0;
+	}
+
+	public int getPercent() {
+		return progressHistogram;
+	}
+
+	public double getMinimum() {
+		if(limits == null)
+			try {
+				limits = buffer.getLimits();
+			} catch (ProcessInterruptedException e) {
+				return 0;
+			}
+		return limits[0];
+	}
+
+	public double getMaximum() {
+		if(limits == null)
+			try {
+				limits = buffer.getLimits();
+			} catch (ProcessInterruptedException e) {
+				return 0;
+			}
+		return limits[1];
+	}
+	
+	public void refreshHistogram() {
+		refresh = true;
+	}
+
+	public String getLog() {
+		return null;
+	}
+
+	public boolean isCancelable() {
+		return true;
+	}
+
+	public boolean isPausable() {
+		return false;
+	}
+
+	public void setPercent(int value) {
+		progressHistogram = value;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferHistogramComputer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBuffer.java	(revision 15423)
@@ -0,0 +1,661 @@
+/* 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.impl.buffer;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.AbstractBuffer;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.BufferParam;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.BufferCreationException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.WarpException;
+import org.gvsig.fmap.dal.coverage.process.IncrementableTask;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.visitor.Visitor;
+
+/**
+ * Rectangulo de pixeles. Para cada tipo de datos java hay un buffer distinto donde cada elemento es
+ * accedido de la siguiente forma: [banda][fila][columna]
+ * m[1][2][0] = cte;-> Sustituye el elemento de la fila 2 de la banda 1 columna 0
+ * m[1][0] = array; -> Sustituye la fila 0 de la banda 1 
+ * m[0] = matriz cuadrada; -> Sustituye la banda entera.
+ * 
+ */
+public abstract class RasterBuffer extends AbstractBuffer implements Buffer {
+	public static final int     INTERPOLATION_PROCESS      = 0;
+	
+	protected boolean[]		    cancel                     = new boolean[1];
+	public NoData			    noDataValue                = null;
+	protected int			    progressInterpolation      = 0;
+	protected boolean		    canceled                   = false;
+
+	protected int			    width;
+	protected int			    height;
+	protected int			    nBands;
+	protected int			    dataType;
+	private Rectangle2D         dataExtent                 = null;
+	/**
+	 * Reference to the parent RasterDataStore 
+	 */
+	private RasterDataStore     store                      = null;      
+	
+	/**
+	 * Variable est�tica que si est� a false desactiva el uso de cach�. Puede ser usada por un cliente
+	 * para cargar siempre los datos en memoria. independientemente de su tama�o. 
+	 */
+	public static boolean		cacheOn                    = true;
+	/**
+	 * Fuerza la carga de los datos en cach� independientemente de su tama�o. Su
+	 * uso suele ser util solo para depuraci�n. Su valor por defecto y recomendado
+	 * es siempre false.
+	 */
+	public static boolean 	    forceToLoadInCache         = false;
+	/**
+	 * Fuerza la carga de los datos en cach� de solo lectura independientemente de su tama�o. Su
+	 * uso suele ser util solo para depuraci�n. Su valor por defecto y recomendado
+	 * es siempre false.
+	 */
+	public static boolean 	    forceToLoadInReadOnlyCache = false;
+	/**
+	 * Valor con el que se rellena una banda no valida del buffer. Una banda no valida es la que 
+	 * no tiene datos asignados y tampoco puede ser null. Todas las bandas no validas de un buffer
+	 * apuntan por referencia a la misma banda.
+	 */
+	protected double			notValidValue              = 0D;
+	
+	/**
+	 * Proceso del cual se devuelve el porcentaje cuando este es solicitado
+	 */
+	private int                 process                    = INTERPOLATION_PROCESS;
+	private HistogramComputer   histogramComputer          = null;
+	private BufferInterpolation interp                     = null;
+	
+	public RasterDataStore getStore() {
+		return store;
+	}
+
+	public void setStore(RasterDataStore store) {
+		this.store = store;
+	} 
+	
+	/**
+	 * Reserva de memoria para el rasterbuf
+	 * @param dataType Tipo de dato
+	 * @param width Ancho
+	 * @param height Alto
+	 * @param bandNr Numero de bandas
+	 * @param orig
+	 */
+	public abstract void malloc(int dataType, int width, int height, int bandNr);
+ 
+	public int getWidth() {
+			return width;
+	}
+	
+	/**
+	 * Gets a bouding box of this buffer
+	 * @return
+	 */
+	public Rectangle2D getDataExtent() {
+		return dataExtent;
+	}
+	
+	/**
+	 * Sets a bounding box of this buffer
+	 * @param r
+	 */
+	public void setDataExtent(Rectangle2D r) {
+		this.dataExtent = r;
+	}
+
+	public int getHeight() {
+			return height;
+	}
+
+	public int getBandCount() {
+			return nBands;
+	}
+
+	/**
+	 * Obtiene el tipo de dato. Los tipos de dato posibles est�n definidos en IRaster.
+	 * @return tipo de datos
+	 */
+	public int getDataType() {
+		return dataType;
+	}
+	
+	/**
+	 * Asigna el tipo de dato. Los tipos de dato posibles est�n definidos en IRaster.
+	 * @param dataType Tipo de dato del buffer
+	 */
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+
+	/**
+	 * Obtiene el tama�o del tipo de dato en bytes
+	 * @return Tipo de dato
+	 */
+	public int getDataSize() {
+			if (dataType == TYPE_BYTE) {
+					return 1;
+			} else if ((dataType == TYPE_SHORT) | (dataType == TYPE_USHORT)) {
+					return 2;
+			} else if (dataType == TYPE_INT) {
+					return 4;
+			}else if (dataType == TYPE_FLOAT) {
+					return 8;
+			}else if (dataType == TYPE_DOUBLE) {
+					return 16;
+			}
+
+			return 0;
+	}
+
+	/**
+	 * Obtiene el tama�o del buffer
+	 * @return tama�o del buffer
+	 */
+	public long sizeof() {
+			return getDataSize() * width * height * nBands;
+	}
+	
+	/**
+	 * Replica la banda de una posici�n sobre otra. Si la banda de destino no existe
+	 * se crea nueva. Si la posici�n de la banda de destino est� intercalada entre bandas 
+	 * que ya existen las otras se desplazan hacia abajo, NO se machacan los datos de ninguna.
+	 * Los datos se replican por referencia por lo que al modificar la banda original las
+	 * del resto quedar�n afectadas.
+	 * @param orig. Posici�n de la banda de origen. 
+	 * @param dest. Posici�n de la banda destino
+	 */   
+	public abstract void replicateBand(int orig, int dest);
+	
+	/**
+	 * Cambia bandas de posici�n. Las posiciones deben existir como bandas del raster. 
+	 * Cada elemento del array representa una banda existente en el buffer (de longitud
+	 * rasterBuf.length) y el valor contenido dentro la banda que le corresponde. Por ejemplo
+	 * si pasamos un array {1, 0, 3, 2} significa que el buffer tiene cuatro bandas y que 
+	 * cambiamos la 0 por la 1 y la 2 por la 3. Un array {0, 1, 2, 3} en el mismo 
+	 * caso no producir�a nig�n cambio.
+	 * 
+	 * Si quisieramos asignar en un buffer monobanda su banda a la segunda posici�n habria
+	 * que insertar una vacia, por ejemplo con addBandFloat(0, null) se insertaria una 
+	 * banda nula en la posici�n 0 y la banda que estaba en la 0 pasar�a a la segunda.
+	 * 
+	 */
+	public abstract void switchBands(int[] bandPosition);
+		
+	/**
+	 * Convierte un tipo de dato a cadena
+	 * @param type Tipo de dato
+	 * @return cadena  que representa el tipo de dato
+	 */
+	public static String typesToString(int type) {
+			switch (type) {
+			case RasterBuffer.TYPE_IMAGE:
+					return new String("Image");
+
+			case RasterBuffer.TYPE_BYTE:
+					return new String("Byte");
+
+			case RasterBuffer.TYPE_DOUBLE:
+					return new String("Double");
+
+			case RasterBuffer.TYPE_FLOAT:
+					return new String("Float");
+
+			case RasterBuffer.TYPE_INT:
+				return new String("Integer");
+				
+			case RasterBuffer.TYPE_USHORT:
+			case RasterBuffer.TYPE_SHORT:
+					return new String("Short");
+			}
+
+			return null;
+	}
+	
+	public boolean isInside(int x, int y) {
+		if (x < 0 || y < 0 || x >= getWidth() || y >= getHeight())
+			return false;
+		return true;
+	}
+			
+	public NoData getNoDataValue() {
+		return noDataValue;
+	}
+	
+	public int getBlockHeight() {
+		return RasterLibrary.blockHeight;
+	}
+	
+	public void setNoDataValue(NoData nd){
+		noDataValue = nd;
+	}
+	
+	public double getNotValidValue(){
+		return notValidValue;
+	}
+	
+	public void setNotValidValue(double value){
+		this.notValidValue = value;
+	}
+	
+	public abstract Buffer cloneBuffer();
+	
+	/**
+	 * Ajusta el �rea del grid a un ancho y un alto dado en pixeles. Este ajuste se har� 
+	 * en relaci�n a un m�todo de interpolaci�n definido en el par�metro.
+	 * @param w Ancho de la nueva imagen.
+	 * @param h Alto de la nueva imagen.
+	 * @param interpolation M�todo de interpolaci�n que se usar� en el ajuste.
+	 */
+	public Buffer getAdjustedWindow(int w, int h, int interpolationMethod) throws ProcessInterruptedException {
+		getBufferInterpolation();
+		if (w == getWidth() && h == getHeight())
+			return this;
+		Buffer rasterBuf = null;
+		switch (interpolationMethod) {
+			case Buffer.INTERPOLATION_NearestNeighbour:
+				rasterBuf = interp.adjustRasterNearestNeighbourInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_Bilinear:
+				rasterBuf = interp.adjustRasterBilinearInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_InverseDistance:
+				rasterBuf = interp.adjustRasterInverseDistanceInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_BicubicSpline:
+				rasterBuf = interp.adjustRasterBicubicSplineInterpolation(w, h);
+				break;
+			case Buffer.INTERPOLATION_BSpline:
+				rasterBuf = interp.adjustRasterBSplineInterpolation(w, h);
+				break;
+		}
+		if (rasterBuf != null)
+			return rasterBuf;
+		else
+			return this;
+	}
+	
+	public IncrementableTask getIncrementableTask(int type) {
+		switch (type) {
+		case INCREMENTABLE_INTERPOLATION:
+			return getBufferInterpolation();
+		case INCREMENTABLE_HISTOGRAM:
+			return getHistogramComputer();
+		}
+		return null;
+	}
+	
+	/**
+	 * Gets the buffer interpolation
+	 * @return
+	 */
+	private BufferInterpolation getBufferInterpolation() {
+		if(interp == null)
+			interp = new BufferInterpolation(this);
+		return interp;
+	}
+
+	public HistogramComputer getHistogramComputer() {
+		if(histogramComputer == null)
+			histogramComputer = new BufferHistogramComputer(this);
+		return histogramComputer;
+	}
+	
+	public double[] getLimits() throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		double max = Double.NEGATIVE_INFINITY;
+		double secondMax = max;
+		double min = Double.MAX_VALUE;
+		double secondMin = min;
+		double value = 0;
+
+		switch (getDataType()) {
+			case Buffer.TYPE_BYTE:
+				for (int i = 0; i < getBandCount(); i++)
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) ((getElemByte(r, c, i)));
+							if (value > max) {
+								if (max != value) secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value) secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				break;
+			case Buffer.TYPE_SHORT:
+				for (int i = 0; i < getBandCount(); i++)
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemShort(r, c, i);
+							if (value > max) {
+								if (max != value) secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value) secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				break;
+			case Buffer.TYPE_INT:
+				for (int i = 0; i < getBandCount(); i++)
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemInt(r, c, i);
+							if (value > max) {
+								if (max != value) secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value) secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				break;
+			case Buffer.TYPE_FLOAT:
+				for (int i = 0; i < getBandCount(); i++)
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value =  (double) getElemFloat(r, c, i);
+							if (value > max) {
+								if (max != value) secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value) secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				break;
+			case Buffer.TYPE_DOUBLE:
+				for (int i = 0; i < getBandCount(); i++)
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = getElemDouble(r, c, i);
+							if (value > max) {
+								if (max != value) secondMax = max;
+								max = value;
+							}
+							if (value < min) {
+								if (min != value) secondMin = min;
+								min = value;
+							}
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				break;
+		}
+		// Si no existe un secondMax lo igualo al maximo existente
+		if (secondMax == Double.NEGATIVE_INFINITY)
+			secondMax = max;
+		// Si no existe un secondMin lo igualo al minimo existente
+		if (secondMin == Double.MAX_VALUE)
+			secondMin = min;
+		
+		double[] values = new double[4];
+		values[0] = min;
+		values[1] = max;
+		values[2] = secondMin;
+		values[3] = secondMax;
+		return values;
+	}
+	
+	public double[][] getAllBandsLimits() throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		double max[] = new double[getBandCount()];
+		double min[] = new double[getBandCount()];
+		double value = 0;
+
+		for (int i = 0; i < getBandCount(); i++) {
+			max[i] = Double.NEGATIVE_INFINITY;
+			min[i] = Double.MAX_VALUE;
+		}
+		
+		switch (getDataType()) {
+			case Buffer.TYPE_BYTE:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) ((getElemByte(r, c, i)));
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_SHORT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemShort(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_INT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemInt(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_FLOAT:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = (double) getElemFloat(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+			case Buffer.TYPE_DOUBLE:
+				for (int i = 0; i < getBandCount(); i++) {
+					for (int r = 0; r < getHeight(); r++) {
+						for (int c = 0; c < getWidth(); c++) {
+							value = getElemDouble(r, c, i);
+							if (value > max[i])
+								max[i] = value;
+							if (value < min[i])
+								min[i] = value;
+						}
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+				}
+				break;
+		}
+		double[][] values = new double[2][getBandCount()];
+
+		for (int i = 0; i < getBandCount(); i++) {
+			values[0][i] = min[i];
+			values[1][i] = max[i];
+		}
+		return values;
+	}
+	
+	public void addDrawableBands(int[] db) {
+		
+	}
+
+	public void resetPercent() {
+		switch(process) {
+		case INTERPOLATION_PROCESS: progressInterpolation = 0;
+		}
+	}
+
+	public int getPercent() {
+		switch(process) {
+		case INTERPOLATION_PROCESS: return progressInterpolation;
+		}
+		return 0;
+	}
+	
+	/**
+	 * Asigna el proceso del cual se desea obtener informaci�n. Los procesos
+	 * disponibles se definen como constantes en esta clase.
+	 * @param process
+	 */
+	public void setProcess(int process) {
+		this.process = process;
+	}
+	
+	public boolean isCached() {
+		return false;
+	}
+
+	//****************************************************
+	//*********Implementing DataSet methods***************
+	//****************************************************
+
+	public boolean isFromStore(DataStore store) {
+		return store == this.store;
+	}
+
+	//****************************************************
+	//*********Implementing Visitable methods*************
+	//****************************************************
+
+	public void accept(Visitor visitor) throws BaseException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+
+		switch (getDataType()) {
+		case Buffer.TYPE_BYTE:
+			for (int i = 0; i < getBandCount(); i++) {
+				for (int r = 0; r < getHeight(); r++) {
+					for (int c = 0; c < getWidth(); c++) 
+						visitor.visit(getElemByte(r, c, i));
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+				}
+			}
+			break;
+		case Buffer.TYPE_SHORT:
+			for (int i = 0; i < getBandCount(); i++) {
+				for (int r = 0; r < getHeight(); r++) {
+					for (int c = 0; c < getWidth(); c++)
+						visitor.visit(getElemShort(r, c, i));
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+				}
+			}
+			break;
+		case Buffer.TYPE_INT:
+			for (int i = 0; i < getBandCount(); i++) {
+				for (int r = 0; r < getHeight(); r++) {
+					for (int c = 0; c < getWidth(); c++)
+						visitor.visit(getElemInt(r, c, i));
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+				}
+			}
+			break;
+		case Buffer.TYPE_FLOAT:
+			for (int i = 0; i < getBandCount(); i++) {
+				for (int r = 0; r < getHeight(); r++) {
+					for (int c = 0; c < getWidth(); c++)
+						visitor.visit(getElemFloat(r, c, i));
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+				}
+			}
+			break;
+		case Buffer.TYPE_DOUBLE:
+			for (int i = 0; i < getBandCount(); i++) {
+				for (int r = 0; r < getHeight(); r++) {
+					for (int c = 0; c < getWidth(); c++)
+						visitor.visit(getElemDouble(r, c, i));
+					if (task.getEvent() != null)
+						task.manageEvent(task.getEvent());
+				}
+			}
+			break;
+		}
+	}
+
+	protected void finalize() throws Throwable {
+		histogramComputer          = null;
+		store                      = null;
+		dataExtent                 = null;
+		cancel                     = null;
+		noDataValue                = null;
+		super.finalize();
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/RasterBuffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultRasterQuery.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultRasterQuery.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultRasterQuery.java	(revision 15423)
@@ -0,0 +1,963 @@
+package org.gvsig.raster.impl.buffer;
+
+import java.awt.Rectangle;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+
+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.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.QueryException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.raster.cache.tile.TileCacheLibrary;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.cache.tile.provider.TileListener;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.cache.RasterReadOnlyBuffer;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.store.QueryableRaster;
+import org.gvsig.timesupport.Time;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.gvsig.tools.task.TaskStatus;
+
+/**
+ * Default implementation for RasterQuery
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultRasterQuery implements RasterQuery, SpiRasterQuery {
+	public static final int  TYPE_UNDEFINED             = -1;
+	public static final int  TYPE_ENTIRE                = 0;
+	public static final int  TYPE_WCOORDS               = 1;
+	public static final int  TYPE_WCOORDS_RESCALED      = 2;
+	public static final int  TYPE_WCOORDS_SHIFT         = 3;
+	public static final int  TYPE_PX                    = 4;
+	public static final int  TYPE_PX_RESCALED           = 5;
+	public static final int  TYPE_PX_SHIFT              = 6;
+	public static final int  TYPE_PX_RESCALED_SHIFT     = 7;
+	public static final int  TYPE_TILED                 = 8;
+	public static final int  TYPE_ONE_TILE              = 9;
+
+	private int              type                       = TYPE_ENTIRE;
+	/*
+	 * Request in pixels
+	 */
+	private Rectangle        pixelWindow                = null;
+	/*
+	 * Request in pixels adjusted to the source. The provider will use this parameter. If the type is with
+	 * shift then adjustedPixelWindow will be the same to the pixelWindow
+	 */
+	private Rectangle        adjustedPixelWindow        = null;
+	/*
+	 * Request in world coordinates
+	 */
+	private Extent           requestBoundingBox         = null;
+	/*
+	 * Request in world coordinates adjusted to the source. The provider will use this parameter. If the type is with
+	 * shift then adjustedBoundingBox will be the same to the requestBoundingBox
+	 */
+	private Extent           adjustedBoundingBox        = null;
+
+	private int              widthForResampling         = -1;
+	private int              heightForResampling        = -1;
+	/*
+	 * If the request is adjusted to the input source this width is the same to widthForResampling else
+	 * the provider has to receive the right buffer size for the request, so this adjustedWidth will
+	 * contain a smaller buffer without frames. 
+	 */
+	private int              adjustedBufferWidth        = 0;
+	/*
+	 * If the request is adjusted to the input source this height is the same to heightForResampling else
+	 * the provider has to receive the right buffer size for the request, so this adjustedHeight will
+	 * contain a smaller buffer without frames. 
+	 */
+	private int              adjustedBufferHeight       = 0;
+
+	private double[]         step                       = null;
+
+	private int              tileRow                    = 0;
+	private int              tileCol                    = 0;
+	private int              resolutionLevel            = -1;
+	private boolean          adjustToSrcExtent          = true;
+
+	private int[]            drawableBands              = new int[]{0};
+	private boolean          readOnly                   = false;
+	private boolean          memoryBuffer               = false;
+	private boolean          storeLastBuffer            = false;
+	private Time             time                       = null;
+
+	
+	private boolean			 supersamplingLoadingBuffer = false;
+	/**
+	 * Valor NoData con el que se rellenan las celdas cuando adjustToExtent es false
+	 */
+	private NoData           noDataValueToFill          = null;
+
+	private TileListener     listener                   = null;
+	private int              alphaBandNumber            = -1;
+	private boolean          dontBuildBuffer            = false;
+	private CacheStruct      cacheStruct                = null;   
+	private TaskStatus       taskStatus                 = null;
+
+	//Parameters only for providers
+	private BandList         bandList                   = null;
+	private Buffer           bufferForProviders         = null;
+	private boolean          forceARGBBuffer            = false;
+	private boolean          forceRGBBuffer             = false;
+	//private Buffer           bufferWithoutAdjust        = null;
+
+
+	//****************************************************
+	//*************Request of data windows****************
+	//****************************************************
+	
+	public void setAreaOfInterest() {
+		this.type = TYPE_ENTIRE;
+	}
+
+	public void setAreaOfInterest(Rectangle pixelWindow) {
+		this.pixelWindow = pixelWindow;
+		this.type = TYPE_PX;
+	}
+
+	public void setAreaOfInterest(Rectangle pixelWindow, int bufWidth, int bufHeight) {
+		this.pixelWindow = pixelWindow;
+		this.widthForResampling = bufWidth;
+		this.heightForResampling = bufHeight;
+		this.type = TYPE_PX;
+	}
+
+	public void setAreaOfInterest(Extent requestBoundingBox, int bufWidth, int bufHeight) {
+		this.widthForResampling = bufWidth;
+		this.heightForResampling = bufHeight;
+		this.requestBoundingBox = requestBoundingBox;
+		this.type = TYPE_WCOORDS;
+	}
+
+	public void setAreaOfInterest(Extent boundingBox) {
+		this.requestBoundingBox = boundingBox;
+		this.type = TYPE_WCOORDS;
+	}
+
+	public void setAreaOfInterest(Extent requestBoundingBox, 
+			int bufWidth, int bufHeight, TileListener listener) {
+		this.requestBoundingBox = requestBoundingBox;
+		this.widthForResampling = bufWidth;
+		this.heightForResampling = bufHeight;
+		this.type = TYPE_TILED;
+		this.listener = listener;
+	}
+
+	public void setTileParameters(int level, int tileCol, int tileRow) {
+		this.type = TYPE_ONE_TILE;
+		this.resolutionLevel = level;
+		this.tileRow = tileRow;
+		this.tileCol = tileCol;
+	}
+
+	/**
+	 * @deprecated Use setTileParameters(int level, int tileCol, int tileRow)
+	 */
+	public void setTileParameters(int level, int tileCol, int tileRow, Extent bbox, CacheStruct cacheStruct) {
+		this.type = TYPE_ONE_TILE;
+		this.requestBoundingBox = bbox;
+		this.resolutionLevel = level;
+		this.tileRow = tileRow;
+		this.tileCol = tileCol;
+		int[] size = null;
+		if(cacheStruct != null) {
+			this.cacheStruct = cacheStruct;
+			size = cacheStruct.getTileSizeByLevel(level);
+		} else {
+			size = new int[]{TileCacheLibrary.DEFAULT_TILEWIDTH, TileCacheLibrary.DEFAULT_TILEHEIGHT};
+		}
+		this.widthForResampling = size[0];
+		this.heightForResampling = size[1];
+	}
+
+
+
+	//****************************************************
+	//****************Internal Services*******************
+	//****************************************************
+	
+	public boolean requestIsTiled() {
+		switch (type) {
+		case TYPE_TILED:
+		case TYPE_ONE_TILE:
+			return true;
+		}
+		return false;
+	}
+
+	public boolean requestHasShift() {
+		switch (type) {
+		case TYPE_PX_RESCALED_SHIFT:
+		case TYPE_PX_SHIFT:
+		case TYPE_WCOORDS_SHIFT:
+			return true;
+		}
+		return false;
+	}
+
+	public boolean requestIsPixelCoordinates() {
+		switch (type) {
+		case TYPE_PX:
+		case TYPE_PX_SHIFT:
+		case TYPE_PX_RESCALED:
+		case TYPE_PX_RESCALED_SHIFT:
+		case TYPE_ENTIRE:
+			return true;
+		}
+		return false;
+	}
+
+	public boolean requestIsInWorldCoordinates() {
+		switch (type) {
+		case TYPE_WCOORDS:
+		case TYPE_WCOORDS_RESCALED:
+		case TYPE_WCOORDS_SHIFT:
+		case TYPE_TILED:
+			return true;
+		}
+		return false;
+	}
+
+	public boolean requestIsRescaled() {
+		switch (type) {
+		case TYPE_PX_RESCALED:
+		case TYPE_PX_RESCALED_SHIFT:
+		case TYPE_WCOORDS_RESCALED:
+		case TYPE_TILED:
+			return true;
+		}
+		return false;
+	}
+
+	/**
+	 * Returns true if the request is trying apply supersampling, that is, the size of the result is
+	 * bigger that the window of maximum resolution of this source
+	 * @return
+	 */
+	public boolean isSupersamplingTheRequest() {
+		if(!requestHasShift()) {
+			return (getBufWidth() > getAdjustedWidth() || getBufHeight() > getAdjustedHeight());
+		}
+		return (getAdjustedBufWidth() > getAdjustedWidth() || getAdjustedBufHeight() > getAdjustedHeight());
+	}
+
+
+	public RasterQuery clone() {
+		DefaultRasterQuery q = new DefaultRasterQuery();
+		q.type = type;
+		q.pixelWindow = (Rectangle)pixelWindow.clone();
+		q.adjustToSrcExtent = adjustToSrcExtent;
+		q.widthForResampling = widthForResampling;
+		q.heightForResampling = heightForResampling;
+		q.requestBoundingBox = requestBoundingBox != null ? requestBoundingBox.clone() : null;
+		q.tileCol = tileCol;
+		q.tileRow = tileRow;
+		q.resolutionLevel = resolutionLevel;
+		q.readOnly = readOnly;
+		q.memoryBuffer = memoryBuffer;
+		q.storeLastBuffer = storeLastBuffer;
+		if(drawableBands != null) {
+			q.drawableBands = new int[drawableBands.length];
+			for (int i = 0; i < q.drawableBands.length; i++) {
+				q.drawableBands[i] = drawableBands[i];
+			}
+		}
+		q.supersamplingLoadingBuffer = supersamplingLoadingBuffer;
+		q.noDataValueToFill = noDataValueToFill != null ? (NoData)noDataValueToFill.clone() : null;
+		q.listener = listener;
+		q.alphaBandNumber = alphaBandNumber;
+		q.bandList = bandList != null ? (BandList)bandList.clone() : null;
+		q.bufferForProviders = bufferForProviders;
+		return q;
+	}
+
+	//****************************************************
+	//*************Parameters calculation*****************
+	//****************************************************
+	
+	/**
+	 * Calculates the parameters using the base request. That is, bounding boxes, data windows,
+	 * output size, steps and parameters for supersampling, band lists and buffers. This parameters
+	 * are calculated adjusting to the source limits. For this reason, the request parameters are 
+	 * saved in other variables, to allow calculate the displacement and resampling whether it was 
+	 * necessary
+	 * @param store
+	 * @throws QueryException 
+	 */
+	public void calculateParameters(RasterDataStore store) throws QueryException {
+		calculateRequestType(store);
+
+		//Parameters for requests in pixels
+		if(requestIsPixelCoordinates()) {
+			calculateAdjustedPxSizeFromPxSize((int)store.getWidth(), (int)store.getHeight());
+			calculateBoundingBoxesFromPxRequest(store);
+		} 
+
+		//Parameters for requests in world coordinates
+		if(requestIsInWorldCoordinates()) {
+			calculateAdjustedWCWindowFromWCWindow(store.getAffineTransform(), (int)store.getWidth(), (int)store.getHeight());
+			calculatePxWindowsFromBoundingBoxes(store);
+		}
+
+		//Output
+		calculateOutputSizeFromPxWindow(store);
+
+		//Supersampling parameters
+		step = null;
+		if(isSupersamplingTheRequest() && !store.isRasterEnclosed()) {
+			calculateStep(store);
+			supersampledBuffers(store);
+		}
+
+		//Bands and buffers
+		buildDrawableBandList(store.getBands());
+		if(!dontBuildBuffer)
+			createBuffer(store);
+	}
+
+	/**
+	 * Adjust the request in world coordinates to the data size
+	 * @param q
+	 */
+	private void calculateAdjustedWCWindowFromWCWindow(AffineTransform at, int w, int h) {
+		if(requestHasShift()) {
+			setAdjustedRequestBoundingBox(getRequestBoundingBox().clone());
+		}
+		RasterUtils util = RasterLocator.getManager().getRasterUtils();
+		Extent adjustedDataExtent = util.calculateAdjustedView(getRequestBoundingBox(), at, w, h);
+		setAdjustedRequestBoundingBox(adjustedDataExtent);
+	}
+
+	/**
+	 * Adjust the request in pixel coordinates to the data size
+	 * @param q
+	 */
+	private void calculateAdjustedPxSizeFromPxSize(int sourceWidth, int sourceHeight) {
+		adjustedPixelWindow = (Rectangle)pixelWindow.clone();
+
+		if(requestHasShift()) 
+			return;
+
+		if(getAdjustedX() < 0)
+			setAdjustedX(0);
+		if(getAdjustedY() < 0)
+			setAdjustedY(0);
+		if((getAdjustedX() + getAdjustedWidth()) > sourceWidth)
+			setAdjustedWidth(sourceWidth - getX());
+		if((getAdjustedY() + getAdjustedHeight()) > sourceHeight)
+			setAdjustedHeight(sourceHeight - getAdjustedY());
+	}
+
+
+	private void calculateBoundingBoxesFromPxRequest(RasterDataStore store) {
+		Extent extent = new ExtentImpl(
+				store.rasterToWorld(new Point2D.Double(getX(), getY())),
+				store.rasterToWorld(new Point2D.Double(getX() + getWidth(), getY() + getHeight())));
+		setRequestBoundingBox(extent);
+
+		Extent adjustedExtent = new ExtentImpl(
+				store.rasterToWorld(new Point2D.Double(getAdjustedX(), getAdjustedY())),
+				store.rasterToWorld(new Point2D.Double(getAdjustedX() + getAdjustedWidth(), getAdjustedY() + getAdjustedHeight())));
+		setAdjustedRequestBoundingBox(adjustedExtent);
+	}
+
+	private double round(double value) {
+		double a = (value - (int)value);
+		return (a > 0.95 || a < 0.05) ? Math.round(value) : value;
+	}
+
+	private void calculateOutputSizeFromPxWindow(RasterDataStore store) {
+		if(!requestIsRescaled()) {
+			setBufHeight(getHeight());
+			setBufWidth(getWidth());
+			setAdjustedBufWidth(getAdjustedWidth());
+			setAdjustedBufHeight(getAdjustedHeight());
+		} else {
+			double scaleWidth = (double)getWidth() / getBufWidth();
+			double scaleHeight = (double)getHeight() / getBufHeight();
+			setAdjustedBufWidth((int)Math.ceil(round(getAdjustedWidth() / scaleWidth)));
+			setAdjustedBufHeight((int)Math.ceil(round(getAdjustedHeight() / scaleHeight)));
+		}
+	}
+
+	private void calculatePxWindowsFromBoundingBoxes(RasterDataStore store) {
+		Extent requestBBox = getRequestBoundingBox();
+		Point2D ul = store.worldToRaster(requestBBox.getUL());
+		Point2D lr = store.worldToRaster(requestBBox.getLR());
+		int w = (int)Math.ceil(Math.abs(round(ul.getX()) - round(lr.getX())));
+		int h = (int)Math.ceil(Math.abs(round(ul.getY()) - round(lr.getY())));
+		Rectangle r = new Rectangle((int)ul.getX(), (int)ul.getY(), w, h);
+		pixelWindow = r;
+
+		Extent adjustedBBox = getAdjustedRequestBoundingBox();
+		ul = store.worldToRaster(adjustedBBox.getUL());
+		lr = store.worldToRaster(adjustedBBox.getLR());
+		w = (int)Math.ceil(Math.abs(round(ul.getX()) - round(lr.getX())));
+		h = (int)Math.ceil(Math.abs(round(ul.getY()) - round(lr.getY())));
+		r = new Rectangle((int)ul.getX(), (int)ul.getY(), w, h);
+		adjustedPixelWindow = r;
+	}
+
+	/**
+	 * <p>
+	 * If the request is being supersampled, then the buffer size will be bigger than the pixel window. 
+	 * In this case the provider will receive a buffer in 1:1 scale. The supersampling function will be 
+	 * in the client (supersampling deactivated) or in the store (supersampling activated). 
+	 * </p><p>
+	 * The buffer will have one pixel more because the resampling cuts the first pixel by the beginning and
+	 * shows the last pixel by the end.
+	 * </p>
+	 * @param store
+	 */
+	private void supersampledBuffers(RasterDataStore store) {
+		//Si se est� pidiendo supersampleo el provider tiene que recibir un buffer de tama�o igual al n�mero real de
+		//pixels del �rea, por ello habr� que cambiar el adjustedbufwidth y adjustedBufHeight. Adem�s habr� que variar
+		//el extent del provider y la ventana en pixeles para que todo cuadre. El objetivo es que cuando el cliente (Render)
+		//supersamplee no le queden huecos en blanco porque le falte el �ltimo pixel.
+		if((getAdjustedX() + getAdjustedWidth()) < store.getWidth())
+			setAdjustedWidth(getAdjustedWidth() + 1);
+		if((getAdjustedY() + getAdjustedHeight()) < store.getHeight())
+			setAdjustedHeight(getAdjustedHeight() + 1);
+		setAdjustedBufWidth(getAdjustedWidth());
+		setAdjustedBufHeight(getAdjustedHeight());
+		Point2D ul = store.rasterToWorld(new Point2D.Double(adjustedPixelWindow.getX(), adjustedPixelWindow.getY()));
+		Point2D lr = store.rasterToWorld(new Point2D.Double(
+				adjustedPixelWindow.getX() + adjustedPixelWindow.getWidth(), 
+				adjustedPixelWindow.getY() + adjustedPixelWindow.getHeight()));
+		setAdjustedRequestBoundingBox(new ExtentImpl(ul, lr));
+	}
+
+	/**
+	 * Giving a world coordinates, a buffer size and a original raster size. If the 
+	 * buffer is bigger than the window requested in the source raster (supersampling), 
+	 * then it means that each pixel of the raster will be written several times in 
+	 * the destination buffer.
+	 * 
+	 * This function calculates the shift in pixels en X and Y coordinate that 
+	 * correspond to the first pixel, due to this pixel won't be drawn entirely.
+	 * 
+	 * This operation is needed when the client wants to apply suppersampling on the 
+	 * result of a request.
+	 */
+	private void calculateStep(RasterDataStore store) {
+		Point2D tl = store.worldToRaster(getAdjustedRequestBoundingBox().getUL());
+		Point2D br = store.worldToRaster(getAdjustedRequestBoundingBox().getLR());
+
+		//Se obtiene el tama�o de la petici�n original pero ajustada ya que adjustedBufferWidth y adjustedBufferHeight
+		//habr�n sido modificados para que no excedan el tama�o de la ventana, ya que el provider no debe supersamplear
+		double scaleWidth = (double)getWidth() / getBufWidth();
+		double scaleHeight = (double)getHeight() / getBufHeight();
+		int srcOriginalAdjustedWidth = (int)Math.ceil(round(getAdjustedWidth() / scaleWidth));
+		int srcOriginalAdjustedHeight = (int)Math.ceil(round(getAdjustedHeight() / scaleHeight));
+
+		double wPx = (srcOriginalAdjustedWidth / Math.abs(br.getX() - tl.getX()));
+		double hPx = (srcOriginalAdjustedHeight / Math.abs(br.getY() - tl.getY()));
+
+		int x = (int)((tl.getX() > br.getX()) ? Math.floor(br.getX()) : Math.floor(tl.getX()));
+		int y = (int)((tl.getY() > br.getY()) ? Math.floor(br.getY()) : Math.floor(tl.getY()));
+
+		double a = (tl.getX() > br.getX()) ? (Math.abs(br.getX() - x)) : (Math.abs(tl.getX() - x));
+		double b = (tl.getY() > br.getY()) ? (Math.abs(br.getY() - y)) : (Math.abs(tl.getY() - y));
+
+		double stpX = (int)((a * srcOriginalAdjustedWidth) / Math.abs(br.getX() - tl.getX()));
+		double stpY = (int)((b * srcOriginalAdjustedHeight) / Math.abs(br.getY() - tl.getY()));
+
+		step = new double[]{stpX, stpY, wPx, hPx};
+	}
+
+	public Buffer createBuffer(RasterDataStore store) throws QueryException {
+		if(isReadOnly()) {
+			bufferForProviders = DefaultRasterManager.getInstance().createReadOnlyBuffer(
+					store.getDataType()[0], getAdjustedBufWidth(), getAdjustedBufHeight(), store.getBandCount());
+			try {
+				((RasterReadOnlyBuffer)bufferForProviders).setBufferParams((QueryableRaster)store, 
+						getAdjustedX(), 
+						getAdjustedY(), 
+						getAdjustedX() + getAdjustedWidth() - 1, 
+						getAdjustedY() + getAdjustedHeight() - 1, 
+						bandList);
+			} catch (FileNotExistsException e) {
+				throw new QueryException("Error setting buffer params in a RO buffer", e);
+			} catch (NotSupportedExtensionException e) {
+				throw new QueryException("Error setting buffer params in a RO buffer", e);
+			} catch (InvalidSetViewException e) {
+				throw new QueryException("Error setting buffer params in a RO buffer", e);
+			}
+		} else {
+			BandList bandList = buildDrawableBandList(store.getBands());
+			int bandCount = bandList.getDrawableBandsCount();
+			if(forceARGBBuffer) 
+				bandCount = 4;
+			if(forceRGBBuffer) 
+				bandCount = 3;
+			
+			if(isMemoryBuffer()) 
+				bufferForProviders = DefaultRasterManager.getInstance().createMemoryBuffer(
+						store.getDataType()[0], getAdjustedBufWidth(), getAdjustedBufHeight(), bandCount, true);
+			else
+				bufferForProviders = DefaultRasterManager.getInstance().createBuffer(
+						store.getDataType()[0], getAdjustedBufWidth(), getAdjustedBufHeight(), bandCount, true);
+		}
+
+		bufferForProviders.setDataExtent(getAdjustedRequestBoundingBox().toRectangle2D());
+		return bufferForProviders;
+
+	}
+
+	/**
+	 * Builds a list o bands to draw from the store band list and
+	 * the <code>drawablebands</code> asigned by the user
+	 * @param drawableBands
+	 * @param storeBandList
+	 * @return
+	 */
+	public BandList buildDrawableBandList(BandList storeBandList) {
+		bandList = (BandList)storeBandList.clone();
+		//If drawableBands is null then the bandList is the same that the source band list
+		if(drawableBands != null)
+			bandList.setDrawableBands(drawableBands);
+		return bandList;
+	}
+	
+	private boolean isAdjustingPixelWindowToStore(RasterDataStore store) {
+		return (pixelWindow.getX() >= 0 && 
+				pixelWindow.getY() >= 0 && 
+				pixelWindow.getWidth() <= store.getWidth() && 
+				pixelWindow.getHeight() <= store.getHeight());
+	}
+	
+	private boolean isBufferSizeDefined() {
+		return (widthForResampling != -1 && heightForResampling != -1);
+	}
+	
+	private boolean isAdjustingRequestBBoxToStore(RasterDataStore store) {
+		Extent intersection = requestBoundingBox.intersection(store.getExtent());
+		return intersection.equals(store.getExtent());
+	}
+	
+	private void calculateRequestType(RasterDataStore store) {
+		if(type == TYPE_ENTIRE) {
+			pixelWindow = new Rectangle(0, 0, (int)store.getWidth(), (int)store.getHeight());
+			return;
+		}
+		
+		if(!adjustToSrcExtent) {
+			if(type == TYPE_PX) {
+				if(isAdjustingPixelWindowToStore(store)) {
+					if(isBufferSizeDefined())
+						this.type = TYPE_PX_RESCALED;
+					else
+						this.type = TYPE_PX;
+				} else {
+					if(isBufferSizeDefined())
+						this.type = TYPE_PX_RESCALED_SHIFT;
+					else
+						this.type = TYPE_PX_SHIFT;
+				}
+			}
+			if(type == TYPE_WCOORDS) {
+				if(isBufferSizeDefined()) {
+					if(isAdjustingRequestBBoxToStore(store))
+						this.type = TYPE_WCOORDS_RESCALED;
+					else
+						this.type = TYPE_WCOORDS_SHIFT;						
+				} //else TYPE_WCOORDS
+			}
+		} else {
+			if(type == TYPE_PX) {
+				if(isBufferSizeDefined())
+					this.type = TYPE_PX_RESCALED;
+			}
+			if(type == TYPE_WCOORDS) {
+				if(isBufferSizeDefined())
+					this.type = TYPE_WCOORDS_RESCALED;
+				//else TYPE_WCOORDS
+			}
+		}
+	}
+
+	//****************************************************
+	//*********Implementing DataQuery methods*************
+	//****************************************************
+
+	public Object getQueryParameter(String name) {
+		return null;
+	}
+
+	public double getScale() {
+		return 0;
+	}
+
+	public void setQueryParameter(String name, Object value) {
+
+	}
+
+	public void setScale(double scale) {
+
+	}
+
+	//****************************************************
+	//*********Implementing Persistent methods************
+	//****************************************************
+
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+
+	}
+
+	//****************************************************
+	//**************Getters and Setters*******************
+	//****************************************************
+	
+	public void forceARGBRequest() {
+		this.forceARGBBuffer = true;
+		this.forceRGBBuffer = false;
+	}
+	
+	public void forceRGBRequest() {
+		this.forceRGBBuffer = true;
+		this.forceARGBBuffer = false;
+	}
+	
+	public boolean isforcingRGBRequest() {
+		return (forceRGBBuffer && !forceARGBBuffer);
+	}
+	
+	public boolean isforcingARGBRequest() {
+		return (forceARGBBuffer && !forceRGBBuffer);
+	}
+	
+	public void dontBuildBuffer() {
+		this.dontBuildBuffer = true;
+	}
+
+	public int getType() {
+		return type;
+	}
+
+	public void storeLastBuffer(boolean store) {
+		this.storeLastBuffer = store;
+	}
+
+	/**
+	 * The user can told if the buffer will be stored or not in the RasterDatasource.
+	 * @return store
+	 */
+	public boolean isStoredLastBuffer() {
+		return storeLastBuffer;
+	}
+
+	public void setAdjustToExtent(boolean adjustToExtent) {
+		this.adjustToSrcExtent = adjustToExtent;
+	}
+
+	public boolean isAdjustToExtent() {
+		return adjustToSrcExtent;
+	}
+
+	public int[] getDrawableBands() {
+		return drawableBands;
+	}
+
+	public void setAllDrawableBands() {
+		this.drawableBands = null;
+	}
+
+	public void setDrawableBands(int[] drawableBands) {
+		this.drawableBands = drawableBands;
+	}
+
+	public void setReadOnly(boolean readOnly) {
+		this.readOnly = readOnly;
+	}
+
+	/**
+	 * Returns true if the supersampling is enable and false if it is disable
+	 * Rendering from gvSIG, the resampling is always disable because if the request 
+	 * is greater than 1:1 scale the resampling will be done in the client <code>Render</code>.
+	 * The default value is disable.
+	 */
+	public boolean isSupersamplingOptionActive() {
+		return supersamplingLoadingBuffer;
+	}
+
+	/**
+	 * Enables or disables the supersampling loading the buffer. Rendering from gvSIG,
+	 * the resampling is always disable because if the request is greater than 1:1 scale
+	 * the resampling will be done in the client <code>Render</code>
+	 */
+	public void setSupersamplingOption(boolean supersamplingLoadingBuffer) {
+		this.supersamplingLoadingBuffer = supersamplingLoadingBuffer;
+	}
+
+	public void setMemoryBuffer(boolean memoryBuffer) {
+		this.memoryBuffer = memoryBuffer;
+	}
+
+	/**
+	 * Obtiene el flag que dice si la carga del siguiente buffer es en memoria
+	 * @return memory true si la siguiente carga de buffer se hace en memoria y false se deja decidir al dataset 
+	 * el tipo de buffer
+	 */
+	public boolean isMemoryBuffer() {
+		return memoryBuffer;
+	}
+
+	public void setNoDataToFill(NoData noData) {
+		this.noDataValueToFill = noData;
+	}
+
+	public void setAlphaBand(int bandNumber) {
+		this.alphaBandNumber = bandNumber;
+	}
+
+	public int getAlphaBandNumber() {
+		return alphaBandNumber;
+	}
+
+	public NoData getNoDataValueToFill() {
+		return this.noDataValueToFill;
+	}
+	
+	public void setRequestPixelWindow(Rectangle pixelWindow) {
+		this.pixelWindow = pixelWindow;
+	}
+
+	public int getX() {
+		return (int)pixelWindow.getX();
+	}
+
+	public int getY() {
+		return (int)pixelWindow.getY();
+	}
+
+	public int getWidth() {
+		return (int)pixelWindow.getWidth();
+	}
+
+	public int getHeight() {
+		return (int)pixelWindow.getHeight();
+	}
+
+	public void setX(int x) {
+		pixelWindow.setLocation(x, getY());
+	}
+
+	public void setY(int y) {
+		pixelWindow.setLocation(getX(), y);
+	}
+
+	public void setWidth(int w) {
+		pixelWindow.setSize(w, getWidth());
+	}
+
+	public void setHeight(int h) {
+		pixelWindow.setSize(getHeight(), h);
+	}
+
+	public int getAdjustedX() {
+		return (int)adjustedPixelWindow.getX();
+	}
+
+	public int getAdjustedY() {
+		return (int)adjustedPixelWindow.getY();
+	}
+
+	public int getAdjustedWidth() {
+		return (int)adjustedPixelWindow.getWidth();
+	}
+
+	public int getAdjustedHeight() {
+		return (int)adjustedPixelWindow.getHeight();
+	}
+
+	public void setAdjustedX(int x) {
+		adjustedPixelWindow.setLocation(x, getAdjustedY());
+	}
+
+	public void setAdjustedY(int y) {
+		adjustedPixelWindow.setLocation(getAdjustedX(), y);
+	}
+
+	public void setAdjustedWidth(int w) {
+		adjustedPixelWindow.setSize(w, getAdjustedHeight());
+	}
+
+	public void setAdjustedHeight(int h) {
+		adjustedPixelWindow.setSize(getAdjustedWidth(), h);
+	}
+
+	/**
+	 * Gets the window of the request in pixel coordinates
+	 */
+	 public Rectangle getRequestPxWindow() {
+		 return pixelWindow;
+	 }
+
+	 /**
+	  * Gets the adjusted window of the request in pixel coordinates
+	  */
+	 public Rectangle getAdjustedRequestPxWindow() {
+		 return adjustedPixelWindow;
+	 }
+
+	 /**
+	  * Gets a bounding box of a request in world coordinates.
+	  */
+	 public Extent getRequestBoundingBox() {
+		 return requestBoundingBox;
+	 }
+
+	 /**
+	  * Sets a bounding box of a request in world coordinates.
+	  * @param requestBoundingBox
+	  */
+	 public void setRequestBoundingBox(Extent requestBoundingBox) {
+		 this.requestBoundingBox = requestBoundingBox;
+	 }
+
+	 /**
+	  * Gets a bounding box of a request in world coordinates adjusted to the bounding box of the source.
+	  */
+	 public Extent getAdjustedRequestBoundingBox() {
+		 return adjustedBoundingBox;
+	 }
+
+	 /**
+	  * Sets a bounding box of a request in world coordinates adjusted to the bounding box of the source.
+	  * @param requestBoundingBox
+	  */
+	 public void setAdjustedRequestBoundingBox(Extent adjustedBoundingBox) {
+		 this.adjustedBoundingBox = adjustedBoundingBox;
+	 }
+
+	 public int getBufWidth() {
+		 return widthForResampling;
+	 }
+
+	 public int getBufHeight() {
+		 return heightForResampling;
+	 }
+
+	 public void setBufHeight(int h) {
+		 heightForResampling = h;
+	 }
+
+	 public void setBufWidth(int w) {
+		 widthForResampling = w;
+	 }
+
+	 public int getAdjustedBufWidth() {
+		 return adjustedBufferWidth;
+	 }
+
+	 public int getAdjustedBufHeight() {
+		 return adjustedBufferHeight;
+	 }
+
+	 public void setAdjustedBufHeight(int h) {
+		 adjustedBufferHeight = h;
+	 }
+
+	 public void setAdjustedBufWidth(int w) {
+		 adjustedBufferWidth = w;
+	 }
+
+	 public boolean isReadOnly() {
+		 return readOnly;
+	 }
+
+	 public TileListener getTileListener() {
+		 return listener;
+	 }
+
+	 public void setTileListener(TileListener listener) {
+		 this.listener = listener;
+	 }
+
+	 public Time getTime() {
+		 return time;
+	 }
+
+	 public void setTime(Time time) {
+		 this.time = time;
+	 }
+
+	 public int getTileRow() {
+		 return tileRow;
+	 }
+
+	 public int getTileCol() {
+		 return tileCol;
+	 }
+
+	 public CacheStruct getCacheStruct() {
+		 return cacheStruct;
+	 }
+
+	 public void setCacheStruct(CacheStruct cacheStruct) {
+		 this.cacheStruct = cacheStruct;
+	 }
+
+	 public int getResolutionLevel() {
+		 return resolutionLevel;
+	 }
+
+	 public void setTaskStatus(TaskStatus taskStatus) {
+		 this.taskStatus = taskStatus;
+	 }
+
+	 public BandList getBandList() {
+		 return bandList;
+	 }
+
+	 public void setBandList(BandList bandList) {
+		 this.bandList = bandList;
+	 }
+
+	 /**
+	  * Buffer loaded by the provider and created by the store
+	  * @return
+	  */
+	 public Buffer getBufferForProviders() {
+		 return bufferForProviders;
+	 }
+	 
+	 public void setBufferResult(Buffer buffer) {
+		 this.bufferForProviders = buffer;
+	 }
+
+	 public void setBufferForProviders(Buffer buffer) throws QueryException {
+		 if(buffer.getWidth() != getAdjustedBufWidth() || buffer.getHeight() != getAdjustedBufHeight())
+			 throw new QueryException("Error in buffer size");
+		 this.bufferForProviders = buffer;
+	 }
+
+	 public double[] getStep() {
+		 return step;
+	 }
+
+	 /**
+	  * Gets the task status
+	  */
+	 public TaskStatus getTaskStatus() {
+		 return taskStatus;
+	 }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/DefaultRasterQuery.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferParamImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferParamImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferParamImpl.java	(revision 15423)
@@ -0,0 +1,157 @@
+package org.gvsig.raster.impl.buffer;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.BufferParam;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+
+/**
+ * Parameters to create buffers to store raster data
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class BufferParamImpl implements BufferParam {
+	private int              accessType     = UNDEFINED;
+	private int              dataType         = Buffer.TYPE_UNDEFINED;
+	private int              bandCount        = 0;
+	private int              width            = 0;
+	private int              height           = 0;
+	private int              x                = 0;
+	private int              y                = 0;
+	private boolean          malloc           = true;
+	
+	private RasterDataStore  roDataSource     = null;
+	private BandList         bandList         = null;
+	private int[]            roWindow         = null;
+	private Extent           roWindowExtent   = null;
+	
+	/**
+	 * Creates a parameter object for building a buffer. The buffer type is read-write.
+	 * This type could be changed after the creation of a {@link BufferParam} object.
+	 * @param  w
+	 *         Width
+	 * @param  h
+	 *         Height
+	 * @param  bandCount
+	 * 		   Number of bands
+	 * @param  dataType
+	 *         Type of data        
+	 */
+	public BufferParamImpl(int w, int h, int bandCount, int dataType, boolean malloc, int accessType) {
+		this.width = w;
+		this.height = h;
+		this.bandCount = bandCount;
+		this.dataType = dataType;
+		this.setMalloc(malloc);
+		this.accessType = accessType;
+	}
+	
+	/**
+	 * Creates a parameter object for building a buffer. For this call the buffer type 
+	 * is read-only. 
+	 */
+	public BufferParamImpl(RasterDataStore roDataSource, int[] window, BandList bandList) {
+		accessType = READ_ONLY;
+		this.setRoWindow(window);
+		this.width = window[2] - window[0];
+		this.height = window[3] - window[1];
+		this.bandCount = bandList.getDrawableBandsCount();
+		this.roDataSource = roDataSource;
+	}
+
+	public void setAccessType(int accessType) {
+		this.accessType = accessType;
+	}
+	
+	public int getAccessType() {
+		return accessType;
+	}
+
+	public void setBandList(BandList bandList) {
+		this.bandList = bandList;
+	}
+
+	public BandList getBandList() {
+		return bandList;
+	}
+	
+	public int getDataType() {
+		return dataType;
+	}
+
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+
+	public int getBandCount() {
+		return bandCount;
+	}
+
+	public void setBandCount(int bandCount) {
+		this.bandCount = bandCount;
+	}
+
+	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 int getX() {
+		return x;
+	}
+
+	public void setX(int x) {
+		this.x = x;
+	}
+
+	public int getY() {
+		return y;
+	}
+
+	public void setY(int y) {
+		this.y = y;
+	}
+	
+	public void setDataStore(RasterDataStore roDataSource) {
+		this.roDataSource = roDataSource;
+	}
+
+	public RasterDataStore getDataStore() {
+		return roDataSource;
+	}
+
+	public void setMalloc(boolean malloc) {
+		this.malloc = malloc;
+	}
+
+	public boolean isMalloc() {
+		return malloc;
+	}
+	
+	public void setRoWindow(int[] roWindow) {
+		this.roWindow = roWindow;
+	}
+
+	public int[] getRoWindow() {
+		return roWindow;
+	}
+	
+	public void setRoWindowExtent(Extent roWindow) {
+		this.roWindowExtent = roWindow;
+	}
+
+	public Extent getRoWindowExtent() {
+		return roWindowExtent;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferParamImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferInterpolation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferInterpolation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferInterpolation.java	(revision 15423)
@@ -0,0 +1,1072 @@
+/* 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.impl.buffer;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.process.IncrementableTask;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+
+/**
+ * Clase que contiene la funcionalidad para poder interpolar un buffer de datos
+ * por distintos m�todos.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @author Victor Olaya
+ */
+public class BufferInterpolation implements IncrementableTask {
+
+	private Buffer       buffer  = null;
+	private double       percent = 0;
+	
+	/**
+	 * Constructor. Asigna un RasterBuffer.
+	 * @param buf
+	 */
+	public BufferInterpolation(Buffer buf) {
+		this.buffer = buf;
+	}
+	
+	/**
+	 * Ajusta el raster al ancho y alto solicitado por el vecino m�s cercano. Promedia el valor de dos
+	 * pixeles contiguos.
+	 * @param w Nuevo ancho
+	 * @param h Nuevo alto
+	 */
+	public Buffer adjustRasterNearestNeighbourInterpolation(int w, int h) throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		
+		double stepX = (double) w / (double) buffer.getWidth();
+		double stepY = (double) h / (double) buffer.getHeight();
+		Buffer rasterBuf = DefaultRasterManager.getInstance().createBuffer(buffer.getDataType(), w, h, buffer.getBandCount(), true);
+		
+
+		int[] bands = new int[rasterBuf.getBandCount()];
+		for (int iBand = 0; iBand < rasterBuf.getBandCount(); iBand++)
+			bands[iBand] = iBand;
+
+		percent = 0;
+		double multip = 100.0D / (buffer.getHeight() * bands.length);
+		switch (buffer.getDataType()) {
+			case RasterBuffer.TYPE_BYTE:
+				for (int iBand = 0; iBand < bands.length; iBand++) {
+					if (w <= buffer.getWidth()) { // submuestreo
+						for (int iRow = 0; iRow < buffer.getHeight(); iRow++) {
+							for (int iCol = 0; iCol < buffer.getWidth(); iCol++)
+								rasterBuf.setElem((int) (iRow * stepY), (int) (iCol * stepX), bands[iBand], buffer.getElemByte(iRow, iCol, iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					} else { // supermuestreo
+						for (int iRow = 0; iRow < h; iRow++) {
+							for (int iCol = 0; iCol < w; iCol++)
+								rasterBuf.setElem(iRow, iCol, bands[iBand], buffer.getElemByte((int) (iRow / stepY), (int) (iCol / stepX), iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					}
+				}
+				break;
+			case RasterBuffer.TYPE_DOUBLE:
+				for (int iBand = 0; iBand < bands.length; iBand++) {
+					if (w <= buffer.getWidth()) { // submuestreo
+						for (int iRow = 0; iRow < buffer.getHeight(); iRow++) {
+							for (int iCol = 0; iCol < buffer.getWidth(); iCol++)
+								rasterBuf.setElem((int) (iRow * stepY), (int) (iCol * stepX), bands[iBand], buffer.getElemDouble(iRow, iCol, iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					} else { // supermuestreo
+						for (int iRow = 0; iRow < h; iRow++) {
+							for (int iCol = 0; iCol < w; iCol++)
+								rasterBuf.setElem(iRow, iCol, bands[iBand], buffer.getElemDouble((int) (iRow / stepY), (int) (iCol / stepX), iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					}
+				}
+				break;
+			case RasterBuffer.TYPE_FLOAT:
+				for (int iBand = 0; iBand < bands.length; iBand++) {
+					if (w <= buffer.getWidth()) { // submuestreo
+						for (int iRow = 0; iRow < buffer.getHeight(); iRow++) {
+							for (int iCol = 0; iCol < buffer.getWidth(); iCol++)
+								rasterBuf.setElem((int) (iRow * stepY), (int) (iCol * stepX), bands[iBand], buffer.getElemFloat(iRow, iCol, iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					} else { // supermuestreo
+						for (int iRow = 0; iRow < h; iRow++) {
+							for (int iCol = 0; iCol < w; iCol++)
+								rasterBuf.setElem(iRow, iCol, bands[iBand], buffer.getElemFloat((int) (iRow / stepY), (int) (iCol / stepX), iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					}
+				}
+				break;
+			case RasterBuffer.TYPE_INT:
+				for (int iBand = 0; iBand < bands.length; iBand++) {
+					if (w <= buffer.getWidth()) { // submuestreo
+						for (int iRow = 0; iRow < buffer.getHeight(); iRow++) {
+							for (int iCol = 0; iCol < buffer.getWidth(); iCol++)
+								rasterBuf.setElem((int) (iRow * stepY), (int) (iCol * stepX), bands[iBand], buffer.getElemInt(iRow, iCol, iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					} else { // supermuestreo
+						for (int iRow = 0; iRow < h; iRow++) {
+							for (int iCol = 0; iCol < w; iCol++)
+								rasterBuf.setElem(iRow, iCol, bands[iBand], buffer.getElemInt((int) (iRow / stepY), (int) (iCol / stepX), iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					}
+				}
+				break;
+			case RasterBuffer.TYPE_USHORT:
+			case RasterBuffer.TYPE_SHORT:
+				for (int iBand = 0; iBand < bands.length; iBand++) {
+					if (w <= buffer.getWidth()) { // submuestreo
+						for (int iRow = 0; iRow < buffer.getHeight(); iRow++) {
+							for (int iCol = 0; iCol < buffer.getWidth(); iCol++)
+								rasterBuf.setElem((int) (iRow * stepY), (int) (iCol * stepX), bands[iBand], buffer.getElemShort(iRow, iCol, iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					} else { // supermuestreo
+						for (int iRow = 0; iRow < h; iRow++) {
+							for (int iCol = 0; iCol < w; iCol++)
+								rasterBuf.setElem(iRow, iCol, bands[iBand], buffer.getElemShort((int) (iRow / stepY), (int) (iCol / stepX), iBand));
+							percent = (iBand * buffer.getHeight() + iRow) * multip;
+							if (task.getEvent() != null)
+								task.manageEvent(task.getEvent());
+						}
+					}
+				}
+				break;
+		}
+		return rasterBuf; 
+	}
+	
+	/**
+	 * Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci�n bilineal. Promedia
+	 * el valor de cuatro pixeles adyacentes.
+	 * <P>
+	 * Para cada pixel del raster A:(x, y) obtiene el B:(x + 1, y), C:(x, y + 1), D:(x + 1, y + 1)
+	 * Para cada valor del kernel se calcula un valor 'd' que es un peso dependiendo de su posici�n.
+	 * Este peso depende de la posici�n del pixel destino dentro del origen. La posici�n del pixel destino
+	 * en el origen es un valor decimal que puede ir de 0 a 1. Si est� muy pegado a la esquina superior
+	 * izquierda estar� cercano a 0 y si est� muy pegado a la esquina inferior derecha estar� cercano a 1.
+	 * Este valor est� representado por 'dx' y 'dy'. 
+	 * </P>
+	 * <P>
+	 * Los pesos aplicados son a
+	 * <UL> 
+	 * <LI>A (1-dx) * (1-dy)</LI>
+	 * <LI>B dx * (1-dy)</LI>
+	 * <LI>C (1-dx) * dy</LI>
+	 * <LI>D dx * dy</LI>
+	 * </UL>
+	 * La variable 'z' contiene el valor acumulado de cada peso por el valor del pixel.
+	 * La variable 'n' contiene el valor acumulado de los pesos de los cuatro pixeles.
+	 * El valor final del pixel ser� 'z/n', es decir un promedio del valor de los cuatro teniendo
+	 * en cuenta el peso de cada uno.
+	 * </P>
+	 * @param w Nuevo ancho del buffer de salida
+	 * @param h Nuevo alto del buffer de salida
+	 */
+	public Buffer adjustRasterBilinearInterpolation(int w, int h) throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		
+		double pxSizeX = (double) buffer.getWidth() / (double) w;
+		double pxSizeY = (double) buffer.getHeight() / (double) h;
+		Buffer rasterBuf = DefaultRasterManager.getInstance().createBuffer(buffer.getDataType(), w, h, buffer.getBandCount(), true);
+		
+		double posX, posY;
+		double dx = 0D, dy = 0D;
+
+		percent = 0;
+		double multip = 100.0D / (h * buffer.getBandCount());
+
+		for (int iBand = 0; iBand < buffer.getBandCount(); iBand++) {
+			posY = pxSizeY / 2D;
+			switch (buffer.getDataType()) {
+				case RasterBuffer.TYPE_BYTE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelByte(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (byte) ((byte) getBilinearValue(dx, dy, kernel) & 0xff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_SHORT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelShort(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (short) ((short) getBilinearValue(dx, dy, kernel) & 0xffff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_INT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelInt(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (int) ((int) getBilinearValue(dx, dy, kernel) & 0xff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_FLOAT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelFloat(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (float) getBilinearValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_DOUBLE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelDouble(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (double) getBilinearValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+			}
+		}
+
+		return rasterBuf;
+	}
+
+	/**
+	 * Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci�n de distancia inversa.
+	 * Asigna el valor de un pixel en funci�n inversa de la distancia.
+	 * <P>
+	 * Para cada pixel del raster A:(x, y) obtiene el B:(x + 1, y), C:(x, y + 1), D:(x + 1, y + 1)
+	 * Para cada valor del kernel se calcula un valor 'd' que es un peso dependiendo de su posici�n.
+	 * Este peso ser� dependiente de la posici�n del pixel destino dentro del origen. La posici�n del pixel destino
+	 * en el origen es un valor decimal que puede ir de 0 a 1. Si est� muy pegado a la esquina superior
+	 * izquierda estar� cercano a 0 y si est� muy pegado a la esquina inferior derecha estar� cercano a 1.
+	 * Este valor est� representado por 'dx' y 'dy'. En este caso, y a diferencia del m�todo
+	 * bilinear el peso vendr� representado por la inversa de la distancia entre la posici�n 
+	 * dentro del pixel y el origen del mismo.
+	 * </P>
+	 * <P>
+	 * Los pesos aplicados son a
+	 * <UL> 
+	 * <LI>A  1 / sqrt((1-dx) * (1-dy))</LI>
+	 * <LI>B  1 / sqrt(dx * (1-dy))</LI>
+	 * <LI>C  1 / sqrt((1-dx) * dy)</LI>
+	 * <LI>D  1 / sqrt(dx * dy)</LI>
+	 * </UL>
+	 * La variable 'z' contiene el valor acumulado de cada peso por el valor del pixel.
+	 * La variable 'n' contiene el valor acumulado de los pesos de los cuatro pixeles.
+	 * El valor final del pixel ser� 'z/n', es decir un promedio del valor de los cuatro teniendo
+	 * en cuenta el peso de cada uno.
+	 * </P>
+	 * @param w Nuevo ancho del buffer de salida
+	 * @param h Nuevo alto del buffer de salida
+	 */
+	public Buffer adjustRasterInverseDistanceInterpolation(int w, int h) throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		
+		double pxSizeX = (double) buffer.getWidth() / (double) w;
+		double pxSizeY = (double) buffer.getHeight() / (double) h;
+		Buffer rasterBuf = DefaultRasterManager.getInstance().createBuffer(buffer.getDataType(), w, h, buffer.getBandCount(), true);
+
+		double posX, posY;
+		double dx = 0D, dy = 0D;
+
+		percent = 0;
+		double multip = 100.0D / (h * buffer.getBandCount());
+
+		for (int iBand = 0; iBand < buffer.getBandCount(); iBand++) {
+			posY = pxSizeX / 2D;
+			switch (buffer.getDataType()) {
+				case RasterBuffer.TYPE_BYTE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelByte(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (byte) ((byte) getInverseDistanceValue(dx, dy, kernel) & 0xff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_SHORT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelShort(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (short) ((short) getInverseDistanceValue(dx, dy, kernel) & 0xffff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_INT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelInt(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (int) ((int) getInverseDistanceValue(dx, dy, kernel) & 0xff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_FLOAT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelFloat(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (float) getInverseDistanceValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_DOUBLE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[] kernel = getKernelDouble(((int) posX), ((int) posY), iBand);
+								rasterBuf.setElem(iRow, iCol, iBand, (double) getInverseDistanceValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+			}
+		}
+		return rasterBuf;
+	}
+
+	/**
+	 * Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci�n BSpline. Promedia
+	 * el valor de cuatro pixeles adyacentes.
+	 * @param w Nuevo ancho
+	 * @param h Nuevo alto
+	 */
+	public Buffer adjustRasterBSplineInterpolation(int w, int h) throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		
+		double pxSizeX = (double) buffer.getWidth() / (double) w;
+		double pxSizeY = (double) buffer.getHeight() / (double) h;
+		Buffer rasterBuf = DefaultRasterManager.getInstance().createBuffer(buffer.getDataType(), w, h, buffer.getBandCount(), true);
+
+		double posX, posY;
+		double dx = 0D, dy = 0D;
+
+		percent = 0;
+		double multip = 100.0D / (h * buffer.getBandCount());
+
+		for (int iBand = 0; iBand < buffer.getBandCount(); iBand++) {
+			posY = pxSizeY / 2D;
+			switch (buffer.getDataType()) {
+				case RasterBuffer.TYPE_BYTE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelByte(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (byte) ((byte) getBilinearValue(dx, dy, k) & 0xff));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (byte) ((byte) getBSplineValue(dx, dy, kernel) & 0xff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_SHORT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelShort(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (short) ((short) getBilinearValue(dx, dy, k) & 0xffff));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (short) ((short) getBSplineValue(dx, dy, kernel) & 0xffff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_INT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelInt(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (int) ((int) getBilinearValue(dx, dy, k) & 0xffffffff));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (int) ((int) getBSplineValue(dx, dy, kernel) & 0xffffffff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_FLOAT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelFloat(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (float) getBilinearValue(dx, dy, k));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (float) getBSplineValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_DOUBLE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelDouble(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (double) getBilinearValue(dx, dy, k));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (double) getBSplineValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+			}
+		}
+		return rasterBuf;
+	}
+
+	/**
+	 * Ajusta el raster al ancho y alto solicitado ajustando con una interpolaci�n de spline bicubica.
+	 * @param w Nuevo ancho
+	 * @param h Nuevo alto
+	 */
+	public Buffer adjustRasterBicubicSplineInterpolation(int w, int h) throws ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		
+		double pxSizeX = (double) buffer.getWidth() / (double) w;
+		double pxSizeY = (double) buffer.getHeight() / (double) h;
+		Buffer rasterBuf = DefaultRasterManager.getInstance().createBuffer(buffer.getDataType(), w, h, buffer.getBandCount(), true);
+
+		double posX, posY;
+		double dx = 0D, dy = 0D;
+
+		percent = 0;
+		double multip = 100.0D / (h * buffer.getBandCount());
+
+		for (int iBand = 0; iBand < buffer.getBandCount(); iBand++) {
+			posY = pxSizeY / 2D;
+			switch (buffer.getDataType()) {
+				case RasterBuffer.TYPE_BYTE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelByte(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (byte) ((byte) getBilinearValue(dx, dy, k) & 0xff));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (byte) ((byte) getBicubicSplineValue(dx, dy, kernel) & 0xff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_SHORT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelShort(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (short) ((short) getBilinearValue(dx, dy, k) & 0xffff));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (short) ((short) getBicubicSplineValue(dx, dy, kernel) & 0xffff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_INT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelInt(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (int) ((int) getBilinearValue(dx, dy, k) & 0xffffffff));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (int) ((int) getBicubicSplineValue(dx, dy, kernel) & 0xffffffff));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_FLOAT:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelFloat(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (float) getBilinearValue(dx, dy, k));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (float) getBicubicSplineValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+				case RasterBuffer.TYPE_DOUBLE:
+					for (int iRow = 0; iRow < h; iRow++) {
+						dy = posY - ((int) posY);
+						posX = pxSizeX / 2D;
+						for (int iCol = 0; iCol < w; iCol++) {
+							dx = posX - ((int) posX);
+							try {
+								double[][] kernel = get4x4Submatrix(((int) posX), ((int) posY), iBand);
+								if (kernel == null) {
+									double[] k = getKernelDouble(((int) posX), ((int) posY), iBand);
+									rasterBuf.setElem(iRow, iCol, iBand, (double) getBilinearValue(dx, dy, k));
+								} else
+									rasterBuf.setElem(iRow, iCol, iBand, (double) getBicubicSplineValue(dx, dy, kernel));
+							} catch (ArrayIndexOutOfBoundsException e) {
+								// System.out.println(posX + " " + posY);
+							}
+							posX += pxSizeX;
+						}
+						posY += pxSizeY;
+						percent = (iBand * h + iRow) * multip;
+						if (task.getEvent() != null)
+							task.manageEvent(task.getEvent());
+					}
+					break;
+			}
+		}
+		return rasterBuf;
+	}
+	
+	/**
+	 * 
+	 * @param dx
+	 * @param dy
+	 * @param kernel
+	 * @return
+	 */
+	private double getBicubicSplineValue(double dx, double dy, double[][] kernel) {
+		int	i;
+		double a0, a2, a3, b1, b2, b3;
+		double[] c = new double[4];
+
+		for(i = 0; i < 4; i++) {
+			a0 = kernel[0][i] - kernel[1][i];
+			a2 = kernel[2][i] - kernel[1][i];
+			a3 = kernel[3][i] - kernel[1][i];
+
+			b1 = -a0 / 3.0 + a2 - a3 / 6.0;
+			b2 = a0 / 2.0 + a2 / 2.0;
+			b3 = -a0 / 6.0 - a2 / 2.0 + a3 / 6.0;
+
+			c[i] = kernel[1][i] + b1 * dx + b2 * (dx * dx) + b3 * (dx * dx * dx);
+		}
+
+		a0 = c[0] - c[1];
+		a2 = c[2] - c[1];
+		a3 = c[3] - c[1];
+
+		b1 = -a0 / 3.0 + a2 - a3 / 6.0;
+		b2 =  a0 / 2.0 + a2 / 2.0;
+		b3 = -a0 / 6.0 - a2 / 2.0 + a3 / 6.0;
+
+		return( c[1] + b1 * dy + b2 * (dy * dy) + b3 * (dy * dy * dy) );
+	}
+
+	/**
+	 * 
+	 * @param dx
+	 * @param dy
+	 * @param kernel
+	 * @return
+	 */
+	private double getBSplineValue(double dx, double dy, double[][] kernel) {
+		int i = 0, ix = 0, iy = 0;
+		double px = 0, py = 0, z = 0;
+		double[] Rx = new double[4];
+		double[] Ry = new double[4];
+
+		for(i = 0, px = -1.0 - dx, py = -1.0 - dy; i < 4; i++, px++, py++){
+			Rx[i]	= 0.0;
+			Ry[i]	= 0.0;
+
+			if( (z = px + 2.0) > 0.0 )
+				Rx[i] += z * z * z;
+			if( (z = px + 1.0) > 0.0 )
+				Rx[i] += -4.0 * z * z * z;
+			if( (z = px + 0.0) > 0.0 )
+				Rx[i] += 6.0 * z * z * z;
+			if( (z = px - 1.0) > 0.0 )
+				Rx[i] += -4.0 * z * z * z;
+			if( (z = py + 2.0) > 0.0 )
+				Ry[i] += z * z * z;
+			if( (z = py + 1.0) > 0.0 )
+				Ry[i] += -4.0 * z * z * z;
+			if( (z = py + 0.0) > 0.0 )
+				Ry[i] += 6.0 * z * z * z;
+			if( (z = py - 1.0) > 0.0 )
+				Ry[i] += -4.0 * z * z * z;
+
+			Rx[i] /= 6.0;
+			Ry[i] /= 6.0;
+		}
+
+		for(iy = 0, z = 0.0; iy < 4; iy++) {
+			for(ix = 0; ix < 4; ix++) {
+				z	+= kernel[ix][iy] * Rx[ix] * Ry[iy];
+			}
+		}
+		return z;
+	}
+
+	/**
+	 * Calcula los valores N y Z para el m�todo bilinear y obtiene el valor del pixel como
+	 * Z / N
+	 * @param dx distancia en X desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param dy distancia en Y desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param kernel valor del pixel y alrededor 
+	 * @return valor del pixel
+	 */
+	private double getBilinearValue(double dx, double dy, double[] kernel) {
+		double z = 0.0, n = 0.0, d;
+		d = (1.0 - dx) * (1.0 - dy);
+		z += d * kernel[0];
+		n += d;
+
+		d = dx * (1.0 - dy);
+		z += d * kernel[1]; 
+		n += d;
+
+		d = (1.0 - dx) * dy;
+		z += d * kernel[2]; 
+		n += d;
+
+		d = dx * dy;
+		z += d * kernel[3]; 
+		n += d;
+
+		double b = 0;
+		if(n > 0.0)
+			b = (z / n);
+		return b;
+	}
+
+	/**
+	 * Calcula los valores N y Z para el m�todo de distancia inversa y calcula el valor del
+	 * pixel como Z / N.
+	 * @param dx distancia en X desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param dy distancia en Y desde el centro del pixel hasta el punto. Es un valor entre 0 y 1
+	 * @param kernel valor del pixel y alrededor 
+	 * @return valor del pixel
+	 */
+	private double getInverseDistanceValue(double dx, double dy, double[] kernel) {
+		double z = 0.0, n = 0.0, d;
+		double t = Math.sqrt(dx * dx + dy * dy);
+		d = 1.0 / ((t == 0) ? 0.5 : t);
+		z += d * kernel[0];
+		n += d;
+
+		t = Math.sqrt((1.0 - dx) * ( 1.0 - dx) + dy * dy);
+		d = 1.0 / ((t == 0) ? 0.5 : t);
+		z += d * kernel[1]; 
+		n += d;
+
+		t = Math.sqrt(dx * dx + (1.0 - dy) * (1.0 - dy));
+		d = 1.0 / ((t == 0) ? 0.5 : t);
+		z += d * kernel[2]; 
+		n += d;
+
+		t = Math.sqrt((1.0 - dx) *( 1.0 - dx) + (1.0 - dy) * (1.0 - dy));
+		d = 1.0 / ((t == 0) ? 0.5 : t);
+		z += d * kernel[3]; 
+		n += d;
+
+		double b = 0;
+		if(n > 0.0)
+			b = (z / n);
+		return b;
+	}
+
+	/**
+	 * Obtiene un kernel de 4x4 elementos. Si alguno de los elementos se sale de la imagen
+	 * , por ejemplo en los bordes devuelve null.  
+	 * @param x
+	 * @param y
+	 * @param band
+	 * @return
+	 */
+	private double[][] get4x4Submatrix(int x, int y, int band) {
+		int	ix, iy, px, py;
+		double[][] z_xy = new double[4][4];
+
+		for(iy = 0, py = y - 1; iy < 4; iy++, py++) {
+			for(ix = 0, px = x - 1; ix < 4; ix++, px++) {
+				if (!buffer.isInside(px, py))
+					return null;
+				else {
+					switch(buffer.getDataType()) {
+					case Buffer.TYPE_BYTE: z_xy[ix][iy] = (buffer.getElemByte(py, px, band) & 0xff); break;
+					case Buffer.TYPE_SHORT: z_xy[ix][iy] = (buffer.getElemShort(py, px, band) & 0xffff); break;
+					case Buffer.TYPE_INT: z_xy[ix][iy] = (buffer.getElemInt(py, px, band) & 0xffffffff); break;
+					case Buffer.TYPE_FLOAT: z_xy[ix][iy] = buffer.getElemFloat(py, px, band); break;
+					case Buffer.TYPE_DOUBLE: z_xy[ix][iy] = buffer.getElemDouble(py, px, band); break;
+					}
+				}
+			}
+		}
+		return z_xy;
+	}
+	  
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	private double[] getKernelByte(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = (buffer.getElemByte(y, x, band) & 0xff);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = (buffer.getElemByte(y, nextX, band) & 0xff);
+		d[2] = (buffer.getElemByte(nextY, x, band) & 0xff);
+		d[3] = (buffer.getElemByte(nextY, nextX, band) & 0xff);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	private double[] getKernelShort(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = (buffer.getElemShort(y, x, band) & 0xffff);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = (buffer.getElemShort(y, nextX, band) & 0xffff);
+		d[2] = (buffer.getElemShort(nextY, x, band) & 0xffff);
+		d[3] = (buffer.getElemShort(nextY, nextX, band) & 0xffff);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	private double[] getKernelInt(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = (buffer.getElemInt(y, x, band) & 0xffffffff);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = (buffer.getElemInt(y, nextX, band) & 0xffffffff);
+		d[2] = (buffer.getElemInt(nextY, x, band) & 0xffffffff);
+		d[3] = (buffer.getElemInt(nextY, nextX, band) & 0xffffffff);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	private double[] getKernelFloat(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = buffer.getElemFloat(y, x, band);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = buffer.getElemFloat(y, nextX, band);
+		d[2] = buffer.getElemFloat(nextY, x, band);
+		d[3] = buffer.getElemFloat(nextY, nextX, band);
+		return d;
+	}
+
+	/**
+	 * Obtiene un kernel de cuatro elemento que corresponden a los pixeles (x, y), (x + 1, y),
+	 * (x, y + 1), (x + 1, y + 1). Si los pixeles x + 1 o y + 1 se salen del raster de origen
+	 * se tomar� x e y. 
+	 * @param x Coordenada X del pixel inicial
+	 * @param y Coordenada Y del pixel inicial
+	 * @param band N�mero de banda.
+	 * @return Kernel solicitado en forma de array.
+	 */
+	private double[] getKernelDouble(int x, int y, int band) {
+		double[] d = new double[4];
+		d[0] = buffer.getElemDouble(y, x, band);
+		int nextX = ((x + 1) >= buffer.getWidth()) ? x : (x + 1);
+		int nextY = ((y + 1) >= buffer.getHeight()) ? y : (y + 1);
+		d[1] = buffer.getElemDouble(y, nextX, band);
+		d[2] = buffer.getElemDouble(nextY, x, band);
+		d[3] = buffer.getElemDouble(nextY, nextX, band);
+		return d;
+	}
+	
+	public int getPercent() {
+		return Math.min((int) percent, 100);
+	}
+
+	public String getLog() {
+		return null;
+	}
+
+	public boolean isCancelable() {
+		return true;
+	}
+
+	public boolean isPausable() {
+		return false;
+	}
+
+	public void setPercent(int value) {
+		this.percent = value;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/buffer/BufferInterpolation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/AbstractRasterProvider.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/AbstractRasterProvider.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/AbstractRasterProvider.java	(revision 15423)
@@ -0,0 +1,1265 @@
+/* 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.impl.provider;
+
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.net.URI;
+import java.security.NoSuchAlgorithmException;
+import java.util.Collection;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.List;
+
+import org.apache.commons.io.FilenameUtils;
+import org.cresques.cts.IProjection;
+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.DataServerExplorer;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.StoresRepository;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+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.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPointList;
+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.CloneException;
+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.ParsingException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+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.exception.ReadException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.raster.spi.AbstractCoverageStoreProvider;
+import org.gvsig.fmap.dal.resource.spi.ResourceProvider;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorer;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemServerExplorerParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.fmap.dal.spi.DataStoreProviderServices;
+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.DefaultNoData;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.datastruct.serializer.ColorTableRmfSerializer;
+import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer;
+import org.gvsig.raster.impl.store.AbstractRasterDataParameters;
+import org.gvsig.raster.impl.store.DefaultRasterStore;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.SimpleProviderHistogramComputer;
+import org.gvsig.raster.impl.store.properties.SimpleProviderStatistics;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.raster.impl.store.rmf.RmfBlocksManager;
+import org.gvsig.raster.impl.store.serializer.ColorInterpretationRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoInfoRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoPointListRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.ProjectionRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.StatisticsRmfSerializer;
+import org.gvsig.raster.util.DefaultProviderServices;
+import org.gvsig.timesupport.Interval;
+import org.gvsig.timesupport.Time;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.locator.LocatorException;
+import org.gvsig.tools.resourcesstorage.ResourcesStorage;
+import org.gvsig.tools.util.UnmodifiableBasicMap;
+
+/**
+ * Base class for all raster providers.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class AbstractRasterProvider extends AbstractCoverageStoreProvider implements RasterProvider {
+
+    private static final Logger LOG = LoggerFactory.getLogger(AbstractRasterProvider.class);
+
+	/**
+	 * Flags que representan a las bandas visualizables
+	 */
+	public static final int                   RED_BAND               = 0x01;
+	public static final int                   GREEN_BAND             = 0x02;
+	public static final int                   BLUE_BAND              = 0x04;
+	public static final int                   ALPHA_BAND             = 0x08;
+
+	protected int                             bandCount              = 1;
+	private int[]                             dataType               = null;
+	protected NoData                          noData                 = null;
+
+	protected Statistics                      stats                  = null;
+	protected HistogramComputer               histogram              = null;
+	protected DataStoreParameters             param                  = null;
+	protected DataStoreProviderServices       storeServices          = null;
+	protected RmfBlocksManager                rmfBlocksManager       = null;
+	protected ColorTable                      colorTable             = null;
+	private ColorInterpretation               colorInterpretation    = null;
+	protected TimeSeries                      serialInfo             = null;
+	protected Transparency                    transparency           = null;
+	protected TileServer                      tileServer             = null;
+	protected GeoPointList                    geoPointList           = null;
+
+	protected FileUtils                       fileUtil               = RasterLocator.getManager().getFileUtils();
+	protected RasterUtils                     rasterUtil             = RasterLocator.getManager().getRasterUtils();
+
+	protected IProjection                     proj                   = null;
+	protected long                            fileSize               = 0;
+	protected long                            bytesReaded            = 0;
+	protected long                            lineCnt                = 0;
+	protected URI                          uri;
+	protected String                          selectedSubdatasetID   = null;
+	/**
+	 * Transformaci�n creada a partir de la informaci�n de georreferencia de la
+	 * propia imagen. Esta informaci�n est� en la cabecera o en ficheros
+	 * worldfile.
+	 */
+	protected AffineTransform                 ownTransformation      = null;
+	/**
+	 * Transformaci�n asignada de forma externa, bien desde el fichero rmf o
+	 * asignada directamente por el usuario.
+	 */
+	protected AffineTransform                 externalTransformation = null;
+	private static Logger                     logger                 = LoggerFactory.getLogger(AbstractRasterProvider.class.getName());
+
+    public AbstractRasterProvider(AbstractRasterDataParameters params,
+        DataStoreProviderServices storeServices, DynObject metadata) {
+        super(params, storeServices, metadata);
+        if (params.getURI() != null) {
+            uri = params.getURI();
+            if ("FILE".equalsIgnoreCase(uri.getScheme())) {
+                File f = new File(uri);
+                if (f.exists()) {
+                    setFileSize(f.length());
+                }
+            }
+            uri = translateURI(uri);
+        }
+
+        // If there is a defined SRS, set it to provider. This must be override
+        // if provider is georeferenced.
+        if(params != null && params.getSRS() != null){
+            try {
+                this.setProjection(params.getSRS(), false);
+            } catch (RmfSerializerException e) {
+                LOG.warn("Can not persist {} parameter projection to {} provider",
+                    new Object[] { params.getSRSID(), this.getName() });
+            }
+        }
+
+        ownTransformation = new AffineTransform();
+        externalTransformation = new AffineTransform();
+    }
+
+	public AbstractRasterProvider(DataStoreParameters params,
+			DataStoreProviderServices storeServices, DynObject metadata) {
+		super(params, storeServices, metadata);
+		RasterDataParameters rasterParameters = (RasterDataParameters) params;
+		URI uriParam = rasterParameters.getURI();
+        if(uriParam != null) {
+            if ("FILE".equalsIgnoreCase(uriParam.getScheme())) {
+                File f = new File(uriParam);
+                if (f.exists())
+                    setFileSize(f.length());
+            }
+			if(params instanceof RemoteStoreParameters)
+				uri = translateURI(uriParam);
+		}
+
+        if(rasterParameters != null && rasterParameters.getSRS() != null){
+            try {
+                this.setProjection(rasterParameters.getSRS(), false);
+            } catch (RmfSerializerException e) {
+                LOG.warn("Can not persist {} parameter projection to {} provider",
+                    new Object[] { rasterParameters.getSRSID(), this.getName() });
+            }
+        }
+
+		ownTransformation = new AffineTransform();
+		externalTransformation = new AffineTransform();
+	}
+
+	public AbstractRasterProvider(String params) {
+		super();
+	}
+
+	public AbstractRasterProvider(URI uri) {
+        super();
+    }
+
+	public AbstractRasterProvider() {
+		super(null, null, null);
+	}
+
+	public String[] getFormatList() {
+		return null;
+	}
+
+	/**
+	 * Acciones de inicilizaci�n comunes a todos los drivers.
+	 * Este m�todo debe ser llamado explicitamente por el constructor de cada driver.
+	 * Estas son acciones de inicializaci�n que se ejecutan despu�s del constructor de cada driver.
+	 * Las acciones que hayan de ser realizadas antes se definen en el constructor de RasterDataset.
+	 */
+	protected void init() {
+	}
+
+	public boolean isRGB() {
+		if(getDataType()[0] == Buffer.TYPE_BYTE) {
+			ColorInterpretation ci = getColorInterpretation();
+			return ci.isRGB();
+		}
+		return false;
+	}
+
+	public boolean isARGB() {
+		if(getDataType()[0] == Buffer.TYPE_BYTE) {
+			ColorInterpretation ci = getColorInterpretation();
+			return ci.isRGBA();
+		}
+		return false;
+	}
+
+	public boolean isTiled() {
+		return false;
+	}
+
+	public boolean isTimeSupported() {
+		return false;
+	}
+
+	public RasterProvider cloneProvider() throws CloneException {
+		try {
+			DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+			AbstractRasterProvider provider = (AbstractRasterProvider)dataManager.createProvider(storeServices, param);
+			//DefaultRasterProvider provider = singleDatasetInstance(storeServices, param);
+			// Estas van por referencia
+			provider.histogram = histogram;
+			provider.stats = stats;
+			return provider;
+		} catch (ProviderNotRegisteredException e) {
+			e.printStackTrace();
+		} catch (InitializeException e) {
+			e.printStackTrace();
+		}
+		return null;
+	}
+
+	/**
+	 * Factoria para abrir distintos tipos de raster.
+	 * @param storeServices
+	 * @param param
+	 *
+	 * @return SingleDataset, o null si hay problemas.
+	 * @throws RasterDriverException
+	 */
+	@SuppressWarnings("unchecked")
+	public static AbstractRasterProvider singleDatasetInstance(DataStoreProviderServices storeServices, String param) throws RasterDriverException {
+		DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+		//We have to locate a provider's name which manages the selected file
+		//A FilesystemServerExplorer will give a getProviderNames service
+
+		FilesystemServerExplorer serverExplorer = null;
+		try {
+			FilesystemServerExplorerParameters paramsExplorer = (FilesystemServerExplorerParameters)dataManager.createServerExplorerParameters(FilesystemServerExplorer.NAME);
+			paramsExplorer.setRoot(File.separator);
+			serverExplorer = (FilesystemServerExplorer)dataManager.openServerExplorer(FilesystemServerExplorer.NAME, paramsExplorer);
+		} catch (ValidateDataParametersException e) {
+			throw new RasterDriverException("Error validating parameters", e);
+		} catch (InitializeException e) {
+			throw new RasterDriverException("Error creating a server explorer ", e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new RasterDriverException("Provider not registered", e);
+		}
+
+		//Gets the list of provider's name to manage the file
+		File file = new File(param);
+		List<String> provName = serverExplorer.getProviderNameList(file);
+		if(provName.size() > 0) {
+			for (int i = 0; i < provName.size(); i++) {
+				//Gets the first provider what is not a TileProvider
+				if(provName.get(i).compareTo("Tile Store") != 0) {
+					DataStoreParameters newparams;
+					try {
+						newparams = dataManager.createStoreParameters(provName.get(i));
+						((FilesystemStoreParameters)newparams).setFile(file);
+						if(storeServices == null)
+							storeServices = new DefaultRasterStore();
+						return (AbstractRasterProvider)dataManager.createProvider(storeServices, newparams);
+					} catch (InitializeException e) {
+						throw new RasterDriverException("Error creating a server explorer ", e);
+					} catch (ProviderNotRegisteredException e) {
+						throw new RasterDriverException("Provider not registered", e);
+					}
+				}
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Carga un fichero raster. Puede usarse para calcular el extent e instanciar
+	 * un objeto de este tipo.
+	 * @return RasterProvider
+	 */
+	abstract public RasterProvider load();
+
+	/**
+	 * Obtiene el ancho de la imagen
+	 * @return Ancho de la imagen
+	 */
+	abstract public double getWidth();
+
+	/**
+	 * Obtiene el ancho de la imagen
+	 * @return Ancho de la imagen
+	 */
+	abstract public double getHeight();
+
+	/**
+	 * Asigna un nuevo Extent
+	 * @param e	Extent
+	 */
+	public abstract void setView(Extent e);
+
+	/**
+	 * Obtiene el extent asignado
+	 * @return	Extent
+	 */
+	public abstract Extent getView();
+
+	/**
+	 * Obtiene el valor del raster en la coordenada que se le pasa.
+	 * El valor ser� Double, Int, Byte, etc. dependiendo del tipo de
+	 * raster.
+	 * @param x	coordenada X
+	 * @param y coordenada Y
+	 * @return data
+	 */
+	abstract public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException;
+
+	/**
+	 * Gets the set of data selected in the {@link RasterQuery}
+	 * @param q
+	 * @return buffer
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 */
+	public Buffer getDataSet(SpiRasterQuery query) throws ProcessInterruptedException, RasterDriverException {
+		SpiRasterQuery q = (SpiRasterQuery)query;
+		loadBuffer(q);
+		return q.getBufferForProviders();
+	}
+
+	/**
+	 * Load a buffer with the parameters. The buffer should already have been created
+	 * inside the query structure <code>SpiRasterQuery</code> by the <code>RasterDataStore</code>. The other
+	 * parameters have been calculated too, all of them adjusted to the raster limits. The provider only
+	 * have to read the parameters and load the buffer.
+	 *
+	 * @param query
+	 * @throws ProcessInterruptedException
+	 * @throws RasterDriverException
+	 */
+	abstract public void loadBuffer(SpiRasterQuery query) throws ProcessInterruptedException, RasterDriverException;
+
+	abstract public int getBlockSize();
+
+	abstract public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException;
+
+	/**
+	 * Informa de si el dataset soporta overviews o no.
+	 * @return true si soporta overviews y false si no las soporta.
+	 */
+	abstract public boolean isOverviewsSupported();
+
+	public void reload() {
+		try {
+			loadFromRmf(getRmfBlocksManager());
+		} catch (ParsingException e) {
+			logger.debug("No se ha podido leer el RMF", e);
+		}
+	}
+
+	/**
+	 * Carga metadatos desde el fichero Rmf si estos existen
+	 * @param fName Nombre del fichero
+	 * @throws ParsingException
+	 */
+	protected void loadFromRmf(RmfBlocksManager manager) throws ParsingException {
+		if (!manager.checkRmf())
+			return;
+
+		if (!new File(manager.getPath()).exists())
+			return;
+
+		GeoInfoRmfSerializer geoInfoSerializer = new GeoInfoRmfSerializer(this);
+		ColorTableRmfSerializer colorTableSerializer = new ColorTableRmfSerializer();
+		GeoPointListRmfSerializer gcpSerializer = new GeoPointListRmfSerializer();
+		NoDataRmfSerializer noDataSerializer = null;
+		if(noData == null)
+			noData = new DefaultNoData(null, null, manager.getPath(), getBandCount());
+		noDataSerializer = new NoDataRmfSerializer((DefaultNoData)noData);
+		ColorInterpretationRmfSerializer colorInterpSerializer = new ColorInterpretationRmfSerializer();
+		ProjectionRmfSerializer projectionRmfSerializer = new ProjectionRmfSerializer();
+		StatisticsRmfSerializer statsRmfSerializer = new StatisticsRmfSerializer(getStatistics());
+
+		manager.addClient(geoInfoSerializer);
+		manager.addClient(colorTableSerializer);
+		manager.addClient(gcpSerializer);
+		manager.addClient(noDataSerializer);
+		manager.addClient(colorInterpSerializer);
+		manager.addClient(projectionRmfSerializer);
+		manager.addClient(statsRmfSerializer);
+
+		manager.read(null);
+
+		manager.removeAllClients();
+
+		if (colorTableSerializer.getResult() != null)
+			setColorTable((ColorTable) colorTableSerializer.getResult());
+
+		if (colorInterpSerializer.getResult() != null) {
+			DataStoreColorInterpretation ci = (DataStoreColorInterpretation) colorInterpSerializer.getResult();
+			setColorInterpretation(ci);
+			getTransparency().setColorInterpretation(ci);
+			getTransparency().setTransparencyBand(ci.getBand(DataStoreColorInterpretation.ALPHA_BAND));
+		}
+
+		if (projectionRmfSerializer.getResult() != null) {
+			proj = (IProjection) projectionRmfSerializer.getResult();
+		}
+
+		if( gcpSerializer.getResult() != null &&
+			gcpSerializer.getResult() instanceof GeoPointList &&
+			((GeoPointList)gcpSerializer.getResult()).size() > 0) {
+			setGeoPointList((GeoPointList)gcpSerializer.getResult());
+		}
+	}
+
+	/**
+	 * Obtiene el n�mero de bandas del fichero
+	 * @return Entero que representa el n�mero de bandas
+	 */
+	public int getBandCount() {
+		return bandCount;
+	}
+
+	/**
+	 * @return Returns the dataType.
+	 */
+	public int[] getDataType() {
+		return dataType;
+	}
+
+	/**
+	 * @param dataType The dataType to set.
+	 */
+	public void setDataType(int[] dataType) {
+		this.dataType = dataType;
+	}
+
+	public double getPixelSizeX() {
+		return externalTransformation.getScaleX();
+	}
+
+	public double getPixelSizeY() {
+		return externalTransformation.getScaleY();
+	}
+
+	public NoData getNoDataValue() {
+		if(noData == null) {
+			noData = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(getBandCount(), getDataType()[0]);
+			noData.setNoDataTransparent(false);
+			File rmfFile = getRMFFile();
+			if(rmfFile!=null){
+			    noData.setFileName(rmfFile.getName());
+			}
+		}
+		return noData;
+	}
+
+	public void setNoDataValue(NoData value) {
+		this.noData = value;
+	}
+
+	/**
+	 * Dice si el fichero tiene georreferenciaci�n o no.
+	 * @return true si tiene georreferenciaci�n y false si no la tiene
+	 */
+	public boolean isGeoreferenced() {
+		return true;
+	}
+
+	/**
+	 * 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();
+		externalTransformation.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 {
+			externalTransformation.inverseTransform(pt, p);
+		} catch (NoninvertibleTransformException e) {
+			return pt;
+		}
+		return p;
+	}
+
+	/**
+	 * Calcula el extent en coordenadas del mundo real
+	 * @return Extent
+	 */
+	public Extent getExtent() {
+		return new ExtentImpl(	rasterToWorld(new Point2D.Double(0, 0)),
+							rasterToWorld(new Point2D.Double(getWidth(), getHeight())),
+							rasterToWorld(new Point2D.Double(getWidth(), 0)),
+							rasterToWorld(new Point2D.Double(0, getHeight())));
+	}
+
+	/**
+	 * Calcula el extent en coordenadas del mundo real sin rotaci�n. Solo coordenadas y tama�o de pixel
+	 * @return Extent
+	 */
+	public Extent getExtentWithoutRot() {
+		AffineTransform at = new AffineTransform(	externalTransformation.getScaleX(), 0,
+													0, externalTransformation.getScaleY(),
+													externalTransformation.getTranslateX(), externalTransformation.getTranslateY());
+		Point2D p1 = new Point2D.Double(0, 0);
+		Point2D p2 = new Point2D.Double(getWidth(), getHeight());
+		at.transform(p1, p1);
+		at.transform(p2, p2);
+		return new ExtentImpl(p1, p2);
+	}
+
+	/**
+	 * Asigna el par�metro de inicializaci�n del driver.
+	 * @param provServices
+	 * @param param
+	 */
+	public void setParam(DataStoreProviderServices provServices, DataStoreParameters param) {
+		if(param instanceof RasterDataParameters)
+			this.uri = ((RasterDataParameters)param).getURI();
+		this.param = param;
+		this.storeServices = provServices;
+	}
+
+	abstract public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException;
+
+	public void selectSubdataset() {}
+
+	/**
+	 * Selects the subdataset. This method will select
+	 * the rmf file.
+	 */
+	protected void selectSubdataset(String subdataset) {
+		selectedSubdatasetID = subdataset;
+		getRmfBlocksManager().setPath(getRMFFile().getPath());
+	}
+
+	/**
+	 * Obtiene el gestor de ficheros RMF
+	 * @return RmfBloksManager
+	 */
+	public RmfBlocksManager getRmfBlocksManager() {
+		File fileRMF = getRMFFile();
+		if(fileRMF != null) {
+			if (rmfBlocksManager == null || !fileRMF.equals(rmfBlocksManager)) {
+				rmfBlocksManager = new RmfBlocksManager(fileRMF.getPath());
+			}
+		}
+		return rmfBlocksManager;
+	}
+
+    public File getRMFFile() {
+        String tail = selectedSubdatasetID == null ? ".rmf" : "-sd" + selectedSubdatasetID + ".rmf";
+        File rmfFolder =
+            (getDataParameters() != null && getDataParameters() instanceof RasterDataParameters)
+                ? ((RasterDataParameters) getDataParameters()).getRMFFolder() : null;
+
+        String fileName;
+
+        URI objUri = getURI();
+        File file;
+        if ("FILE".equalsIgnoreCase(objUri.getScheme())) {
+            file = new File(objUri);
+            fileName = FilenameUtils.getBaseName(new File(objUri).getAbsolutePath());
+            if (rmfFolder == null) {
+                rmfFolder = file.getParentFile();
+                if ((getDataParameters() != null && getDataParameters() instanceof RasterDataParameters)) {
+                    ((RasterDataParameters) getDataParameters()).setRMFFolder(rmfFolder);
+                }
+            }
+            return new File(rmfFolder.getAbsolutePath() + File.separator + fileName + tail);
+        }
+        return new File(getRMFFileForRemoteServices(getName()));
+    }
+
+	protected String getRMFFileForRemoteServices(String layerName) {
+		String md5 = "";
+		try {
+			md5 = RasterLocator.getManager().getFileUtils().convertPathToMD5(uri.toString());
+		} catch (LocatorException e) {
+			logger.debug("Error getting the Locator", e);
+		} catch (NoSuchAlgorithmException e) {
+			logger.debug("Error getting the algorithm MD5", e);
+		}
+		File path = new File(RasterLibrary.pathRMFRemote);
+		if(!path.exists())
+			path.mkdir();
+		return RasterLibrary.pathRMFRemote + File.separator + md5 + "-" + layerName + ".rmf";
+	}
+
+	public boolean isInside(Point2D p){
+		//Realizamos los calculos solo si el punto est�n dentro del extent de la imagen rotada, as� nos ahorramos los calculos
+		//cuando el puntero est� fuera
+
+		Point2D pt = new Point2D.Double();
+		try {
+
+			getAffineTransform().inverseTransform(p, pt);
+			if(	pt.getX() >= 0 && pt.getX() < getWidth() &&
+					pt.getY() >= 0 && pt.getY() < getHeight())
+				return true;
+		} catch (NoninvertibleTransformException e) {
+			return false;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Consulta de si un raster tiene rotaci�n o no.
+	 * @return true si tiene rotaci�n y false si no la tiene.
+	 */
+	public boolean isRotated() {
+		if(externalTransformation.getShearX() != 0 || externalTransformation.getShearY() != 0)
+			return true;
+		return false;
+	}
+
+	public boolean isMultiFile() {
+		return false;
+	}
+
+	public boolean isMosaic() {
+		return false;
+	}
+
+	/**
+	 * Devuelve si el Dataset es reproyectable
+	 * @return true if Dataset is reproyectable
+	 */
+	public boolean isReproyectable() {
+		return true;
+	}
+
+	public String getWktProjection() {
+		if(proj != null && RasterLocator.getManager().isCRSUtilSupported())
+			return RasterLocator.getManager().getCRSUtils().convertIProjectionToWkt((IProjection) proj);
+		return null;
+	}
+
+	public void saveObjectToRmf(Class<?> class1, Object value) throws RmfSerializerException {
+        if (getRmfBlocksManager() != null) {
+            ((DefaultProviderServices) RasterLocator.getManager().getProviderServices()).saveObjectToRmfFile(
+                getRmfBlocksManager(), class1, value);
+        }
+	}
+
+	/**
+	 * Carga un objecto desde un serializador del tipo class1. Usa value para iniciar dicho
+	 * serializador
+	 *
+	 * @param class1
+	 * @param value
+	 * @return
+	 * @throws RmfSerializerException
+	 */
+	private static Object loadObjectFromRmfFile(RmfBlocksManager blocksManager, Class<?> class1, Object value) throws RmfSerializerException {
+		ClassSerializer serializerObject = ((DefaultProviderServices)RasterLocator.getManager().getProviderServices()).getSerializerObject(class1, value);
+
+		if (serializerObject == null)
+			throw new RmfSerializerException("No se ha podido encontrar el serializador para el Rmf");
+
+		if (!blocksManager.checkRmf())
+			throw new RmfSerializerException("Error al comprobar el fichero Rmf");
+
+		blocksManager.addClient(serializerObject);
+		try {
+			blocksManager.read(null);
+		} catch (ParsingException e) {
+			throw new RmfSerializerException("Error al leer el fichero Rmf", e);
+		}
+		blocksManager.removeAllClients();
+
+		return serializerObject.getResult();
+	}
+
+	public Object loadObjectFromRmf(Class<?> class1, Object value) throws RmfSerializerException {
+		RmfBlocksManager blocksManager = getRmfBlocksManager();
+		if(blocksManager!=null){
+		    return loadObjectFromRmfFile(blocksManager, class1, value);
+		}
+		return null;
+	}
+
+	/**
+	 * Carga un objeto del fichero RMF especificado por parametro
+	 * @param file
+	 * @param class1
+	 * @param value
+	 * @return Object
+	 * @throws RmfSerializerException
+	 */
+	public static Object loadObjectFromRmfFile(String file, Class<?> class1, Object value) throws RmfSerializerException {
+		String fileRMF = RasterLocator.getManager().getFileUtils().getNameWithoutExtension(file) + ".rmf";
+		RmfBlocksManager blocksManager = new RmfBlocksManager(fileRMF);
+		return loadObjectFromRmfFile(blocksManager, class1, value);
+	}
+
+	/**
+	 * Guarda en el RMF el objecto actual en caso de que exista un serializador para el
+	 * @param value
+	 * @throws RmfSerializerException
+	 */
+	public void saveObjectToRmf(Object value) throws RmfSerializerException {
+		saveObjectToRmf(value.getClass(), value);
+	}
+
+	/**
+	 * Carga un objecto desde un serializador usando el tipo del mismo objeto pasado por parametro.
+	 * Usa value para iniciar dicho serializador
+	 * @param value
+	 * @return Object
+	 * @throws RmfSerializerException
+	 */
+	public Object loadObjectFromRmf(Object value) throws RmfSerializerException {
+		return loadObjectFromRmf(value.getClass(), value);
+	}
+
+
+	public double getCellSize() {
+		try {
+			Extent e = getExtent();
+			double dCellsize = (e.getMax().getX() - e.getMin().getX() ) / getWidth();
+			return dCellsize;
+		} catch (NullPointerException e) {
+			return 1;
+		}
+	}
+
+
+	public RasterProvider newProvider() {
+		return null;
+	}
+
+	public ColorTable getColorTable() {
+		return colorTable;
+	}
+
+	public Image getImageLegend() {
+		return null;
+	}
+
+	public void setColorTable(ColorTable value) {
+		colorTable = value;
+	}
+
+	public Transparency getTransparency() {
+		return transparency;
+	}
+
+	public Metadata getMetadata() {
+		return null;
+	}
+
+	public ColorInterpretation getColorInterpretation() {
+		return this.colorInterpretation;
+	}
+
+	/**
+	 * Asigna el objeto que contiene que contiene la interpretaci�n de
+	 * color por banda
+	 * @param DataStoreColorInterpretation
+	 */
+	public void setColorInterpretation(ColorInterpretation colorInterpretation) {
+		this.colorInterpretation = colorInterpretation;
+	}
+
+	public Statistics getStatistics() {
+		if(stats == null) {
+			stats = new SimpleProviderStatistics(this);
+		}
+		return stats;
+	}
+
+	public void setStatistics(Statistics stats) throws RmfSerializerException {
+		this.stats = stats;
+		saveObjectToRmf(Statistics.class, stats);
+	}
+
+	public HistogramComputer getHistogramComputer() {
+		if (histogram == null)
+			histogram = new SimpleProviderHistogramComputer(this);
+		return histogram;
+	}
+
+    //****************************************************
+	//*********Implementing Disposable methods************
+	//****************************************************
+
+    public void doDispose() {
+
+    }
+
+    //****************************************************
+	//*****Implementing DataStoreProvider methods*********
+	//****************************************************
+
+	@Override
+	public DataServerExplorer getExplorer() throws ReadException,
+			ValidateDataParametersException {
+    	/*DataManager manager = DALLocator.getDataManager();
+		FilesystemServerExplorerParameters params;
+		try {
+			params = (FilesystemServerExplorerParameters) manager
+					.createServerExplorerParameters(FilesystemServerExplorer.NAME);
+			params.setRoot(((AbstractRasterStoreParameters)this.getDataParameters()).getFile().getParent());
+			return manager.createServerExplorer(params);
+		} catch (DataException e) {
+			throw new ReadException(this.getName(), e);
+		}*/
+    	return null;
+	}
+
+
+	/**
+	 * Returs the DataParameters
+	 * @return the DataParameters
+	 */
+	public RasterDataParameters getDataParameters() {
+		if(getDataStoreParameters() instanceof RasterDataParameters)
+			return (RasterDataParameters)getDataStoreParameters();
+		return null;
+	}
+
+	public Iterator<?> getChilds() {
+		return null;
+	}
+
+	public ResourceProvider getResource() {
+		return null;
+	}
+
+	public Object getSourceId() {
+		if( this.getDataParameters() instanceof RasterFileStoreParameters)
+			return ((RasterFileStoreParameters)this.getDataParameters()).getFile();
+		else
+			return this.getDataParameters().getURI();
+	}
+
+	public void open() throws OpenException {
+	}
+
+	/**
+	 * Traduce el nombre del fichero por un alias asignado por el propio driver.
+	 * Cuando es traducido por un alias el driver intentar� abrir el alias y no el
+	 * fichero. Esto es util porque algunos formatos tienen la extensi�n en el
+	 * fichero de cabecera pero lo que se abre realmente es el fichero de datos.
+	 * @param uri
+	 * @return uri
+	 */
+	public URI translateURI(URI uri) {
+	    return uri;
+	}
+
+	/*
+	 * Si alguna subclase necesita sobreescribir este m�todo, deber� hacerlo con el translateURI en lugar de este.
+	 */
+	public final String translateFileName(String fileName) {
+		return fileName;
+	}
+
+
+	public String getFileSuffix() {
+		String path = new File(getURIOfFirstProvider()).getAbsolutePath();
+        return FilenameUtils.getExtension(path);
+	}
+
+	public URI getURIOfFirstProvider() {
+	    //FIXME: Esto que lo sobreescriban los proveedores que no son de archivo
+//		return RasterLocator.getManager().getFileUtils().getFormatedRasterFileName(uri);
+	    return getURI();
+	}
+
+	public URI getURI() {
+		return uri;
+	}
+
+	public void setFName(String n) {
+	    File file = new File(n);
+	    uri = file.toURI();
+	}
+
+    public String getName() {
+        String pathName = null;
+        try {
+            URI x = this.getURI();
+            pathName = new File(x).getAbsolutePath();
+            return FilenameUtils.getBaseName(pathName);
+        } catch (Throwable th1) {
+            try {
+                return FilenameUtils.getBaseName(this.uri.getPath());
+            } catch (Throwable th2) {
+                return this.uri.getPath();
+            }
+        }
+    }
+
+	public String getFullName() {
+	    if(uri!=null && "FILE".equalsIgnoreCase(uri.getScheme())){
+	        return new File(uri).getAbsolutePath();
+	    } else {
+	        return uri.toString();
+	    }
+	}
+
+	/**
+	 * Gets the size of the file if exists in Bytes
+	 * @return the size of file
+	 */
+	public long getFileSize() {
+		return fileSize;
+	}
+
+	public void setFileSize(long sz) {
+		fileSize = sz;
+	}
+
+	public IProjection getProjection() {
+		return proj;
+	}
+
+	public void setProjection(IProjection proj, boolean persist) throws RmfSerializerException {
+		this.proj = proj;
+		if(persist) {
+			saveObjectToRmf(IProjection.class, proj);
+		}
+	}
+
+	protected long getTime() {
+		return (new Date()).getTime();
+	}
+
+	public void setAffineTransform(AffineTransform t) {
+		externalTransformation = (AffineTransform) t.clone();
+	}
+
+	public AffineTransform getAffineTransform() {
+		return externalTransformation;
+	}
+
+	/**
+	 * Elimina la matriz de transformaci�n asociada al raster y que se tiene en
+	 * cuenta para el setView. Este reseteo tendr� en cuenta que si el raster
+	 * tiene asociado un rmf esta transformaci�n no ser� eliminada sino que se
+	 * asignar� la correspondiente al rmf existente.
+	 */
+	public void resetAffineTransform() {
+		externalTransformation.setToIdentity();
+	}
+
+	public AffineTransform getOwnAffineTransform() {
+		return ownTransformation;
+	}
+
+	public String getInfoByPoint(double x, double y, ICancellable cancellable) throws InfoByPointException {
+		return null;
+	}
+
+	public String getInfoByPoint(int x, int y, Extent bbox, int w, int h, ICancellable cancellable) throws InfoByPointException {
+		return null;
+	}
+
+	public void setTileServer(Class<?> tileServer) throws InitializeException {
+
+	}
+
+	public int[] getTileSize(int level) {
+		return new int[]{0, 0};
+	}
+
+	public boolean isRasterEnclosed() {
+		return false;
+	}
+
+	public int getSourceType() {
+	    String scheme = getURI().getScheme();
+        if("PG".equalsIgnoreCase(scheme)){
+	           return RasterDataStore.POSTGIS;
+	    } else if ("http".equalsIgnoreCase(scheme) || "https".equalsIgnoreCase(scheme)) {
+            return RasterDataStore.REMOTE;
+	    }
+        //"file".equalsIgnoreCase(scheme)
+		return RasterDataStore.FILE;
+	}
+
+	/**
+	 * Most of providers don't need tiles. It those cases this method
+	 * won't execute anything. Only providers that use tile cache will need
+	 * implement this function, for instance TileProvider and MosaicProvider.
+	 */
+	public void deleteLayerFromCache() {
+
+	}
+
+	public TimeSeries getTimeSerials() throws RmfSerializerException {
+		if(serialInfo == null) {
+			serialInfo =  new DefaultTimeSerials();
+			loadObjectFromRmf(TimeSeries.class, serialInfo);
+			//Seleccionamos la primera serie por defecto. El usuario seleccionar� otra si la necesita
+			serialInfo.selectSerial(0);
+		}
+		return serialInfo;
+	}
+
+	public void setTimeSerials(TimeSeries serialInfo) throws RmfSerializerException {
+		this.serialInfo = serialInfo;
+		saveObjectToRmf(TimeSeries.class, serialInfo);
+	}
+
+	public long[] getFileSizeByProvider() {
+		return new long[]{getFileSize()};
+	}
+
+	public URI[] getURIByProvider() {
+		//For providers with one file
+		return new URI[]{getURIOfFirstProvider()};
+	}
+
+	public int[] getBandCountByProvider() {
+		return new int[]{getBandCount()};
+	}
+
+	public int getInternalProviderCount() {
+		return 1;
+	}
+
+	public RasterProvider getInternalProvider(int i) {
+		return this;
+	}
+
+	public URI getURIByBand(int band) {
+		//No matter which band be selected. In providers with one file is always the first URI
+		return getURIOfFirstProvider();
+	}
+
+	public int getBandPositionByProvider(int band) {
+		return band;
+	}
+
+	public int getSubdatasetCount() {
+		return 0;
+	}
+
+//	public void addFile(File file) throws InvalidSourceException {
+//		//Do nothing
+//	}
+//
+//	public void removeFile(File file) {
+//		//Do nothing
+//	}
+
+	public boolean needEnhanced() {
+		return false;
+	}
+
+	/**
+	 * Gets the {@link Interval} of the store, that means the temporal
+	 * interval where the store has valid data.
+	 * In raster this method has sense in a mosaic. Therefore this has to be implemented
+	 * by the provider.
+	 * @return
+	 *         a time interval or null if there is not time support
+	 */
+	public Interval getInterval() {
+		return null;
+	}
+
+	/**
+	 * Gets all the possible values of time for which the store has data.
+	 * In raster this method has sense in a mosaic. Therefore this has to be implemented
+	 * by the provider.
+	 * @return
+	 *         a collection of {@link Time} objects.
+	 */
+	public Collection<?> getTimes() {
+		return null;
+	}
+
+	/**
+	 * Gets all the possible values of time for which the store has data
+	 * and intersects with an interval.
+	 * In raster this method has sense in a mosaic. Therefore this has to be implemented
+	 * by the provider.
+	 * @param interval
+	 *         the interval of time
+	 * @return
+	 *         a collection of {@link Time} objects.
+	 */
+	public Collection<?> getTimes(Interval interval) {
+		return null;
+	}
+
+	/**
+	 * Gets the list of geo points associated to this provider
+	 * @return the list of geo points
+	 */
+	public GeoPointList getGeoPointList() {
+		return geoPointList;
+	}
+
+	/**
+	 * Sets the list of geo points associated to this provider
+	 */
+	public void setGeoPointList(GeoPointList geoPointList) {
+		this.geoPointList = geoPointList;
+	}
+
+	/**
+	 * @deprecated This method should not be used. The store have a getDefaultBandList
+	 * @return BandList
+	 */
+	public BandList getDefaultBandList() {
+		BandList bandList = new BandListImpl();
+		URI[] uriByProvider = getURIByProvider();
+		int[] nBandsByProvider = getBandCountByProvider();
+
+		for (int iProvider = 0; iProvider < uriByProvider.length; iProvider++) {
+			for (int iBand = 0; iBand < nBandsByProvider[iProvider]; iBand++) {
+				try {
+                    bandList.addBand(new DatasetBandImpl(
+                        new File(uriByProvider[iProvider]).getAbsolutePath(),
+                        iBand,
+                        getDataType()[0],
+                        nBandsByProvider[iProvider])
+                    );
+				} catch (BandNotFoundInListException e1) {
+				}
+			}
+		}
+
+		int[] drawableBands = new int[bandList.getBandCount()];
+		for (int i = 0; i < bandList.getBandCount(); i++) {
+			drawableBands[i] = i;
+		}
+
+		bandList.setDrawableBands(drawableBands);
+		return bandList;
+	}
+
+	public void close() {
+		if(transparency != null)
+			transparency.dispose();
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+
+	protected void finalize() throws Throwable {
+		dataType               = null;
+		noData                 = null;
+		stats                  = null;
+		histogram              = null;
+		param                  = null;
+		storeServices          = null;
+		rmfBlocksManager       = null;
+		colorTable             = null;
+		colorInterpretation    = null;
+		serialInfo             = null;
+		transparency           = null;
+		tileServer             = null;
+		fileUtil               = null;
+		rasterUtil             = null;
+		proj                   = null;
+		uri                    = null;
+		selectedSubdatasetID   = null;
+		ownTransformation      = null;
+		externalTransformation = null;
+	}
+                
+    @Override
+    public UnmodifiableBasicMap<String, DataStore> getChildren() {
+        return null;
+    }
+
+    @Override
+    public StoresRepository getStoresRepository() {
+        return null;
+    }
+
+    @Override
+    public ResourcesStorage getResourcesStorage() {
+        return null;
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/AbstractRasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/PixelSquareStructure.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/PixelSquareStructure.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/PixelSquareStructure.java	(revision 15423)
@@ -0,0 +1,51 @@
+package org.gvsig.raster.impl.provider.fusion;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+
+/** 
+ * Structure which represents a bitmap
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PixelSquareStructure {
+	public double               pixelSize                 = 0;
+	public int                  dataType                  = Buffer.TYPE_UNDEFINED;
+	public int                  bandCount                 = 0;
+	public int                  width                     = 0;
+	public int                  height                    = 0;
+	public Extent               bbox                      = null;
+	public NoData               nodata                    = null;
+	public Buffer               buffer                    = null;
+	
+	public PixelSquareStructure(
+			Buffer buf,
+			Extent bbox,
+			double pixelSize) {
+		this.pixelSize = pixelSize;
+		this.dataType = buf.getDataType();
+		this.bandCount = buf.getBandCount();
+		this.width = buf.getWidth();
+		this.height = buf.getHeight();
+		nodata = buf.getNoDataValue() != null ? 
+				buf.getNoDataValue() : 
+				RasterLocator.getManager().getDataStructFactory().createDefaultNoData(bandCount, dataType);
+		this.bbox = bbox;
+		this.buffer = buf;
+	}
+	
+	public PixelSquareStructure(
+			double pixelSize,
+			int bandCount,
+			int datatype) {
+		this.pixelSize = pixelSize;
+		this.dataType = datatype;
+		this.bandCount = bandCount;
+		this.width = (int)Math.ceil(bbox.width() * pixelSize);
+		this.height = (int)Math.ceil(bbox.height() * pixelSize);
+		nodata = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(bandCount, datatype);
+	}
+}
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/PixelSquareStructure.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/AbstractFusionMethod.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/AbstractFusionMethod.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/AbstractFusionMethod.java	(revision 15423)
@@ -0,0 +1,84 @@
+package org.gvsig.raster.impl.provider.fusion;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+
+public abstract class AbstractFusionMethod {
+	protected PixelSquareStructure     pxSquare  = null;
+	
+	public class SubSquare {
+		private Buffer buffer        = null;
+		private AffineTransform    parentTransform  = null;
+		private AffineTransform    squareTransform  = null;
+		private Extent             squareExtent     = null;
+		
+		public SubSquare(
+				Extent parentExtent,
+				Rectangle2D parentSize,
+				Extent squareExtent,
+				Rectangle2D squareSize,
+				Buffer buf) {
+			this.buffer = buf;
+			this.squareExtent = squareExtent;
+			parentTransform = new AffineTransform(
+					parentExtent.width() /  parentSize.getWidth(), 
+					0, 0, 
+					-(parentExtent.height() /  parentSize.getHeight()), 
+					parentExtent.getULX(), 
+					parentExtent.getULY());
+			
+			squareTransform = new AffineTransform(
+					squareExtent.width() /  squareSize.getWidth(), 
+					0, 0, 
+					-(squareExtent.height() /  squareSize.getHeight()), 
+					squareExtent.getULX(), 
+					squareExtent.getULY());
+		}
+		
+		private Point2D parentRasterToWorld(Point2D pt) {
+			return parentTransform.transform(pt, pt);
+		}
+
+		private Point2D squareWorldToRaster(Point2D pt) {
+			try {
+				return squareTransform.inverseTransform(pt, pt);
+			} catch (NoninvertibleTransformException e) {
+				return pt;
+			}
+		}
+		
+		/**
+		 * Returns true if the pixel coordinates relative to the parent buffer is inside of this square
+		 * @param row
+		 * @param col
+		 * @return
+		 */
+		public Point2D getLocalCoords(int row, int col) {
+			Point2D p = parentRasterToWorld(new Point2D.Double(col, row));
+			if (p.getX() >= squareExtent.getULX() && p.getX() <= squareExtent.getLRX() && p.getY() <= squareExtent.getULY()  && p.getY() >= squareExtent.getLRY()) {
+				return squareWorldToRaster(p);
+			}
+			return null;
+		}
+		
+		public Buffer getBuffer() {
+			return buffer;
+		}
+	}
+	
+	public AbstractFusionMethod(PixelSquareStructure pxSquare) {
+		this.pxSquare = pxSquare;
+	}
+	
+	public abstract Byte getByteValue(int row, int col, int band);
+	
+	public abstract Float getFloatValue(int row, int col, int band);
+	
+	public abstract int getBandCount();
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/AbstractFusionMethod.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/BufferListFusion.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/BufferListFusion.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/BufferListFusion.java	(revision 15423)
@@ -0,0 +1,244 @@
+package org.gvsig.raster.impl.provider.fusion;
+
+import java.awt.geom.Rectangle2D;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+
+/** 
+ * Buffer composed by a list of buffers and its extents. The buffers are not tiles and it can
+ * be superposed among them. The number of pixel of each buffer can be different too. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class BufferListFusion {
+	//private Logger           log          = LoggerFactory.getLogger(MemoryMatrixBuffer.class);
+	public static int            FIRST                     = 0;
+	public static int            LAST                      = 0;
+	public static int            MIXED                     = 0;
+	public static int            MINIMUM                   = 0;
+	public static int            MAXIMUM                   = 0;
+	public static int            AVERAGE                   = 0;
+	
+	public static int            COLOR_STATISTICS          = 0;
+	public static int            COLOR_HISTOGRAM           = 0;
+	public static int            COLOR_LINEAR_CORRELATION  = 0;
+	
+	private List<Buffer>         bufferList                = null;
+	private List<Extent>         bboxList                  = null;
+	private PixelSquareStructure pxSquare                  = null;
+	private AbstractFusionMethod fusion                    = null;
+	private int                  alphaBandNumber           = -1;
+	
+	public BufferListFusion(
+			List<Buffer> bufferList,
+			PixelSquareStructure pxSquare,
+			int fusionMethod) {
+		this.bufferList = bufferList;
+		if(pxSquare.bbox == null) {
+			Extent bbox = getBoundingBox();
+			pxSquare.bbox = bbox;
+		}
+		this.pxSquare = pxSquare;
+		
+		if(fusionMethod == FIRST) {
+			fusion = new FirstFusionMethod(bufferList, pxSquare);
+		}
+	}
+	
+	/**
+	 * Gets a entire window from buffers
+	 * @param ext
+	 * @param buf
+	 * @return
+	 */
+	public Buffer getWindow() {
+		if(pxSquare.dataType == Buffer.TYPE_BYTE) {
+			for (int row = 0; row < pxSquare.buffer.getHeight(); row++) {
+				for (int col = 0; col < pxSquare.buffer.getWidth(); col++) {
+					boolean hasData = false;
+					
+					for (int band = 0; band < fusion.getBandCount(); band++) {
+						Byte value = fusion.getByteValue(row, col, band);
+						if(value != null) {
+							pxSquare.buffer.setElem(row, col, band, value.byteValue());
+							hasData = true;
+							value = null;
+						}
+					}
+					
+					for (int band = fusion.getBandCount(); band < pxSquare.buffer.getBandCount(); band++) {
+						pxSquare.buffer.setElem(row, col, band, (byte)255);	
+					}
+					
+					if(alphaBandNumber != -1 && alphaBandNumber < pxSquare.buffer.getBandCount())
+						if(hasData) //No data has been written
+							pxSquare.buffer.setElem(row, col, alphaBandNumber, (byte)255);
+						else
+							pxSquare.buffer.setElem(row, col, alphaBandNumber, (byte)0);
+				}	
+			}
+		}
+
+		if(pxSquare.dataType == Buffer.TYPE_FLOAT) {
+			for (int row = 0; row < pxSquare.buffer.getHeight(); row++) {
+				for (int col = 0; col < pxSquare.buffer.getWidth(); col++) {
+					for (int band = 0; band < fusion.getBandCount(); band++) {
+						pxSquare.buffer.setElem(row, col, band, fusion.getFloatValue(row, col, band));
+					}
+					for (int band = fusion.getBandCount(); band < pxSquare.buffer.getBandCount(); band++) {
+						pxSquare.buffer.setElem(row, col, band, 0F);	
+					}
+				}	
+			}
+		}
+		return pxSquare.buffer;
+	}
+	
+	/**
+	 * Sets a band to NODATA value 
+	 * @param bufResult
+	 * @param tileExtent
+	 * @param buf
+	 * @param ex
+	 * @param pixelSize
+	 */
+	protected void clearMaskBuffer(Buffer buf) {
+		if(buf.getDataType() == Buffer.TYPE_BYTE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+						buf.setElem(i, j, iBand, pxSquare.nodata.getValue().byteValue());						
+					}
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_SHORT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+						buf.setElem(i, j, iBand, pxSquare.nodata.getValue().shortValue());						
+					}
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_INT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+						buf.setElem(i, j, iBand, pxSquare.nodata.getValue().intValue());						
+					}
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_FLOAT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+						buf.setElem(i, j, iBand, pxSquare.nodata.getValue().floatValue());						
+					}
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_DOUBLE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+						buf.setElem(i, j, iBand, pxSquare.nodata.getValue().doubleValue());						
+					}
+				}
+			}
+			return;
+		}
+	}
+	
+	private Extent getBoundingBox() {
+		double minX = Double.MAX_VALUE;
+		double minY = Double.MAX_VALUE;
+		double maxX = 0;
+		double maxY = 0;
+		if(bboxList != null) {
+			for (int i = 0; i < bboxList.size(); i++) {
+				Extent e = bboxList.get(i);
+				if(e.getMin().getX() < minX)
+					minX = e.getMin().getX();
+				if(e.getMin().getY() < minY)
+					minY = e.getMin().getY();
+				if(e.getMax().getX() > maxX)
+					maxX = e.getMax().getX();
+				if(e.getMax().getY() > maxY)
+					maxY = e.getMax().getY();
+			}
+		} else {
+			for (int i = 0; i < bufferList.size(); i++) {
+				Rectangle2D e = bufferList.get(i).getDataExtent();
+				if(e.getX() < minX)
+					minX = e.getX();
+				if((e.getY() - e.getHeight()) < minY)
+					minY = (e.getY() - e.getHeight());
+				if((e.getX() + e.getWidth()) > maxX)
+					maxX = (e.getX() + e.getWidth());
+				if(e.getY() > maxY)
+					maxY = e.getY();
+			}
+		}
+		return new ExtentImpl(minX, minY, maxX, maxY);
+	}
+	
+	public void dispose() {
+		for (int i = 0; i < bufferList.size(); i++) {
+			bufferList.get(i).dispose();
+		}
+		bufferList.clear();
+	}
+
+	public void setAlphaBand(int alphaBandNumber) {
+		this.alphaBandNumber = alphaBandNumber;
+	}
+	
+	/*public void setNoDataValue(int datatype) {
+		NoData noData = RasterLocator.getManager().getDataStructFactory().createDefaultNoData(bandCount, datatype);
+		switch (datatype) {
+		case Buffer.TYPE_BYTE:
+			byteNoData = noData.getValue().byteValue();
+			break;
+		case Buffer.TYPE_SHORT:
+			shortNoData = noData.getValue().shortValue();
+			break;
+		case Buffer.TYPE_INT:
+			intNoData = noData.getValue().intValue();
+			break;
+		case Buffer.TYPE_FLOAT:
+			floatNoData = noData.getValue().floatValue();
+			break;
+		case Buffer.TYPE_DOUBLE:
+			doubleNoData = ((NoData)noData).getValue().doubleValue();
+			break;
+		}
+	}
+	
+	private Extent getIntersectionBoundingBox(Extent bbox) {
+		Extent intersection = bbox;
+		if(bboxList != null) {
+			for (int i = 0; i < bboxList.size(); i++) {
+				Extent e = bboxList.get(i);
+				intersection = intersection.intersection(e);
+			}
+		} else {
+			for (int i = 0; i < bufferList.size(); i++) {
+				Rectangle2D r = bufferList.get(i).getDataExtent();
+				Extent e = new ExtentImpl(r.getMinX(), r.getMinY(), r.getMaxX(), r.getMaxY());
+				intersection = intersection.intersection(e);
+			}
+		}
+		return intersection;
+	}*/
+	
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/BufferListFusion.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/FirstFusionMethod.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/FirstFusionMethod.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/FirstFusionMethod.java	(revision 15423)
@@ -0,0 +1,120 @@
+package org.gvsig.raster.impl.provider.fusion;
+
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+
+public class FirstFusionMethod extends AbstractFusionMethod {
+	protected SubSquareList     subSquareList    = null;
+	private int                 bandCount        = 0;
+	
+	private int[]               lastPixelCoords  = new int[]{-1, -1};
+	private byte[]              dataByte         = null;
+	private short[]             dataShort        = null;
+	private int[]               dataInt          = null;
+	private float[]             dataFloat        = null;
+	private double[]            dataDouble       = null;
+	
+	public class SubSquareList extends ArrayList<SubSquare> {
+		private static final long serialVersionUID = 1L;
+		private int               bandCount        = 0;
+		
+		public SubSquareList(int bandCount) {
+			this.bandCount = bandCount;
+		}
+		
+		public byte[] getByteValue(int row, int col) {
+			byte[] value = new byte[bandCount];
+			for (int i = 0; i < size(); i++) {
+				Point2D coord = get(i).getLocalCoords(row, col);
+				if(coord != null) {
+					get(i).getBuffer().getElemByte((int)coord.getY(), (int)coord.getX(), value);
+					return value;
+				}
+			}
+			return null;
+		}
+		
+		public float[] getFloatValue(int row, int col) {
+			float[] value = new float[bandCount];
+			for (int i = 0; i < size(); i++) {
+				Point2D coord = get(i).getLocalCoords(row, col);
+				if(coord != null) {
+					get(i).getBuffer().getElemFloat((int)coord.getY(), (int)coord.getX(), value);
+					return value;
+				}
+			}
+			return null;
+		}
+	}
+	
+	public FirstFusionMethod(
+			List<Buffer> bufferList, 
+			PixelSquareStructure pxSquare) {
+		super(pxSquare);
+		switch (pxSquare.dataType) {
+		case Buffer.TYPE_BYTE:
+			dataByte = new byte[pxSquare.bandCount];
+			break;
+		case Buffer.TYPE_SHORT:
+			dataShort = new short[pxSquare.bandCount];
+			break;
+		case Buffer.TYPE_INT:
+			dataInt = new int[pxSquare.bandCount];
+			break;
+		case Buffer.TYPE_FLOAT:
+			dataFloat = new float[pxSquare.bandCount];
+			break;
+		case Buffer.TYPE_DOUBLE:
+			dataDouble = new double[pxSquare.bandCount];
+			break;
+		}
+		
+		for (int i = 0; i < bufferList.size(); i++) {
+			bandCount = bufferList.get(i).getBandCount() > bandCount ? bufferList.get(i).getBandCount() : bandCount; 
+		}
+		
+		subSquareList = new SubSquareList(bandCount);
+		for (int i = 0; i < bufferList.size(); i++) {
+			SubSquare square = new SubSquare(
+					pxSquare.bbox, 
+					new Rectangle2D.Double(0, 0, pxSquare.width, pxSquare.height),
+					new ExtentImpl(bufferList.get(i).getDataExtent()),
+					new Rectangle2D.Double(0, 0, bufferList.get(i).getWidth(), bufferList.get(i).getHeight()),
+					bufferList.get(i));
+			subSquareList.add(square);
+		}
+	}
+	
+	public Byte getByteValue(int row, int col, int band) {
+		if(row != lastPixelCoords[0] || col != lastPixelCoords[1]) {
+			//Lee todas las bandas de una y devuelve la que corresponda al par�metro band
+			dataByte = subSquareList.getByteValue(row, col);
+			lastPixelCoords[0] = row;
+			lastPixelCoords[1] = col;
+		}
+		if(dataByte != null)
+			return dataByte[band];
+		return null;
+	}
+
+	public Float getFloatValue(int row, int col, int band) {
+		if(row == lastPixelCoords[0] && col == lastPixelCoords[1]) {
+			dataFloat = subSquareList.getFloatValue(row, col);
+			lastPixelCoords[0] = row;
+			lastPixelCoords[1] = col;
+		}
+		if(dataFloat != null)
+			return dataFloat[band];
+		return null;
+	}
+	
+	public int getBandCount() {
+		return bandCount;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/fusion/FirstFusionMethod.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/MemoryTileMatrixBuffer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/MemoryTileMatrixBuffer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/MemoryTileMatrixBuffer.java	(revision 15423)
@@ -0,0 +1,515 @@
+/* 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.impl.provider;
+
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+
+/** 
+ * Buffer composed by a list of tiles and its extents. 
+ * It will expose a method getWindow to read a window of data from the tile list.
+ * The list of tiles have to make a square.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MemoryTileMatrixBuffer {
+	//private Logger           log          = LoggerFactory.getLogger(MemoryMatrixBuffer.class);
+	private Buffer[]         bufferList   = null;
+	private int              nRows        = 0;
+	private int              nCols        = 0;	
+	@SuppressWarnings("unused")
+	private Extent           bbox         = null;
+	private List<Tile>       tileList     = null;
+	private int              dataType     = Buffer.TYPE_UNDEFINED;
+	
+	public class Position {
+		int col = 0;
+		int row = 0;
+	}
+	
+	/**
+	 * Constructor using an array of tiles. It will compute the number
+	 * of rows and columns and the complete bounding box
+	 * @param tileList
+	 */
+	public MemoryTileMatrixBuffer(Tile[] tileList) {
+		this.tileList = new ArrayList<Tile>();
+		bufferList = new Buffer[tileList.length];
+		for (int i = 0; i < tileList.length; i++) {
+			this.tileList.add(tileList[i]);
+			bufferList[i] = (Buffer)tileList[i].getData()[0];
+			if(bufferList[i] != null)
+				dataType = bufferList[i].getDataType();
+			//extentList[i] = tileList[i].getExtent();
+			//pxLayerList[i] = tileList[i].getCoordsPx();
+		}
+		int minRow = Integer.MAX_VALUE;
+		int maxRow = Integer.MIN_VALUE;
+		int minCol = Integer.MAX_VALUE;
+		int maxCol = Integer.MIN_VALUE;
+		for (int i = 0; i < tileList.length; i++) {
+			if(tileList[i].getRow() > maxRow)
+				maxRow = tileList[i].getRow();
+			if(tileList[i].getCol() > maxCol)
+				maxCol = tileList[i].getCol();
+			if(tileList[i].getRow() < minRow)
+				minRow = tileList[i].getRow();
+			if(tileList[i].getCol() < minCol)
+				minCol = tileList[i].getCol();
+		}
+		nRows = maxRow - minRow + 1;
+		nCols = maxCol - minCol + 1;
+		bbox = calculateBBox();
+	}
+	
+	/**
+	 * Constructor using an ArrayList of tiles. It will compute the number
+	 * of rows and columns and the complete bounding box
+	 * @param tileList
+	 */
+	public MemoryTileMatrixBuffer(List<Tile> tileList) {
+		this.tileList = tileList;
+		bufferList = new Buffer[tileList.size()];
+		for (int i = 0; i < tileList.size(); i++) {
+			bufferList[i] = (Buffer)tileList.get(i).getData()[0];
+			if(bufferList[i] != null)
+				dataType = bufferList[i].getDataType();
+		}
+		int minRow = Integer.MAX_VALUE;
+		int maxRow = Integer.MIN_VALUE;
+		int minCol = Integer.MAX_VALUE;
+		int maxCol = Integer.MIN_VALUE;
+		for (int i = 0; i < tileList.size(); i++) {
+			if(tileList.get(i).getRow() > maxRow)
+				maxRow = tileList.get(i).getRow();
+			if(tileList.get(i).getCol() > maxCol)
+				maxCol = tileList.get(i).getCol();
+			if(tileList.get(i).getRow() < minRow)
+				minRow = tileList.get(i).getRow();
+			if(tileList.get(i).getCol() < minCol)
+				minCol = tileList.get(i).getCol();
+		}
+		nRows = maxRow - minRow + 1;
+		nCols = maxCol - minCol + 1;
+		bbox = calculateBBox();
+	}
+	
+	/**
+	 * Builds the complete bounding box of the tile list
+	 * @return
+	 */
+	private Extent calculateBBox() { 
+		double minX = Double.MAX_VALUE;
+		double minY = Double.MAX_VALUE;
+		double maxX = 0;
+		double maxY = 0;
+		for (int i = 0; i < tileList.size(); i++) {
+			Rectangle2D e = tileList.get(i).getExtent();
+			if(e.getX() < minX)
+				minX = e.getX();
+			if((e.getY() - e.getHeight()) < minY)
+				minY = (e.getY() - e.getHeight());
+			if((e.getX() + e.getWidth()) > maxX)
+				maxX = (e.getX() + e.getWidth());
+			if(e.getY() > maxY)
+				maxY = e.getY();
+		}
+		return new ExtentImpl(minX, minY, maxX, maxY);
+	}
+	
+	/**
+	 * Gets a window from tiles
+	 * @param ext
+	 * @param buf
+	 * @return
+	 */
+	public Buffer getWindow(Rectangle2D r, int w, int h, int bandCount) {
+		int shiftRow = 0;
+		int shiftCol = 0;
+		int posRow = 0;
+		int posCol = 0;
+		Rectangle2D[] rTileShiftList = new Rectangle2D[bufferList.length];
+		Rectangle2D[] rBufferShiftList = new Rectangle2D[bufferList.length];
+		int[] colsWidth = new int[nCols];
+		int[] rowsHeight = new int[nRows];
+		for (int i = 0; i < bufferList.length; i++) {
+			Rectangle2D pxLayer = tileList.get(i).getCoordsPx();
+			int initPxTileX = (int)Math.max(pxLayer.getMinX(), r.getMinX()) - (tileList.get(i).getCol() * tileList.get(i).getWidthPx()); 
+			int initPxTileY = (int)Math.max(pxLayer.getMinY(), r.getMinY()) - (tileList.get(i).getRow() * tileList.get(i).getHeightPx());
+			int widthPxTile = (int)Math.min(pxLayer.getMaxX(), r.getMaxX()) - (tileList.get(i).getCol() * tileList.get(i).getWidthPx()) - initPxTileX;
+			int heightPxTile = (int)Math.min(pxLayer.getMaxY(), r.getMaxY()) - (tileList.get(i).getRow() * tileList.get(i).getHeightPx()) - initPxTileY;
+			rTileShiftList[i] = new Rectangle2D.Double(initPxTileX, initPxTileY, widthPxTile, heightPxTile);
+			if(i == 0) {
+				shiftCol = tileList.get(i).getCol();
+				shiftRow = tileList.get(i).getRow();
+			}
+			posCol = tileList.get(i).getCol() - shiftCol;
+			posRow = tileList.get(i).getRow() - shiftRow;
+			if(posCol == 0)
+				colsWidth[posCol] = widthPxTile;
+			else
+				colsWidth[posCol] = widthPxTile + colsWidth[posCol - 1];
+			
+			if(posRow == 0)
+				rowsHeight[posRow] = heightPxTile;
+			else
+				rowsHeight[posRow] = heightPxTile + rowsHeight[posRow - 1];
+			
+			
+			//shiftX = initPxTileX < shiftX ? initPxTileX : shiftX;
+			//shiftY = initPxTileY < shiftY ? initPxTileY : shiftY;
+		}
+		
+		int initPxBufferX = 0; 
+		int initPxBufferY = 0;
+		int widthPxBuffer = 0;
+		int heightPxBuffer = 0;
+		
+		for (int i = 0; i < bufferList.length; i++) {
+			posCol = tileList.get(i).getCol() - shiftCol;
+			posRow = tileList.get(i).getRow() - shiftRow;
+			if(posCol == 0) {
+				initPxBufferX = 0;
+				widthPxBuffer = colsWidth[0];
+			} else {
+				initPxBufferX = colsWidth[posCol - 1];
+				widthPxBuffer = colsWidth[posCol] - initPxBufferX;
+			}
+			if(posRow == 0) {
+				initPxBufferY = 0;
+				heightPxBuffer = rowsHeight[0];
+			} else {
+				initPxBufferY = rowsHeight[posRow - 1];
+				heightPxBuffer = rowsHeight[posRow] - initPxBufferY;
+			}
+			rBufferShiftList[i] = new Rectangle2D.Double(initPxBufferX, initPxBufferY, widthPxBuffer, heightPxBuffer);
+		}			
+		
+		Buffer buf = DefaultRasterManager.getInstance().createBuffer(dataType, w, h, bandCount, true);
+		
+		for (int i = 0; i < bufferList.length; i++) {
+			loadBuffer(buf, 
+					bufferList[i],
+					rTileShiftList[i], 
+					(int)rBufferShiftList[i].getX(), 
+					(int)rBufferShiftList[i].getY(), 
+					false);
+		}
+		return buf;
+	}
+	
+	/**
+	 * Gets a window from tiles
+	 * @param requestExtent
+	 * @param buf
+	 * @return
+	 */
+	public Buffer getWindow(Extent requestExtent, int w, int h, int bandCount) {
+		if(tileList.size() <= 0)
+			return null;
+		
+		Buffer sourceWithoutResampling = createBufferWithoutResampling(requestExtent, tileList.get(0).getExtent(), bufferList[0], w, h, bandCount);
+		double wcX1 = -1;
+		double wcY1 = -1;
+		int initXPxBuf = 0;
+		int initYPxBuf = 0;
+		
+		for (int i = 0; i < bufferList.length; i++) {
+
+			//1-Calcular las coordenadas pixel del tile de entrada
+			Rectangle2D rTile = getClipPoints(tileList.get(i).getExtent(), bufferList[i], requestExtent);
+
+			//2-Ajustar peti�n al extent del tile
+			Extent adjustedRequestExtent = getAdjustedExtent(tileList.get(i).getExtent(), requestExtent);
+
+			if(	(rTile.getX() == 0 && rTile.getWidth() == 0) || 
+					(rTile.getY() == 0 && rTile.getHeight() == 0))
+				continue;
+
+			//3-Calcular coordenada pixel de inicio del buffer
+			wcX1 = Math.abs(adjustedRequestExtent.getMin().getX() - requestExtent.getMin().getX());
+			wcY1 = Math.abs(requestExtent.getMax().getY() - adjustedRequestExtent.getMax().getY());
+			initXPxBuf = (int)Math.floor((wcX1 * (sourceWithoutResampling.getWidth())) / requestExtent.width());
+			initYPxBuf = (int)Math.floor((wcY1 * (sourceWithoutResampling.getHeight())) / requestExtent.height());
+
+			//4-Copiar recorte al buffer
+
+			loadBuffer(sourceWithoutResampling, bufferList[i], rTile, initXPxBuf, initYPxBuf, false);
+		}
+		/*try {
+			save(sourceWithoutResampling, true, requestExtent, null);
+		} catch (NotSupportedExtensionException e) {
+			log.debug("Error saving in MemoryMatrixBuffer", e);
+		} catch (RasterDriverException e) {
+			log.debug("Error saving in MemoryMatrixBuffer", e);
+		} catch (ProcessInterruptedException e) {
+			log.debug("Error saving in MemoryMatrixBuffer", e);
+		} catch (IOException e) {
+			log.debug("Error saving in MemoryMatrixBuffer", e);
+		}*/
+		//Devuelve el buffer pero reescalandolo antes al tama�o en pixeles de la petici�n
+		try {
+			Buffer result = null;
+			result = sourceWithoutResampling.getAdjustedWindow(w, h, Buffer.INTERPOLATION_NearestNeighbour);
+			if(result != sourceWithoutResampling)
+				sourceWithoutResampling.dispose();
+			return result;
+		} catch (ProcessInterruptedException e) {
+		}
+		return null;
+	}
+	
+	/**
+	 * Gets the point list to clip the tile
+	 * @param extTile Bounding box of the tile
+	 * @param b Buffer of the tile
+	 * @param extentRequest 
+	 * @return
+	 */
+	private Rectangle2D getClipPoints(Rectangle2D extTile, Buffer b, Extent extentRequest) {
+		double widthWCTile = extTile.getWidth();
+		double widthPXTile = b.getWidth();
+		double heightWCTile = extTile.getHeight();
+		double heightPXTile = b.getHeight();
+		
+		//1-Ajustar peti�n al extent del tile
+		Extent adjustedRequestExtent = getAdjustedExtent(extTile, extentRequest);
+
+		//2-Obtener el punto inicial y final del recorte del tile en pixeles
+		double wcX1 = adjustedRequestExtent.getMin().getX() - extTile.getX();
+		double wcX2 = adjustedRequestExtent.getMax().getX() - extTile.getX();
+		double wcY1 = extTile.getY() - adjustedRequestExtent.getMax().getY();
+		double wcY2 = extTile.getY() - adjustedRequestExtent.getMin().getY();
+		int initXPxTile = (int)Math.floor((wcX1 * widthPXTile) / widthWCTile);
+		int endXPxTile = (int)Math.ceil((wcX2 * widthPXTile) / widthWCTile);
+		int initYPxTile = (int)Math.floor((wcY1 * heightPXTile) / heightWCTile);
+		int endYPxTile = (int)Math.ceil((wcY2 * heightPXTile) / heightWCTile);
+		endXPxTile = endXPxTile >= widthPXTile ? (int)(widthPXTile - 1) : endXPxTile;
+		endYPxTile = endYPxTile >= heightPXTile ? (int)(heightPXTile - 1) : endYPxTile;
+		
+		return new Rectangle2D.Double(initXPxTile, 
+				initYPxTile, 
+				Math.abs((endXPxTile - initXPxTile) + 1), 
+				Math.abs((endYPxTile - initYPxTile) + 1));
+	}
+	
+	/**
+	 * Write data in the source buffer taking into account the view shift
+	 * @param dstBuf
+	 * @param tileBuf
+	 * @param rTile
+	 * @param initXPxBuf
+	 * @param initYPxBuf
+	 */
+	private void loadBuffer(Buffer dstBuf, Buffer tileBuf, Rectangle2D rTile, int initXPxBuf, int initYPxBuf, boolean alpha) {
+		int r = initXPxBuf;
+		int c = initYPxBuf;
+		//if(!alpha) {
+			if(tileBuf.getDataType() == Buffer.TYPE_BYTE) {
+				for (int band = 0; band < tileBuf.getBandCount(); band++) {
+					r = initYPxBuf;
+					for (int row = (int)rTile.getMinY(); (row < (int)rTile.getMaxY() && r < dstBuf.getHeight()); row++) {
+						c = initXPxBuf;
+						for (int col = (int)rTile.getMinX(); (col < (int)rTile.getMaxX() && c < dstBuf.getWidth()); col++) {
+							dstBuf.setElem(r, c, band, tileBuf.getElemByte(row, col, band));
+							c++;
+						}
+						r++;
+					}
+				}
+			}
+		/*} else {
+			if(tileBuf.getDataType() == Buffer.TYPE_BYTE) {
+				r = initYPxBuf;
+				for (int row = (int)rTile.getMinY(); row < (int)rTile.getMaxY(); row++) {
+					c = initXPxBuf;
+					for (int col = (int)rTile.getMinX(); col < (int)rTile.getMaxX(); col++) {
+						sourceBuf.setElem(r, c, 0, tileBuf.getElemByte(row, col, 0));
+						c++;
+					}
+					r++;
+				}
+			}
+		}*/
+		if(tileBuf.getDataType() == Buffer.TYPE_SHORT) {
+			for (int band = 0; band < tileBuf.getBandCount(); band++) {
+				r = initYPxBuf;
+				for (int row = (int)rTile.getMinY(); (row < (int)rTile.getMaxY() && r < dstBuf.getHeight()); row++) {
+					c = initXPxBuf;
+					for (int col = (int)rTile.getMinX(); (col < (int)rTile.getMaxX() && c < dstBuf.getWidth()); col++) {
+						dstBuf.setElem(r, c, band, tileBuf.getElemShort(row, col, band));
+						c++;
+					}
+					r++;
+				}
+			}
+		}
+		if(tileBuf.getDataType() == Buffer.TYPE_INT) {
+			for (int band = 0; band < tileBuf.getBandCount(); band++) {
+				r = initYPxBuf;
+				for (int row = (int)rTile.getMinY(); (row < (int)rTile.getMaxY() && r < dstBuf.getHeight()); row++) {
+					c = initXPxBuf;
+					for (int col = (int)rTile.getMinX(); (col < (int)rTile.getMaxX() && c < dstBuf.getWidth()); col++) {
+						dstBuf.setElem(r, c, band, tileBuf.getElemInt(row, col, band));
+						c++;
+					}
+					r++;
+				}
+			}
+		}
+		if(tileBuf.getDataType() == Buffer.TYPE_FLOAT) {
+			for (int band = 0; band < tileBuf.getBandCount(); band++) {
+				r = initYPxBuf;
+				for (int row = (int)rTile.getMinY(); (row < (int)rTile.getMaxY() && r < dstBuf.getHeight()); row++) {
+					c = initXPxBuf;
+					for (int col = (int)rTile.getMinX(); (col < (int)rTile.getMaxX() && c < dstBuf.getWidth()); col++) {
+						dstBuf.setElem(r, c, band, tileBuf.getElemFloat(row, col, band));
+						c++;
+					}
+					r++;
+				}
+			}
+		}
+		if(tileBuf.getDataType() == Buffer.TYPE_DOUBLE) {
+			for (int band = 0; band < tileBuf.getBandCount(); band++) {
+				r = initYPxBuf;
+				for (int row = (int)rTile.getMinY(); (row < (int)rTile.getMaxY() && r < dstBuf.getHeight()); row++) {
+					c = initXPxBuf;
+					for (int col = (int)rTile.getMinX(); (col < (int)rTile.getMaxX() && c < dstBuf.getWidth()); col++) {
+						dstBuf.setElem(r, c, band, tileBuf.getElemDouble(row, col, band));
+						c++;
+					}
+					r++;
+				}
+			}
+		}
+	}
+	
+//	private void save(Buffer bufResult, 
+//			boolean alphaBand, 
+//			Extent tileExtent,
+//			ColorInterpretation colorInterpretation) throws NotSupportedExtensionException, RasterDriverException, ProcessInterruptedException, IOException {
+//		//Escritura en disco del tile
+//		RasterManager rManager = RasterLocator.getManager();
+//		DataServerWriter dataWriter = RasterLocator.getManager().createDataServerWriter();
+//		dataWriter.setBuffer(bufResult, -1);
+//		Params params = rManager.createWriter("_.tif").getParams();
+//		double pixelSize = (tileExtent.width() / bufResult.getWidth());
+//		AffineTransform affineTransform = new AffineTransform(pixelSize, 0, 0, -pixelSize,
+//				tileExtent.getULX(),
+//				tileExtent.getULY());
+//		RasterWriter rw = rManager.createWriter(dataWriter, "/tmp/prueba.tif",
+//				bufResult.getBandCount(), affineTransform, bufResult.getWidth(),
+//				bufResult.getHeight(), bufResult.getDataType(), params, null);
+//		
+//		if(colorInterpretation != null) {
+//			String[] values = colorInterpretation.getValues();
+//			if(alphaBand) {
+//				String[] newValues = values;
+//				boolean exists = false;
+//				for (int i = 0; i < values.length; i++) {
+//					if(values[i] != null && values[i].compareTo("Alpha") == 0)
+//						exists = true;
+//				}
+//				if(!exists) {
+//					newValues = new String[values.length + 1];
+//					for (int i = 0; i < values.length; i++) {
+//						newValues[i] = values[i];
+//					}
+//					newValues[newValues.length - 1] = "Alpha";
+//				}
+//				rw.setColorBandsInterpretation(newValues);
+//			}
+//			
+//		} else {
+//			if(alphaBand) {
+//				String[] ci = new String[bufResult.getBandCount()];
+//				if(bufResult.getBandCount() == 4) {
+//					ci[0] = "Red";
+//					ci[1] = "Green";
+//					ci[2] = "Blue";
+//					ci[3] = "Alpha";
+//				} else {
+//					for (int i = 0; i < bufResult.getBandCount(); i++) {
+//						ci[i] = "Gray";
+//					}
+//				}
+//				rw.setColorBandsInterpretation(ci);
+//			}
+//		}
+//		rw.dataWrite();
+//		rw.writeClose();
+//	}
+	
+	/**
+	 * Builds a buffer in the same resolution as the list of tiles. When the operation
+	 * ends this buffer should be resampled.
+	 * @return
+	 */
+	private Buffer createBufferWithoutResampling(Extent extOrigin, 
+			Rectangle2D extTile, 
+			Buffer bufTile,
+			int originWidth, 
+			int originHeight,
+			int bandCount) {
+		double psOrigin = extOrigin.width() / originWidth;
+		double psTile = extTile.getWidth() / bufTile.getWidth();
+		double rel = psTile / psOrigin;
+		int w = (int)Math.floor(originWidth / rel);
+		int h = (int)Math.floor(originHeight / rel);
+		return DefaultRasterManager.getInstance().createBuffer(dataType, w, h, bandCount, true);
+	}
+	
+	
+	/**
+	 * Adjust the request to the tile bounding box
+	 * @param tileExtent
+	 * @param extentRequest
+	 * @return
+	 */
+	private Extent getAdjustedExtent(Rectangle2D tileExtent, Extent extentRequest) {
+		double x1 = Math.max(extentRequest.getMin().getX(), tileExtent.getX());
+		double y1 = Math.min(extentRequest.getMax().getY(), tileExtent.getY());
+		double x2 = Math.min(extentRequest.getMax().getX(), (tileExtent.getX() + tileExtent.getWidth()));
+		double y2 = Math.max(extentRequest.getMin().getY(), (tileExtent.getY() - tileExtent.getHeight()));
+		return new ExtentImpl(x1, y1, x2, y2); 
+	}
+	
+
+	/*private double clip(double value) {
+		return math.clipDecimals(value, 5);
+	}
+	
+	private double round(double value) {
+		double a = (value - (int)value);
+		return (a > 0.95 || a < 0.05) ? Math.round(value) : value;
+	}*/
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/MemoryTileMatrixBuffer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/DefaultTimeSerials.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/DefaultTimeSerials.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/DefaultTimeSerials.java	(revision 15423)
@@ -0,0 +1,289 @@
+/* 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.impl.provider;
+
+import java.text.ParseException;
+import java.util.ArrayList;
+import java.util.Date;
+
+import org.gvsig.fmap.dal.coverage.datastruct.SerialInfo;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+import org.gvsig.raster.impl.datastruct.DefaultSerialInfo;
+import org.gvsig.timesupport.AbsoluteInstant;
+import org.gvsig.timesupport.AbsoluteInterval;
+import org.gvsig.timesupport.RelativeInstant;
+import org.gvsig.timesupport.RelativeInterval;
+import org.gvsig.timesupport.Time;
+/**
+ * DataStore serial information
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultTimeSerials implements TimeSeries {
+	private ArrayList<DefaultSerialInfo>  serial        = new ArrayList<DefaultSerialInfo>(); 
+	private String                        description   = null;
+	private String                        name          = null;
+	
+	/**
+	 * Constructor vacio. 
+	 */
+	public DefaultTimeSerials() {
+	}
+	
+	/**
+	 * Adds a SerialInfo to the list
+	 * @param ser
+	 */
+	public void addSerialInfo(SerialInfo ser) {
+		serial.add((DefaultSerialInfo)ser);
+	}
+	
+	/**
+	 * Clears the list of SerialInfo
+	 */
+	public void clearSerialInfoList() {
+		serial.clear();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#selectSerial(java.lang.String)
+	 */
+	public void selectSerial(String name) {
+		for (int i = 0; i < serial.size(); i++) {
+			if(serial.get(i).getSerialName().compareTo(name) == 0) {
+				this.name = serial.get(i).getSerialName();
+				this.description = serial.get(i).getDescription();
+			}
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#selectSerial(int)
+	 */
+	public void selectSerial(int pos) {
+		if (pos >= 0 && pos < serial.size()) {
+			this.name = serial.get(pos).getSerialName();
+			this.description = serial.get(pos).getDescription();
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#getNumberOfSerials()
+	 */
+	public int getNumberOfSerials() {
+		return serial.size();
+	}
+	
+	/**
+	 * Gets the serial with then name selected
+	 * @param name
+	 * @return
+	 */
+	public DefaultSerialInfo getSerial(String name) {
+		for (int i = 0; i < serial.size(); i++) {
+			if(serial.get(i).getSerialName().compareTo(name) == 0)
+				return serial.get(i);
+		}
+		return null;
+	}
+	
+	/**
+	 * Gets the serial with then name selected
+	 * @param uri
+	 * @return
+	 */
+	public DefaultSerialInfo getSerial(int pos) {
+		return serial.get(pos);
+	}
+	
+	/**
+	 * Sets the serial information
+	 * @param serial
+	 */
+	public void setSerial(ArrayList<DefaultSerialInfo> serial) {
+		this.serial = serial;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#setDescription(java.lang.String)
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#getDescription()
+	 */
+	public String getDescription() {
+		return description;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#getName()
+	 */
+	public String getName() {
+		return name;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#setName(java.lang.String)
+	 */
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#removeIntervals()
+	 */
+	public void removeIntervals() {
+		serial.clear();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#createNewTimeInterval(java.lang.String, java.lang.String)
+	 */
+	public void createNewTimeInterval(String dateA, String dateB) throws ParseException {
+		DefaultSerialInfo tInfo = new DefaultSerialInfo();
+		tInfo.setTimeType(DefaultSerialInfo.RANGES);
+		tInfo.setDataType(SerialInfo.DATE);
+		tInfo.addValue(dateA);
+		tInfo.addValue(dateB);
+		tInfo.setDescription(description);
+		tInfo.setSerialName(name);
+		serial.add(tInfo);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#createNewTimeValue(java.lang.String)
+	 */
+	public void createNewTimeValue(String value) throws ParseException {
+		DefaultSerialInfo tInfo = new DefaultSerialInfo();
+		tInfo.setTimeType(DefaultSerialInfo.SINGLE_VALUES);
+		tInfo.setDataType(SerialInfo.DATE);
+		tInfo.addValue(value);
+		tInfo.setDescription(description);
+		tInfo.setSerialName(name);
+		serial.add(tInfo);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#createNewTimeInterval(double, double)
+	 */
+	public void createNewTimeInterval(double a, double b) throws ParseException {
+		DefaultSerialInfo tInfo = new DefaultSerialInfo();
+		tInfo.setTimeType(DefaultSerialInfo.RANGES);
+		tInfo.setDataType(SerialInfo.NUMERIC);
+		tInfo.addValue(a);
+		tInfo.addValue(b);
+		tInfo.setDescription(description);
+		tInfo.setSerialName(name);
+		serial.add(tInfo);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.SerialInfo#createNewTimeValue(double)
+	 */
+	public void createNewTimeValue(double value) throws ParseException {
+		DefaultSerialInfo tInfo = new DefaultSerialInfo();
+		tInfo.setTimeType(DefaultSerialInfo.SINGLE_VALUES);
+		tInfo.setDataType(SerialInfo.NUMERIC);
+		tInfo.addValue(value);
+		tInfo.setDescription(description);
+		tInfo.setSerialName(name);
+		serial.add(tInfo);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.TimeSerials#createNewTime(org.gvsig.timesupport.Time)
+	 */
+	public void createNewTime(Time time) throws ParseException {
+		if(time instanceof RelativeInstant) {
+			createNewTimeValue((double)((RelativeInstant)time).toMillis());
+		}
+		if(time instanceof AbsoluteInstant) {
+			AbsoluteInstant t = ((AbsoluteInstant)time);
+			String dateA = t.getDays() + "/" + t.getMonths() + "/" + t.getYears() + "-" + t.getHours() + "/" + t.getMinutes() + "/" + t.getSeconds();
+			createNewTimeValue(dateA);
+		}
+		if(time instanceof AbsoluteInterval) {
+			AbsoluteInstant t = ((AbsoluteInterval)time).getStart();
+			String dateA = t.getDays() + "/" + t.getMonths() + "/" + t.getYears() + "-" + t.getHours() + "/" + t.getMinutes() + "/" + t.getSeconds();
+			t = ((AbsoluteInterval)time).getEnd();
+			String dateB = t.getDays() + "/" + t.getMonths() + "/" + t.getYears() + "-" + t.getHours() + "/" + t.getMinutes() + "/" + t.getSeconds();
+			createNewTimeInterval(dateA, dateB);
+		}
+		if(time instanceof RelativeInterval) {
+			RelativeInstant t = ((RelativeInterval)time).getStart();
+			double dateA = t.toMillis();
+			t = ((RelativeInterval)time).getEnd();
+			double dateB = t.toMillis();
+			createNewTimeInterval(dateA, dateB);
+		}
+	}
+	
+	@SuppressWarnings("unchecked")
+	public ArrayList<?> getTimeList() {
+		ArrayList result = new ArrayList();
+		
+		for (int i = 0; i < serial.size(); i++) {
+			DefaultSerialInfo dsi = serial.get(i);
+			ArrayList<?> timeList = dsi.getTime();
+		
+			if(timeList.get(0).getClass() == Date.class) {
+				if(timeList.size() > 1) {
+					long date1 = ((Date)timeList.get(0)).getTime();
+					long date2 = ((Date)timeList.get(timeList.size() - 1)).getTime();
+					long r = date1 + ((date2 - date1) / 2);
+					Date newDate = new Date(r);
+					result.add(newDate);
+				} else {
+					result.add(timeList.get(0));
+				}
+			}
+			
+			if(timeList.get(0).getClass() == Double.class) {
+				if(timeList.size() > 1) {
+					long date1 = ((Double)timeList.get(0)).longValue();
+					long date2 = ((Double)timeList.get(serial.size() - 1)).longValue();
+					long r = date1 + ((date2 - date1) / 2);
+					result.add(new Double(r));
+				} else {
+					result.add(timeList.get(0));
+				}
+			}
+		}
+		return result;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/DefaultTimeSerials.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RemoteRasterProvider.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RemoteRasterProvider.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RemoteRasterProvider.java	(revision 15423)
@@ -0,0 +1,74 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.provider;
+
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
+
+
+/**
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface RemoteRasterProvider extends RasterProvider {
+	
+	/**
+	 * Gets the bounding box of this layer 
+	 * @param layerName
+	 * @return
+	 * @throws RemoteServiceException 
+	 */
+	public Rectangle2D getLayerExtent(String layerName, String srs) throws RemoteServiceException;
+	
+	/**
+	 * 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.
+	 * @return
+	 * @throws RasterDriverException
+	 */
+	public File getFileLayer() throws RasterDriverException;
+	
+	/**
+	 * Gets the file of the last request. Be careful because 
+	 * if a complete request is tiled, this file will only contain
+	 * the last tile. 
+	 * @return
+	 */
+	public File getLastRequest();
+	
+	/**
+	 * Gets the buffer of the last request. Be careful because 
+	 * if a complete request is tiled, this file will only contain
+	 * the last tile. 
+	 * @return
+	 * @throws RasterDriverException 
+	 * @throws ProcessInterruptedException 
+	 */
+	public Buffer getBufferLastRequest() throws ProcessInterruptedException, RasterDriverException;
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RemoteRasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RasterProvider.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RasterProvider.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RasterProvider.java	(revision 15423)
@@ -0,0 +1,627 @@
+/* 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.impl.provider;
+
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.io.File;
+import java.net.URI;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.compat.net.ICancellable;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPointList;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.CloneException;
+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.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RemoteServiceException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Histogramable;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider;
+import org.gvsig.raster.cache.tile.provider.TileServer;
+import org.gvsig.raster.impl.buffer.SpiRasterQuery;
+
+/**
+ * This interface have to be implemented by a raster data source. Is used by a store to
+ * provide services from a specific source.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface RasterProvider extends CoverageStoreProvider, Histogramable {
+
+	public void reload();
+
+	/**
+	 * Gets a list of sizes. If the provider doesn't have files it will return null.
+	 * If the provider has one file it will return an array of one element with the
+	 * size of this file. If the provider contains others with one file each one.
+	 * @return
+	 */
+	public long[] getFileSizeByProvider();
+
+	/**
+	 * Gets a list of file names or URI. Each element of this array is the name of a
+	 * provider
+	 * @return
+	 */
+	public URI[] getURIByProvider();
+
+	/**
+	 * Gets the URI of the first provider.
+	 * @return String
+	 *         File name or URI
+	 */
+	public URI getURIOfFirstProvider();
+
+	/**
+	 * Gets the number of bands by provider.
+	 * @return
+	 */
+	public int[] getBandCountByProvider();
+
+	/**
+	 * Selecting a number of band this function returns the number of band
+	 * inside the file. If this provider has only one file the result
+	 * will be band parameter.
+	 * @param band
+	 * @return
+	 */
+	public int getBandPositionByProvider(int band);
+
+	/**
+	 * Returns the number of internal providers that it has
+	 * @return
+	 */
+	public int getInternalProviderCount();
+
+	/**
+	 * Gets the internal provider of the i position
+	 * @param i
+	 * @return
+	 */
+	public RasterProvider getInternalProvider(int i);
+
+	/**
+	 * Gets the URI of the source. If the provider has only one band
+	 * the result will be the URI. If it is multifile will have to choose
+	 * among several sources.
+	 * @param band
+	 * @return
+	 */
+	public URI getURIByBand(int band);
+
+	/**
+	 * Gets the uniform resource identifier
+	 * @return
+	 */
+	public URI getURI();
+
+	/**
+	 * Gets the number of subdatasets
+	 * @return
+	 */
+	public int getSubdatasetCount();
+
+	/**
+	 * Adds a new file. The behavior of this function depends on
+	 * the kind of provider and its implementation.
+	 * @param file
+	 * @throws InvalidSourceException
+	 */
+	public void addFile(File file) throws InvalidSourceException;
+
+	/**
+	 * Removes a file. The behavior of this function depends on
+	 * the kind of provider and its implementation.
+	 * @param file
+	 */
+	public void removeFile(File file);
+
+	/**
+	 * Obtiene el n�mero de bandas del raster
+	 * @return N�mero de bandas
+	 */
+	public int getBandCount();
+
+	/**
+	 * Obtiene el tipo de dato por banda
+	 * @return tipo de dato por banda
+	 */
+	public int[] getDataType();
+
+	/**
+	 * Obtiene la altura del raster en p�xeles.
+	 * @return altura
+	 */
+	public double getHeight();
+
+	/**
+	 * Obtiene la anchura del raster en p�xeles.
+	 * @return anchura
+	 */
+	public double getWidth();
+
+	/**
+	 * Devuelve si el Dataset es reproyectable
+	 * @return
+	 */
+	public boolean isReproyectable();
+
+	/**
+	 * Returns true if this raster has rotation and false if don't
+	 */
+	public boolean isRotated();
+
+	/**
+	 * Returns true if this provider is open and false if don't
+	 * @return
+	 */
+	public boolean isOpen();
+
+	/**
+	 * Returns true if this provider supports time.
+	 * @return
+	 */
+	public boolean isTimeSupported();
+
+	/**
+	 * Returns true if the provider support tiles
+	 * @return
+	 */
+	public boolean isTiled();
+
+	/**
+	 * Informa de si el dataset soporta overviews o no.
+	 * @return true si soporta overviews y false si no las soporta.
+	 */
+	public boolean isOverviewsSupported();
+
+	/**
+	 * Obtiene el n�mero de overviews de una banda
+	 * @return
+	 */
+	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException;
+
+	/**
+	 * Obtiene el ancho de una overview de una banda
+	 * @return
+	 */
+	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException;
+
+	/**
+	 * Obtiene el alto de una overview de una banda
+	 * @return
+	 */
+	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException;
+
+
+	/**
+	 * Informa de si el punto en coordenadas del mundo real pasado por par�metro cae dentro del
+	 * raster o fuera. Para este calculo cogeremos el punto a averiguar si est� dentro del raster
+	 * y le aplicaremos la transformaci�n inversa de la transformaci�n af�n aplicada. Una vez hecho
+	 * esto ya se puede comprobar si est� dentro de los l�mites del extent del raster.
+	 * @param p Punto a comprobar en coordenadas reales
+	 * @return true si el punto est� dentro y false si est� fuera.
+	 */
+	public boolean isInside(Point2D p);
+
+	/**
+	 * Gets the nodata value.
+	 * @return
+	 */
+	public NoData getNoDataValue();
+
+	/**
+	 * Gets statistics of this provider
+	 * @return MultiFileStatistics
+	 */
+	public Statistics getStatistics();
+
+	/**
+	 * Sets the statistics of this provider. Be careful using this method.
+	 * Statistics shouldn't be assigned unless you had cloned this provider.
+	 * @throws RmfSerializerException
+	 */
+	public void setStatistics(Statistics stats) throws RmfSerializerException;
+
+	/**
+	 * Obtiene el extent del raster.
+	 * @return Extent
+	 */
+	public Extent getExtent();
+
+	/**
+	 * Gets the suffix of the source file
+	 * @return
+	 */
+	public String getFileSuffix();
+
+	/**
+	 * Este es el extent sobre el que se ajusta una petici�n para que esta no
+	 * exceda el extent m�ximo del raster. Para un raster sin rotar ser� igual al
+	 * extent pero para un raster rotado ser� igual al extent del raster como si
+	 * no tuviera rotaci�n. Esto ha de ser as� ya que la rotaci�n solo se hace
+	 * sobre la vista y las peticiones han de hacerse en coordenadas de la imagen
+	 * sin shearing aplicado.
+	 * @return Extent
+	 */
+	public Extent getExtentWithoutRot();
+
+	/**
+	 * Obtiene la matriz de transformaci�n del propio raster. Esta matriz es la
+	 * encargada de convertir las coordenadas de la petici�n en coordenadas a las
+	 * que se pide a la libreria. En gdal, por ejemplo, se piden las coordenadas a
+	 * la libreria en coordenadas pixel por lo que esta matriz tendr� la
+	 * georreferenciaci�n asociada en el worldfile o cabecera. Otras librerias
+	 * como ermapper la petici�n a la libreria se hace en coordenadas geograficas
+	 * que son las mismas en las que pide el usuario de gvSIG por lo que esta
+	 * matriz en este caso se inicializa con la identidad.
+	 * @return
+	 */
+	public AffineTransform getOwnAffineTransform();
+
+	/**
+	 * Obtiene la transformaci�n afin aplicada en las peticiones con coordenadas
+	 * reales. Esta corresponde al producto matricial entre la transformaci�n de
+	 * la propia georreferenciaci�n del raster (ownTransformation) y la
+	 * transformaci�n que se le aplique de forma externa. Si esta �ltima no existe
+	 * ser� la matriz identidad.
+	 * @return Matriz de la transformaci�n af�n.
+	 */
+	public AffineTransform getAffineTransform();
+
+	/**
+	 * Sets the provider projection
+	 * @return IProjection
+	 */
+	public IProjection getProjection();
+
+	/**
+	 * Gets the provider projection
+	 * @return IProjection
+	 */
+	public void setProjection(IProjection proj, boolean persist) throws RmfSerializerException;
+
+	/**
+	 * Obtiene el extent asignado
+	 * @return	Extent
+	 */
+	public Extent getView();
+
+	/**
+	 * Gets a DatasetMetadata object
+	 * @return
+	 */
+	public Metadata getMetadata();
+
+	/**
+	 * Gets the object with the color interpretation by band
+	 * @return ColorInterpretation
+	 */
+	public ColorInterpretation getColorInterpretation();
+
+	/**
+	 * Assigns the object with the color interpretation by band
+	 * @param ci
+	 */
+	public void setColorInterpretation(ColorInterpretation ci);
+
+	/**
+	 * Define el objeto paleta. Si se define null quiere decir que no tiene paleta
+	 * para su visualizaci�n.
+	 * @param value
+	 */
+	public void setColorTable(ColorTable value);
+
+	/**
+	 * Gets the {@link ColorTable} or null if the raster
+	 * does not have
+	 * @return
+	 */
+	public ColorTable getColorTable();
+
+	/**
+	 * Gets the legend as a image. The store could not have implemented this method .
+	 * This is useful above all for WMS but whatever raster layer
+	 * could return a legend as image.
+	 * @return
+	 */
+	public Image getImageLegend();
+
+	/**
+	 * Obtiene el estado de transparencia a partir de los estados de transparencia de todos
+	 * los ficheros que lo componen. Si varios de los ficheros que lo componen tienen banda de
+	 * transparencia estas tendr�n que ser mezcladas sobre una banda de transparencia �nica.
+	 * @return Objeto FileTransparency con el estado de transparencia
+	 */
+	public Transparency getTransparency();
+
+	/**
+	 * Cierra los raster asociados.
+	 */
+	public void close();
+
+	/**
+	 * 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);
+
+	/**
+	 * 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);
+
+	/**
+	 * Asigna una transformaci�n al raster para que se tenga en cuenta en la
+	 * asignaci�n del setView. Esta asignaci�n recalcula el extent, el
+	 * requestExtent y asigna el AffineTransform que se usar� para la
+	 * transformaci�n. Esta transformaci�n ser� considerada como si la imagen
+	 * tuviera asociado un rmf.
+	 * @param t Transformaci�n af�n a aplicar
+	 */
+	public void setAffineTransform(AffineTransform t);
+
+	/**
+	 * Gets the pixel size
+	 * @return
+	 */
+	public double getCellSize();
+
+	/**
+	 * Obtiene el tama�o de pixel en X
+	 * @return tama�o de pixel en X
+	 */
+	public double getPixelSizeX();
+
+	/**
+	 * Obtiene el tama�o de pixel en Y
+	 * @return tama�o de pixel en Y
+	 */
+	public double getPixelSizeY();
+
+	/**
+	 * Obtiene el valor del raster en la coordenada que se le pasa.
+	 * El valor ser� Double, Int, Byte, etc. dependiendo del tipo de
+	 * raster.
+	 * @param x	coordenada X
+	 * @param y coordenada Y
+	 * @return
+	 */
+	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException;
+
+	/**
+	 * Obtiene la proyecci�n asociada al raster. Como todos los dataset del
+	 * multiDataset deben tener la misma proyecci�n obtenemos esta del primer
+	 * dataset.
+	 * @return Proyecci�n en formato cadena
+	 * @throws RasterDriverException
+	 */
+	public String getWktProjection() throws RasterDriverException;
+
+	/**
+	 * Sets the nodata value
+	 * @return
+	 */
+	public void setNoDataValue(NoData value);
+
+	/**
+	 * Obtiene el flag que dice si el raster est� o no georreferenciado
+	 * @return true si est� georreferenciado y false si no lo est�.
+	 */
+	public boolean isGeoreferenced();
+
+	/**
+	 * Returns true if the provider has several files and all of them has the same extension
+	 * @return
+	 */
+	public boolean isMultiFile();
+
+	/**
+	 * Returns true if the source of data is a mosaic of images
+	 * @return
+	 */
+	public boolean isMosaic();
+
+	/**
+	 * Deletes the cache of this layer composed by the files in the provider list
+	 */
+	public void deleteLayerFromCache();
+
+	/**
+	 * Clone this RasterProvider
+	 * @return
+	 */
+	public RasterProvider cloneProvider() throws CloneException;
+
+	/**
+	 * Returs the DataParameters
+	 * @return
+	 */
+	public RasterDataParameters getDataParameters();
+
+	/**
+	 * 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.
+	 * @deprecated This method is only used to generate statistics. The statistics have to change the way in
+	 * which are calculated. Then this function will be eliminated.
+	 */
+	public Object readBlock(int pos, int blockHeight, double scale)
+		throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException;
+
+
+	/**
+	 * Carga un objecto desde un serializador usando el tipo del mismo objeto pasado por parametro.
+	 * Usa value para iniciar dicho serializador
+	 * @param class1
+	 * @param value
+	 * @return
+	 * @throws RmfSerializerException
+	 */
+	public Object loadObjectFromRmf(Class<?> class1, Object value) throws RmfSerializerException;
+
+	/**
+	 * Guarda en el RMF el objecto actual en caso de que exista un serializador para el.
+	 * El tipo del objeto se especifica en el parametro class1.
+	 * Esto nos puede permitir poder poner a null un valor y encontrar su serializador.
+	 * @param class1
+	 * @param value
+	 * @throws RmfSerializerException
+	 */
+	public void saveObjectToRmf(Class<?> class1, Object value) throws RmfSerializerException;
+
+	/**
+	 * Sets the status information using other provider of the same type. The first action
+	 * of this method should be to check the type of the parameter.
+	 * @param provider
+	 */
+	public void setStatus(RasterProvider provider);
+
+	/**
+	 * Gets the information in a real point
+	 * @param x
+	 * @param y
+	 * @return
+	 * @throws RemoteServiceException
+	 */
+	public String getInfoByPoint(double x, double y, ICancellable cancellable) throws InfoByPointException;
+
+	/**
+	 * Gets the information in a pixel point. Some services need additional
+	 * information as the window where the request is done
+	 * @param x
+	 *        X Pixel position
+	 * @param y
+	 *        Y pixel position
+	 * @param bbox
+	 *        Bounding box of the window
+	 * @param w
+	 *        Width in pixels of the window
+	 * @param h
+	 *        Height in pixels of the window
+	 * @param cancellable
+	 * @return
+	 * @throws RemoteServiceException
+	 */
+	public String getInfoByPoint(int x, int y, Extent bbox, int w, int h, ICancellable cancellable) throws InfoByPointException;
+
+	/**
+	 * Gets the tile cache data server
+	 * @return
+	 */
+	public TileServer getTileServer();
+
+	/**
+	 * Some services neither has limits nor pixel size. For instance, WebMapService
+	 * is a service of this type if the size is not fixed. Other services, like
+	 * WMTS are enclosed too but in this case it will have resolution by level.
+	 * This method returns true if the data source is enclosed.
+	 * @return
+	 */
+	public boolean isRasterEnclosed();
+
+	/**
+	 * Gets the rmf file path. This method will have to be redefined by providers
+	 * with a different path
+	 * @return
+	 */
+	public File getRMFFile();
+
+	/**
+	 * Selects the subdataset.
+	 */
+	public void selectSubdataset();
+
+	/**
+	 * Gets the list of supported formats
+	 * @return
+	 */
+	public String[] getFormatList();
+
+	/**
+	 * Returns the source type (FILE, POSTGIS, REMOTE,...)
+	 * @return
+	 */
+	public int getSourceType();
+
+	/**
+	 * This function returns true if the image to be loaded needs a enhanced filter or
+	 * doesn't. It depends on the format, number of bands, type of data and so on.
+	 * @return The default value is false but each driver can change this value.
+	 */
+	public boolean needEnhanced();
+
+	/**
+	 * Gets the time serial information
+	 * @return
+	 * @throws RmfSerializerException
+	 */
+	public TimeSeries getTimeSerials() throws RmfSerializerException;
+
+	/**
+	 * Sets the time serial information
+	 * @throws RmfSerializerException
+	 */
+	public void setTimeSerials(TimeSeries serialInfo) throws RmfSerializerException;
+
+	/**
+	 * Gets the set of data selected in the {@link RasterQuery}
+	 * @param q
+	 * @return
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 */
+	public Buffer getDataSet(SpiRasterQuery query) throws ProcessInterruptedException, RasterDriverException;
+
+	/**
+	 * Gets the list of geo points associated to this provider
+	 * @return
+	 */
+	public GeoPointList getGeoPointList();
+
+	/**
+	 * Sets the list of geo points associated to this provider
+	 */
+	public void setGeoPointList(GeoPointList geoPointList);
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/RasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/TiledRasterProvider.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/TiledRasterProvider.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/TiledRasterProvider.java	(revision 15423)
@@ -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.impl.provider;
+
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.impl.buffer.SpiRasterQuery;
+
+/**
+ * Interface that should be implemented by tiled providers 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface TiledRasterProvider {
+	/**
+	 * 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 getCoordsInTheNearestLevel(Extent extent, int w, int h);
+	
+	/**
+	 * Calculates the extent of a zoom level using a center. 
+	 * @param viewCenter
+	 * @param level
+	 * @param w
+	 * @param h
+	 * @return
+	 */
+	public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h);
+	
+	/**
+	 * Gets the number of zoom levels
+	 * @return
+	 */
+	public int getZoomLevels();
+	
+	/**
+	 * Gets the nearest level to the selected pixel size
+	 * @param pixelSize
+	 * @return
+	 */
+	public int getNearestLevel(double pixelSize);
+	
+	/**
+	 * Gets a tile
+	 * @param level
+	 *        Resolution level
+	 * @param tileCol
+	 *        Tile column in the resolution level
+	 * @param tileRow
+	 *        Tile row in the resolution level
+	 * @param bbox
+	 *        Bounding box of the tile
+	 * @return
+	 * @throws TileGettingException
+	 */
+	public Tile getTile(SpiRasterQuery q) throws TileGettingException;
+	
+	/**
+	 * Gets a tile
+	 * @param level
+	 *        Resolution level
+	 * @param tileCol
+	 *        Tile column in the resolution level
+	 * @param tileRow
+	 *        Tile row in the resolution level
+	 * @param bbox
+	 *        Bounding box of the tile
+	 * @return
+	 * @throws TileGettingException
+	 */
+	//public Tile getTile(int level, int tileCol, int tileRow, Extent ex, CacheStruct cacheStruct) throws TileGettingException;
+	
+	/**
+	 * Sets the tile cache data server. This is the server assigned by the client. 
+	 * It will force to build a second level cache if the CacheStruct is not the same
+	 * as the owner. 
+	 * @param tileServer
+	 */
+	public void setTileServer(Class<?> tileServer) throws InitializeException;
+	
+	/**
+	 * Returns the tile size in pixels if this providers have tiles
+	 * @return
+	 */
+	public int[] getTileSize(int level);
+	
+	/**
+	 * Gets the internal provider used to feed the TileProvider
+	 * @return
+	 */
+	public RasterProvider getInternalProvider();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/TiledRasterProvider.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/FileTileServer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/FileTileServer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/FileTileServer.java	(revision 15423)
@@ -0,0 +1,137 @@
+/* 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.impl.provider.tile;
+
+import java.io.File;
+import java.net.URI;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.raster.cache.tile.TileCacheLibrary;
+import org.gvsig.raster.cache.tile.TileCacheLocator;
+import org.gvsig.raster.cache.tile.TileCacheManager;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.cache.tile.provider.Downloader;
+import org.gvsig.raster.cache.tile.provider.TileServer;
+
+/**
+* Data server for the tile cache in a GdalProvider
+* @author Nacho Brodin (nachobrodin@gmail.com)
+*/
+public class FileTileServer implements TileServer {
+	protected   CacheStruct                struct         = null;
+	protected   Downloader                 downloader     = null;
+	protected   RasterDataStore            store          = null;
+	protected   String                     suffix         = "tif";
+	protected   boolean                    externalStruct = false;
+
+	public FileTileServer(RasterDataStore store) {
+		this.store = store;
+	}
+
+	public Downloader getDownloader() {
+		//The downloader is built the first time or if the structure is assigned from the client.
+		boolean firstLoad = (downloader == null);
+
+		if(firstLoad || externalStruct) {
+			downloader = new TileDownloaderForFiles(store, getStruct(),
+					getStruct().getTileSizeByLevel(0)[0],
+					getStruct().getTileSizeByLevel(0)[1],
+					getFileSuffix());
+			externalStruct = false;
+			return downloader;
+		}
+
+		//If the tile size has changed.
+		if(((TileDownloaderForFiles)downloader).getTileSize()[0] != TileCacheLibrary.DEFAULT_TILEWIDTH ||
+		   ((TileDownloaderForFiles)downloader).getTileSize()[1] != TileCacheLibrary.DEFAULT_TILEHEIGHT) {
+			downloader = new TileDownloaderForFiles(store, getStruct(),
+					TileCacheLibrary.DEFAULT_TILEWIDTH,
+					TileCacheLibrary.DEFAULT_TILEHEIGHT,
+					getFileSuffix());
+		}
+		return downloader;
+	}
+
+	public CacheStruct getStruct() {
+		if(struct == null) {
+			TileCacheManager  manager = TileCacheLocator.getManager();
+
+			int coordinates = CacheStruct.FLAT;
+			if(store.getProjection() != null)
+				coordinates = (store.getProjection() != null && store.getProjection().isProjected()) ? CacheStruct.FLAT : CacheStruct.GEOGRAFIC;
+			else {
+				Extent e = store.getExtent();
+				if(e.getULX() >= -180 && e.getULX() <= 180 && e.getLRX() >= -180 && e.getLRX() <= 180 &&
+					e.getULY() >= -90 && e.getULY() <= 90 && e.getLRY() >= -90 && e.getLRY() <= 90) {
+					coordinates = CacheStruct.GEOGRAFIC;
+				}
+			}
+
+			String epsg = null;
+			IProjection proj = store.getProjection();
+			if(proj != null)
+				epsg = proj.getAbrev();
+
+			URI uri = ((RasterDataParameters)store.getParameters()).getURI();
+			struct = manager.createCacheStructure(coordinates,
+					TileCacheLibrary.DEFAULT_LEVELS,
+					store.getExtent().toRectangle2D(),
+					store.getCellSize(),
+					TileCacheLibrary.DEFAULT_TILEWIDTH,
+					TileCacheLibrary.DEFAULT_TILEHEIGHT,
+					new File(uri).getAbsolutePath(),
+					TileCacheLibrary.DEFAULT_STRUCTURE,
+					RasterLibrary.pathTileCache,
+					getFileSuffix(),
+					epsg,
+					store.getFileSize());
+		}
+		return struct;
+	}
+
+	public void setStruct(CacheStruct struct) {
+		if(struct != null) {
+			this.struct = struct;
+			if(struct.getTileSizeByLevel(0) != null) {
+				downloader = new TileDownloaderForFiles(store,
+						struct,
+						struct.getTileSizeByLevel(0)[0],
+						struct.getTileSizeByLevel(0)[1],
+						getFileSuffix());
+				externalStruct = true;
+			}
+		}
+	}
+
+	public String getFileSuffix() {
+		return suffix;
+	}
+
+	public void setFileSuffix(String extension) {
+		this.suffix = extension;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/FileTileServer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles.java	(revision 15423)
@@ -0,0 +1,208 @@
+/* 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.impl.provider.tile;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+
+/** 
+ * Tile getter 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TileDownloaderForFiles extends BaseTileDownloader {
+	protected CacheStruct               struct     = null;
+	protected String                    extension  = null;
+	
+	public TileDownloaderForFiles(RasterDataStore store, 
+			CacheStruct struct,
+			int tileWidth,
+			int tileHeight,
+			String extension) {
+		super(store, tileWidth, tileHeight);
+		this.struct = struct;
+		this.extension = extension;
+	}
+	
+	public synchronized Tile downloadTile(Tile tile) throws TileGettingException {
+		Extent tileExtent = new ExtentImpl(tile.getUl(), tile.getLr());
+		ColorInterpretation ci = store.getColorInterpretation();
+		
+		//Escribe todas las bandas a disco
+		//BandList newBandList = store.getDefaultBandList();//createBandList(prov);
+		
+		Buffer bufResult = null;
+		
+		double pixelSize = struct.getPixelSizeByLevel(tile.getLevel());
+		
+		try {
+			Extent ex = store.getExtent().intersection(tileExtent);
+			
+			//newBuf ser�n distintas de tilePx cuando haya zonas con valores no data. Las de los bordes
+			int newBufWidth = (int)Math.ceil((ex.width() * this.tilePxWidth) / tileExtent.width());
+			int newBufHeight = (int)Math.ceil((ex.height() * this.tilePxHeight) / tileExtent.height());
+			boolean alphaBand = false;
+			int nBandsBuffer = store.getBandCount();
+			
+			if(store.getColorInterpretation().hasAlphaBand())
+				alphaBand = true;
+			
+			//A partir de ahora todos los tiles RGB llevan banda de transparencia, por eso eliminamos este c�digo. Esto es para que 
+			//las capas tileadas puedan aparecer con banda transparente en el cuadro de propiedades. Si no da problemas la 
+			//modificaci�n eliminarlo permanentemente dentro de un par de versiones (19/11/2013 BN2207)
+			
+			/*if(isInternalTile(newBufWidth, newBufHeight)) {
+				bufResult = readSupersampledBuffer(tileExtent, this.tilePxWidth, this.tilePxHeight, false);
+				if(bufResult == null) {
+					RasterQuery q = RasterLocator.getManager().createQuery();
+					q.setAreaOfInterest(tileExtent, this.tilePxWidth, this.tilePxHeight);
+					q.setAllDrawableBands();
+					q.setAdjustToExtent(true); 
+					bufResult = store.query(q);
+				}
+			} else {*/
+			
+			//Hay parte del tile que cae fuera de la imagen
+			if(store.getDataType()[0] == Buffer.TYPE_BYTE) {
+				//Para imagenes byte se crea una banda de transparencia
+				alphaBand = true;
+				if(!store.getColorInterpretation().hasAlphaBand())
+					nBandsBuffer ++; 
+			} 
+
+			Buffer smallBuf = readSupersampledBuffer(ex, newBufWidth, newBufHeight, alphaBand);
+
+			if(smallBuf == null) { //No ha habido resampleo
+				RasterQuery q = RasterLocator.getManager().createQuery();
+				q.setAreaOfInterest(ex, newBufWidth, newBufHeight);
+				q.setAllDrawableBands();
+				q.setAdjustToExtent(true); 
+				if(alphaBand)
+					q.setAlphaBand(store.getBandCount() - 1);
+				smallBuf = store.query(q);
+			}
+
+			bufResult = buildTileBuffer(nBandsBuffer, this.tilePxWidth, this.tilePxHeight);
+			RasterLocator.getManager().getRasterUtils().copyToBuffer(
+					bufResult, 
+					tileExtent, 
+					smallBuf, 
+					ex, 
+					pixelSize, 
+					store.getColorInterpretation().hasAlphaBand());
+			//}
+
+			smallBuf.dispose();
+			saveTile(bufResult, pixelSize, extension, alphaBand, tile, tileExtent, ci);
+			bufResult.dispose();
+			//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 (ProcessInterruptedException e) {
+		} catch (RasterDriverException e) {
+			throw new TileGettingException(e);
+		} catch (NotSupportedExtensionException e) {
+			throw new TileGettingException(e);
+		} catch (IOException e) {
+			throw new TileGettingException(e);
+		} catch (QueryException e) {
+			throw new TileGettingException(e);
+		}
+		readTileFromDisk(tile);
+		return tile;
+	}
+	
+	public boolean isInternalTile(int bufWidth, int bufHeight) {
+		return (bufHeight == this.tilePxHeight && bufWidth == this.tilePxWidth); 
+	}
+	
+	/**
+	 * When the buffer of the request is greater than the original raster (> scale 1:1) then the request 
+	 * has to be resampled. 
+	 * @param tileExtent
+	 * @param newBandList
+	 * @param bufWidth
+	 * @param bufHeight
+	 * @param nBands
+	 * @return
+	 * @throws ProcessInterruptedException
+	 * @throws TileGettingException
+	 */
+	protected Buffer readSupersampledBuffer(Extent tileExtent, int bufWidth, int bufHeight, boolean hasAlphaBand) throws ProcessInterruptedException, QueryException, TileGettingException {
+		int widthImgPx = (int)Math.abs(tileExtent.width() / store.getPixelSizeX());
+		int heightImgPx = (int)Math.abs(tileExtent.height() / store.getPixelSizeY());
+		
+		if(widthImgPx <= 0)
+			widthImgPx = 1;
+		if(heightImgPx <= 0)
+			heightImgPx = 1;
+		
+		boolean supersampling = ((bufWidth > widthImgPx) || (bufHeight > heightImgPx)) ? true : false;
+		
+		if(supersampling) {
+			RasterQuery q = RasterLocator.getManager().createQuery();
+			q.setAreaOfInterest(tileExtent, widthImgPx, heightImgPx);
+			q.setAllDrawableBands();
+			q.setAdjustToExtent(true); 
+			if(hasAlphaBand)
+				q.setAlphaBand(store.getBandCount() - 1);
+			Buffer buf = store.query(q);
+			Buffer result = buf.getAdjustedWindow(bufWidth, bufHeight, Buffer.INTERPOLATION_NearestNeighbour);
+			if(result != buf)
+				buf.dispose();
+			return result;
+		}
+		return null;
+	}
+	
+	/**
+	 * Builds a buffer using the specified number of bands and initialize it
+	 * @param nbands
+	 * @return
+	 */
+	protected Buffer buildTileBuffer(int nbands, int w, int h) {
+		Buffer bufResult = DefaultRasterManager.getInstance().createMemoryBuffer(store.getDataType()[0], w, h, nbands, true);
+		if(store.getDataType()[0] != Buffer.TYPE_BYTE) {
+			for (int i = 0; i < bufResult.getBandCount(); i++) {
+				clearMaskBuffer(bufResult, i);
+			}
+		} else
+			clearMaskBuffer(bufResult, nbands - 1);
+		return bufResult;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/BaseTileDownloader.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/BaseTileDownloader.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/BaseTileDownloader.java	(revision 15423)
@@ -0,0 +1,373 @@
+/* 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.impl.provider.tile;
+
+import java.awt.Graphics;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.io.File;
+import java.io.IOException;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.dataset.BufferParam;
+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.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.BandNotFoundInListException;
+import org.gvsig.fmap.dal.coverage.exception.BufferCreationException;
+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.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.cache.tile.provider.Downloader;
+import org.gvsig.raster.impl.RasterDefaultImplLibrary;
+import org.gvsig.raster.impl.datastruct.BandListImpl;
+import org.gvsig.raster.impl.datastruct.DatasetBandImpl;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.store.DefaultRasterStore;
+import org.gvsig.raster.util.DefaultProviderServices;
+import org.gvsig.tools.locator.LocatorException;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Base class for downloaders
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class BaseTileDownloader implements Downloader {
+	private Logger                          log               = LoggerFactory.getLogger(BaseTileDownloader.class);
+	protected int                           tilePxWidth       = 0;
+	protected int                           tilePxHeight      = 0;
+	protected RasterDataStore               store             = null;
+	protected byte                          byteNoData        = (byte)0x00;
+	protected short                         shortNoData       = Short.MIN_VALUE;
+	protected int                           intNoData         = Integer.MIN_VALUE;
+	protected float                         floatNoData       = -99999;
+	protected double                        doubleNoData      = -99999;
+
+	public BaseTileDownloader(RasterDataStore store, int tilePxWidth, int tilePxHeight) {
+		this.store = store;
+		this.tilePxWidth = tilePxWidth;
+		this.tilePxHeight = tilePxHeight;
+		if(store.getNoDataValue() != null && store.getNoDataValue().isDefined())
+			setNoDataValue(store.getNoDataValue());
+	}
+
+	/**
+	 * Gets the image that represent a tile while is downloading.
+	 * @return
+	 */
+	public Object[] getDownloadingImage(int w, int h) {
+		if(RasterDefaultImplLibrary.downloadingImg == null)
+			return null;
+		String key = w + "X" + h + "_Downloading";
+		return new Object[]{getBufferFromImageIcon(w, h, key, RasterDefaultImplLibrary.downloadingImg)};
+	}
+
+	/**
+	 * Gets the image that represent a crash tile
+	 * @return
+	 */
+	public Object[] getCrashImage(int w, int h) {
+		if(RasterDefaultImplLibrary.crashImg == null)
+			return null;
+		String key = w + "X" + h + "_Crash";
+		return new Object[]{getBufferFromImageIcon(w, h, key, RasterDefaultImplLibrary.crashImg)};
+	}
+
+	private Buffer getBufferFromImageIcon(int w, int h, String key, ImageIcon icon) {
+		Buffer buf = RasterDefaultImplLibrary.defaultImages.get(key);
+		if(buf == null) {
+			try {
+				BufferParam par = RasterLocator.getManager().getBufferFactory().createBufferParams(w, h, 4, Buffer.TYPE_BYTE, true);
+				buf = RasterLocator.getManager().getBufferFactory().createBuffer(par);
+			} catch (LocatorException e) {
+				log.debug("Error creating buffers ", e);
+			} catch (BufferCreationException e) {
+				log.debug("Error creating buffers ", e);
+			}
+
+			byte[] background = new byte[]{-1, -1, -1, (byte)50};
+			for (int i = 0; i < buf.getHeight(); i++)
+				for (int j = 0; j < buf.getWidth(); j++)
+					buf.setElemByte(j, i, background);
+
+			BufferedImage img = new BufferedImage(icon.getIconWidth(), icon.getIconHeight(), BufferedImage.TYPE_INT_ARGB);
+			Graphics g = img.createGraphics();
+		    g.drawImage(icon.getImage(), 0, 0, null);
+			int initX = (w / 2) - (img.getWidth() / 2);
+			int initY = (h / 2) - (img.getHeight() / 2);
+			for (int i = initY; i < (img.getHeight() + initY); i++) {
+				for (int j = initX; j < (img.getWidth() + initX); j++) {
+					int value = img.getRGB(j - initX, i - initY);
+					buf.setElem(i, j, 0, (byte)((value & 0x00ff0000) >> 16));
+					buf.setElem(i, j, 1, (byte)((value & 0x0000ff00) >> 8));
+					buf.setElem(i, j, 2, (byte)(value & 0x000000ff));
+					buf.setElem(i, j, 3, (byte)((value & 0xff000000) >> 24));
+				}
+			}
+			RasterDefaultImplLibrary.defaultImages.put(key, buf);
+		}
+		return buf;
+	}
+
+	/**
+	 * Gets the size of a tile in pixels
+	 * @return Array of two integers. The first integer is the width and the second the height in pixels
+	 */
+	public int[] getTileSize() {
+		return new int[]{tilePxWidth, tilePxHeight};
+	}
+
+	/**
+	 * Sets the nodata value
+	 * @param noData
+	 */
+	public void setNoDataValue(NoData noData) {
+		switch (store.getDataType()[0]) {
+		case Buffer.TYPE_BYTE:
+			byteNoData = noData.getValue().byteValue();
+			break;
+		case Buffer.TYPE_SHORT:
+			shortNoData = noData.getValue().shortValue();
+			break;
+		case Buffer.TYPE_INT:
+			intNoData = noData.getValue().intValue();
+			break;
+		case Buffer.TYPE_FLOAT:
+			floatNoData = noData.getValue().floatValue();
+			break;
+		case Buffer.TYPE_DOUBLE:
+			doubleNoData = ((NoData)noData).getValue().doubleValue();
+			break;
+		}
+	}
+
+	public Tile readTileFromDisk(Tile tile) throws TileGettingException {
+		if(!tile.getFile().exists()) {
+			tile.setCorrupt(true);
+			return null;
+		}
+
+		BandList bandList = (BandList)tile.getDownloaderParams("BandList");
+
+		try {
+			DefaultRasterStore tileStore = new DefaultRasterStore();
+			AbstractRasterProvider tileProvider = DefaultProviderServices.loadProvider(tile.getFile());
+			tileStore.setProvider(tileProvider);
+			this.tilePxWidth = tile.getWidthPx();
+			this.tilePxHeight = tile.getHeightPx();
+
+			RasterQuery q = RasterLocator.getManager().createQuery();
+			int[] renderBands = bandList.getDrawableBands();
+			if(renderBands.length == 4 && renderBands[3] < tileProvider.getBandCount())
+				q.forceARGBRequest();
+			else
+				q.forceRGBRequest();
+			q.setDrawableBands(bandList.getDrawableBands());
+			Buffer buf = tileStore.query(q);
+
+			tile.setData(new Object[]{buf, null, tileStore.getColorTable()});
+
+			buf.setDataExtent(tileStore.getExtent().toRectangle2D());
+			tileStore.close();
+			return tile;
+		} catch (ProcessInterruptedException e) {
+			throw new TileGettingException(e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new TileGettingException(e);
+		} catch (InitializeException e) {
+			throw new TileGettingException(e);
+		} catch (QueryException e) {
+			throw new TileGettingException(e);
+		}
+	}
+
+	/**
+	 * Builds a BandList structure using all bands of a raster provider
+	 * @param prov
+	 * @return
+	 */
+	@SuppressWarnings("unused")
+	private BandList createBandListFromProvider(RasterProvider prov) {
+		BandList bandList = new BandListImpl();
+		bandList.clear();
+		int nBands = prov.getDataType()[0] == Buffer.TYPE_BYTE ? prov.getBandCount() - 1 : prov.getBandCount();
+
+		int[] drawableBands = new int[nBands];
+		for(int i = 0; i < nBands; i++) {
+			try {
+				int dataType = prov.getDataType()[i];
+				DatasetBand band = new DatasetBandImpl(new File(prov.getURIByBand(i)).getAbsolutePath(),
+													prov.getBandPositionByProvider(i),
+													dataType,
+													nBands);
+				bandList.addBand(band);
+				drawableBands[i] = i;
+			} catch(BandNotFoundInListException ex) {
+				//No a�adimos la banda
+			}
+		}
+		bandList.setDrawableBands(drawableBands);
+		return bandList;
+	}
+
+	/**
+	 * Sets a band to NODATA value
+	 * @param bufResult
+	 * @param tileExtent
+	 * @param buf
+	 * @param ex
+	 * @param pixelSize
+	 */
+	protected void clearMaskBuffer(Buffer buf, int nBand) {
+		if(buf.getDataType() == Buffer.TYPE_BYTE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, byteNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_SHORT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, shortNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_INT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, intNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_FLOAT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, floatNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_DOUBLE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, doubleNoData);
+				}
+			}
+			return;
+		}
+	}
+
+	/**
+	 * Saves a buffer to disk
+	 * @param bufResult Buffer to save
+	 * @param pixelSize Pixel size
+	 * @param extension output file format
+	 * @param alphaBand true if it has alpha band
+	 * @param path Path to the new file
+	 * @param tileExtent Bounding box of the tile
+	 * @throws NotSupportedExtensionException
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 * @throws IOException
+	 */
+	protected void saveTile(Buffer bufResult,
+			double pixelSize,
+			String extension,
+			boolean alphaBand,
+			Tile tile,
+			Extent tileExtent,
+			ColorInterpretation colorInterpretation) throws NotSupportedExtensionException, RasterDriverException, ProcessInterruptedException, IOException {
+		//Escritura en disco del tile
+		RasterManager rManager = RasterLocator.getManager();
+		DataServerWriter dataWriter = RasterLocator.getManager().createDataServerWriter();
+		dataWriter.setBuffer(bufResult, -1);
+		Params params = rManager.createWriter("_." + extension).getParams();
+		AffineTransform affineTransform = new AffineTransform(pixelSize, 0, 0, -pixelSize,
+				tileExtent.getULX(),
+				tileExtent.getULY());
+		RasterWriter rw = rManager.createWriter(dataWriter, tile.getFile().getAbsolutePath(),
+				bufResult.getBandCount(), affineTransform, bufResult.getWidth(),
+				bufResult.getHeight(), bufResult.getDataType(), params, null);
+
+		if(colorInterpretation != null) {
+			String[] values = colorInterpretation.getValues();
+			if(alphaBand) {
+				String[] newValues = values;
+				boolean exists = false;
+				for (int i = 0; i < values.length; i++) {
+					if(values[i] != null && values[i].compareTo("Alpha") == 0)
+						exists = true;
+				}
+				if(!exists) {
+					newValues = new String[values.length + 1];
+					for (int i = 0; i < values.length; i++) {
+						newValues[i] = values[i];
+					}
+					newValues[newValues.length - 1] = "Alpha";
+				}
+				rw.setColorBandsInterpretation(newValues);
+			}
+
+		} else {
+			if(alphaBand) {
+				String[] ci = new String[bufResult.getBandCount()];
+				if(bufResult.getBandCount() == 4) {
+					ci[0] = "Red";
+					ci[1] = "Green";
+					ci[2] = "Blue";
+					ci[3] = "Alpha";
+				} else {
+					for (int i = 0; i < bufResult.getBandCount(); i++) {
+						ci[i] = "Gray";
+					}
+				}
+				rw.setColorBandsInterpretation(ci);
+			}
+		}
+		rw.dataWrite();
+		rw.writeClose();
+		tile.setCorrupt(false);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/BaseTileDownloader.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles_oldversion.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles_oldversion.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles_oldversion.java	(revision 15423)
@@ -0,0 +1,201 @@
+/* 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.impl.provider.tile;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+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.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.cache.tile.provider.CacheStruct;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+
+/** 
+ * Tile getter 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TileDownloaderForFiles_oldversion extends BaseTileDownloader {
+	protected CacheStruct               struct     = null;
+	protected String                    extension  = null;
+	
+	public TileDownloaderForFiles_oldversion(RasterDataStore store, 
+			CacheStruct struct,
+			int tileWidth,
+			int tileHeight,
+			String extension) {
+		super(store, tileWidth, tileHeight);
+		this.struct = struct;
+		this.extension = extension;
+	}
+	
+	public synchronized Tile downloadTile(Tile tile) throws TileGettingException {
+		Extent tileExtent = new ExtentImpl(tile.getUl(), tile.getLr());
+		ColorInterpretation ci = store.getColorInterpretation();
+		
+		//Escribe todas las bandas a disco
+		//BandList newBandList = store.getDefaultBandList();//createBandList(prov);
+		
+		Buffer bufResult = null;
+		
+		double pixelSize = struct.getPixelSizeByLevel(tile.getLevel());
+		
+		try {
+			Extent ex = store.getExtent().intersection(tileExtent);
+			
+			//newBuf ser�n distintas de tilePx cuando haya zonas con valores no data. Las de los bordes
+			int newBufWidth = (int)Math.ceil((ex.width() * this.tilePxWidth) / tileExtent.width());
+			int newBufHeight = (int)Math.ceil((ex.height() * this.tilePxHeight) / tileExtent.height());
+			boolean alphaBand = false;
+			int nBandsBuffer = store.getBandCount();
+			
+			if(store.getColorInterpretation().hasAlphaBand())
+				alphaBand = true;
+			
+			//Si no hay parte del tile que cae fuera de la imagen no se usa una nueva banda de transparencia ni valores nodata
+			if(isInternalTile(newBufWidth, newBufHeight)) {
+				bufResult = readSupersampledBuffer(tileExtent, this.tilePxWidth, this.tilePxHeight, false);
+				if(bufResult == null) {
+					RasterQuery q = RasterLocator.getManager().createQuery();
+					q.setAreaOfInterest(tileExtent, this.tilePxWidth, this.tilePxHeight);
+					q.setAllDrawableBands();
+					q.setAdjustToExtent(true); 
+					bufResult = store.query(q);
+				}
+			} else {
+				//Hay parte del tile que cae fuera de la imagen
+				if(store.getDataType()[0] == Buffer.TYPE_BYTE) {
+					//Para imagenes byte se crea una banda de transparencia
+					alphaBand = true;
+					if(!store.getColorInterpretation().hasAlphaBand())
+						nBandsBuffer ++; 
+				} 
+				
+				Buffer smallBuf = readSupersampledBuffer(ex, newBufWidth, newBufHeight, alphaBand);
+				
+				if(smallBuf == null) { //No ha habido resampleo
+					RasterQuery q = RasterLocator.getManager().createQuery();
+					q.setAreaOfInterest(ex, newBufWidth, newBufHeight);
+					q.setAllDrawableBands();
+					q.setAdjustToExtent(true); 
+					if(alphaBand)
+						q.setAlphaBand(store.getBandCount() - 1);
+					smallBuf = store.query(q);
+				}
+				
+				bufResult = buildTileBuffer(nBandsBuffer, this.tilePxWidth, this.tilePxHeight);
+				RasterLocator.getManager().getRasterUtils().copyToBuffer(
+						bufResult, 
+						tileExtent, 
+						smallBuf, 
+						ex, 
+						pixelSize, 
+						store.getColorInterpretation().hasAlphaBand());
+			}
+			
+			saveTile(bufResult, pixelSize, extension, alphaBand, tile, tileExtent, ci);
+			//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 (ProcessInterruptedException e) {
+		} catch (RasterDriverException e) {
+			throw new TileGettingException(e);
+		} catch (NotSupportedExtensionException e) {
+			throw new TileGettingException(e);
+		} catch (IOException e) {
+			throw new TileGettingException(e);
+		} catch (QueryException e) {
+			throw new TileGettingException(e);
+		}
+		readTileFromDisk(tile);
+		return tile;
+	}
+	
+	public boolean isInternalTile(int bufWidth, int bufHeight) {
+		return (bufHeight == this.tilePxHeight && bufWidth == this.tilePxWidth); 
+	}
+	
+	/**
+	 * When the buffer of the request is greater than the original raster (> scale 1:1) then the request 
+	 * has to be resampled. 
+	 * @param tileExtent
+	 * @param newBandList
+	 * @param bufWidth
+	 * @param bufHeight
+	 * @param nBands
+	 * @return
+	 * @throws ProcessInterruptedException
+	 * @throws TileGettingException
+	 */
+	protected Buffer readSupersampledBuffer(Extent tileExtent, int bufWidth, int bufHeight, boolean hasAlphaBand) throws ProcessInterruptedException, TileGettingException {
+		int widthImgPx = (int)Math.abs(tileExtent.width() / store.getPixelSizeX());
+		int heightImgPx = (int)Math.abs(tileExtent.height() / store.getPixelSizeY());
+		boolean supersampling = ((bufWidth > widthImgPx) || (bufHeight > heightImgPx)) ? true : false;
+		
+		if(supersampling) {
+			RasterQuery q = RasterLocator.getManager().createQuery();
+			q.setAreaOfInterest(tileExtent, widthImgPx, heightImgPx);
+			q.setAllDrawableBands();
+			q.setAdjustToExtent(true); 
+			if(hasAlphaBand)
+				q.setAlphaBand(store.getBandCount() - 1);
+			Buffer buf = null;
+			try {
+				buf = store.query(q);
+			} catch (QueryException e) {
+				throw new TileGettingException(e);
+			}
+			Buffer result = buf.getAdjustedWindow(bufWidth, bufHeight, Buffer.INTERPOLATION_NearestNeighbour);
+			if(result != buf)
+				buf.dispose();
+			return result;
+		}
+		return null;
+	}
+	
+	/**
+	 * Builds a buffer using the specified number of bands and initialize it
+	 * @param nbands
+	 * @return
+	 */
+	protected Buffer buildTileBuffer(int nbands, int w, int h) {
+		Buffer bufResult = DefaultRasterManager.getInstance().createMemoryBuffer(store.getDataType()[0], w, h, nbands, true);
+		if(store.getDataType()[0] != Buffer.TYPE_BYTE) {
+			for (int i = 0; i < bufResult.getBandCount(); i++) {
+				clearMaskBuffer(bufResult, i);
+			}
+		} else
+			clearMaskBuffer(bufResult, nbands - 1);
+		return bufResult;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/provider/tile/TileDownloaderForFiles_oldversion.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/RasterDefaultImplLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/RasterDefaultImplLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/RasterDefaultImplLibrary.java	(revision 15423)
@@ -0,0 +1,199 @@
+/* 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.impl;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import javax.swing.ImageIcon;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.metadata.exceptions.MetadataException;
+import org.gvsig.raster.impl.datastruct.BandListImpl;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.raster.impl.datastruct.DatasetBandImpl;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.datastruct.Kernel;
+import org.gvsig.raster.impl.datastruct.TransparencyRangeImpl;
+import org.gvsig.raster.impl.datastruct.serializer.ColorTableRmfSerializer;
+import org.gvsig.raster.impl.datastruct.serializer.HistogramRmfSerializer;
+import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer;
+import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList;
+import org.gvsig.raster.impl.grid.filter.band.ColorBalanceCMYManager;
+import org.gvsig.raster.impl.grid.filter.band.ColorBalanceRGBManager;
+import org.gvsig.raster.impl.grid.filter.band.ColorTableListManager;
+import org.gvsig.raster.impl.grid.filter.band.HSLToRGBManager;
+import org.gvsig.raster.impl.grid.filter.band.RGBToHSLManager;
+import org.gvsig.raster.impl.grid.filter.band.ToLumSaManager;
+import org.gvsig.raster.impl.grid.filter.convolution.ConvolutionListManager;
+import org.gvsig.raster.impl.grid.filter.correction.MedianListManager;
+import org.gvsig.raster.impl.grid.filter.correction.ModeManager;
+import org.gvsig.raster.impl.grid.filter.enhancement.BrightnessContrastListManager;
+import org.gvsig.raster.impl.grid.filter.enhancement.EnhancementStretchListManager;
+import org.gvsig.raster.impl.grid.filter.enhancement.EqualizationManager;
+import org.gvsig.raster.impl.grid.filter.enhancement.GrayScaleManager;
+import org.gvsig.raster.impl.grid.filter.pansharp.PanSharpeningListManager;
+import org.gvsig.raster.impl.grid.filter.segmentation.FirstDerivativeListManager;
+import org.gvsig.raster.impl.grid.filter.statistics.StatisticsListManager;
+import org.gvsig.raster.impl.grid.render.DefaultRender;
+import org.gvsig.raster.impl.store.AbstractRasterDataStore;
+import org.gvsig.raster.impl.store.DefaultRasterStore;
+import org.gvsig.raster.impl.store.DefaultRemoteRasterStore;
+import org.gvsig.raster.impl.store.ParamImpl;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
+import org.gvsig.raster.impl.store.serializer.ColorInterpretationRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoInfoRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.GeoPointListRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.ProjectionRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.ROIFileRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.StatisticsRmfSerializer;
+import org.gvsig.raster.impl.store.serializer.TimeSeriesRmfSerializer;
+import org.gvsig.raster.util.persistence.GenericPersistentObject;
+import org.gvsig.raster.util.persistence.PersistencyFilterParams;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+
+/**
+ * Library for default implementation initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class RasterDefaultImplLibrary extends AbstractLibrary {
+	public static ImageIcon                downloadingImg    = null;
+	public static ImageIcon                crashImg          = null;
+	public static HashMap<String, Buffer>  defaultImages     = new HashMap<String, Buffer>();
+	
+	public RasterDefaultImplLibrary() {
+		registerAsImplementationOf(RasterLibrary.class);
+	}
+
+	/**
+	 * Ejecuta las acciones necesarias para arrancar la librer�a.
+	 */
+	public static void wakeUp() {
+		if (RasterLibrary.wakeup)
+			return;
+
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		// Punto de extensi�n para registro de drivers de escritura
+		extensionPoints.add("RasterWriter", "Raster Writer Classes");
+		// Punto de extensi�n de los filtros
+		extensionPoints.add("RasterFilter", "Raster Filter Classes");
+		// Punto de extensi�n de los serializadores
+		extensionPoints.add("Serializer", "Raster Serializer Classes");
+		// Registro de clases por defecto
+		extensionPoints.add("DefaultRasterProvider", "Default Raster Drivers");
+
+		// Invoca las llamadas est�ticas de cada clase para registrarlas en los puntos de extensi�n
+		BrightnessContrastListManager.register();
+		FirstDerivativeListManager.register();
+		MedianListManager.register();
+		ConvolutionListManager.register();
+		ColorTableListManager.register();
+		StatisticsListManager.register();
+		PanSharpeningListManager.register();
+		RGBToHSLManager.register();
+		HSLToRGBManager.register();
+		ColorBalanceCMYManager.register();
+		ColorBalanceRGBManager.register();
+		ToLumSaManager.register();
+		EnhancementStretchListManager.register();
+		EqualizationManager.register();
+		ModeManager.register();
+		GrayScaleManager.register();
+		
+		// Registro de serializadores
+		ColorInterpretationRmfSerializer.register();
+		GeoInfoRmfSerializer.register();
+		GeoPointListRmfSerializer.register();
+		ProjectionRmfSerializer.register();
+		StatisticsRmfSerializer.register();
+		ColorTableRmfSerializer.register();
+		HistogramRmfSerializer.register();
+		NoDataRmfSerializer.register();
+		TimeSeriesRmfSerializer.register();
+		ROIFileRmfSerializer.register();
+
+		// Cleans the temporary folder
+		RasterLocator.getManager().getFileUtils().cleanUpTempFiles();
+		// Builds the temporary folder
+		RasterLocator.getManager().getFileUtils().getTemporalPath();
+		RasterLibrary.wakeup = true;
+	}
+
+	protected void doInitialize() throws LibraryException {
+        //Register the default GeometryManager
+        RasterLocator.registerManager(DefaultRasterManager.class);
+        wakeUp();
+	}
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+    	List<Throwable> exs = new ArrayList<Throwable>();
+    	
+    	try {
+			AbstractRasterDataStore.registerMetadataDefinition();
+		} catch (MetadataException e) {
+			exs.add(e);
+		}
+    	
+    	if (exs.size() > 0) {
+			throw new LibraryException(this.getClass(), exs);
+		}
+    	
+    	BandListImpl.registerPersistence();
+    	DefaultRender.registerPersistence();
+    	DataStoreColorTable.registerPersistence();
+    	DefaultRasterStore.registerPersistence();
+    	DefaultRemoteRasterStore.registerPersistence();
+    	DataStoreColorTable.registerPersistence();
+    	ColorItemImpl.registerPersistence();
+    	DataStoreColorInterpretation.registerDynClass();
+    	DataStoreTransparency.registerPersistence();
+    	TransparencyRangeImpl.registerPersistence();
+    	DatasetBandImpl.registerPersistence();
+    	ExtentImpl.registerPersistence();
+    	DefaultRasterFilterList.registerPersistence();
+    	GenericPersistentObject.registerPersistence();
+    	
+    	Kernel.registerPersistence();
+    	PersistencyFilterParams.registerPersistence();
+    	ParamsImpl.registerPersistence();
+    	ParamImpl.registerPersistence();
+    	
+    	//uncomment to show tile downloading image
+		//if(downloadingImg == null)
+			//downloadingImg = new ImageIcon(getClass().getResource("images/download.jpg"));
+		if(crashImg == null)
+			crashImg = new ImageIcon(getClass().getResource("images/Download_Warning.png"));
+    }
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/RasterDefaultImplLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/Supersampling.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/Supersampling.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/Supersampling.java	(revision 15423)
@@ -0,0 +1,233 @@
+package org.gvsig.raster.impl.store;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+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.store.RasterDataStore;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.DefaultRasterQuery;
+import org.gvsig.raster.impl.buffer.SpiRasterQuery;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+
+/**
+ * The requests to a <code>RasterDataStore</code> adjust the bounding box and the size in pixels 
+ * to the source limits. The user can need a buffer that exceeds the raster dimension. 
+ * In this case, the area that is out of the raster limits should be set to nodata values or 
+ * transparent in RGB cases. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @deprecated Is being used the method getAdjustedWindow of <code>Buffer</code> 
+ */
+public class Supersampling {
+	private DefaultRasterQuery           query                   = null;
+	private DefaultRasterQuery           originalQuery           = null;
+	private RasterDataStore              store                   = null; 
+	private FramedBufferResampling       framedBufferResampling  = null;
+	protected byte                       byteNoData              = (byte)0x00;
+	protected short                      shortNoData             = Short.MIN_VALUE;
+	protected int                        intNoData               = Integer.MIN_VALUE;
+	protected float                      floatNoData             = -99999;
+	protected double                     doubleNoData            = -99999;
+	
+	public Supersampling(DefaultRasterQuery q, RasterDataStore store) {
+		this.query = q;
+		this.store = store;
+		setNoDataValue(store.getNoDataValue());
+		this.originalQuery = (DefaultRasterQuery)query.clone();
+	}
+	
+	public Buffer query(RasterProvider provider) throws QueryException, ProcessInterruptedException {
+		query.calculateParameters(store);
+		Buffer bufResult = null;
+		Buffer buf = null;
+		
+		try {
+			if(query.requestHasShift()) {
+				framedBufferResampling = new FramedBufferResampling(originalQuery, store);
+				buf = framedBufferResampling.query(provider);
+			} else 
+				buf = ((AbstractRasterProvider)provider).getDataSet((SpiRasterQuery)query);
+			
+			bufResult = supersampleBuffer(buf);
+			buf.dispose();
+		} catch (RasterDriverException e) {
+			throw new QueryException("Error getting data", e);
+		}
+		return bufResult;
+	}
+	
+	private Buffer supersampleBuffer(Buffer buf) {
+		int width = query.getBufWidth();
+		int height = query.getBufHeight();
+		double[] step = query.getStep();
+		
+		Buffer result = buildBuffer(buf.getBandCount(), width, height, buf.getDataType());
+		int[] r = new int[height];
+		int[] c = new int[width];
+		calcSupersamplingStepsArrays(r, c, step);
+
+		if(buf.getDataType() == Buffer.TYPE_BYTE) {
+			byte[] data = new byte[buf.getBandCount()];
+			for (int row = 0; row < height; row++) {
+				for (int col = 0; col < width; col++) {
+					buf.getElemByte(r[row], c[col], data);
+					result.setElemByte(row, col, data);
+				}
+			}
+		}
+		
+		if(buf.getDataType() == Buffer.TYPE_SHORT) {
+			short[] data = new short[buf.getBandCount()];
+			for (int row = 0; row < height; row++) {
+				for (int col = 0; col < width; col++) {
+					buf.getElemShort(r[row], c[col], data);
+					result.setElemShort(row, col, data);
+				}
+			}
+		}
+		
+		if(buf.getDataType() == Buffer.TYPE_INT) {
+			int[] data = new int[buf.getBandCount()];
+			for (int row = 0; row < height; row++) {
+				for (int col = 0; col < width; col++) {
+					buf.getElemInt(r[row], c[col], data);
+					result.setElemInt(row, col, data);
+				}
+			}
+		}
+		
+		if(buf.getDataType() == Buffer.TYPE_FLOAT) {
+			float[] data = new float[buf.getBandCount()];
+			for (int row = 0; row < height; row++) {
+				for (int col = 0; col < width; col++) {
+					buf.getElemFloat(r[row], c[col], data);
+					result.setElemFloat(row, col, data);
+				}
+			}
+		}
+		
+		if(buf.getDataType() == Buffer.TYPE_DOUBLE) {
+			double[] data = new double[buf.getBandCount()];
+			for (int row = 0; row < height; row++) {
+				for (int col = 0; col < width; col++) {
+					buf.getElemDouble(r[row], c[col], data);
+					result.setElemDouble(row, col, data);
+				}
+			}
+		}
+		return result;
+	}
+	
+	/**
+	 * Calcula los vectores de desplazamiento en pixels en X e Y cuando se supersamplea.
+	 * @param r Array de desplazamientos para las filas. Debe tener espacio reservado
+	 * @param c Array de desplazamientos para las columnas. Debe tener espacio reservado
+	 * cargados.
+	 */
+	private void calcSupersamplingStepsArrays(int[] r, int[] c, double[] step) {
+		double pos = step[1];
+		for(int row = 0; row < r.length; row ++) {
+			r[row] = (int)(pos / step[3]);
+			pos ++;
+		}
+		pos = step[0];
+		for(int col = 0; col < c.length; col ++) {
+			c[col] = (int)(pos / step[2]);
+			pos ++;
+		}
+	}
+
+	
+	/**
+	 * Sets the nodata value
+	 * @param noData
+	 */
+	private void setNoDataValue(NoData noData) {
+		if(noData == null)
+			return;
+		switch (store.getDataType()[0]) {
+		case Buffer.TYPE_BYTE:
+			byteNoData = noData.getValue().byteValue();
+			break;
+		case Buffer.TYPE_SHORT:
+			shortNoData = noData.getValue().shortValue();
+			break;
+		case Buffer.TYPE_INT:
+			intNoData = noData.getValue().intValue();
+			break;
+		case Buffer.TYPE_FLOAT:
+			floatNoData = noData.getValue().floatValue();
+			break;
+		case Buffer.TYPE_DOUBLE:
+			doubleNoData = ((NoData)noData).getValue().doubleValue();
+			break;
+		}
+	}
+	
+	/**
+	 * Builds a buffer using the specified number of bands and initialize it
+	 * @param nbands
+	 * @return
+	 */
+	private Buffer buildBuffer(int nbands, int w, int h, int datatype) {
+		Buffer bufResult = DefaultRasterManager.getInstance().createBuffer(datatype, w, h, nbands, true);
+		for (int i = 0; i < bufResult.getBandCount(); i++) {
+			clearMaskBuffer(bufResult, i);
+		}
+		return bufResult;
+	}
+	
+	/**
+	 * Sets a band to NODATA value 
+	 * @param bufResult
+	 * @param tileExtent
+	 * @param buf
+	 * @param ex
+	 * @param pixelSize
+	 */
+	protected void clearMaskBuffer(Buffer buf, int nBand) {
+		if(buf.getDataType() == Buffer.TYPE_BYTE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, byteNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_SHORT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, shortNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_INT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, intNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_FLOAT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, floatNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_DOUBLE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, doubleNoData);
+				}
+			}
+			return;
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/Supersampling.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultStoreFactory.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultStoreFactory.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultStoreFactory.java	(revision 15423)
@@ -0,0 +1,55 @@
+/* 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.impl.store;
+
+import org.gvsig.fmap.dal.DataParameters;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreFactory;
+import org.gvsig.fmap.dal.exception.InitializeException;
+
+/**
+ * Default implementation for building a raster store.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultStoreFactory implements DataStoreFactory {
+	private DataParameters  parameters = null;
+	
+	public DataStore createStore() throws InitializeException {
+		if(parameters == null)
+			return null;
+		
+		//DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+		
+		//Servicio remoto
+		/*if(	parameters instanceof RemoteStoreParameters) {
+			return new DefaultRemoteRasterStore();
+		} */
+		
+		return new DefaultRasterStore();
+	}
+
+	public void setParameters(DataParameters parameters) {
+		this.parameters = parameters;
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultStoreFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ColorInterpretationRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ColorInterpretationRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ColorInterpretationRmfSerializer.java	(revision 15423)
@@ -0,0 +1,151 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.store.serializer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML la informaci�n de interpretaci�n de color de cada
+ * banda del raster.
+ * </P>
+ * \<ColorInterpretation\>
+ * \<BandCount\>3\</BandCount\><BR>
+ * \<Band\>Red\</Band\><BR>
+ * \<Band\>Green\</Band\><BR>
+ * \<Band\>Blue\</Band\><BR>
+ * \</ColorInterpretation\><BR>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorInterpretationRmfSerializer extends ClassSerializer {
+	//TAGS
+	public static final String         MAIN_TAG  = "ColorInterpretation";
+	public static final String         BAND      = "Band";
+	public static final String         BANDCOUNT = "BandCount";
+
+	private ColorInterpretation        datasetCI = null;
+
+	/**
+	 * Registra ColorInterpretationRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point=extensionPoints.get("Serializer");
+		point.append("ColorInterpretation", "", ColorInterpretationRmfSerializer.class);
+	}
+
+	/**
+	 * Constructor. Asigna la tabla a serializar.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public ColorInterpretationRmfSerializer(DataStoreColorInterpretation datasetCI) {
+		this.datasetCI = datasetCI;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public ColorInterpretationRmfSerializer() {
+	}
+
+	public void read(String xml) throws ParsingException {
+		String cInterp = null;
+		datasetCI = new DataStoreColorInterpretation();
+
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+		try {
+			int tag = parser.nextTag();
+
+			if ( parser.getEventType() != KXmlParser.END_DOCUMENT ){
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+				while(tag != KXmlParser.END_DOCUMENT) {
+					switch(tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().compareTo(MAIN_TAG) == 0) {
+								int nBands = Integer.valueOf(parserString(parser, BANDCOUNT, null)).intValue();
+								datasetCI.initColorInterpretation(nBands);
+								for (int i = 0; i < nBands; i++) {
+									cInterp = parserString(parser, BAND, null);
+									datasetCI.setColorInterpValue(i, cInterp);
+								}
+							}
+							break;
+						case KXmlParser.END_TAG:
+							break;
+						case KXmlParser.TEXT:
+							break;
+					}
+					tag = parser.next();
+				}
+				parser.require(KXmlParser.END_DOCUMENT, null, null);
+			}
+
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+	}
+
+	public String write() {
+		StringBuffer b = new StringBuffer();
+		if (datasetCI == null)
+			return null;
+
+		b.append("<" + MAIN_TAG + ">\n");
+		putProperty(b, BANDCOUNT, datasetCI.length(), 1);
+		
+		for (int i = 0; i < datasetCI.length(); i++) {
+			String ci = datasetCI.get(i);
+			if (ci != null)
+				putProperty(b, BAND, ci, 1);
+		}
+		b.append("</" + MAIN_TAG + ">\n");
+		return b.toString();
+	}
+
+	public Object getResult() {
+		return datasetCI;
+	}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ColorInterpretationRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoInfoRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoInfoRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoInfoRmfSerializer.java	(revision 15423)
@@ -0,0 +1,217 @@
+/* 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.impl.store.serializer;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML la informaci�n geo del raster y obtener esta informaci�n desde XML.
+ * Esta clase implementa el interfaz IRmfBlock con los m�todos de escritura y
+ * lectura. Estos ser�n utilizados por el gestor de ficheros RMF para escribir y
+ * leer datos.
+ * </P>
+ * <P>
+ * La estructura XML es la siguiente:
+ * </P>
+ * <P>
+ * \<FLyrGeoRaster xmlns="http://www.gvsig.org"\><BR>
+ * \<Extent\><BR>
+ * \<X\>4.325548573549895\</X\><BR>
+ * \<Y\>1952.062652448396\</Y\><BR>
+ * \<RotationX\>-0.23070178571428576\</RotationX\><BR>
+ * \<RotationY\>-0.1655108150921638\</RotationY\><BR>
+ * \<PixelSizeX\>0.04363559968817176\</PixelSizeX\><BR>
+ * \<PixelSizeY\>-0.43297650488377315\</PixelSizeY\><BR>
+ * \<Width\>98.92190449308538\</Width\><BR>
+ * \<Height\>-746.0185179147411\</Height\><BR>
+ * \</Extent\><BR>
+ * \<Dimension\><BR>
+ * \<ImagePxWidth\>2268\</ImagePxWidth\><BR>
+ * \<ImagePxHeight\>1724\</ImagePxHeight\><BR>
+ * \</Dimension\><BR>
+ * \</FLyrGeoRaster\><BR>
+ * </P>
+ *
+ * @version 23/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GeoInfoRmfSerializer extends ClassSerializer {
+
+	//TAGS
+	public static final String MAIN_TAG = "FLyrGeoRaster";
+	public static final String EXTENT   = "Extent";
+	public static final String X        = "X";
+	public static final String Y        = "Y";
+	public static final String ROTX     = "RotationX";
+	public static final String ROTY     = "RotationY";
+	public static final String PSX      = "PixelSizeX";
+	public static final String PSY      = "PixelSizeY";
+	public static final String W        = "Width";
+	public static final String H        = "Height";
+	public static final String DIM      = "Dimension";
+	public static final String IMGW     = "ImagePxWidth";
+	public static final String IMGH     = "ImagePxHeight";
+
+	private AbstractRasterProvider      
+	                           provider = null;
+	private AffineTransform    at       = null;
+	private Point2D            dim      = null;
+
+	/**
+	 * Registra GeoInfoRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("GeoInfo", "", GeoInfoRmfSerializer.class);
+	}
+
+	/**
+	 * Constructor. Asigna la tabla a serializar.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public GeoInfoRmfSerializer(AbstractRasterProvider dataset) {
+		this.provider = dataset;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public GeoInfoRmfSerializer(AffineTransform at, Point2D dim) {
+		this.at = at;
+		this.dim = dim;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public GeoInfoRmfSerializer() {
+	}
+
+	public void read(String xml) throws ParsingException {
+		double x = 0, y = 0, rotX = 0, rotY = 0, psX = 0, psY = 0;
+		double imgW = 0, imgH = 0;
+
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+		try {
+			int tag = parser.nextTag();
+
+			if ( parser.getEventType() != KXmlParser.END_DOCUMENT ){
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+				while(tag != KXmlParser.END_DOCUMENT) {
+					switch(tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().compareTo(MAIN_TAG) == 0) {
+								x = Double.parseDouble(parserString(parser, X, null));
+								y = Double.parseDouble(parserString(parser, Y, null));
+								rotX = Double.parseDouble(parserString(parser, ROTX, null));
+								rotY = Double.parseDouble(parserString(parser, ROTY, null));
+								psX = Double.parseDouble(parserString(parser, PSX, null));
+								psY = Double.parseDouble(parserString(parser, PSY, null));
+								Double.parseDouble(parserString(parser, W, null));
+								Double.parseDouble(parserString(parser, H, null));
+								imgW = Double.parseDouble(parserString(parser, IMGW, null));
+								imgH = Double.parseDouble(parserString(parser, IMGH, null));
+							}
+							break;
+						case KXmlParser.END_TAG:
+							break;
+						case KXmlParser.TEXT:
+							break;
+					}
+					tag = parser.next();
+				}
+				parser.require(KXmlParser.END_DOCUMENT, null, null);
+			}
+			reader.close();
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+
+		dim = new Point2D.Double(imgW, imgH);
+		at = new AffineTransform(psX, rotY, rotX, psY, x, y);
+		if (provider != null)
+			provider.setAffineTransform(at);
+	}
+
+	public String write() {
+		StringBuffer b = new StringBuffer();
+
+		if(provider != null) {
+			at = provider.getAffineTransform();
+			dim = new Point2D.Double(provider.getWidth(), provider.getHeight());
+		}
+
+		b.append("<" + MAIN_TAG + ">\n");
+		b.append("\t<" + EXTENT + ">\n");
+		putProperty(b, X, at.getTranslateX(), 3);
+		putProperty(b, Y, at.getTranslateY(), 3);
+		putProperty(b, ROTX, at.getShearX(), 3);
+		putProperty(b, ROTY, at.getShearY(), 3);
+		double wd = 0;
+		double hd = 0;
+		if(provider != null) {
+			wd = (provider.getExtent().getMax().getX() - provider.getExtent().getMin().getX());
+			hd = (provider.getExtent().getMax().getY() - provider.getExtent().getMin().getY());
+		}
+		putProperty(b, PSX, at.getScaleX(), 3);
+		putProperty(b, PSY, at.getScaleY(), 3);
+		putProperty(b, W, wd, 3);
+		putProperty(b, H, hd, 3);
+		b.append("\t</" + EXTENT + ">\n");
+		b.append("\t<" + DIM + ">\n");
+		putProperty(b, IMGW, dim.getX(), 3);
+		putProperty(b, IMGH, dim.getY(), 3);
+		b.append("\t</" + DIM + ">\n");
+		b.append("</" + MAIN_TAG + ">\n");
+		return b.toString();
+	}
+
+	public Object getResult() {
+		return provider;
+	}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoInfoRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ROIFileRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ROIFileRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ROIFileRmfSerializer.java	(revision 15423)
@@ -0,0 +1,133 @@
+/* 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.impl.store.serializer;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * This class converts to XML the path of a file of Regions of interest.
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)   
+ */
+public class ROIFileRmfSerializer extends ClassSerializer {
+	private final String  MAIN_TAG   = "ROI";
+	private List<File>    fileList   = null;
+
+	/**
+	 * Registra ProjectionRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("ROI", "", ROIFileRmfSerializer.class);
+	}
+
+	public ROIFileRmfSerializer(List<File> file) {
+		this.fileList = file;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public ROIFileRmfSerializer() {
+	}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+
+	public Object getResult() {
+		return fileList;
+	}
+
+	public void read(String xml) throws ParsingException {
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+
+		try {
+			int tag = parser.nextTag();
+
+			if (parser.getEventType() != KXmlParser.END_DOCUMENT) {
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+
+				while (tag != KXmlParser.END_DOCUMENT) {
+					switch (tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().equals("ROIFile")) {
+								for (int i = 0; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeName(i).equals("value")) {
+										if(fileList == null)
+											fileList = new ArrayList<File>();
+										fileList.add(new File((String) parser.getAttributeValue(i)));
+									}
+								}
+							}
+					}
+					tag = parser.next();
+				}
+			}
+			reader.close();
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+	}
+
+	public String write() throws IOException {
+		if (fileList == null || fileList.size() == 0)
+			return "";
+		
+		StringBuffer b = new StringBuffer();
+
+		b.append("<" + MAIN_TAG + ">\n");
+		for (int i = 0; i < fileList.size(); i++) {
+			if(fileList.get(i) != null) {
+				b.append("\t<ROIFile");
+				b.append(" value=\"" + fileList.get(i).getAbsolutePath() + "\"/>\n");
+				b.append("</" + MAIN_TAG + ">\n");
+			}
+		}
+
+		return b.toString();
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ROIFileRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/TimeSeriesRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/TimeSeriesRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/TimeSeriesRmfSerializer.java	(revision 15423)
@@ -0,0 +1,268 @@
+/* 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.impl.store.serializer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.text.ParseException;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+import org.gvsig.raster.impl.datastruct.DefaultSerialInfo;
+import org.gvsig.raster.impl.provider.DefaultTimeSerials;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML la informaci�n de una serie y obtener esta informaci�n desde XML.
+ * Esta clase implementa el interfaz IRmfBlock con los m�todos de escritura y
+ * lectura. Estos ser�n utilizados por el gestor de ficheros RMF para escribir y
+ * leer datos.
+ * </P>
+ * <P>
+ * La estructura XML es la siguiente:
+ * </P>
+ * <P>
+ * \<TimeSeries\><BR>
+ * &nbsp;\<SerialElement\><BR>
+ * &nbsp;&nbsp;\<Name\>katrina\</Name\><BR>
+ * &nbsp;&nbsp;\<Description\>Evoluci�n del huracan katrina\</Description\><BR>
+ * &nbsp;&nbsp;\<Type\>Single value\</Type\><BR>
+ * &nbsp;&nbsp;\<Dates\><BR>
+ * &nbsp;&nbsp;&nbsp;\<Date\>28//8//2005-6:10:00\</Date\><BR>
+ * &nbsp;&nbsp;\</Dates\><BR>
+ * &nbsp;\</SerialElement\><BR>
+ * \</TimeSeries\><BR>
+ * </P>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TimeSeriesRmfSerializer extends ClassSerializer {
+	//TAGS
+	public static final String MAIN_TAG   = "TimeSeries";
+	public static final String SERIAL     = "SerialElement";
+	public static final String DESC       = "Description";
+	public static final String TIMETYPE   = "SourceType";
+	public static final String DATES      = "Dates";
+	public static final String DATE       = "Date";
+	public static final String NAME       = "Name";
+	private TimeSeries         serialInfo = null;
+
+	/**
+	 * Registra GeoPointRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("Series", "", TimeSeriesRmfSerializer.class);
+	}
+
+	/**
+	 * Constructor. Asigna la lista de puntos a serializar.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public TimeSeriesRmfSerializer(TimeSeries serialInfo) {
+		this.serialInfo = serialInfo;
+	}
+	
+	
+	private void readDate(DefaultSerialInfo tInfo, KXmlParser parser) throws ParseException {
+		String d = parser.getText();
+		try {
+			Double value = new Double(d);
+			tInfo.addValue(value.doubleValue());
+		} catch (NumberFormatException e) {
+			tInfo.addValue(d);
+		}
+	}
+	
+	/**
+	 * Parsers a date list
+	 * @param tInfo
+	 * @param parser
+	 * @param xml
+	 * @param tag
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 * @throws ParsingException
+	 * @throws NumberFormatException
+	 * @throws ParseException 
+	 */
+	public void parserDates(DefaultSerialInfo tInfo, KXmlParser parser, String parseableTag, String[] errorTags) throws XmlPullParserException, IOException, NumberFormatException, ParsingException, ParseException  {
+		boolean end = false;
+		boolean init = false;
+		boolean readDate = false;
+		int tag = parser.next();
+		while (!end) {
+			switch (tag) {
+				case KXmlParser.END_DOCUMENT:
+					return;
+				case KXmlParser.START_TAG:
+					if (parser.getName().compareTo(parseableTag) == 0) {
+						init = true;
+					}
+					if(init) {
+						if (parser.getName().compareTo(DATE) == 0) {
+							readDate = true;
+						}
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (parser.getName().compareTo(parseableTag) == 0)
+						end = true;
+					break;
+				case KXmlParser.TEXT:
+					if(readDate) {
+						readDate(tInfo, parser);
+						readDate = false;
+					}
+					break;
+			}
+			if (!end)
+				tag = parser.next();
+		}
+	}
+
+	/**
+	 * Parsers a serial structure
+	 * @param tInfo
+	 * @param parser
+	 * @param xml
+	 * @param tag
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 * @throws ParsingException
+	 * @throws NumberFormatException
+	 * @throws ParseException 
+	 */
+	public void parserSerial(DefaultSerialInfo tInfo, KXmlParser parser, String xml, int tag) throws XmlPullParserException, IOException, NumberFormatException, ParsingException, ParseException  {
+		String name = parserString(parser, NAME, null);
+		String desc = parserString(parser, DESC, null);
+		String timeType = parserString(parser, TIMETYPE, null);
+		
+		tInfo.setSerialName(name);
+		tInfo.setDescription(desc);
+		try {
+			tInfo.setTimeType(new Integer(timeType));
+		} catch (NumberFormatException e) {
+		}
+		parserDates(tInfo, parser, DATES, null);
+	}
+
+	public void read(String xml) throws ParsingException {
+		ArrayList<DefaultSerialInfo> list = new ArrayList<DefaultSerialInfo>();
+		DefaultSerialInfo tInfo = null;
+		boolean init = false;
+		boolean tagOk = false;
+		boolean end = false;
+
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+		try {
+			int tag = parser.nextTag();
+
+			if ( parser.getEventType() != KXmlParser.END_DOCUMENT ){
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+				while(tag != KXmlParser.END_DOCUMENT) {
+					switch(tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().compareTo(MAIN_TAG) == 0)
+								init = true;
+							if(init) {
+								if (parser.getName().compareTo(SERIAL) == 0) {
+									tInfo = new DefaultSerialInfo();
+									tagOk = true;
+								}
+							}
+							break;
+						case KXmlParser.END_TAG:
+							if(parser.getName().compareTo(MAIN_TAG) == 0)
+								end = true;
+							break;
+						case KXmlParser.TEXT:
+							if(tagOk) {
+								parserSerial(tInfo, parser, xml, tag);
+								//list.add(tInfo);
+								tagOk = false;
+							}
+							break;
+					}
+					if(end)
+						break;
+					tag = parser.next();
+				}
+			}
+
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		} catch (NumberFormatException e) {
+			throw new ParsingException(xml);
+		} catch (ParseException e) {
+			throw new ParsingException(xml);
+		}
+
+		((DefaultTimeSerials)serialInfo).addSerialInfo(tInfo);//.setSerial(list);
+	}
+
+	public String write() {
+		StringBuffer b = new StringBuffer();
+		DefaultTimeSerials si = (DefaultTimeSerials)serialInfo;
+		
+		b.append("<" + MAIN_TAG + ">\n");
+		for (int i = 0; i < si.getNumberOfSerials(); i++) {
+			DefaultSerialInfo ti = si.getSerial(i);
+			b.append("\t<" + SERIAL + ">\n");
+			putProperty(b, NAME, ti.getSerialName(), 2);
+			putProperty(b, DESC, ti.getDescription(), 2);
+			putProperty(b, TIMETYPE, ti.getTimeType() + "", 2);
+			b.append("\t\t<" + DATES + ">\n");
+			for (int j = 0; j < ti.getTime().size(); j++) {
+				putProperty(b, DATE, ti.getTimeInfo(j), 3);
+			}
+			b.append("\t\t</" + DATES + ">\n");
+			b.append("\t</" + SERIAL + ">\n");
+		}
+		b.append("</" + MAIN_TAG + ">\n");
+		return b.toString();
+	}
+
+	public Object getResult() {
+		return serialInfo;
+	}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/TimeSeriesRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/StatisticsRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/StatisticsRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/StatisticsRmfSerializer.java	(revision 15423)
@@ -0,0 +1,359 @@
+/* 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.impl.store.serializer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.store.properties.AbstractStatistics;
+import org.gvsig.raster.impl.store.properties.SimpleProviderStatistics;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML las estadisticas y obtener las estad�sticas desde XML.
+ * Esta clase implementa el interfaz IRmfBlock con los m�todos de escritura y
+ * lectura. Estos ser�n utilizados por el gestor de ficheros RMF para escribir y
+ * leer datos.
+ * </P>
+ * <P>
+ * La estructura XML de las estad�sticas es la siguiente:
+ * </P>
+ * <P>
+ *\<Statistics\> <BR>
+ *&nbsp;\<Max\>0\</Max\><BR>
+ *&nbsp;\<SecondMax\>0\</SecondMax\><BR>
+ *&nbsp;\<Min\>0\</Min\><BR>
+ *&nbsp;\<SecondMin\>0\</SecondMin\><BR>
+ *&nbsp;\<Maximun\>0\</Maximun\><BR>
+ *&nbsp;\<Minimun\>0\</Minimun\><BR>
+ *&nbsp;\<Mean\>0\</Mean\><BR>
+ *&nbsp;\<Variance\>0\</Variance\><BR>
+ *&nbsp;\<BandCount\>0\</BandCount\><BR>
+ *&nbsp;\<TailTrim\>1.0:23 2.0:34 .... \</TailTrim\><BR>
+ *\</Statistics\><BR>
+ *</P>
+ *
+ * @version 23/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class StatisticsRmfSerializer extends ClassSerializer {
+	// TAGS
+	public static final String MAIN_TAG  = "Statistics";
+	public static final String BAND      = "Band";
+	public static final String MIN       = "Min";
+	public static final String MAX       = "Max";
+	public static final String SNDMIN    = "SecondMin";
+	public static final String SNDMAX    = "SecondMax";
+	public static final String MINRGB    = "MinRGB";
+	public static final String MAXRGB    = "MaxRGB";
+	public static final String SNDMINRGB = "SecondMinRGB";
+	public static final String SNDMAXRGB = "SecondMaxRGB";
+	public static final String MAXIMUN   = "Maximun";
+	public static final String MINIMUN   = "Minimun";
+	public static final String MEAN      = "Mean";
+	public static final String VARIANCE  = "Variance";
+	public static final String NVALUES   = "NValues";
+	public static final String BANDCOUNT = "BandCount";
+	public static final String TAILTRIM  = "TailTrim";
+	public static final String KEY       = "Key";
+	public static final String VALUE     = "Value";
+
+	private AbstractStatistics  stat      = null;
+
+	/**
+	 * Registra StatisticsRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("Statistics", "", StatisticsRmfSerializer.class);
+	}
+
+	/**
+	 * Constructor. Asigna la tabla a serializar.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public StatisticsRmfSerializer(Statistics stat) {
+		this.stat = (AbstractStatistics)stat;
+	}
+	
+	/**
+	 * Constructor. Asigna la tabla a serializar.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public StatisticsRmfSerializer(AbstractStatistics stat) {
+		this.stat = stat;
+	}
+
+	/**
+	 * Devuelve el objeto estadisticas de un dataset, en caso de no existir, lo crea.
+	 * @return
+	 */
+	private AbstractStatistics getDatasetStatistics() {
+		if (stat == null)
+			stat = new SimpleProviderStatistics(null);
+
+		return stat;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public StatisticsRmfSerializer() {
+	}
+
+	/**
+	 * Parsea el tag Band para extraer la lista de valores (Values) asociada a una banda.
+	 * @param parser KXmlParser
+	 * @return Array de long
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 */
+	private long[] parserStatBandValues(KXmlParser parser, int band, double[] max, double[] min, double[] sndmax, double[] sndmin, double[] maxRGB, double[] minRGB, double[] sndmaxRGB, double[] sndminRGB, double[] mean, double[] variance, long[] nValues)  throws XmlPullParserException, IOException {
+		boolean maxOk = false, minOk = false, sndmaxOk = false, sndminOk = false, meanOk = false, varianceOk = false, nvaluesOk = false;
+		boolean maxRGBOk = false, minRGBOk = false, sndmaxRGBOk = false, sndminRGBOk = false;
+		long[] valueList = null;
+		boolean end = false;
+			int tag = parser.next();
+			while (!end) {
+				switch(tag) {
+				case KXmlParser.START_TAG:
+					if(parser.getName() != null) {
+						if (parser.getName().compareTo(MAX) == 0)
+							maxOk = true;
+						if (parser.getName().compareTo(MIN) == 0)
+							minOk = true;
+						if (parser.getName().compareTo(SNDMAX) == 0)
+							sndmaxOk = true;
+						if (parser.getName().compareTo(SNDMIN) == 0)
+							sndminOk = true;
+						if (parser.getName().compareTo(MAXRGB) == 0)
+							maxRGBOk = true;
+						if (parser.getName().compareTo(MINRGB) == 0)
+							minRGBOk = true;
+						if (parser.getName().compareTo(SNDMAXRGB) == 0)
+							sndmaxRGBOk = true;
+						if (parser.getName().compareTo(SNDMINRGB) == 0)
+							sndminRGBOk = true;
+						if (parser.getName().compareTo(MEAN) == 0)
+							meanOk = true;
+						if (parser.getName().compareTo(VARIANCE) == 0)
+							varianceOk = true;
+						if (parser.getName().compareTo(NVALUES) == 0)
+							nvaluesOk = true;
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (parser.getName().compareTo(BAND) == 0)
+						end = true;
+					break;
+				case KXmlParser.TEXT:
+					if(maxOk) {
+						max[band] = Double.parseDouble(parser.getText());
+						maxOk = false;
+					}
+					if(minOk) {
+						min[band] = Double.parseDouble(parser.getText());
+						minOk = false;
+					}
+					if(sndmaxOk) {
+						sndmax[band] = Double.parseDouble(parser.getText());
+						sndmaxOk = false;
+					}
+					if(sndminOk) {
+						sndmin[band] = Double.parseDouble(parser.getText());
+						sndminOk = false;
+					}
+					if(maxRGBOk) {
+						maxRGB[band] = Double.parseDouble(parser.getText());
+						maxRGBOk = false;
+					}
+					if(minRGBOk) {
+						minRGB[band] = Double.parseDouble(parser.getText());
+						minRGBOk = false;
+					}
+					if(sndmaxRGBOk) {
+						sndmaxRGB[band] = Double.parseDouble(parser.getText());
+						sndmaxRGBOk = false;
+					}
+					if(sndminRGBOk) {
+						sndminRGB[band] = Double.parseDouble(parser.getText());
+						sndminRGBOk = false;
+					}
+					if(meanOk) {
+						mean[band] = Double.parseDouble(parser.getText());
+						meanOk = false;
+					}
+					if(varianceOk) {
+						variance[band] = Double.parseDouble(parser.getText());
+						varianceOk = false;
+					}
+					if(nvaluesOk) {
+						nValues[band] = Long.parseLong(parser.getText());
+						nvaluesOk = false;
+					}
+					break;
+				}
+				if (!end)
+					tag = parser.next();
+			}
+			return valueList;
+	}
+
+	public void read(String xml) throws ParsingException {
+		int bandCount = 0;
+		double[] max = null, maxRGB = null;
+		double[] min = null, minRGB = null;
+		double[] secondMax = null, secondMaxRGB = null;
+		double[] secondMin = null, secondMinRGB = null;
+		double[] mean = null;
+		double[] variance = null;
+		long[] nValues = null;
+
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+		try {
+			int tag = parser.nextTag();
+
+			if ( parser.getEventType() != KXmlParser.END_DOCUMENT ){
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+				while(tag != KXmlParser.END_DOCUMENT) {
+					switch(tag) {
+						case KXmlParser.START_TAG:
+							if(parser.getName() != null) {
+								if (parser.getName().compareTo(MAIN_TAG) == 0) {
+									bandCount = Integer.parseInt(parserString(parser, BANDCOUNT, null));
+									if(max == null) {
+										max = new double[bandCount];
+										min = new double[bandCount];
+										secondMax = new double[bandCount];
+										secondMin = new double[bandCount];
+										maxRGB = new double[bandCount];
+										minRGB = new double[bandCount];
+										secondMaxRGB = new double[bandCount];
+										secondMinRGB = new double[bandCount];
+										mean = new double[bandCount];
+										variance = new double[bandCount];
+										nValues = new long[bandCount];
+									}
+									for (int i = 0; i < bandCount; i++)
+										parserStatBandValues(parser, i, max, min, secondMax, secondMin, maxRGB, minRGB, secondMaxRGB, secondMinRGB, mean, variance, nValues);
+								}
+							}
+							break;
+						case KXmlParser.END_TAG:
+							break;
+						case KXmlParser.TEXT:
+							break;
+					}
+					tag = parser.next();
+				}
+				parser.require(KXmlParser.END_DOCUMENT, null, null);
+			}
+
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+		getDatasetStatistics().setBandCount(bandCount);
+		getDatasetStatistics().setMax(max);
+		getDatasetStatistics().setMin(min);
+		getDatasetStatistics().setSecondMax(secondMax);
+		getDatasetStatistics().setSecondMin(secondMin);
+		getDatasetStatistics().setMaxRGB(maxRGB);
+		getDatasetStatistics().setMinRGB(minRGB);
+		getDatasetStatistics().setSecondMaxRGB(secondMaxRGB);
+		getDatasetStatistics().setSecondMinRGB(secondMinRGB);
+		getDatasetStatistics().setMean(mean);
+		getDatasetStatistics().setVariance(variance);
+		getDatasetStatistics().setNumberOfValues(nValues);
+		getDatasetStatistics().setCalculated(true);
+	}
+
+	public String write() {
+		if (stat == null)
+			return "";
+		
+		StringBuffer b = new StringBuffer();
+				
+		b.append("<" + MAIN_TAG + ">\n");
+		putProperty(b, BANDCOUNT, getDatasetStatistics().getBandCount(), 1);
+		for (int i = 0; i < getDatasetStatistics().getBandCount(); i++) {
+			b.append("\t<" + BAND + ">\n");
+			if (getDatasetStatistics().getMax() != null)
+				putProperty(b, MAX, getDatasetStatistics().getMax()[i], 2);
+			if (getDatasetStatistics().getMin() != null)
+				putProperty(b, MIN, getDatasetStatistics().getMin()[i], 2);
+			if (getDatasetStatistics().getSecondMax() != null)
+				putProperty(b, SNDMAX, getDatasetStatistics().getSecondMax()[i], 2);
+			if (getDatasetStatistics().getSecondMin() != null)
+				putProperty(b, SNDMIN, getDatasetStatistics().getSecondMin()[i], 2);
+			if (getDatasetStatistics().getMaxByteUnsigned() != null)
+				putProperty(b, MAXRGB, getDatasetStatistics().getMaxByteUnsigned()[i], 2);
+			if (getDatasetStatistics().getMinByteUnsigned() != null)
+				putProperty(b, MINRGB, getDatasetStatistics().getMinByteUnsigned()[i], 2);
+			if (getDatasetStatistics().getSecondMaxByteUnsigned() != null)
+				putProperty(b, SNDMAXRGB, getDatasetStatistics().getSecondMaxByteUnsigned()[i], 2);
+			if (getDatasetStatistics().getSecondMinByteUnsigned() != null)
+				putProperty(b, SNDMINRGB, getDatasetStatistics().getSecondMinByteUnsigned()[i], 2);
+			if (getDatasetStatistics().getMean() != null)
+				putProperty(b, MEAN, getDatasetStatistics().getMean()[i], 2);
+			if (getDatasetStatistics().getVariance() != null)
+				putProperty(b, VARIANCE, getDatasetStatistics().getVariance()[i], 2);
+			if (getDatasetStatistics().getNumberOfValues() != null)
+				putProperty(b, NVALUES, new Long(getDatasetStatistics().getNumberOfValues()[i]).toString(), 2);
+			b.append("\t</" + BAND + ">\n");
+		}
+		/*for (int i = 0; i < getDatasetStatistics().getTailTrimCount(); i++) {
+			if (getDatasetStatistics().getTailTrimValue(i) != null) {
+				b.append("\t<" + TAILTRIM + ">\n");
+				putProperty(b, KEY, ((Double) getDatasetStatistics().getTailTrimValue(i)[0]).doubleValue(), 2);
+				putProperty(b, VALUE, ((Double) getDatasetStatistics().getTailTrimValue(i)[1]).doubleValue(), 2);
+				b.append("\t</" + TAILTRIM + ">\n");
+			}
+		}*/
+		b.append("</" + MAIN_TAG + ">\n");
+		return b.toString();
+	}
+
+	public Object getResult() {
+		return stat;
+	}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/StatisticsRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ProjectionRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ProjectionRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ProjectionRmfSerializer.java	(revision 15423)
@@ -0,0 +1,144 @@
+/* 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.impl.store.serializer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.util.CRSUtils;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML una proyeccion y obtener el valor desde un XML.
+ * Esta clase implementa el interfaz IRmfBlock con los m�todos de escritura y
+ * lectura. Estos ser�n utilizados por el gestor de ficheros RMF para escribir y
+ * leer datos.
+ * </P>
+ * <P>
+ * La estructura XML de una proyeccion es la siguiente:
+ * </P>
+ * <P>
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class ProjectionRmfSerializer extends ClassSerializer {
+	private final String MAIN_TAG   = "Projection";
+	private IProjection  projection = null;
+
+	/**
+	 * Registra ProjectionRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("Projection", "", ProjectionRmfSerializer.class);
+	}
+
+	public ProjectionRmfSerializer(IProjection projection) {
+		this.projection = projection;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public ProjectionRmfSerializer() {
+	}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+
+	public Object getResult() {
+		return projection;
+	}
+
+	public void read(String xml) throws ParsingException {
+		CRSUtils util = RasterLocator.getManager().getCRSUtils();
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+
+		try {
+			int tag = parser.nextTag();
+
+			if (parser.getEventType() != KXmlParser.END_DOCUMENT) {
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+
+				while (tag != KXmlParser.END_DOCUMENT) {
+					switch (tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().equals("WktProjection")) {
+								for (int i = 0; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeName(i).equals("value")) {
+										if(RasterLocator.getManager().isCRSUtilSupported())
+											projection = util.convertWktToIProjection((String) parser.getAttributeValue(i));
+									}
+								}
+							}
+					}
+					tag = parser.next();
+				}
+			}
+			reader.close();
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+	}
+
+	public String write() throws IOException {
+		CRSUtils util = RasterLocator.getManager().getCRSUtils();
+		StringBuffer b = new StringBuffer();
+
+		if (projection == null || !RasterLocator.getManager().isCRSUtilSupported())
+			return null;
+
+		b.append("<" + MAIN_TAG + ">\n");
+		b.append("\t<WktProjection");
+		String wkt = util.convertIProjectionToWkt(projection);
+                if( wkt == null ) {
+                    return null;
+                }
+		b.append(" value=\"" + removeQuotes(wkt) + "\"/>\n");
+		b.append("</" + MAIN_TAG + ">\n");
+
+		return b.toString();
+	}
+	
+	private String removeQuotes(String wkt) {
+		return wkt.replace("\"", "");
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/ProjectionRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoPointListRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoPointListRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoPointListRmfSerializer.java	(revision 15423)
@@ -0,0 +1,285 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.store.serializer;
+
+import java.awt.geom.Point2D;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPoint;
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPointList;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.raster.impl.datastruct.DefaultViewPortData;
+import org.gvsig.raster.impl.datastruct.GeoPointImpl;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML la informaci�n de una lista de puntos de control y obtener esta informaci�n desde XML.
+ * Esta clase implementa el interfaz IRmfBlock con los m�todos de escritura y
+ * lectura. Estos ser�n utilizados por el gestor de ficheros RMF para escribir y
+ * leer datos.
+ * </P>
+ * <P>
+ * La estructura XML es la siguiente:
+ * </P>
+ * <P>
+ * \<GeoPoint n="0"\><BR>
+ * \<PixelX\>17.85306122448992\</PixelX\><BR>
+ * \<PixelY\>15.632653061225255\</PixelY\><BR>
+ * \<MapX\>4.62857142857149\</MapX\><BR>
+ * \<MapY\>1945.74693877551\</MapY\><BR>
+ * \<Active\>true\</Active\><BR>
+ * \<LeftCenterPoint\><BR>
+ * \<X\>5.104234119122292\</X\><BR>
+ * \<Y\>1945.2980070494339\</Y\><BR>
+ * \</LeftCenterPoint\><BR>
+ * \<RightCenterPoint\><BR>
+ * \<X\>4.62857142857149\</X\><BR>
+ * \<Y\>1945.74693877551\</Y\><BR>
+ * \</RightCenterPoint\><BR>
+ * \<LeftViewPort\><BR>
+ * \<Proj\>EPSG:23030\</Proj\><BR>
+ * \<Bbox\><BR>
+ * \<Px\>-244.94276588087763\</Px\><BR>
+ * \<Py\>1782.9341499065767\</Py\><BR>
+ * \<WCWidth\>500.094\</WCWidth\><BR>
+ * \<WCHeight\>324.7277142857142\</WCHeight\><BR>
+ * \</Bbox\><BR>
+ * \<Pdim\><BR>
+ * \<Width\>140\</Width\><BR>
+ * \<Height\>140</Height\><BR>
+ * \</Pdim\><BR>
+ * \<Zoom\>1.0\</Zoom\><BR>
+ * \</LeftViewPort\><BR>
+ * \<RightViewPort\><BR>
+ * \<Proj\>EPSG:23030\</Proj\><BR>
+ * \<Bbox\><BR>
+ * \<Px\>-245.41842857142848\</Px\><BR>
+ * \<Py\>1783.3830816326529\</Py\><BR>
+ * \<WCWidth\>500.09399999999994\</WCWidth\><BR>
+ * \<WCHeight\>324.72771428571446\</WCHeight\><BR>
+ * \</Bbox\><BR>
+ * \<Pdim\><BR>
+ * \<Width\>140\</Width\><BR>
+ * \<Height\>140\</Height\><BR>
+ * \</Pdim\><BR>
+ * \<Zoom\>1.0\</Zoom\><BR>
+ * \</RightViewPort\><BR>
+ * \</GeoPoint\><BR>
+ * </P>
+ *
+ * @version 23/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GeoPointListRmfSerializer extends ClassSerializer {
+	//TAGS
+	public static final String MAIN_TAG = "GeoPoints";
+	public static final String GEOPOINT = "GeoPoint";
+	public static final String PIXELX   = "PixelX";
+	public static final String PIXELY   = "PixelY";
+	public static final String MAPX     = "MapX";
+	public static final String MAPY     = "MapY";
+	public static final String ACTIVE   = "Active";
+	public static final String PROJ     = "Proj";
+	public static final String BBOX     = "Bbox";
+	public static final String PX       = "Px";
+	public static final String PY       = "Py";
+	public static final String WCWIDTH  = "WCWidth";
+	public static final String WCHEIGHT = "WCHeight";
+	public static final String PDIM     = "Pdim";
+	public static final String WIDTH    = "Width";
+	public static final String HEIGHT   = "Height";
+	public static final String LYR      = "Layer";
+
+	private GeoPointList        gpList = null;
+	private DefaultViewPortData viewPort = null;
+
+	class GeoPointListImpl extends ArrayList<GeoPoint> implements GeoPointList {
+		private static final long serialVersionUID = 1L;
+		
+		public GeoPointList clone() {
+			GeoPointList clonedPointList = new GeoPointListImpl();
+			for (int i = 0; i < size(); i++) {
+				clonedPointList.add(get(i).cloneGeoPoint());
+			}
+			return clonedPointList;
+		}
+	}
+	
+	/**
+	 * Registra GeoPointRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("GeoPoint", "", GeoPointListRmfSerializer.class);
+	}
+
+	/**
+	 * Constructor. Asigna la lista de puntos a serializar.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public GeoPointListRmfSerializer(GeoPointList gp) {
+		this.gpList = gp;
+	}
+
+	/**
+	 * Constructor. Asigna la lista de puntos a serializar y el viewport.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public GeoPointListRmfSerializer(GeoPointList gp, DefaultViewPortData vp) {
+		this.gpList = gp;
+		this.viewPort = vp;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public GeoPointListRmfSerializer() {
+	}
+
+	/**
+	 * Parsea un punto de control completo
+	 * @param gp
+	 * @param parser
+	 * @param xml
+	 * @param tag
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 * @throws ParsingException
+	 * @throws NumberFormatException
+	 */
+	public void parserGeoPoint(GeoPointImpl gp, KXmlParser parser, String xml, int tag) throws XmlPullParserException, IOException, NumberFormatException, ParsingException  {
+		double px = Double.parseDouble(parserString(parser, PIXELX, null));
+		double py = Double.parseDouble(parserString(parser, PIXELY, null));
+		gp.setPixelPoint(new Point2D.Double(px, py));
+		double mx = Double.parseDouble(parserString(parser, MAPX, null));
+		double my = Double.parseDouble(parserString(parser, MAPY, null));
+		gp.setMapPoint(new Point2D.Double(mx, my));
+		gp.setActive(Boolean.valueOf(parserString(parser, ACTIVE, null)).booleanValue());
+	}
+
+	public void read(String xml) throws ParsingException {
+		ArrayList<GeoPointImpl> list = new ArrayList<GeoPointImpl>();
+		GeoPointImpl gp = null;
+		boolean init = false;
+		boolean tagOk = false;
+		boolean vpRead = false;
+
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+		try {
+			int tag = parser.nextTag();
+
+			if ( parser.getEventType() != KXmlParser.END_DOCUMENT ){
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+				while(tag != KXmlParser.END_DOCUMENT) {
+					switch(tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().compareTo(MAIN_TAG) == 0)
+								init = true;
+							if(init) {
+								if(!vpRead) {
+									viewPort = parseViewPort(parser, LYR, new String[]{BBOX, PX, PY, WCWIDTH, WCHEIGHT}, new String[]{PDIM, WIDTH, HEIGHT}, PROJ);
+									vpRead = true;
+								}
+								if (parser.getName().compareTo(GEOPOINT) == 0) {
+									gp = new GeoPointImpl();
+									tagOk = true;
+								}
+							}
+							break;
+						case KXmlParser.END_TAG:
+							break;
+						case KXmlParser.TEXT:
+							if(tagOk) {
+								parserGeoPoint(gp, parser, xml, tag);
+								tagOk = false;
+								list.add(gp);
+							}
+							break;
+					}
+					tag = parser.next();
+				}
+				parser.require(KXmlParser.END_DOCUMENT, null, null);
+			}
+
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+
+		gpList = new GeoPointListImpl();
+		for (int i = 0; i < list.size(); i++)
+			gpList.add((GeoPointImpl) list.get(i));
+	}
+
+	public String write() {
+		if(gpList == null || gpList.size() == 0)
+			return null;
+		
+		StringBuffer b = new StringBuffer();
+
+		b.append("<" + MAIN_TAG + ">\n");
+		for (int i = 0; i < gpList.size(); i++) {
+			GeoPoint point = gpList.get(i);
+			b.append("\t<" + GEOPOINT + " n=\"" + i + "\">\n");
+			putProperty(b, PIXELX, point.getPixelPoint().getX(), 2);
+			putProperty(b, PIXELY, point.getPixelPoint().getY(), 2);
+			putProperty(b, MAPX, point.getMapPoint().getX(), 2);
+			putProperty(b, MAPY, point.getMapPoint().getY(), 2);
+			putProperty(b, ACTIVE, String.valueOf(point.isActive()), 2);
+			b.append("\t</" + GEOPOINT + ">\n");
+		}
+		b.append("</" + MAIN_TAG + ">\n");
+		return b.toString();
+	}
+
+	public Object getResult() {
+		return gpList;
+	}
+
+	/**
+	 * Obtiene el viewPortData actual asignado o cargado desde el fichero XML
+	 * @return ViewPortData
+	 */
+	public DefaultViewPortData getViewPort() {
+		return viewPort;
+	}
+	
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/serializer/GeoPointListRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataStore.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataStore.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataStore.java	(revision 15423)
@@ -0,0 +1,672 @@
+/* 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.impl.store;
+
+import java.io.File;
+import java.net.URI;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.DataCache;
+
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataQuery;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataSet;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.StoresRepository;
+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.GeoPointList;
+import org.gvsig.fmap.dal.coverage.exception.BandNotFoundInListException;
+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.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.process.vector.Vectorization;
+import org.gvsig.fmap.dal.coverage.store.RasterDataServerExplorer;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+import org.gvsig.fmap.dal.exception.DataException;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ValidateDataParametersException;
+import org.gvsig.fmap.dal.raster.CoverageSelection;
+import org.gvsig.fmap.dal.raster.CoverageStore;
+import org.gvsig.fmap.dal.raster.spi.CoverageStoreProvider;
+import org.gvsig.fmap.dal.raster.spi.CoverageStoreProviderServices;
+import org.gvsig.fmap.dal.resource.Resource;
+import org.gvsig.fmap.dal.spi.DataStoreInitializer;
+import org.gvsig.fmap.dal.spi.DataStoreProvider;
+import org.gvsig.metadata.MetadataLocator;
+import org.gvsig.metadata.MetadataManager;
+import org.gvsig.metadata.exceptions.MetadataException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.DefaultRasterQuery;
+import org.gvsig.raster.impl.datastruct.BandListImpl;
+import org.gvsig.raster.impl.datastruct.DatasetBandImpl;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.grid.render.DefaultRender;
+import org.gvsig.raster.impl.process.vector.PotraceVectorization;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.provider.RemoteRasterProvider;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dispose.impl.AbstractDisposable;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynObject;
+import org.gvsig.tools.dynobject.DynObjectManager;
+import org.gvsig.tools.dynobject.DynObject_v2;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.dynobject.exception.DynFieldNotFoundException;
+import org.gvsig.tools.dynobject.exception.DynMethodException;
+import org.gvsig.tools.exception.BaseException;
+import org.gvsig.tools.observer.impl.DelegateWeakReferencingObservable;
+import org.gvsig.tools.undo.command.Command;
+import org.gvsig.tools.util.UnmodifiableBasicMap;
+import org.gvsig.tools.visitor.Visitor;
+
+/**
+ * Default implementation for RasterDataSource
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class AbstractRasterDataStore extends AbstractDisposable
+	implements RasterDataStore, CoverageStoreProviderServices, QueryableRaster, DataStoreInitializer {
+	public static final String         PERSISTENT_NAME        = "AbstractRasterDataStore_Persistent";
+    public static final String         PERSISTENT_DESCRIPTION = "AbstractRasterDataStore Persistent";
+   // private Logger                     log                    = LoggerFactory.getLogger(AbstractRasterDataStore.class);
+	protected DefaultRasterQuery       currentQuery           = null;
+	protected BandListImpl             storeBandList          = null;
+	protected RasterProvider           provider               = null;
+	protected Metadata                 metadata               = null;
+
+	/**
+	 * Lista de paletas asociadas a las bandas cargadas en el DataSource. Estas son calculadas
+	 * en las funciones que asignan las bandas a dibujar (addDrawableBands)
+	 */
+	private ColorTable[]			   palette                = null;
+
+	/**
+	 * Ancho y alto en pixeles del �ltimo buffer asignado
+	 */
+	protected double 		    	   nWidth                 = 0;
+	protected double 			       nHeight                = 0;
+	private Buffer                     lastBuffer             = null;
+
+	private DataManager                dataManager            = null;
+	protected DataStoreParameters      parameters             = null;
+	private DelegatedDynObject         dynobj                 = null;
+	private DelegateWeakReferencingObservable
+	                                   delegateObservable     = new DelegateWeakReferencingObservable(this);
+	private Render                     render                 = null;
+	protected RasterDataServerExplorer explorer               = null;
+
+	public BandList getDefaultBandList() {
+		if(storeBandList == null) {
+			initializeBandList();
+		}
+		return storeBandList;
+	}
+
+	public void initializeBandList() {
+		if(provider != null) {
+			storeBandList = new BandListImpl();
+			storeBandList.clear();
+			for(int i = 0; i < provider.getBandCount(); i++) {
+				try {
+					int dataType = provider.getDataType()[i];
+					String filename;
+					URI uriByBand = provider.getURIByBand(i);
+					if("FILE".equalsIgnoreCase(uriByBand.getScheme())){
+					    filename = new File(uriByBand).getAbsolutePath();
+					} else {
+                        filename = uriByBand.toString();
+					}
+					DatasetBand band = new DatasetBandImpl(filename,
+							provider.getBandPositionByProvider(i),
+							dataType,
+							provider.getBandCount());
+					storeBandList.addBand(band, i);
+				} catch(BandNotFoundInListException ex) {
+					//No a�adimos la banda
+				}
+			}
+
+			int[] drawableBands = new int[storeBandList.getBandCount()];
+			for (int i = 0; i < storeBandList.getBandCount(); i++) {
+				drawableBands[i] = i;
+			}
+
+			storeBandList.setDrawableBands(drawableBands);
+		}
+	}
+
+	public Buffer query(RasterQuery query) throws ProcessInterruptedException, QueryException {
+		Object[] obj = queryArray(query);
+		if(obj != null && obj.length > 0 && obj[0] instanceof Buffer)
+			return ((Buffer)obj[0]);
+		return null;
+	}
+
+	/**
+	 * <UL>Tasks to do in the <code>Datastore</code>
+	 * <LI>Check parameters and adjust them to not exceed the window size</LI>
+	 * <LI>Build the band list to draw</LI>
+	 * <LI>Create the buffers (RO or RW) and set them in the <code>RasterQuery</code> object</LI>
+	 * <LI>Calculate steps when supersampling is applied</LI>
+	 * </UL>
+     * @throws org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException
+     * @throws org.gvsig.fmap.dal.coverage.exception.QueryException
+	 */
+	public Object[] queryArray(RasterQuery query)
+			throws ProcessInterruptedException, QueryException {
+		Object[] result = null;
+		currentQuery = (DefaultRasterQuery)query;
+		DefaultRasterQuery q = currentQuery;
+
+		if(isTiled() || provider instanceof RemoteRasterProvider)
+			q.dontBuildBuffer();
+
+		Buffer buf = null;
+
+		if(q.requestHasShift()) {
+			//TODO: Sin probar
+			FramedBufferResampling framedBufferResampling = new FramedBufferResampling(q, this);
+			buf = framedBufferResampling.query(provider);
+		} else {
+			q.calculateParameters(this);
+			try {
+				if(q.isReadOnly() && !isTiled())
+					buf = q.getBufferForProviders();
+				else
+					buf = ((AbstractRasterProvider)provider).getDataSet(q);
+			} catch (RasterDriverException e) {
+				throw new QueryException("Error getting data", e);
+			}
+
+			if(q.isSupersamplingOptionActive() && q.isSupersamplingTheRequest()) {
+				buf = buf.getAdjustedWindow(q.getBufWidth(), q.getBufHeight(), Buffer.INTERPOLATION_NearestNeighbour);
+			}
+		}
+		if(buf != null)
+			buf.setDataExtent(q.getAdjustedRequestBoundingBox().toRectangle2D());
+		result = new Object[]{buf};
+
+		if(q.isStoredLastBuffer())
+			lastBuffer = buf;
+		else
+			lastBuffer = null;
+		q.storeLastBuffer(false);
+
+		if(result != null && result.length > 0 && result[0] instanceof Buffer) {
+			((Buffer)result[0]).setStore(this);
+			if(getNoDataValue() != null && getNoDataValue().isDefined())
+				((Buffer)result[0]).setNoDataValue(getNoDataValue());
+			return result;
+		}
+		return null;
+	}
+
+	public Extent adjustToExtent(Extent e) {
+		Extent currentExtent = this.getExtent();
+
+		double minx = e.getMin().getX() < currentExtent.getMin().getX() ? currentExtent.getMin().getX() : e.getMin().getX();
+		double maxx = e.getMax().getX() > currentExtent.getMax().getX() ? currentExtent.getMax().getX() : e.getMax().getX();
+		double miny = e.getMin().getY() < currentExtent.getMin().getY() ? currentExtent.getMin().getY() : e.getMin().getY();
+		double maxy = e.getMax().getY() > currentExtent.getMax().getY() ? currentExtent.getMax().getY() : e.getMax().getY();
+
+		return new ExtentImpl(minx, maxy, maxx, miny);
+	}
+
+	public String getFullName() {
+		return getName();
+	}
+
+	public Buffer getLastBuffer() {
+		return lastBuffer;
+	}
+
+	public TimeSeries getTimeSerials() throws RmfSerializerException {
+		if(getProvider() instanceof RasterProvider)
+			return ((RasterProvider)getProvider()).getTimeSerials();
+		return null;
+	}
+
+	public void setTimeSerials(TimeSeries serialInfo) throws RmfSerializerException {
+		if(getProvider() instanceof RasterProvider)
+			((RasterProvider)getProvider()).setTimeSerials(serialInfo);
+	}
+
+	public abstract void saveColorTableToRmf(ColorTable table) throws RmfSerializerException;
+
+	public abstract void saveGeoPointListToRmf(GeoPointList pointList) throws RmfSerializerException;
+
+	public abstract void saveROIFileListToRmf(List<File> fileList) throws RmfSerializerException;
+
+	/**
+	 * Saves information about serials
+	 * @param serialInfo object to save
+	 * @throws RmfSerializerException
+	 */
+	public abstract void saveSerialInfoToRmf(TimeSeries serialInfo) throws RmfSerializerException;
+
+	/**
+	 * Loads information about serials
+	 * @param serialInfo
+	 * @return true if work correctly
+	 */
+	public abstract boolean loadSerialInfoFromRmf(TimeSeries serialInfo);
+
+	public Vectorization createVectorizeObject() throws QueryException, ProcessInterruptedException {
+		return new PotraceVectorization((RasterDataStore)this);
+	}
+
+	public Render getRender() {
+		if(render == null)
+			render = new DefaultRender(this);
+		return render;
+	}
+
+	public void setRender(Render render) {
+		this.render = render;
+	}
+
+	public boolean isFileSupported(String fName) {
+		return RasterLocator.getManager().getProviderServices().isExtensionSupported(fName);
+	}
+
+	/**
+	 * Registers metadata definition
+	 * @throws MetadataException
+	 */
+	public static void registerMetadataDefinition() throws MetadataException {
+		MetadataManager manager = MetadataLocator.getMetadataManager();
+
+		if(manager == null)
+			return;
+
+		if( manager.getDefinition(METADATA_DEFINITION_NAME) == null  ) {
+			DynStruct defnition = manager.addDefinition(
+					METADATA_DEFINITION_NAME,
+					METADATA_DEFINITION_NAME
+			);
+			defnition.extend(
+					MetadataManager.METADATA_NAMESPACE,
+					DataStore.METADATA_DEFINITION_NAME
+			);
+		}
+	}
+
+	public int getSourceType() {
+		return ((RasterProvider)getProvider()).getSourceType();
+	}
+
+    //****************************************************
+	//****Implementing DataStoreImplementation methods****
+	//****************************************************
+
+	public void intializePhase1(DataManager dataManager,
+			DataStoreParameters parameters) throws InitializeException {
+		DynObjectManager dynManager = ToolsLocator.getDynObjectManager();
+
+		this.dynobj = (DelegatedDynObject) dynManager
+				.createDynObject(
+						MetadataLocator.getMetadataManager().getDefinition(DataStore.SPATIAL_METADATA_DEFINITION_NAME)
+				);
+		this.dataManager = dataManager;
+		this.parameters = parameters;
+
+	}
+
+	public void intializePhase2(DataStoreProvider provider)
+			throws InitializeException {
+		setProvider((RasterProvider)provider);
+	}
+
+	public DataManager getManager() {
+		return this.dataManager;
+	}
+
+	//****************************************************
+	//*********Implementing DataStore methods*************
+	//****************************************************
+
+	public String getProviderName() {
+		return getProvider().getProviderName();
+	}
+
+	public void refresh() throws DataException {
+		return;
+	}
+
+	public DataSet getDataSet() throws DataException {
+		RasterQuery query = DefaultRasterManager.getInstance().createQuery();
+		query.setSupersamplingOption(false);
+		query.setAreaOfInterest();
+		int[] bands = new int[getBandCount()];
+		for (int i = 0; i < bands.length; i++) {
+			bands[i] = i;
+		}
+		query.setDrawableBands(bands);
+		return getDataSet(query);
+	}
+
+	public DataSet getDataSet(DataQuery dataQuery) throws DataException {
+		if(dataQuery instanceof RasterQuery) {
+			Object[] obj = null;
+			try {
+				obj = queryArray((RasterQuery)dataQuery);
+			} catch (ProcessInterruptedException e) {
+				throw new RasterDriverException("", e);
+			} catch (QueryException e) {
+				throw new RasterDriverException(e.getMessage(), e);
+			}
+			if(obj != null && obj.length > 0 && obj[0] instanceof Buffer)
+				return (Buffer)obj[0];
+		}
+		return null;
+	}
+
+	public void accept(Visitor visitor, DataQuery dataQuery)
+			throws BaseException {
+	}
+
+	public void getDataSet(org.gvsig.tools.observer.Observer observer) throws DataException {
+		RasterQuery query = DefaultRasterManager.getInstance().createQuery();
+		query.setSupersamplingOption(false);
+		query.setAreaOfInterest();
+		int[] bands = new int[getBandCount()];
+		for (int i = 0; i < bands.length; i++) {
+			bands[i] = i;
+		}
+		query.setDrawableBands(bands);
+		getDataSet(query, observer);
+	}
+
+	public void getDataSet(DataQuery dataQuery, org.gvsig.tools.observer.Observer observer) throws DataException {
+		if(dataQuery instanceof RasterQuery) {
+			Object[] obj = null;
+			try {
+				obj = queryArray((RasterQuery)dataQuery);
+			} catch (ProcessInterruptedException e) {
+			} catch (QueryException e) {
+				throw new RasterDriverException(e.getMessage(), e);
+			}
+			if(obj != null && obj.length > 0 && obj[0] instanceof Buffer)
+				observer.update(this, obj[0]);
+		}
+	}
+
+	public DataSet getSelection() throws DataException {
+		return null;
+	}
+
+	public void setSelection(DataSet selection) throws DataException {
+	}
+
+	public DataSet createSelection() throws DataException {
+		return null;
+	}
+
+        @Override
+        public UnmodifiableBasicMap<String, DataStore> getChildren() {
+            return null;
+        }
+
+        
+        
+
+	public DataServerExplorer getExplorer() throws DataException, ValidateDataParametersException {
+		return explorer;
+	}
+
+	/**
+     * Sets the explorer
+     * @param explorer
+     */
+    public void setExplorer(RasterDataServerExplorer explorer) {
+    	this.explorer = explorer;
+    }
+
+	public DataQuery createQuery() {
+		return new DefaultRasterQuery();
+	}
+
+	//****************************************************
+	//*********Implementing Metadata methods*************
+	//****************************************************
+
+    public Object getMetadataID() {
+    	if(parameters != null && parameters instanceof RasterFileStoreParameters)
+    		return ((RasterFileStoreParameters)parameters).getFile();
+    	if(parameters != null && parameters instanceof RasterDataParameters)
+    		return ((RasterDataParameters)parameters).getURI();
+    	return null;
+    }
+
+	public Set<?> getMetadataChildren() {
+    	return null;
+    }
+
+    //****************************************************
+	//*********Implementing Disposable methods************
+	//****************************************************
+
+    public void doDispose() {
+
+    }
+
+    //****************************************************
+	//*********Implementing Visitable methods*************
+	//****************************************************
+
+    public void accept(Visitor visitor) throws BaseException {
+
+    }
+
+    //****************************************************
+	//****Implementing ComplexObservable methods**********
+	//****************************************************
+
+    public void disableNotifications() {
+
+	}
+
+    public void enableNotifications() {
+
+	}
+
+    public void beginComplexNotification() {
+
+	}
+
+    public void endComplexNotification() {
+
+	}
+
+    //****************************************************
+	//********Implementing Observable methods*************
+	//****************************************************
+
+	public void addObserver(org.gvsig.tools.observer.Observer o) {
+
+	}
+
+	public void deleteObserver(org.gvsig.tools.observer.Observer o) {
+
+	}
+
+	public void deleteObservers() {
+
+	}
+
+    //****************************************************
+	//********Implementing DynObject methods*************
+	//****************************************************
+
+	public DynClass getDynClass() {
+		return this.dynobj.getDynClass();
+	}
+
+	public void implement(DynClass dynClass) {
+		this.dynobj.implement(dynClass);
+    }
+
+	public void delegate(DynObject dynObject) {
+		this.dynobj.delegate(dynObject);
+    }
+
+	public Object getDynValue(String name)  throws DynFieldNotFoundException {
+		return this.dynobj.getDynValue(name);
+	}
+
+	public void setDynValue(String name, Object value)  throws DynFieldNotFoundException {
+		this.dynobj.setDynValue(name, value);
+    }
+
+	public boolean hasDynValue(String name) {
+		return this.dynobj.hasDynValue(name);
+	}
+    
+    @Override
+    public boolean hasDynMethod(String name) {
+        if( this.metadata instanceof DynObject_v2) {
+            return ((DynObject_v2)this.metadata).hasDynMethod(name);
+        }
+        return false;
+    }
+    
+    @Override
+	public Object invokeDynMethod(String name, Object[] args) throws DynMethodException {
+		return this.dynobj.invokeDynMethod(this, name, args);
+	}
+
+        @Override
+	public Object invokeDynMethod(int code, Object[] args) throws DynMethodException {
+		return this.dynobj.invokeDynMethod(this, code, args);
+	}
+
+	public void clear() {
+		if (dynobj != null) {
+			dynobj.clear();
+		}
+    }
+
+	public DataStoreParameters getParameters() {
+		return parameters;
+	}
+
+	//***********************************************************************
+	//********Implementing CoverageStoreProviderServices methods*************
+	//***********************************************************************
+
+	public CoverageSelection createDefaultCoverageSelection()
+	throws DataException {
+		return null;
+	}
+
+	public CoverageStore getCoverageStore() {
+		return this;
+	}
+
+	public abstract CoverageStoreProvider getProvider();
+
+	public void notifyChange(String notification) {
+		delegateObservable
+		.notifyObservers(new DefaultCoverageStoreNotification(
+				this, notification));
+	}
+
+	public void notifyChange(String arg0, Resource arg1) {
+		/*delegateObservable.notifyObservers(new DefaultFeatureStoreNotification(
+				this, FeatureStoreNotification.RESOURCE_CHANGED));*/
+	}
+
+	public void notifyChange(String notification, Command command) {
+		delegateObservable
+		.notifyObservers(new DefaultCoverageStoreNotification(
+				this, notification, command));
+	}
+
+	public DataStore getStore() {
+		return this;
+	}
+
+	public void close() {
+		if(lastBuffer != null) {
+			lastBuffer.dispose();
+		}
+	}
+
+	protected void finalize() throws Throwable {
+		currentQuery           = null;
+		if(palette != null) {
+			for (int i = 0; i < palette.length; i++) {
+				palette[i] = null;
+			}
+			palette = null;
+		}
+		lastBuffer             = null;
+		dataManager            = null;
+		parameters             = null;
+		metadata               = null;
+		delegateObservable     = null;
+		render                 = null;
+		super.finalize();
+	}
+
+
+    @Override
+    public void useCache(String providerName, DynObject parameters) throws DataException {
+        throw new UnsupportedOperationException("Not supported yet."); 
+    }
+
+    @Override
+    public DataCache getCache() {
+        return null;
+    }
+    
+        @Override
+    public org.gvsig.tools.resourcesstorage.ResourcesStorage getResourcesStorage() {
+        return null;
+    }
+
+    @Override
+    public StoresRepository getStoresRepository() {
+        return null;
+    }
+    
+}
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataStore.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/writer/DefaultRasterWriter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/writer/DefaultRasterWriter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/writer/DefaultRasterWriter.java	(revision 15423)
@@ -0,0 +1,203 @@
+/* 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.impl.store.writer;
+
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.io.IOException;
+
+import org.apache.commons.io.FilenameUtils;
+import org.cresques.cts.ICRSFactory;
+import org.cresques.cts.IProjection;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.ExternalCancellable;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.util.DefaultProviderServices;
+
+/**
+ * Clase abstracta de la que heredan los drivers de escritura. Tiene los m�todos
+ * abstractos que debe implementar cualquier driver de escritura y las
+ * funcionalidades y opciones soportadas comunes a todos ellos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class DefaultRasterWriter implements RasterWriter {
+	public static final int              MODE_FILEWRITE = 1;
+	public static final int              MODE_DATAWRITE = 2;
+
+	protected String                     outFileName    = null;
+	protected String                     inFileName     = null;
+	protected int                        sizeWindowX    = 0;
+	protected int                        sizeWindowY    = 0;
+	protected int                        ulX            = 0;
+	protected int                        ulY            = 0;
+	protected DataServerWriter           dataWriter     = null;
+	protected int                        nBands         = 0;
+	protected String                     ident          = null;
+	protected String                     driver         = null;
+	protected Params                     driverParams   = null;
+	protected AffineTransform            at             = null;
+	protected int                        percent        = 0;
+	protected int                        dataType       = Buffer.TYPE_BYTE;
+	protected IProjection                proj           = null;
+	protected DataStoreColorInterpretation colorInterp    = null;
+	protected ExternalCancellable        extCancellable = null;
+	protected FileUtils                  fileUtil       = RasterLocator.getManager().getFileUtils();
+	protected RasterUtils                rasterUtil     = RasterLocator.getManager().getRasterUtils();
+	protected DefaultProviderServices    pInfo          = (DefaultProviderServices)RasterLocator.getManager().getProviderServices();
+
+    private static final Logger logger = LoggerFactory.getLogger(DefaultRasterWriter.class);
+
+
+	/**
+	 * Devuelve el identificador del driver
+	 * @return Identificador del driver
+	 */
+	public String getIdent() {
+		return ident;
+	}
+
+	/**
+	 * Obtiene el nombre del driver.
+	 * @return Nombre del driver
+	 */
+	public String getDriverName() {
+		return driver;
+	}
+
+	/**
+	 * @return
+	 */
+	public String getDriverType() {
+		return driver;
+	}
+
+	/**
+	 * Asigna el porcentaje de incremento. Esto es usado por el driver para
+	 * actualizar la variable percent
+	 * @param percent
+	 */
+	public void setPercent(int percent) {
+		this.percent = percent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.RasterWriter#getPercent()
+	 */
+	public int getPercent() {
+		return percent;
+	}
+
+	/**
+	 * Obtiene los par�metros del driver.
+	 * @return WriterParams
+	 */
+	public Params getParams() {
+		return driverParams;
+	}
+
+	/**
+	 * Asigna los par�metros del driver modificados por el cliente.
+	 * @param Params
+	 */
+	public void setParams(Params params) {
+		if(params instanceof ParamsImpl)
+			this.driverParams = (ParamsImpl)params;
+	}
+
+	/**
+	 * Realiza la funci�n de compresi�n a partir de un GeoRasterFile.
+	 * @throws IOException
+	 */
+	public abstract void fileWrite() throws IOException, ProcessInterruptedException;
+
+	/**
+	 * Realiza la funci�n de compresi�n a partir de los datos pasados por el
+	 * cliente.
+	 * @throws IOException
+	 * @throws RmfSerializerException
+	 */
+	public abstract void dataWrite() throws IOException, ProcessInterruptedException;
+
+	/**
+	 * Cierra el driver
+	 */
+	public abstract void writeClose() throws IOException;
+
+	/**
+	 * Cancela el grabado de datos
+	 */
+	public abstract void writeCancel();
+
+	/**
+	 * A�ade la proyecci�n Wkt con la que salvar.
+	 * @param wkt
+	 */
+	public abstract void setWkt(String wkt);
+
+	/**
+	 * Asigna la interpretaci�n de color para el fichero de salida.
+	 * @param colorInterp Interpretaci�n de color
+	 */
+	public void setColorBandsInterpretation(String[] colorInterp) {
+		if (colorInterp != null) {
+			this.colorInterp = new DataStoreColorInterpretation();
+			this.colorInterp.initColorInterpretation(colorInterp.length);
+			for (int i = 0; i < colorInterp.length; i++)
+				this.colorInterp.setColorInterpValue(i, colorInterp[i]);
+		}
+	}
+
+	/**
+	 * Assigns the object to be cancelled
+	 *
+	 * @param cancellable
+	 */
+	public void setCancellableRasterDriver(ExternalCancellable cancellable) {
+		this.extCancellable = cancellable;
+	}
+
+    protected void savePrjFile(File dataFile, IProjection proj){
+        File file = new File(FilenameUtils.removeExtension(dataFile.getAbsolutePath())+".prj");
+        try {
+            String export = proj.export(ICRSFactory.FORMAT_WKT_ESRI);
+            if(export!=null){
+                org.apache.commons.io.FileUtils.writeStringToFile(file, export);
+            }
+        } catch (Exception e) {
+            logger.info("Can't write prj file '" + file.getAbsolutePath() + "'.");
+        }
+    }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/writer/DefaultRasterWriter.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRemoteRasterStore.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRemoteRasterStore.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRemoteRasterStore.java	(revision 15423)
@@ -0,0 +1,504 @@
+/* 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.impl.store;
+
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.DALLocator;
+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.exception.CloneException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+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.dal.raster.spi.CoverageStoreProvider;
+import org.gvsig.fmap.dal.spi.DataManagerProviderServices;
+import org.gvsig.raster.impl.datastruct.BandListImpl;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.provider.TiledRasterProvider;
+import org.gvsig.raster.impl.store.properties.MultiDataStoreMetadata;
+import org.gvsig.tools.ToolsLocator;
+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;
+
+/**
+ * This store represents a raster loaded from a remote service. This implements the interface
+ * RemoteRasterServiceStore to provide enough methods for this kind of services.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultRemoteRasterStore extends DefaultRasterStore {
+	public static final String   PERSISTENT_NAME        = "DefaultRemoteRasterStore_Persistent";
+    public static final String   PERSISTENT_DESCRIPTION = "DefaultRemoteRasterStore Persistent";
+	private double               fixedWidth  = -1;
+	private double               fixedHeight = -1;
+	private RasterManager        rManager    = RasterLocator.getManager();
+	
+	//When a image hasn't been loaded yet we need to know the extent
+	
+	public DefaultRemoteRasterStore() {
+		super();
+	}
+
+	/**
+	 * Crea un objeto RasterDataset nuevo con los mismos ficheros
+	 * que el actual.
+	 * @throws InitializeException 
+	 */
+	@Override
+	public RasterDataStore newDataStore() {
+		DataManagerProviderServices dataman = (DataManagerProviderServices) DALLocator.getDataManager();
+		try {
+			RemoteStoreParameters params = null;
+			if(parameters instanceof RemoteStoreParameters)
+				params = ((RemoteStoreParameters)getParameters()).clone();
+			DefaultRasterStore store = (DefaultRasterStore)dataman.openStore(params.getDataStoreName(), params);
+			((RasterProvider)store.getProvider()).setStatus((RasterProvider)getProvider());
+			return store;
+		} catch (ValidateDataParametersException e) {
+			return null;
+		} catch (ProviderNotRegisteredException e) {
+			return null;
+		} catch (InitializeException e) {
+			return null;
+		}
+	}
+	
+//	@Override
+//	protected Buffer setAreaOfInterestInWC(DefaultRasterQuery q)
+//		throws RasterDriverException, InvalidSetViewException, ProcessInterruptedException {
+//		if(q.getType() == DefaultRasterQuery.TYPE_WCOORDS) {
+//			q.setAdjustToExtent(currentQuery.isAdjustToExtent());
+//			return getWindowWithoutResampling(q);
+//		}
+//		
+//		if(	q.getType() == DefaultRasterQuery.TYPE_WCOORDS_RESCALED || 
+//			q.getType() == DefaultRasterQuery.TYPE_ONE_TILE) {
+//			q.setAdjustToExtent(true);
+//			return super.getWindowWithResampling(q);
+//			/*if(getParameters() instanceof RemoteStoreParameters && ((RemoteStoreParameters)getParameters()).isSizeFixed()) {
+//				q.setAdjustToExtent(true);
+//				return super.getResampledWindow(q);
+//			} else
+//				return getWindow(q.getBBox().getULX(), q.getBBox().getULY(), q.getBBox().getLRX(), q.getBBox().getLRY(), q.getBufWidth(), q.getBufHeight(), true);*/
+//		}
+//		
+//		return null;
+//	}
+
+//	public Buffer getWindowWC(DefaultRasterQuery q)
+//		throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
+//
+//		//Leemos pixels completos aunque el valor obtenido sea decimal. Esto se consigue redondeando
+//		//por arriba el m�s alto y por abajo el menor y luego restandolos
+//
+//		Point2D p1 = provider.worldToRaster(new Point2D.Double(q.getRequestBoundingBox().getULX(), q.getRequestBoundingBox().getULY()));
+//		Point2D p2 = provider.worldToRaster(new Point2D.Double(q.getRequestBoundingBox().getLRX(), q.getRequestBoundingBox().getLRY()));
+//
+//		//Para el valor mayor redondeamos por arriba. Para el valor menor redondeamos por abajo.
+//		double p1X = (p1.getX() > p2.getX()) ? Math.ceil(p1.getX()) : Math.floor(p1.getX());
+//		double p1Y = (p1.getY() > p2.getY()) ? Math.ceil(p1.getY()) : Math.floor(p1.getY());
+//		double p2X = (p2.getX() > p1.getX()) ? Math.ceil(p2.getX()) : Math.floor(p2.getX());
+//		double p2Y = (p2.getY() > p1.getY()) ? Math.ceil(p2.getY()) : Math.floor(p2.getY());
+//
+//		int width = (int)Math.abs(p1X - p2X);
+//		int height = (int)Math.abs(p1Y - p2Y);
+//
+//		//Ajustamos por si nos hemos salido del raster
+//		if(((int)(Math.min(p1X, p2X) + width)) > getWidth())
+//			width = (int)(getWidth() - Math.min(p1X, p2X));
+//		if(((int)(Math.min(p1Y, p2Y) + height)) > getHeight())
+//			height = (int)(getHeight() - Math.min(p1Y, p2Y));
+//
+//		if (p1X < 0)
+//			p1X = 0;
+//		if (p1Y < 0)
+//			p1Y = 0;
+//		if (p2X > getWidth())
+//			p2X = getWidth();
+//		if (p2Y > getHeight())
+//			p2Y = getHeight();
+//
+//		//Si hemos redondeado los pixeles de la petici�n (p1 y p2) por arriba y por abajo deberemos calcular un extent mayor
+//		//equivalente a los pixeles redondeados.
+//		Point2D wc1 = provider.rasterToWorld(new Point2D.Double(p1X, p1Y));
+//		Point2D wc2 = provider.rasterToWorld(new Point2D.Double(p2X, p2Y));
+//		
+//		if(fixedWidth >= 0 && fixedHeight >= 0) {
+//			width = (int)fixedWidth;
+//			height = (int)fixedHeight;
+//		}
+//		Buffer buffer =  DefaultRasterManager.getInstance().createMemoryBuffer(provider.getDataType()[0], width, height, provider.getBandCount(), true);
+//		Extent ex = rManager.getDataStructFactory().createExtent(wc1.getX(), wc1.getY(), wc2.getX(), wc2.getY());
+//		q.setRequestBoundingBox(ex);
+//		q.setBandList(storeBandList);
+//		q.setOutputBuffer(buffer);
+//		return ((AbstractRasterProvider)provider).getDataSet(q);
+//	}
+
+//	public Buffer getWindowWithoutResampling(DefaultRasterQuery q)
+//		throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
+//		//El incremento o decremento de las X e Y depende de los signos de rotaci�n y escala en la matriz de transformaci�n. Por esto
+//		//tenemos que averiguar si lrx es x + w o x -w, asi como si lry es y + h o y - h
+//		Extent ext = getExtent();
+//		Point2D pInit = provider.rasterToWorld(new Point2D.Double(0, 0));
+//		Point2D pEnd = provider.rasterToWorld(new Point2D.Double((int)getWidth(), (int)getHeight()));
+//		double wRaster = Math.abs(pEnd.getX() - pInit.getX());
+//		double hRaster = Math.abs(pEnd.getY() - pInit.getY());
+//		double lrx = (((int)(ext.getULX() - wRaster)) == ((int)ext.getLRX())) ? (q.getX() - q.getW()) : (q.getX() + q.getW());
+//		double lry = (((int)(ext.getULY() - hRaster)) == ((int)ext.getLRY())) ? (q.getY() - q.getH()) : (q.getY() + q.getH());
+//
+//		//Leemos pixels completos aunque el valor obtenido sea decimal. Esto se consigue redondeando
+//		//por arriba el m�s alto y por abajo el menor y luego restandolos
+//
+//		Point2D p1 = provider.worldToRaster(new Point2D.Double(q.getX(), q.getY()));
+//		Point2D p2 = provider.worldToRaster(new Point2D.Double(lrx, lry));
+//		int width = (int)Math.abs(Math.ceil(p2.getX()) - Math.floor(p1.getX()));
+//		int height = (int)Math.abs(Math.floor(p1.getY()) - Math.ceil(p2.getY()));
+//
+//		//Ajustamos por si nos hemos salido del raster
+//		if(((int)(p1.getX() + width)) > getWidth())
+//			width = (int)(getWidth() - p1.getX());
+//		if(((int)(p1.getY() + height)) > getHeight())
+//			height = (int)(getHeight() - p1.getY());
+//
+//		if (p1.getX() < 0)
+//			p1.setLocation(0, p1.getY());
+//		if (p1.getY() < 0)
+//			p1.setLocation(p1.getX(), 0);
+//		if (p2.getX() > getWidth())
+//			p2.setLocation(getWidth(), p2.getY());
+//		if (p2.getY() > getHeight())
+//			p2.setLocation(p2.getX(), getHeight());
+//
+//		if(fixedWidth >= 0 && fixedHeight >= 0) {
+//			width = (int)fixedWidth;
+//			height = (int)fixedHeight;
+//		}
+//		
+//		//Si hemos redondeado los pixeles de la petici�n (p1 y p2) por arriba y por abajo deberemos calcular un extent mayor
+//		//equivalente a los pixeles redondeados.
+//		Point2D wc1 = provider.rasterToWorld(new Point2D.Double(Math.floor(p1.getX()), Math.floor(p1.getY())));
+//		Point2D wc2 = provider.rasterToWorld(new Point2D.Double(Math.ceil(p2.getX()), Math.ceil(p2.getY())));
+//		Buffer buffer =  DefaultRasterManager.getInstance().createMemoryBuffer(provider.getDataType()[0], width, height, provider.getBandCount(), true);
+//		q.setAreaOfInterest(wc1.getX(), wc1.getY(), Math.abs(wc2.getX() - wc1.getX()), Math.abs(wc2.getY() - wc1.getY()));
+//		q.setBandList(storeBandList);
+//		q.setOutputBuffer(buffer);
+//		return ((AbstractRasterProvider)provider).getDataSet(q);
+//	}
+	
+//	public void getWindowTiled(DefaultRasterQuery q)
+//		throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {		
+//		((AbstractRasterProvider)provider).getDataSet(q);
+//	}
+
+//	public Buffer getWindowWithResampling(DefaultRasterQuery q)
+//		throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
+//		int mallocNBands = 0;
+//		if(storeBandList.getDrawableBands() != null)
+//			mallocNBands = storeBandList.getDrawableBands().length;
+//		else
+//			mallocNBands = storeBandList.getDrawableBandsCount();
+//		
+//		int dataType = provider.getDataType()[0];
+//		Buffer buffer =  DefaultRasterManager.getInstance().createMemoryBuffer(dataType, q.getBufWidth(), q.getBufHeight(), mallocNBands, true);
+//		q.setBandList(storeBandList);
+//		q.setOutputBuffer(buffer);
+//		return ((AbstractRasterProvider)provider).getDataSet(q);
+//	}
+
+//	public Buffer getWindowPx(DefaultRasterQuery q)
+//		throws InvalidSetViewException, ProcessInterruptedException, RasterDriverException {
+//		if(q.getPixelX() < 0 || q.getPixelY() < 0 || q.getPixelW() > getWidth() || q.getPixelH() > getHeight())
+//			throw new InvalidSetViewException("Out of image");
+//		
+//		if(	q.getType() == DefaultRasterQuery.TYPE_PX || 
+//			q.getType() == DefaultRasterQuery.TYPE_ENTIRE || 
+//			q.getBufWidth() <= 0 || q.getBufHeight() <= 0) {
+//			q.setBufWidth(q.getPixelW());
+//			q.setBufHeight(q.getPixelH());
+//			//TODO: Pruebas con SizeFixed
+//			/*if(((RemoteStoreParameters)getParameters()).isSizeFixed())
+//				return super.getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH());
+//			else
+//				return getWindow(q.getPixelX(), q.getPixelY(), q.getPixelW(), q.getPixelH());*/
+//		}
+//		
+//		Buffer buffer =  DefaultRasterManager.getInstance().createMemoryBuffer(provider.getDataType()[0], 
+//				q.getBufWidth(), q.getBufHeight(), provider.getBandCount(), true);
+//		
+//		q.setBandList(storeBandList);
+//		q.setOutputBuffer(buffer);
+//		return ((AbstractRasterProvider)provider).getDataSet(q);
+//	}
+
+
+	//******************************
+	//Setters and Getters
+	//******************************
+
+	/**
+	 * Calcula el tama�o de los ficheros en disco
+	 * @return tama�o en bytes de todos los ficheros de la lista
+	 */
+	@Override
+	public long getFileSize() {
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.DefaultMultiRasterStore#getHeight()
+	 */
+	@Override
+	public double getHeight() {
+		return provider.getHeight();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.IRasterDataSource#getWidth()
+	 */
+	@Override
+	public double getWidth() {
+		return provider.getWidth();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.RasterDataStore#getDataType()
+	 */
+	@Override
+	public int[] getDataType() {
+		if(provider != null)
+			return provider.getDataType();
+		return null;
+	}
+
+	/**
+	 * Obtiene la coordenada X m�nima de toda la lista
+	 * @return Coordenada X m�nima
+	 */
+	@Override
+	public double getMinX() {
+		return provider.getExtent().getMin().getX();
+	}
+
+	/**
+	 * Obtiene la coordenada Y m�nima de toda la lista
+	 * @return Coordenada Y m�nima
+	 */
+	@Override
+	public double getMinY() {
+		return provider.getExtent().getMin().getY();
+	}
+
+	/**
+	 * Obtiene la coordenada Y m�xima de toda la lista
+	 * @return Coordenada Y m�xima
+	 */
+	@Override
+	public double getMaxX() {
+		return provider.getExtent().getMax().getX();
+	}
+
+	/**
+	 * Obtiene la coordenada Y m�xima de toda la lista
+	 * @return Coordenada Y m�xima
+	 */
+	@Override
+	public double getMaxY() {
+		return provider.getExtent().getMax().getY();
+	}
+
+	/**
+	 * Obtiene la paleta correspondiente a uno de los ficheros que forman el GeoMultiRasterFile
+	 * @param i Posici�n del raster
+	 * @return Paleta asociada a este o null si no tiene
+	 */
+	@Override
+	public ColorTable getColorTable(int i) {
+		return provider.getColorTable();
+	}
+
+	/**
+	 * Obtiene la paleta correspondiente al nombre del fichero pasado por par�metro.
+	 * @param fileName Nombre del fichero
+	 * @return Paleta o null si no la tiene
+	 */
+	@Override
+	public ColorTable getColorTable(String fileName){
+		return provider.getColorTable();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.IRasterDataSource#isGeoreferenced()
+	 */
+	@Override
+	public boolean isGeoreferenced() {
+		return provider.isGeoreferenced();
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.dataset.QueryableRaster#getDataset()
+	 */
+	@Override
+	public RasterDataStore getDataStore() {
+		return this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#cloneDataStore()
+	 */
+	@Override
+	public RasterDataStore cloneDataStore() throws CloneException {
+		DefaultRemoteRasterStore ds = new DefaultRemoteRasterStore();
+		
+		int[] bands = new int[]{provider.getBandCount()};
+		ds.metadata = new MultiDataStoreMetadata(bands);
+		
+		RasterProvider prov = provider.cloneProvider();
+		ds.provider = prov;
+		ds.metadata = provider.getMetadata();
+		
+		ds.storeBandList = (BandListImpl)storeBandList.clone();
+		return ds;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.RasterDataStore#getHistogram()
+	 */
+	@Override
+	public HistogramComputer getHistogramComputer() {
+		if(provider != null)
+			return provider.getHistogramComputer();
+		return null;
+	}
+	
+	/**
+	 * Returns true if the size is fixed
+	 * @return
+	 */
+	public boolean isFixedSize() {
+		return ((RemoteStoreParameters)getParameters()).isSizeFixed();
+	}
+	
+	public CoverageStoreProvider getProvider() {
+		return provider;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.DefaultMultiRasterStore#getCoordsInTheNearestLevel(org.gvsig.fmap.dal.coverage.datastruct.Extent, int, int)
+	 */
+	public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h) {
+		try {
+			return ((TiledRasterProvider)getProvider()).getCoordsInTheNearestLevel(extent, w, h);
+		} catch (ClassCastException e) {
+			return null;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.DefaultMultiRasterStore#getCoordsInLevel(java.awt.geom.Point2D, int, int, int)
+	 */
+	public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h) {
+		try {
+			return ((TiledRasterProvider)getProvider()).getCoordsInLevel(viewCenter, level, w, h);
+		} catch (ClassCastException e) {
+			return null;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.DefaultMultiRasterStore#getZoomLevels()
+	 */
+	public int getZoomLevels() {
+		try {
+			return ((TiledRasterProvider)getProvider()).getZoomLevels();
+		} catch (ClassCastException e) {
+			return -1;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.DefaultMultiRasterStore#getNearestLevel(double)
+	 */
+	public int getNearestLevel(double pixelSize) {
+		try {
+			return ((TiledRasterProvider)getProvider()).getNearestLevel(pixelSize);
+		} catch (ClassCastException e) {
+			return -1;
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.AbstractRasterDataStore#loadFromState(org.gvsig.tools.persistence.PersistentState)
+	 */
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		super.loadFromState(state);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.AbstractRasterDataStore#saveToState(org.gvsig.tools.persistence.PersistentState)
+	 */
+	public void saveToState(PersistentState state) throws PersistenceException {
+		super.saveToState(state);
+	}	
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			if (manager.getDefinition(DefaultRasterStore.class) == null) {
+				DefaultRasterStore.registerPersistence();
+			}
+			
+			definition = manager.addDefinition(
+					DefaultRemoteRasterStore.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			
+			definition.extend(PersistenceManager.PERSISTENCE_NAMESPACE, DefaultRasterStore.PERSISTENT_NAME);
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRemoteRasterStore.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractNewRasterStoreParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractNewRasterStoreParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractNewRasterStoreParameters.java	(revision 15423)
@@ -0,0 +1,239 @@
+/* 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.impl.store;
+
+import java.awt.geom.AffineTransform;
+import java.io.File;
+import java.net.URI;
+
+import org.cresques.cts.IProjection;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.parameter.NewRasterStoreParameters;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+import org.gvsig.tools.dynobject.DynClass;
+import org.gvsig.tools.dynobject.DynField;
+import org.gvsig.tools.dynobject.DynObjectManager;
+
+/**
+ * This class represents parameters that we need to create a new
+ * raster source.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class AbstractNewRasterStoreParameters extends AbstractRasterFileDataParameters
+	implements NewRasterStoreParameters {
+	public static final String         DYNCLASS_NAME               = "NewRasterStoreParameters";
+	protected DelegatedDynObject       delegatedDynObject          = null;
+	private static DynClass            DYNCLASS                    = null;
+	private Buffer                     buffer                      = null;
+
+	public AbstractNewRasterStoreParameters() {
+		super();
+		initialize();
+	}
+
+	public static void registerDynClass() {
+	   	DynObjectManager dynman = ToolsLocator.getDynObjectManager();
+    	DynClass dynClass = dynman.get(DYNCLASS_NAME);
+    	DynField field;
+    	if (dynClass == null) {
+    		dynClass = dynman.add(DYNCLASS_NAME);
+
+    		field = dynClass.addDynFieldObject(FIELD_DATA_SERVER);
+    		field.setDescription("Data server");
+    		field.setClassOfValue(Object.class);
+    		field.setMandatory(false);
+
+    		field = dynClass.addDynField(FIELD_SRS);
+    		field.setDescription("SRS");
+    		field.setClassOfValue(Object.class);
+    		field.setMandatory(false);
+
+    		field = dynClass.addDynFieldObject(FIELD_PARAMS);
+    		field.setDescription("Driver parameters");
+    		field.setClassOfValue(Object.class);
+    		field.setMandatory(false);
+
+    		field = dynClass.addDynFieldInt(FIELD_BAND);
+    		field.setDescription("band");
+    		field.setClassOfValue(Integer.class);
+    		field.setMandatory(false);
+
+    		field = dynClass.addDynFieldString(FIELD_WKT);
+            field.setDescription("");
+            field.setMandatory(false);
+            field.setClassOfValue(String.class);
+
+            field = dynClass.addDynFieldArray(FIELD_COLORINTERPRETATION);
+            field.setDescription("Color interpretation by band");
+            field.setMandatory(false);
+            field.setClassOfValue(String.class);
+
+            field = dynClass.addDynFieldString(FIELD_AFFINETRANSFORM);
+    		field.setDescription("Affine transform");
+    		field.setClassOfValue(String.class);
+    		field.setMandatory(false);
+
+    		field = dynClass.addDynFieldObject(FIELD_URI);
+    		field.setDescription("Uniform Resource Identifier (File name or URL)");
+    		field.setClassOfValue(URI.class);
+    		field.setMandatory(false);
+
+            DYNCLASS = dynClass;
+    	}
+
+	}
+
+	protected void initialize() {
+		this.delegatedDynObject = (DelegatedDynObject) ToolsLocator
+				.getDynObjectManager().createDynObject(
+						DYNCLASS);
+	}
+
+	protected DelegatedDynObject getDelegatedDynObject() {
+		return this.delegatedDynObject;
+	}
+
+	public Buffer getBuffer() {
+		return buffer;
+	}
+
+	public String[] getColorInterpretation() {
+		return (String[])getDynValue(FIELD_COLORINTERPRETATION);
+	}
+
+	public String getFileName() {
+		String s = getFile().toString();
+		int n = s.lastIndexOf(File.separator);
+		if(n >= 0)
+			return s.substring(n + 1, s.length());
+		return s;
+	}
+
+	public String getPath() {
+		String s = getFile().toString();
+		int n = s.lastIndexOf(File.separator);
+		if(n >= 0)
+			return s.substring(0, n);
+		return s;
+	}
+
+	public IProjection getProjection() {
+		return (IProjection) getDynValue(FIELD_SRS);
+	}
+
+	public Params getDriverParams() {
+		return (Params)getDynValue(FIELD_PARAMS);
+	}
+
+	public void setDriverParams(Params params) {
+		this.setDynValue(FIELD_PARAMS, params);
+	}
+
+	public void setBuffer(Buffer buffer) {
+		this.buffer = buffer;
+	}
+
+	public int getBand() {
+		if(getDynValue(FIELD_BAND) == null)
+			return -1;
+		return (Integer)getDynValue(FIELD_BAND);
+	}
+
+	public void setBand(int n) {
+		this.setDynValue(FIELD_BAND, n);
+	}
+
+	public void setAffineTransform(AffineTransform at) {
+		StringBuilder str = new StringBuilder();
+		str.append(at.getScaleX());
+		str.append(",");
+		str.append(at.getShearX());
+		str.append(",");
+		str.append(at.getShearY());
+		str.append(",");
+		str.append(at.getScaleY());
+		str.append(",");
+		str.append(at.getTranslateX());
+		str.append(",");
+		str.append(at.getTranslateY());
+		this.setDynValue(FIELD_AFFINETRANSFORM, str);
+	}
+
+	public AffineTransform getAffineTransform() {
+		if(getDynValue(FIELD_AFFINETRANSFORM) != null) {
+			String str = (String)getDynValue(FIELD_AFFINETRANSFORM);
+			String[] values = str.split(",");
+			return new AffineTransform(
+					new Double(values[0]),
+					new Double(values[1]),
+					new Double(values[2]),
+					new Double(values[3]),
+					new Double(values[4]),
+					new Double(values[5]));
+		}
+		return null;
+	}
+
+	public void setWktProjection(String wkt) {
+		this.setDynValue(FIELD_WKT, wkt);
+	}
+
+	public String getWktProjection() {
+		return (String)getDynValue(FIELD_WKT);
+	}
+
+	public void setColorInterpretation(String[] colorInterpretation) {
+		this.setDynValue(FIELD_COLORINTERPRETATION, colorInterpretation);
+	}
+
+	public void setDestination(String path, String fileName) {
+		this.setFile(new File(path, fileName));
+	}
+
+	public void setDestination(String fileName) {
+		this.setFile(new File(fileName));
+	}
+
+	public void setProjection(IProjection projection) {
+		this.setDynValue(FIELD_SRS, projection);
+	}
+
+	public boolean isValid() {
+		if(getFileName() == null)
+			return false;
+		return true;
+	}
+
+	public DataServerWriter getDataServer() {
+		return (DataServerWriter)getDynValue(FIELD_DATA_SERVER);
+	}
+
+	public void setDataServer(DataServerWriter dataServer) {
+		this.setDynValue(FIELD_DATA_SERVER, dataServer);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractNewRasterStoreParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataParameters.java	(revision 15423)
@@ -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.impl.store;
+
+import java.io.File;
+import java.net.URI;
+
+import org.cresques.DataTypes;
+import org.cresques.cts.IProjection;
+
+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.fmap.dal.spi.AbstractDataParameters;
+import org.gvsig.tools.dynobject.DynStruct;
+
+/**
+ * Base class for all kind of parameters in raster
+ * TODO: Now it only accepts files. Maybe in the future other kind of sources could be accepted like remote services (URL)
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class AbstractRasterDataParameters extends AbstractDataParameters implements
+		RasterDataParameters {
+	public static final String     PERSISTENT_NAME        = "AbstractRasterDataParameters_Persistent";
+    public static final String     PERSISTENT_DESCRIPTION = "AbstractRasterDataParameters Persistent";
+
+	private static final String    FIELD_FRAME            = "frame";
+	private static final String    FIELD_ALPHABAND        = "alphaband";
+	private static final String    FIELD_VISIBLE          = "visible";
+	private static final String    FIELD_REPROJ_OPTION    = "selected_option";
+
+	/**
+	 * @param definition
+	 */
+	public static void registerDynClass(DynStruct definition) {
+		definition.addDynFieldString(FIELD_URI)
+		.setDescription("Uniform Resource Identifier (File name or URL)")
+		.setType(DataTypes.URI)
+		.setMandatory(false);
+
+		definition.addDynFieldInt(FIELD_FRAME)
+		.setDescription("frame")
+		.setType(DataTypes.INT)
+		.setMandatory(false)
+		.setHidden(true);
+
+		definition.addDynFieldInt(FIELD_ALPHABAND)
+		.setDescription("alphaband")
+		.setType(DataTypes.INT)
+		.setMandatory(false)
+		.setHidden(true);
+
+		definition.addDynFieldBoolean(FIELD_VISIBLE)
+        .setDescription("If the boolean in i position is true, that means that the i provider is visible")
+        .setMandatory(false)
+        .setHidden(true);
+
+        definition.addDynFieldInt(FIELD_REPROJ_OPTION)
+		.setDescription("Reprojection option")
+		.setType(DataTypes.INT)
+		.setDefaultFieldValue(new Integer(0))
+		.setMandatory(false)
+		.setHidden(true);
+
+		definition.addDynFieldString(FIELD_RMF_FOLDER)
+		.setDescription("Folder to store the RMF file")
+        .setType(DataTypes.FILE)
+		.setMandatory(false)
+		.setHidden(true);
+
+		definition.addDynFieldObject(FIELD_CRS)
+		.setDescription("CRS").
+		setType(org.cresques.DataTypes.CRS).
+		setMandatory(false);
+	}
+
+	public void assignFields(RasterDataParameters par, RasterDataServerExplorer explorer) {
+		setRMFFolder(par.getRMFFolder());
+		setReprojectionOption(par.getReprojectionOption());
+		setVisible(par.isVisible());
+		setAlphaBand(par.getAlphaBand());
+		setFrame(par.getFrame());
+		setURI(par.getURI());
+		setSRS(par.getSRS());
+	}
+
+	/**
+	 *
+	 */
+	public AbstractRasterDataParameters() {
+		super();
+	}
+
+	public void setReprojectionOption(int option) {
+		this.setDynValue(FIELD_REPROJ_OPTION, option);
+	}
+
+	public int getReprojectionOption() {
+		Integer b = (Integer)getDynValue(FIELD_REPROJ_OPTION);
+		if(b != null)
+			return ((Integer)b).intValue();
+		return 0;
+	}
+
+	public boolean isValid() {
+		return (this.getURI() != null);
+	}
+
+	public URI getURI() {
+		return (URI) this.getDynValue(FIELD_URI);
+	}
+
+	public void setURI(URI uri) {
+		this.setDynValue(FIELD_URI, uri);
+	}
+
+    public void setRMFFolder(File rmfFolder) {
+        this.setDynValue(FIELD_RMF_FOLDER, rmfFolder);
+    }
+
+	public File getRMFFolder() {
+		return (File)this.getDynValue(FIELD_RMF_FOLDER);
+	}
+
+	public String getSRSID() {
+	    return getSRS() != null ? getSRS().getAbrev() : null;
+	}
+
+	public void setSRSID(String srsid) {
+		if (srsid == null) {
+		    setSRS(null);
+		} else {
+		    setSRS(CRSFactory.getCRS(srsid));
+		}
+	}
+
+	public void setSRS(IProjection srs) {
+	    this.setDynValue(FIELD_CRS, srs);
+	}
+
+	public IProjection getSRS() {
+		return (IProjection) this.getDynValue(FIELD_CRS);
+	}
+
+	/**
+	 * Sets the number of alpha band
+	 * @param alphaBand
+	 */
+	public void setAlphaBand(int alphaBand) {
+		this.setDynValue(FIELD_ALPHABAND, new Integer(alphaBand));
+	}
+
+	/**
+	 * Sets the frame width
+	 * @param frame
+	 */
+	public void setFrame(int frame) {
+		this.setDynValue(FIELD_FRAME, new Integer(frame));
+	}
+
+	/**
+	 * Gets the number of alpha band
+	 * @param alphaBand
+	 */
+	public int getAlphaBand() {
+		Integer b = (Integer)getDynValue(FIELD_ALPHABAND);
+		if(b != null)
+			return ((Integer)b).intValue();
+		return 0;
+	}
+
+	/**
+	 * Gets the frame width
+	 * @param frame
+	 */
+	public int getFrame() {
+		Integer b = (Integer)getDynValue(FIELD_FRAME);
+		if(b != null)
+			return ((Integer)b).intValue();
+		return 0;
+	}
+
+	public boolean isVisible() {
+		Boolean b = (Boolean)getDynValue(FIELD_VISIBLE);
+		if(b != null)
+			return ((Boolean)b).booleanValue();
+		return true;
+	}
+
+	public void setVisible(boolean visible) {
+		this.setDynValue(FIELD_VISIBLE, new Boolean(visible));
+	}
+
+	public boolean isSourceTiled() {
+		return false;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterDataParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterFileDataParameters.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterFileDataParameters.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterFileDataParameters.java	(revision 15423)
@@ -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.
+*
+*/
+
+/*
+* AUTHORS (In addition to CIT):
+* 2009 IVER T.I   {{Task}}
+*/
+
+package org.gvsig.raster.impl.store;
+
+import java.io.File;
+import java.net.URI;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterFileStoreParameters;
+import org.gvsig.fmap.dal.serverexplorer.filesystem.FilesystemStoreParameters;
+import org.gvsig.tools.dynobject.DelegatedDynObject;
+
+/**
+ * Base class for all kind of parameters in raster files
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class AbstractRasterFileDataParameters extends AbstractRasterDataParameters implements
+		RasterFileStoreParameters, FilesystemStoreParameters {
+    private static final Logger logger = LoggerFactory.getLogger(AbstractRasterFileDataParameters.class);
+	public static final String         DYNCLASS_NAME         = "RasterFileDataParameters";
+	protected DelegatedDynObject       delegatedDynObject    = null;
+
+	public AbstractRasterFileDataParameters() {
+		super();
+	}
+
+	protected DelegatedDynObject getDelegatedDynObject() {
+		return delegatedDynObject;
+	}
+
+    public File getFile() {
+        URI uri = getURI();
+        if (uri!=null && "FILE".equalsIgnoreCase(uri.getScheme())) {
+            return new File(uri);
+        }
+        return null;
+    }
+
+	public void setFile(File aFile) {
+		this.setURI(aFile.toURI());
+	}
+
+	public boolean isOverridingHost() {
+		return false;
+	}
+
+	public void setOverrideHost(boolean over) {
+
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/AbstractRasterFileDataParameters.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/WriteFileFormatFeatures.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/WriteFileFormatFeatures.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/WriteFileFormatFeatures.java	(revision 15423)
@@ -0,0 +1,179 @@
+/* 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.impl.store;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+
+
+/**
+ * Caracteristicas de un formato de fichero utilizado para escritura. El contenido 
+ * de esta clase es utilizado por el driver para informar de las caracteristicas de cada
+ * formato. 
+ *
+ * 02-jun-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WriteFileFormatFeatures {
+	private String		driverName         = null;
+	private String		ext                = null;
+	private int[]		nBandsSupported    = new int[]{-1};
+	private int[]		dataTypesSupported = new int[]{Buffer.TYPE_BYTE};
+	@SuppressWarnings("unchecked")
+	private Class		driver             = null;
+	protected Params	driverParams       = new ParamsImpl();
+	
+	/**
+	 * Constructor.
+	 * Asigna las caracteristicas del formato de escritura. El tipo de dato se inicializa por
+	 * defecto a solo byte. Si recibe como parametro un null el formato acepta por defecto el tipo
+	 * byte.
+	 * @param name Nombre del driver. En el caso de gdal debe coincidir con el nombre de driver de gdal
+	 * @param ext Extensi�n del fichero
+	 * @param bands N�mero de bandas m�ximas soportadas en la escritura. Si el valor es menor que 1 soporta cualquier n�mero.
+	 * @param dataTypes Array con el tipo de datos que soporta. Cada posici�n del array contiene un entero 
+	 * que corresponde con un tipo de dato soportado. Los tipo de datos posibles est�n listados como constante
+	 * en la clase IBuffer
+	 * @param driver Clase con el driver de la libreria de raster que gestiona el formato.
+	 */
+	@SuppressWarnings("unchecked")
+	public WriteFileFormatFeatures(String name, String ext, int[] bands, int[] dataTypes, Class driver) {
+		this.driverName = name;
+		this.ext = ext;
+		this.nBandsSupported = bands;
+		if(dataTypes != null)
+			this.dataTypesSupported = dataTypes;
+		this.driver = driver;
+	}
+	
+	public WriteFileFormatFeatures() {
+		
+	}
+	
+	 /**
+     * Carga los par�metros comunes a todos los drivers en el objeto WriterParams.
+     */
+    public void loadParams() {
+    	driverParams.clear();
+    	//Aqu� se definen los par�metros globales a todos los drivers.
+    }
+    
+    /**
+     * Obtiene los par�metros del driver.
+     * @return WriterParams
+     */
+    public Params getParams() {
+		return driverParams;
+	}
+    
+    /**
+     * Asigna los par�metros del driver modificados por el cliente.
+     * @param ParamsImpl
+     */
+    public void setParams(Params params) {
+		this.driverParams = params;
+	}
+    
+	/**
+	 * Obtiene la clase del driver que gestiona la escritura de ese tipo de formato
+	 * @return Clase del driver
+	 */
+	@SuppressWarnings("unchecked")
+	public Class getDriver() {
+		return driver;
+	}
+	
+	/**
+	 * Asigna la clase del driver que gestiona la escritura de ese tipo de formato
+	 * @param Clase del driver
+	 */
+	@SuppressWarnings("unchecked")
+	public void setDriver(Class driver) {
+		this.driver = driver;
+	}
+	
+	/**
+	 * Obtiene una lista de los tipos de datos soportados. Estos est�n definidos como
+	 * constantes en IBuffer.
+	 * @return Lista con los tipos de datos soportados
+	 */
+	public int[] getDataTypesSupported() {
+		return dataTypesSupported;
+	}
+	
+	/**
+	 * Asigna una lista de los tipos de datos soportados. Estos est�n definidos como
+	 * constantes en IBuffer.
+	 * @param Lista con los tipos de datos soportados
+	 */
+	public void setDataTypesSupported(int[] dataTypesSupported) {
+		this.dataTypesSupported = dataTypesSupported;
+	}
+	
+	/**
+	 * Obtiene el nombre del driver. En el caso de gdal debe coincidir con el nombre de driver de gdal.
+	 * @return Nombre del driver
+	 */
+	public String getDriverName() {
+		return driverName;
+	}
+	
+	/**
+	 * Asigna el nombre del driver. En el caso de gdal debe coincidir con el nombre de driver de gdal.
+	 * @return Nombre del driver
+	 */
+	public void setDriverName(String driverName) {
+		this.driverName = driverName;
+	}
+	
+	/**
+	 * Obtiene la extensi�n del formato
+	 * @return Cadena con la extensi�n del formato
+	 */
+	public String getExt() {
+		return ext;
+	}
+	
+	/**
+	 * Asigna la extensi�n del formato
+	 * @param ext Cadena con la extensi�n del formato
+	 */
+	public void setExt(String ext) {
+		this.ext = ext;
+	}
+	
+	/**
+	 * Obtiene el n�mero de bandas soportadas o -1 si es cualquier n�mero de ellas
+	 * @return N�mero de bandas soportadas
+	 */
+	public int[] getNBandsSupported() {
+		return nBandsSupported;
+	}
+	
+	/**
+	 * Asigna el n�mero de bandas soportadas o -1 si es cualquier n�mero de ellas
+	 * @param N�mero de bandas soportadas
+	 */
+	public void setNBandsSupported(int[] bandsSupported) {
+		nBandsSupported = bandsSupported;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/WriteFileFormatFeatures.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/RmfBlocksManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/RmfBlocksManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/RmfBlocksManager.java	(revision 15423)
@@ -0,0 +1,278 @@
+/* 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.impl.store.rmf;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+/**
+ * Gestor para la escritura de bloques XML en el fichero RMF. Cada cliente que quiere
+ * escribir en el se registrar� a traves de ClientRegister y esta clase ser� la encargada
+ * de gestionar la lectura y escritura de bloques.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RmfBlocksManager extends ClientRegister implements IRmfBlock {
+	private final String MAIN_TAG = "RasterMetaFile";
+	private String       version  = "1.0";
+	
+	private String path = null;
+
+	/**
+	 * Constructor. Asigna la ruta del fichero.
+	 * @param path
+	 */
+	public RmfBlocksManager(String path) {
+		setPath(path);
+	}
+
+	/**
+	 * Asigna la ruta del fichero
+	 * @param path
+	 */
+	public void setPath(String path) {
+		this.path = path;
+	}
+
+	/**
+	 * Obtiene la ruta del fichero
+	 * @return path
+	 */
+	public String getPath() {
+		return path;
+	}
+	
+	/**
+	 * Genera una copia de seguridad del fichero del rmf
+	 * @throws IOException
+	 */
+	public void fileBackup() throws IOException {
+		RasterLocator.getManager().getFileUtils().copyFile(getPath(), getPath() + "~");
+	}
+
+	public void read(String xml) throws ParsingException {
+		File file = new File(getPath());
+		ArrayList<String> lines = new ArrayList<String>();
+
+		BufferedReader inGrf = null;
+		try {
+			inGrf = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
+			String str = inGrf.readLine();
+			while (str != null) {
+				for (int i = 0; i < clients.size(); i++) {
+					IRmfBlock block = ((IRmfBlock) clients.get(i));
+					String main = block.getMainTag();
+					if (str.startsWith("<" + main)) {
+						lines.clear();
+						while (str.compareTo("</" + main + ">") != 0) {
+							lines.add(str);
+							str = inGrf.readLine();
+							if(str == null) {
+								inGrf.close();
+								return;
+							}
+						}
+						lines.add(str);
+						StringBuffer buf = new StringBuffer();
+						for (int j = 0; j < lines.size(); j++)
+							buf.append((String) lines.get(j));
+						block.read(buf.toString());
+
+					}
+				}
+
+				str = inGrf.readLine();
+			}
+			inGrf.close();
+		} catch (FileNotFoundException e) {
+			throw new ParsingException("File Input error: creating BufferedReader");
+		} catch (IOException ex) {
+			throw new ParsingException("File Input error: reading lines");
+		}
+	}
+
+	/**
+	 * Creaci�n de nuevo fichero RMF. A�ade la cabecera y vuelca el contenido de
+	 * todos los IRmfBlock.
+	 * @param file Fichero
+	 * @return true si el fichero no existia y se ha creado nuevo
+	 * @throws IOException 
+	 * @throws IOException
+	 */
+	private void create(File file) throws IOException {
+		file.createNewFile();
+		FileWriter writer = new FileWriter(file);
+		writer.write("<?xml version=\"1.0\" encoding=\"ISO-8859-15\"?>\n");
+		writer.write("<" + getMainTag() + " version=\"" + version + "\">\n");
+		for (int i = 0; i < clients.size(); i++) {
+			IRmfBlock block = ((IRmfBlock) clients.get(i));
+			String xmlBlock = block.write();
+			if(xmlBlock != null)
+				writer.write(xmlBlock);
+		}
+		writer.write("</" + getMainTag() + ">\n");
+		writer.close();
+	}
+
+	public String write() throws IOException {
+		File file = new File(getPath());
+		ArrayList<String> lines = new ArrayList<String>();
+
+		// Si no existe a�n el rmf se crea, se a�ade las cabeceras y se vuelca el
+		// contenido de los bloques
+		if (!file.exists())
+			create(file);
+
+		// A�adir bloques al fichero.
+		BufferedReader inGrf = new BufferedReader(new InputStreamReader(new FileInputStream(file)));
+		String str = inGrf.readLine();
+		while (str != null) {
+			lines.add(str);
+			str = inGrf.readLine();
+		}
+
+		// Obtenemos el primer tag de un bloque. Para cada uno recorremos todo el
+		// rmf actual buscando ese tag. Si existe se a�ade el nuevo bloque y se
+		// borra el viejo. Si no existe lo a�ade al final antes de la etiqueta de
+		// cierre </RasterMetaFile>
+		for (int i = 0; i < clients.size(); i++) {
+			IRmfBlock block = ((IRmfBlock) clients.get(i));
+			String tag = block.getMainTag();
+
+			for (int nLine = 0; nLine < lines.size(); nLine++) {
+				String line = (String) lines.get(nLine);
+				if (line != null && (line.compareTo("</" + getMainTag() + ">") == 0 || line.startsWith("<" + tag))) {
+					String xmlBlock = block.write();
+					if(xmlBlock != null) { //Sustituci�n de bloque
+						if (nLine != 0)
+							lines.add(nLine, xmlBlock);
+						if (line.startsWith("<" + tag)) {
+							while (((String) lines.get(nLine + 1)).compareTo("</" + tag + ">") != 0)
+								lines.remove(nLine + 1);
+							lines.remove(nLine + 1);
+						}
+					} else { //Eliminado de bloque
+						if (line.startsWith("<" + tag)) {
+							while (((String) lines.get(nLine)).compareTo("</" + tag + ">") != 0)
+								lines.remove(nLine);
+							lines.remove(nLine);
+						}
+					}
+					break;
+				}
+			}
+		}
+		inGrf.close();
+
+		// Escribir fichero de salida.
+		file.delete();
+		file.createNewFile();
+		FileWriter writer = new FileWriter(file);
+
+		for (int i = 0; i < lines.size(); i++) {
+			if (((String) lines.get(i)).length() == 0)
+				continue;
+			if (!((String) lines.get(i)).endsWith("\n"))
+				writer.write((String) lines.get(i) + "\n");
+			else
+				writer.write((String) lines.get(i));
+		}
+		writer.close();
+
+		return null;
+	}
+
+	/**
+	 * Obtiene un bloque XML que representa a las propiedades del objeto a
+	 * serializar. Antes de la operaci�n hace una copia de seguridad del fichero
+	 * RMF.
+	 * @param rmfBackup Especifica si debe hacer la copia de seguridad.
+	 * @return Texto XML que representa el objeto.
+	 */
+	public String write(boolean rmfBackup) throws IOException, FileNotFoundException {
+		if (rmfBackup && new File(getPath()).exists())
+			RasterLocator.getManager().getFileUtils().copyFile(getPath(), getPath() + "~");
+
+		return write();
+	}
+
+	/**
+	 * M�todo que checkea si el fichero pasado es valido para ser rmf. Si existe
+	 * el fichero ser� valido si se puede escribir en el y no est� vacio y no es
+	 * un directorio y contiene los caracteres de cabecera de comienzo de XML (<?xml
+	 * .... >). En caso de que el fichero no exista tambi�n es valido ya que se
+	 * crear� de cero.
+	 * @return true si es un rmf valido y false si no lo es
+	 */
+	public boolean checkRmf() {
+		File f = new File(getPath());
+		if (f.exists()) {
+			if (!f.canWrite() || f.length() == 0 || f.isDirectory())
+				return false;
+			BufferedReader inGrf;
+			try {
+				inGrf = new BufferedReader(new InputStreamReader(new FileInputStream(f)));
+				String str = inGrf.readLine();
+				if (!str.startsWith("<?xml")) {
+					inGrf.close();
+					return false;
+				}
+				while (str != null) {
+					if (str.startsWith("<" + getMainTag())) {
+						inGrf.close();
+						if(str.contains("version=\"")) {
+							String versionNbr = str.substring(str.indexOf("version=\"") + 9);
+							versionNbr = versionNbr.substring(0, versionNbr.indexOf("\""));
+							if(!versionNbr.equals(version)) {
+								return false;
+							}
+						} 
+						return true;
+					}
+					str = inGrf.readLine();
+				}
+				inGrf.close();
+			} catch (FileNotFoundException e) {
+				return false;
+			} catch (IOException e) {
+				return false;
+			}
+		}
+		return true;
+	}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+
+	public Object getResult() {
+		return null;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/RmfBlocksManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClassSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClassSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClassSerializer.java	(revision 15423)
@@ -0,0 +1,322 @@
+/* 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.impl.store.rmf;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.io.IOException;
+
+import org.gvsig.fmap.crs.CRSFactory;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.raster.impl.datastruct.ExtentImpl;
+import org.gvsig.raster.impl.datastruct.DefaultViewPortData;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+
+/**
+ * Clase de la que debe heredar cualquier clase que convierta objetos a XML
+ * para ser guardados en ficheros rmf.
+ *
+ * 23-abr-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class ClassSerializer implements IRmfBlock {
+
+	/**
+	 * Parsea un tag con un String como texto de la forma \<TAG\>String\</TAG\>
+	 * @param parser         KXmlParser
+	 * @param parseableTag   cadena de texto con el nombre del tag
+	 * @param errorTags	Lista de tags que interrumpiran el proceso si son encontrados
+	 * @return	valor double recuperado
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 * @throws ParsingException
+	 */
+	protected String parserString(KXmlParser parser, String parseableTag, String[] errorTags) throws XmlPullParserException, IOException, ParsingException {
+		String value = null;
+		boolean end = false;
+		boolean tagOk = false;
+		int tag = parser.next();
+		while (!end) {
+			switch (tag) {
+				case KXmlParser.END_DOCUMENT:
+					if (value != null)
+						return value;
+					throw new ParsingException("No se ha encontrado el parametro " + parseableTag + " en el RMF");
+				case KXmlParser.START_TAG:
+					if (parser.getName() != null) {
+						if (errorTags != null)
+							for (int i = 0; i < errorTags.length; i++)
+								if (parser.getName().compareTo(errorTags[i]) == 0)
+									return null;
+						if (parser.getName().compareTo(parseableTag) == 0)
+							tagOk = true;
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (parser.getName().compareTo(parseableTag) == 0)
+						end = true;
+					break;
+				case KXmlParser.TEXT:
+					if (tagOk) {
+						value = parser.getText();
+						tagOk = false;
+					}
+					break;
+			}
+			if (!end)
+				tag = parser.next();
+		}
+		return value;
+	}
+
+	/**
+	 * Parsea un bloque que representa un Extent con la forma \<Bbox\><BR> \<Px\>-245.41842857142848\</Px\><BR> \<Py\>1783.3830816326529\</Py\><BR> \<WCWidth\>500.09399999999994\</WCWidth\><BR> \<WCHeight\>324.72771428571446\</WCHeight\><BR> \</Bbox\><BR>
+	 * @param gp
+	 * @param parser
+	 * @param parseableTag Tag principal del Extent
+	 * @param bbox lista de 4 elementos que representa los 4 tags minx, maxy,
+	 *          ancho y alto
+	 * @throws NumberFormatException
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 * @throws ParsingException
+	 */
+	public Extent parseBoundingBox(KXmlParser parser, String parseableTag, String[] bbox) throws NumberFormatException, XmlPullParserException, IOException, ParsingException {
+		boolean end = false;
+		boolean tagOk = false;
+		int tag = parser.next();
+		Extent ext = null;
+		while (!end) {
+			switch (tag) {
+				case KXmlParser.START_TAG:
+					if (parser.getName() != null)
+						if (parser.getName().compareTo(parseableTag) == 0)
+							tagOk = true;
+					break;
+				case KXmlParser.END_TAG:
+					if (parser.getName().compareTo(parseableTag) == 0)
+						end = true;
+					break;
+				case KXmlParser.TEXT:
+					if (tagOk) {
+						double x = Double.valueOf(parserString(parser, bbox[0], null)).doubleValue();
+						double y = Double.valueOf(parserString(parser, bbox[1], null)).doubleValue();
+						double w = Double.valueOf(parserString(parser, bbox[2], null)).doubleValue();
+						double h = Double.valueOf(parserString(parser, bbox[3], null)).doubleValue();
+						ext = new ExtentImpl(x, y, x + w, y - h);
+					}
+					tagOk = false;
+					break;
+			}
+			if (!end)
+				tag = parser.next();
+		}
+		return ext;
+	}
+
+	/**
+	 * Parsea un bloque correspondiente a un punto con la forma
+	 * \<Pdim\><BR>
+	 * \<Width\>140.0\</Width\><BR>
+	 * \<Height\>140.0\</Height\><BR>
+	 * \</Pdim\><BR>
+	 * @param gp
+	 * @param parser
+	 * @param parseableTag
+	 * @throws NumberFormatException
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 * @throws ParsingException
+	 */
+	public Point2D parsePoint2D(KXmlParser parser, String parseableTag, String[] points) throws NumberFormatException, XmlPullParserException, IOException, ParsingException {
+		boolean end = false;
+		boolean tagOk = false;
+		Point2D dim = null;
+		int tag = parser.next();
+		while (!end) {
+			switch (tag) {
+				case KXmlParser.START_TAG:
+					if (parser.getName() != null)
+						if (parser.getName().compareTo(parseableTag) == 0)
+							tagOk = true;
+					break;
+				case KXmlParser.END_TAG:
+					if (parser.getName().compareTo(parseableTag) == 0)
+						end = true;
+					break;
+				case KXmlParser.TEXT:
+					if (tagOk) {
+						double x = Double.valueOf(parserString(parser, points[0], null)).doubleValue();
+						double y = Double.valueOf(parserString(parser, points[1], null)).doubleValue();
+						dim = new Point2D.Double(x, y);
+						tagOk = false;
+					}
+					break;
+			}
+			if (!end)
+				tag = parser.next();
+		}
+		return dim;
+	}
+
+	/**
+	 * Parsea un viewport contenido en un punto de control
+	 * @param gp
+	 * @param parser
+	 * @param parseableTag Tag correspondiente a la cabecera del viewport
+	 * @param bbox lista de tags correspondientes al extent. El primero ser� la cabecera y los siguientes cuatro minx, maxy, ancho y alto
+	 * @param size tags del tama�o en pixeles. El primero ser� la cabecera y los siguientes dos ancho y alto
+	 * @param proj tag de la proyecci�n
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 * @throws ParsingException
+	 */
+	public DefaultViewPortData parseViewPort(KXmlParser parser, String parseableTag, String[] bbox, String[] size, String proj) throws XmlPullParserException, IOException, ParsingException {
+		boolean end = false;
+		boolean begin = true;
+		DefaultViewPortData vp = new DefaultViewPortData();
+		vp.mat = new AffineTransform();
+
+		int tag = parser.next();
+		while (!end) {
+			switch (tag) {
+				case KXmlParser.START_TAG:
+					if (parser.getName() != null)
+						if (parser.getName().compareTo(parseableTag) == 0) {
+							String project = parserString(parser, proj, null);
+							Extent ext = parseBoundingBox(parser, bbox[0], new String[] { bbox[1], bbox[2], bbox[3], bbox[4] });
+							Point2D dim = parsePoint2D(parser, size[0], new String[] { size[1], size[2] });
+							vp.setExtent(ext);
+							vp.pxSize = new Point2D.Double(dim.getX(), dim.getY());
+							if (project != null && project != "")
+								vp.setProjection(CRSFactory.getCRS(project));
+							begin = false;
+						} else if (begin)
+							return null;
+					break;
+				case KXmlParser.END_TAG:
+					if (parser.getName().compareTo(parseableTag) == 0)
+						end = true;
+					break;
+				case KXmlParser.TEXT:
+					break;
+			}
+			if (!end)
+				tag = parser.next();
+		}
+		return vp;
+	}
+
+	/**
+	 * Convierte una lista de valores en un solo String en un array de enteros. El
+	 * String debe representar una lista de numeros separados por espacios.
+	 * <P>
+	 * String v = "4 5 65 2 1"
+	 * </P>
+	 * <P>
+	 * Se converir�a en:
+	 * </P>
+	 * <P>
+	 * int[] i = new int[]{4, 5, 65, 2, 1};
+	 * </P>
+	 * @param list Cadena con la lista de valores
+	 * @return Array de valores long
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 */
+	protected int[] convertStringInIntArray(String list) throws XmlPullParserException, IOException {
+		String[] sValues = list.split(" ");
+		int[] iValues = new int[sValues.length];
+		for (int i = 0; i < sValues.length; i++)
+			try {
+				iValues[i] = Integer.parseInt(sValues[i]);
+			} catch (NumberFormatException e) {
+				// iValues[i] vale cero
+			}
+		return iValues;
+	}
+
+	/**
+	 * Convierte una lista de valores en un solo String en un array de double. El
+	 * String debe representar una lista de numeros separados por espacios.
+	 * <P>
+	 * String v = "4.2 5 65.5 2 1"
+	 * </P>
+	 * <P>
+	 * Se converir�a en:
+	 * </P>
+	 * <P>
+	 * double[] i = new double[]{4.2, 5, 65.5, 2, 1};
+	 * </P>
+	 * @param list Cadena con la lista de valores
+	 * @return Array de valores double
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 */
+	protected double[] convertStringInDoubleArray(String list) throws XmlPullParserException, IOException {
+		String[] sValues = list.split(" ");
+		double[] dValues = new double[sValues.length];
+		for (int i = 0; i < sValues.length; i++)
+			try {
+				dValues[i] = Double.parseDouble(sValues[i]);
+			} catch (NumberFormatException e) {
+				// dValues[i] vale cero
+			}
+		return dValues;
+	}
+
+	/**
+	 * A�ade al buffer la propiedad (String) especificada en los par�metros
+	 * @param b Buffer
+	 * @param prop Nombre de la propiedad (Tag)
+	 * @param value Valor de la propiedad
+	 */
+	public void putProperty(StringBuffer b, String prop, String value, int level) {
+		for (int i = 0; i < level; i++)
+			b.append("\t");
+		b.append("<" + prop + ">");
+		b.append(value);
+		b.append("</" + prop + ">\n");
+	}
+
+	/**
+	 * A�ade al buffer la propiedad (int) especificada en los par�metros
+	 * @param b Buffer
+	 * @param prop Nombre de la propiedad (Tag)
+	 * @param value Valor de la propiedad
+	 */
+	public void putProperty(StringBuffer b, String prop, int value, int level) {
+		putProperty(b, prop, String.valueOf(value), level);
+	}
+
+	/**
+	 * A�ade al buffer la propiedad (double) especificada en los par�metros
+	 * @param b Buffer
+	 * @param prop Nombre de la propiedad (Tag)
+	 * @param value Valor de la propiedad
+	 */
+	public void putProperty(StringBuffer b, String prop, double value, int level) {
+		putProperty(b, prop, String.valueOf(value), level);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClassSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClientRegister.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClientRegister.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClientRegister.java	(revision 15423)
@@ -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.impl.store.rmf;
+
+import java.util.ArrayList;
+/**
+ * Clase base para el gestor de ficheros rmf. Esta contiene el mecanismo de registro de objetos
+ * serializadores. Mantiene una lista de IRmfBlock.
+ * 
+ * 21-abr-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class ClientRegister {
+
+	protected ArrayList<IRmfBlock> clients = new ArrayList<IRmfBlock>();
+	
+	/**
+	 * A�ade un objeto IRmfBlock
+	 * @param block
+	 */
+	public void addClient(IRmfBlock block) {
+		removeClient(block.getClass());
+		clients.add(block);
+	}
+	
+	/**
+	 * Elimina un objeto IRmfBlock de la lista a trav�s de la clase del serializador.
+	 * 
+	 * @param id
+	 */
+	@SuppressWarnings("unchecked")
+	public void removeClient(Class class1) {
+		for (int i = clients.size() - 1; i >= 0; i--)
+			if (clients.get(i).getClass().equals(class1))
+				clients.remove(i);
+	}
+	
+	/**
+	 * Obtiene el objeto serializador a trav�s de su nombre de clase. El nombre
+	 * de este coincide con el nombre del objeto que se est� serializando seguido de la palabra 
+	 * Serializer. Asi pues, el serializador del objeto Histogram se llamar� HistogramSerializer.
+	 * @param id
+	 * @return IRmfBlock
+	 */
+	public IRmfBlock getClient(String id) {
+		for (int i = 0; i < clients.size(); i++) {
+			try {
+				if (Class.forName(id).isInstance(clients.get(i)))
+					return (IRmfBlock) clients.get(i);
+			} catch (ClassNotFoundException e) {
+				return null; // No devuelve ninguno
+			}
+		}
+		return null;
+	}
+	
+	/**
+	 * Obtiene el objeto serializador a trav�s de su posici�n. 
+	 * @param pos Posici�n
+	 * @return IRmfBlock
+	 */
+	public IRmfBlock getClient(int pos) {
+		return (IRmfBlock) clients.get(pos);
+	}
+	
+	/**
+	 * Elimina todos los objetos serializadores de la lista.
+	 */
+	public void removeAllClients() {
+		clients.clear();
+	}
+	
+	/**
+	 * Obtiene el n�mero de clientes registrado (Objetos IRmfBlock).
+	 * @return Entero con el n�mero de clientes registrado
+	 */
+	public int getClientsCount() {
+		return clients.size();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/ClientRegister.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/IRmfBlock.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/IRmfBlock.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/IRmfBlock.java	(revision 15423)
@@ -0,0 +1,65 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.store.rmf;
+
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+
+/**
+ * Interfaz que deben implementar las clases que escriben bloques XML en ficheros RMF.
+ * Contiene m�todos para escribir y leer un bloque de informaci�n del fichero RMF. La clase
+ * que implementa este interfaz es la encargada de serializar un objeto en cadenas XML y 
+ * crear este desde cadenas XML. Esto lo har� a trav�s de los m�todos de este interfaz para
+ * que el gestor de RMF pueda administrar la escritura y lectura del fichero.
+ * 
+ * 21-abr-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface IRmfBlock {
+	
+	/**
+	 * Lee el bloque XML pasado por par�metro y carga el objeto correspondiente
+	 * con los datos.
+	 * @param xml. Texto XML que representa el objeto.
+	 */
+	public void read(String xml) throws ParsingException;
+	
+	/**
+	 * Obtiene un bloque XML que representa a las propiedades del objeto a 
+	 * serializar.
+	 * @return Texto XML que representa el objeto.
+	 */
+	public String write() throws IOException;
+	
+	/**
+	 * Obtiene el tag principal del bloque
+	 * @return Tag principal
+	 */
+	public String getMainTag();
+	
+	/**
+	 * Obtiene el objeto resultante de haber aplicado un read.
+	 * @return Object del tipo correspondiente al bloque implementado.
+	 */
+	public Object getResult();
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/rmf/IRmfBlock.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/persistence/RasterStorePersistenceFactory.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/persistence/RasterStorePersistenceFactory.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/persistence/RasterStorePersistenceFactory.java	(revision 15423)
@@ -0,0 +1,87 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Gobernment (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 {}  {{Task}}
+ */
+package org.gvsig.raster.impl.store.persistence;
+
+import java.awt.Color;
+
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.AbstractSinglePersistenceFactory;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * Factory to manage the persistence of {@link Color} objects.
+ * 
+ * @author 2009- <a href="cordinyana@gvsig.org">C�sar Ordi�ana</a> - gvSIG team
+ * @author 2010- <a href="jjdelcerro@gvsig.org">Joaquin Jose del Cerro</a> -
+ *         gvSIG team
+ */
+public class RasterStorePersistenceFactory extends AbstractSinglePersistenceFactory {
+
+	static final String FIELD_RED = "red";
+	static final String FIELD_GREEN = "green";
+	static final String FIELD_BLUE = "blue";
+	static final String FIELD_ALPHA = "alpha";
+
+	private static final String DYNCLASS_NAME = "AwtColor";
+	private static final String DYNCLASS_DESCRIPTION = "Awt Color";
+
+	/**
+	 * Creates a new {@link RasterStorePersistenceFactory} with the {@link DynStruct}
+	 * definition for the {@link Color} objects.
+	 */
+	public RasterStorePersistenceFactory() {
+		super(Color.class, DYNCLASS_NAME, DYNCLASS_DESCRIPTION, null, null);
+
+		DynStruct definition = this.getDefinition();
+
+		definition.addDynFieldInt(FIELD_RED).setMandatory(true);
+		definition.addDynFieldInt(FIELD_GREEN).setMandatory(true);
+		definition.addDynFieldInt(FIELD_BLUE).setMandatory(true);
+		definition.addDynFieldInt(FIELD_ALPHA).setMandatory(true);
+	}
+
+	public Object createFromState(PersistentState state)
+			throws PersistenceException {
+		int red = state.getInt(FIELD_RED);
+		int green = state.getInt(FIELD_GREEN);
+		int blue = state.getInt(FIELD_BLUE);
+		int alpha = state.getInt(FIELD_ALPHA);
+
+		return new Color(red, green, blue, alpha);
+	}
+
+	public void saveToState(PersistentState state, Object obj)
+			throws PersistenceException {
+		Color color = (Color) obj;
+		state.set(FIELD_RED, color.getRed());
+		state.set(FIELD_GREEN, color.getGreen());
+		state.set(FIELD_BLUE, color.getBlue());
+		state.set(FIELD_ALPHA, color.getAlpha());
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/persistence/RasterStorePersistenceFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamsImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamsImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamsImpl.java	(revision 15423)
@@ -0,0 +1,197 @@
+/* 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.impl.store;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Param;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.tools.ToolsLocator;
+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;
+
+
+/**
+* Par�metros para los drivers de escritura. Las variables estaticas contenidas representan
+* los tipos de par�metro posibles.
+*
+* @author Nacho Brodin (nachobrodin@gmail.com)
+*/
+public class ParamsImpl implements Params {
+	public static final int NONE        = -1;
+	public static final int CHECK       = 1;
+	public static final int CHOICE      = 2;
+	public static final int SLIDER      = 3;
+	public static final int MULTI_CHECK = 4;
+	private List<Param> params = new ArrayList<Param>();
+	
+	public void setManagerID(String id) {
+		for (int i = 0; i < params.size(); i++) {
+			params.get(i).setManagerID(id);
+		}
+	}
+
+	/**
+	 * Obtiene el par�metro de la posici�n definida por param
+	 * @param param Posici�n del par�metro
+	 * @return Objeto Param
+	 */
+	public Param getParam(int param) {
+		return (Param)params.get(param);
+	}
+
+	/**
+	 * Asigna el par�metro pasado a la lista de par�metros necesitados por el driver
+	 * @param param
+	 */
+	public void setParam(Param param) {
+		params.add(param);
+	}
+
+	/**
+	 * Inicializa la lista de par�metros
+	 */
+	public void clear() {
+		params.clear();
+	}
+
+	/**
+	 * Obtiene un par�metro de la lista a partir de su identificador
+	 * @param id Identificador del par�metro
+	 * @return Par�metro o null si no existe
+	 */
+	public Param getParamById(String id) {
+		for (Iterator<Param> iter = params.iterator(); iter.hasNext();) {
+			ParamImpl p = (ParamImpl) iter.next();
+			if (p.getId().equals(id))
+				return p;
+		}
+		return null;
+	}
+
+	public void setParam(String id, Object value, int type, String[] list) {
+		ParamImpl p = (ParamImpl)getParamById(id);
+		if (p == null)
+			p = new ParamImpl();
+
+		p.setId(id);
+		p.setDefaultValue(value);
+		p.setType(type);
+		p.setList(list);
+		params.add(p);
+	}
+	
+	public void setParam(String id, Object value) {
+		ParamImpl p = (ParamImpl)getParamById(id);
+		if (p == null)
+			p = new ParamImpl();
+
+		p.setId(id);
+		p.setDefaultValue(value);
+		p.setType(-1);
+		p.setList(null);
+		params.add(p);
+	}
+
+	/**
+	 * Borra los parametros asociados a ese id
+	 * @param id
+	 */
+	public void removeParam(String id) {
+		for (int i = 0; i < params.size(); i++) {
+			ParamImpl p = (ParamImpl) params.get(i);
+			if (p.getId().equals(id)) {
+				params.remove(i);
+				i--;
+			}
+		}
+	}
+
+	/**
+	 * Asigna un valor para un par�metro existens. Si no existe no hace nada.
+	 *
+	 * @param id Identificador del par�metro
+	 * @param value Valor a asignar
+	 */
+	public void changeParamValue(String id, Object value) {
+		for (Iterator<Param> iter = params.iterator(); iter.hasNext();) {
+			ParamImpl p = (ParamImpl) iter.next();
+			if(p.getId().equals(id))
+				p.setDefaultValue(value);
+		}
+	}
+
+	/**
+	 * Obtiene el n�mero de par�metros.
+	 * @return N�mero de par�metros.
+	 */
+	public int getNumParams() {
+		return params.size();
+	}
+
+	/**
+	 * Devuelve el array de los Params
+	 * @return
+	 */
+	public List<Param> getParams() {
+		return params;
+	}
+
+
+	@SuppressWarnings("unchecked")
+	public Object clone() throws CloneNotSupportedException {
+		ParamsImpl aux = new ParamsImpl();
+		((ParamsImpl) aux).params = (List<Param>)((ArrayList<Param>) this.params).clone();
+		return aux;
+	}
+	
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		@SuppressWarnings("unchecked")
+		List<Param> list = state.getList("list");
+		if(list != null) {
+			this.params = new ArrayList<Param>();
+			this.params.addAll(list);
+		}
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("list", params);
+	}	
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		
+		DynStruct definition = manager.addDefinition(
+				ParamsImpl.class,
+				"ParamsImpl_Persistence",
+				"ParamsImpl Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldList("list").setClassOfItems(Param.class).setMandatory(false);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamsImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/FramedBufferResampling.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/FramedBufferResampling.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/FramedBufferResampling.java	(revision 15423)
@@ -0,0 +1,203 @@
+package org.gvsig.raster.impl.store;
+
+import java.awt.Rectangle;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+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.store.RasterDataStore;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.DefaultRasterQuery;
+import org.gvsig.raster.impl.buffer.SpiRasterQuery;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+
+/**
+ * The requests to a <code>RasterDataStore</code> adjust the bounding box and the size in pixels 
+ * to the source limits. The user can need a buffer that exceeds the raster dimension. 
+ * In this case, the area that is out of the raster limits should be set to nodata values or 
+ * transparent in RGB cases. 
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class FramedBufferResampling {
+	private DefaultRasterQuery           query            = null;
+	private DefaultRasterQuery           originalQuery    = null;
+	private RasterDataStore              store            = null; 
+	protected byte                       byteNoData       = (byte)0x00;
+	protected short                      shortNoData      = Short.MIN_VALUE;
+	protected int                        intNoData        = Integer.MIN_VALUE;
+	protected float                      floatNoData      = -99999;
+	protected double                     doubleNoData     = -99999;
+	
+	public FramedBufferResampling(DefaultRasterQuery q, RasterDataStore store) {
+		this.query = q;
+		this.store = store;
+		this.originalQuery = (DefaultRasterQuery)query.clone();
+		setNoDataValue(store.getNoDataValue());
+	}
+	
+	public Buffer query(RasterProvider provider) throws QueryException, ProcessInterruptedException {
+		adjustQueryToTheStore();
+		query.calculateParameters(store);
+		originalQuery.calculateParameters(store);
+		Buffer bufResult = null;
+		try {
+			Buffer buf = ((AbstractRasterProvider)provider).getDataSet((SpiRasterQuery)query);
+			bufResult = buildBuffer(buf.getBandCount(), originalQuery.getAdjustedBufWidth(), originalQuery.getAdjustedBufHeight());
+			RasterLocator.getManager().getRasterUtils().copyToBuffer(
+					bufResult, 
+					originalQuery.getAdjustedRequestBoundingBox(), 
+					buf, 
+					query.getAdjustedRequestBoundingBox(), 
+					1, 
+					store.getColorInterpretation().hasAlphaBand());
+			buf.dispose();
+		} catch (RasterDriverException e) {
+			throw new QueryException("Error getting data", e);
+		}
+		return bufResult;
+	}
+	
+	/**
+	 * Sets the nodata value
+	 * @param noData
+	 */
+	private void setNoDataValue(NoData noData) {
+		if(noData == null)
+			return;
+		switch (store.getDataType()[0]) {
+		case Buffer.TYPE_BYTE:
+			byteNoData = noData.getValue().byteValue();
+			break;
+		case Buffer.TYPE_SHORT:
+			shortNoData = noData.getValue().shortValue();
+			break;
+		case Buffer.TYPE_INT:
+			intNoData = noData.getValue().intValue();
+			break;
+		case Buffer.TYPE_FLOAT:
+			floatNoData = noData.getValue().floatValue();
+			break;
+		case Buffer.TYPE_DOUBLE:
+			doubleNoData = ((NoData)noData).getValue().doubleValue();
+			break;
+		}
+	}
+	
+	/**
+	 * Builds a buffer using the specified number of bands and initialize it
+	 * @param nbands
+	 * @return
+	 */
+	private Buffer buildBuffer(int nbands, int w, int h) {
+		Buffer bufResult = DefaultRasterManager.getInstance().createBuffer(store.getDataType()[0], w, h, nbands, true);
+		for (int i = 0; i < bufResult.getBandCount(); i++) {
+			clearMaskBuffer(bufResult, i);
+		}
+		return bufResult;
+	}
+	
+	/**
+	 * Sets a band to NODATA value 
+	 * @param bufResult
+	 * @param tileExtent
+	 * @param buf
+	 * @param ex
+	 * @param pixelSize
+	 */
+	protected void clearMaskBuffer(Buffer buf, int nBand) {
+		if(buf.getDataType() == Buffer.TYPE_BYTE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, byteNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_SHORT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, shortNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_INT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, intNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_FLOAT) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, floatNoData);
+				}
+			}
+			return;
+		}
+		if(buf.getDataType() == Buffer.TYPE_DOUBLE) {
+			for (int i = 0; i < buf.getHeight(); i++) {
+				for (int j = 0; j < buf.getWidth(); j++) {
+					buf.setElem(i, j, nBand, doubleNoData);
+				}
+			}
+			return;
+		}
+	}
+	
+	private double round(double value) {
+		double a = (value - (int)value);
+		return (a > 0.95 || a < 0.05) ? Math.round(value) : value;
+	}
+	
+	private void adjustQueryToTheStore() {
+		if(query.getType() == DefaultRasterQuery.TYPE_WCOORDS_SHIFT) {
+			Extent e = query.getAdjustedRequestBoundingBox().intersection(store.getExtent());
+			int w = (int)Math.ceil(round((query.getBufWidth() * e.width()) /  query.getAdjustedRequestBoundingBox().width()));
+			int h = (int)Math.ceil(round((query.getBufHeight() * e.height()) /  query.getAdjustedRequestBoundingBox().height()));
+			query.setAdjustedRequestBoundingBox(e);
+			query.setBufWidth(w);
+			query.setBufHeight(h);
+		}
+		
+		if(query.getType() == DefaultRasterQuery.TYPE_PX_SHIFT) {
+			Rectangle r = adjustRectangleToStoreSize(query.getRequestPxWindow());
+			query.setRequestPixelWindow(r);
+		}
+		
+		if(query.getType() == DefaultRasterQuery.TYPE_PX_RESCALED_SHIFT) {
+			Rectangle r = adjustRectangleToStoreSize(query.getRequestPxWindow());
+			query.setRequestPixelWindow(r);
+			int w = (int)r.getWidth() - (int)originalQuery.getRequestPxWindow().getWidth();
+			int h = (int)r.getHeight() - (int)originalQuery.getRequestPxWindow().getHeight();
+			query.setBufWidth(query.getBufWidth() - w);
+			query.setBufHeight(query.getBufHeight() - h);
+		}
+	}
+	
+	/**
+	 * Adjusts the limits of the rectangle to the store limits
+	 * @param r
+	 * @return
+	 */
+	private Rectangle adjustRectangleToStoreSize(Rectangle r) {
+		Rectangle newRect = (Rectangle)r.clone();  
+		if(r.getX() < 0)
+			newRect.setBounds(0, (int)r.getY(), (int)(r.getWidth() + r.getX()), (int)r.getHeight());
+		if(r.getY() < 0)
+			newRect.setBounds((int)r.getX(), 0, (int)r.getWidth(), (int)(r.getHeight() + r.getY()));
+		if(newRect.getWidth() > store.getWidth())
+			newRect.setSize((int)store.getWidth(), (int)r.getHeight());
+		if(newRect.getHeight() > store.getHeight())
+			newRect.setSize((int)r.getWidth(), (int)store.getHeight());
+		return newRect;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/FramedBufferResampling.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/QueryableRaster.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/QueryableRaster.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/QueryableRaster.java	(revision 15423)
@@ -0,0 +1,170 @@
+/* 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.impl.store;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.impl.buffer.SpiRasterQuery;
+
+
+
+/**
+ * A kind of dataset which can be queried should implement this interface.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface QueryableRaster {
+	
+	/**
+	 * Gets the dataset of this queryable raster
+	 * @return RasterDataSet
+	 */
+	public RasterDataStore getDataStore();
+	
+	/**
+	 * Obtiene la lista de bandas
+	 * @return BandList
+	 */
+	public BandList getBands();
+	
+	/**
+	 * Asigna las bandas dibujables cuando se solicita una acci�n de lectura de datos
+	 * @param db int[]
+	 */
+	public void setDrawableBands(int[] db);
+	
+	/**
+	 * Removes the drawable bands
+	 */
+	public void clearDrawableBands();
+	
+	/**
+	 * Obtiene las bandas dibujables cuando se solicita una acci�n de lectura de datos
+	 * @return
+	 */
+	public int[] getDrawableBands();
+	
+	/**
+	 * Obtiene el n�mero de bandas del raster
+	 * @return N�mero de bandas
+	 */
+	public int getBandCount();
+	
+	/**
+	 * Obtiene el valor NoData asociado al raster.
+	 * @return
+	 */
+	public NoData getNoDataValue();
+	
+	/**
+	 * Para este dataset asigna que bandas se pintaran
+	 * sobre el RasterBuf cuando se haga un update. Especificamos a 
+	 * trav�s de los par�metros para que posici�n del RasterBuf ir� 
+	 * dibujada con que banda del fichero de imagen.
+	 * @param posRasterBuf	Posici�n del RasterBuf que queremos pintar.
+	 * @param imageBand	Banda de la imagen que se pintar�
+	 */
+	public void addDrawableBand(int posRasterBuf, int imageBand);
+	
+	/**
+	 * Obtiene la paleta correspondiente al nombre del fichero pasado por par�metro. 
+	 * @param fileName Nombre del fichero
+	 * @return Paleta o null si no la tiene
+	 */
+	public ColorTable getColorTable(String fileName);
+	
+	/**
+	 * Obtiene la paleta correspondiente a uno de los ficheros que forman el GeoMultiRasterFile
+	 * @param i Posici�n del raster
+	 * @return Paleta asociada a este o null si no tiene
+	 */
+	public ColorTable getColorTable(int i);
+	
+	/**
+	 * Obtiene el extent del raster.
+	 * @return Extent
+	 */
+	public Extent getExtent();
+	
+	/**
+	 * Gets an extent adjusted to the bounding box of this raster
+	 * @param e
+	 * @return
+	 */
+	public Extent adjustToExtent(Extent e);
+	
+	/**
+	 * Obtiene la altura del raster en p�xeles.
+	 * @return altura
+	 */
+	public double getHeight();
+
+	/**
+	 * Obtiene la anchura del raster en p�xeles.
+	 * @return anchura
+	 */
+	public double getWidth();
+	
+	/**
+	 * Recupera del raster la matriz de transformaci�n que lo situa en cualquier parte de la vista
+	 * @param band
+	 * @return AffineTransform
+	 */
+	public AffineTransform getAffineTransform();
+	
+	/**
+	 * 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);
+	
+	/**
+	 * 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);
+		
+	/**
+	 * Gets a tile of data if the provider is able to return a tile
+	 * @param wPx
+	 * @param hPx
+	 * @param row
+	 * @param col
+	 * @param bbox
+	 * @param cacheStruct
+	 *        The client CacheStruct or null to use the preferred CacheStruct
+	 * @return 
+	 * @throws TileGettingException 
+	 */
+	public Tile getTile(SpiRasterQuery q) throws TileGettingException;
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/QueryableRaster.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteStoreHistogram.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteStoreHistogram.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteStoreHistogram.java	(revision 15423)
@@ -0,0 +1,177 @@
+/* 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.impl.store.properties;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.NotSupportedExtensionException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+import org.gvsig.fmap.dal.exception.CloseException;
+import org.gvsig.raster.impl.provider.RemoteRasterProvider;
+import org.gvsig.tools.locator.LocatorException;
+
+/**
+ * Class to get histograms from a remote service. If the image has a fixed
+ * size then a MultiDataStoreHistogram will build the histogram.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RemoteStoreHistogram extends MultiProviderHistogramComputer {
+	private RemoteRasterProvider                provider            = null;
+	private HistogramComputer                   lastBufferHistogram = null;
+	
+	/**
+	 * Constructor
+	 * @param dataset
+	 */
+	public RemoteStoreHistogram(RemoteRasterProvider prov) {
+		super(prov);
+		this.provider = prov;
+	}
+	
+	/**
+	 * Obtiene el histograma. Pregunta a todos los datasets que forman el multidataset
+	 * por su histograma y luego los fusiona.
+	 * @return histograma 
+	 * @throws HistogramException 
+	 */
+	public BufferHistogram getBufferHistogram()
+		throws ProcessInterruptedException, HistogramException {
+		if(((RemoteStoreParameters)provider.getDataParameters()).isSizeFixed()) 
+			return super.getBufferHistogram();
+		else {
+			ProviderServices provServ = RasterLocator.getManager().getProviderServices();
+			RasterDataParameters storeParameters = provServ.createParameters(
+					provider.getLastRequest().getPath());
+			storeParameters.setSRS(provider.getProjection());
+			
+			try {
+				RasterDataStore mrs = RasterLocator.getManager().getProviderServices().open(storeParameters);
+				lastBufferHistogram = mrs.getHistogramComputer();
+				BufferHistogram bh = lastBufferHistogram.getBufferHistogram();
+				mrs.close();
+				return bh;
+			} catch (LocatorException e) {
+				throw new HistogramException(e.getMessage(), e);
+			} catch (NotSupportedExtensionException e) {
+				throw new HistogramException(e.getMessage(), e);
+			} catch (RasterDriverException e) {
+				throw new HistogramException(e.getMessage(), e);
+			} catch (CloseException e) {
+				throw new HistogramException(e.getMessage(), e);
+			} 
+		}
+	}
+
+	/**
+	 * Pone a cero el porcentaje de progreso del proceso de calculo de histograma
+	 */
+	public void resetPercent() {
+		if(((RemoteStoreParameters)provider.getDataParameters()).isSizeFixed()) 
+			super.resetPercent();
+		else {
+			if(lastBufferHistogram != null)
+				lastBufferHistogram.resetPercent();
+		}
+	}
+
+	/**
+	 * Obtiene el porcentaje de proceso en la construcci�n del histograma,
+	 * @return porcentaje de progreso
+	 */
+	public int getPercent() {
+		if(((RemoteStoreParameters)provider.getDataParameters()).isSizeFixed()) 
+			return super.getPercent();
+		else {
+			if(lastBufferHistogram != null)
+				return lastBufferHistogram.getPercent();
+		}
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Histogram#getMaximum()
+	 */
+	public double getMaximum() {
+		if(((RemoteStoreParameters)provider.getDataParameters()).isSizeFixed()) 
+			return super.getMaximum();
+		else {
+			ProviderServices provServ = RasterLocator.getManager().getProviderServices();
+			RasterDataParameters storeParameters = provServ.createParameters(
+					provider.getLastRequest().getPath());
+			storeParameters.setSRS(provider.getProjection());
+			
+			try {
+				RasterDataStore mrs = RasterLocator.getManager().getProviderServices().open(storeParameters);
+				double res = mrs.getHistogramComputer().getMaximum();
+				mrs.close();
+				return res;
+			} catch (LocatorException e) {
+				return 0;
+			} catch (NotSupportedExtensionException e) {
+				return 0;
+			} catch (RasterDriverException e) {
+				return 0;
+			} catch (CloseException e) {
+				return 0;
+			} 
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Histogram#getMinimum()
+	 */
+	public double getMinimum() {
+		if(((RemoteStoreParameters)provider.getDataParameters()).isSizeFixed()) 
+			return super.getMinimum();
+		else {
+			ProviderServices provServ = RasterLocator.getManager().getProviderServices();
+			RasterDataParameters storeParameters = provServ.createParameters(
+					provider.getLastRequest().getPath());
+			storeParameters.setSRS(provider.getProjection());
+			
+			try {
+				RasterDataStore mrs = RasterLocator.getManager().getProviderServices().open(storeParameters);
+				double res = mrs.getHistogramComputer().getMinimum();
+				mrs.close();
+				return res;
+			} catch (LocatorException e) {
+				return 0;
+			} catch (NotSupportedExtensionException e) {
+				return 0;
+			} catch (RasterDriverException e) {
+				return 0;
+			} catch (CloseException e) {
+				return 0;
+			}
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteStoreHistogram.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreMetadata.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreMetadata.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreMetadata.java	(revision 15423)
@@ -0,0 +1,278 @@
+/* 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.impl.store.properties;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.raster.impl.datastruct.TransparencyRangeImpl;
+
+
+
+/**
+ * Guarda en un Array los metadatos de los distintos tipos de imagenes.
+ *
+ *  NODATA_VALUES=255 255 255 1
+ *  AREA_OR_POINT=Point 4
+ *  TIFFTAG_XRESOLUTION=72 4
+ *  TIFFTAG_YRESOLUTION=72 4
+ *  TIFFTAG_RESOLUTIONUNIT=2 (pixels/inch) 4
+ *
+ *  STATISTICS_MINIMUM=0
+ *  STATISTICS_MAXIMUM=221
+ *  STATISTICS_MEAN=35.910196078431
+ *  STATISTICS_MEDIAN=30
+ *  STATISTICS_MODE=0
+ *  STATISTICS_STDDEV=29.609849452294
+ *  STATISTICS_HISTONUMBINS=256
+ *  STATISTICS_HISTOMIN=0
+ *  STATISTICS_HISTOMAX=255
+ *  LAYER_TYPE=athematic
+ *  STATISTICS_HISTOBINVALUES=30285675|0|0|22050| ...
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DataStoreMetadata implements Metadata {
+	/**
+	 * Valores para los identificadores de los metadatos
+	 */
+	private ArrayList<String>               metadata       = new ArrayList<String>();
+	/**
+	 * Valores de los metadatos
+	 */
+	private ArrayList<String>               values         = new ArrayList<String>();
+	/**
+	 * Valores no data para cada banda de la imagen (si los tiene)
+	 */
+	protected double[]                      noDataByBand   = null;
+	/**
+	 * Valor para saber si el NoData esta activo
+	 */
+	protected boolean                       noDataEnabled  = false;
+	/**
+	 * Metadatos
+	 */
+	protected String[] 				        metadataString = null;
+	protected DataStoreColorInterpretation 	colorInterpr   = null;
+	
+	public DataStoreMetadata(String[] metadata, DataStoreColorInterpretation colorInterpr) {
+		this.colorInterpr = colorInterpr;
+		if(metadata == null)
+			return;
+		metadataString = metadata;
+		for(int i = 0;i < metadata.length;i++) {
+			String[] value = metadata[i].split("=");
+			if(value.length >= 2) {
+				this.metadata.add(value[0]);
+				this.values.add(value[1]);
+			}
+		}
+	}
+
+	/**
+	 * Crea un objeto TransparencyRange a partir de los rangos de transparencia
+	 * @return
+	 */
+	public TransparencyRange parserNodataByBand() {
+		int bandR = colorInterpr.getBand("Red");
+		int bandG = colorInterpr.getBand("Green");
+		int bandB = colorInterpr.getBand("Blue");
+
+		if(bandR < 0 && bandG < 0 && bandB < 0)
+			return null;
+
+		//Esta comprobaci�n es para los raster con paleta (gif). Cuando se trate la paleta y no se usen como
+		//imagenes de una banda habr� que cambiar esto
+		if((colorInterpr.length() == 1) && colorInterpr.get(0).equals("Palette"))
+			return null;
+
+		if(noDataByBand == null)
+			return null;
+
+		//Si todos los valores nodata por banda son -1 es que no hay ninguno asignado
+		int count = 0;
+		for(int i = 0; i < noDataByBand.length; i++)
+			if(noDataByBand[i] < 0)
+				count ++;
+
+		if(count == noDataByBand.length)
+			return null;
+
+		TransparencyRange tr = new TransparencyRangeImpl();
+		int[] red = new int[2];
+		int[] green = new int[2];
+		int[] blue = new int[2];
+
+		if(bandR >= 0) {
+			red[0] = red[1] = (int)noDataByBand[bandR];
+			tr.setRed(red);
+		}
+		if(bandG >= 0) {
+			green[0] = green[1] = (int)noDataByBand[bandG];
+			tr.setGreen(green);
+		}
+		if(bandB >= 0) {
+			blue[0] = blue[1] = (int)noDataByBand[bandB];
+			tr.setBlue(blue);
+		}
+
+		tr.setAnd(true);
+		tr.loadStrEntryFromValues();
+
+		return tr;
+	}
+
+	/**
+	 * Parsea los metadatos NODATA_VALUES si existe alguno y devuelve un objeto TransparencyRange.
+	 * @param nodata
+	 * @return Vector de enteros con los valores RGBA o null si no tiene este metadato o no es parseable
+	 * en este formato.
+	 */
+	public TransparencyRange[] parserNodataInMetadata() {
+		//Esta comprobaci�n es para los raster con paleta (gif). Cuando se trate la paleta y no se usen como
+		//imagenes de una banda habr� que cambiar esto
+		if((colorInterpr.length() == 1) && colorInterpr.get(0).equals("Palette"))
+			return null;
+
+		int count = 0;
+		for(int i = 0; i < metadata.size(); i++) {
+			if(((String)metadata.get(i)).equals("NODATA_VALUES"))
+				count ++;
+		}
+		if(count == 0)
+			return null;
+
+		TransparencyRange[] trList = new TransparencyRange[count];
+
+		count = 0;
+		for(int i = 0; i < metadata.size(); i++) {
+			TransparencyRange tr = new TransparencyRangeImpl();
+			int[] red = new int[2];
+			int[] green = new int[2];
+			int[] blue = new int[2];
+
+			if(((String)metadata.get(i)).equals("NODATA_VALUES")){
+				String data = (String)values.get(i);
+				String[] dataValues = data.split(" ");
+				//int[] values = new int[dataValues.length];
+				try{
+					red[0] = red[1] = Integer.parseInt(dataValues[0]);
+					green[0] = green[1] = Integer.parseInt(dataValues[1]);
+					blue[0] = blue[1] = Integer.parseInt(dataValues[2]);
+				}catch(NumberFormatException exc){
+					return null;
+				}
+			}
+			tr.setAnd(true);
+			tr.setRed(red);
+			tr.setGreen(green);
+			tr.setBlue(blue);
+			tr.loadStrEntryFromValues();
+			trList[count] = tr;
+			count ++;
+		}
+
+		return trList;
+	}
+
+	/**
+	 * Inicializa los valores no data;
+	 * @param values
+	 */
+	public void initNoDataByBand(int values) {
+		noDataByBand = new double[values];
+		for(int i = 0; i < values; i++)
+			noDataByBand[i] = -1;
+	}
+
+	/**
+	 * Asigna un valor para el valor noData por banda
+	 * @param band Banda
+	 * @param value valor
+	 */
+	public void setNoDataValue(int band, double value) {
+		try {
+			noDataByBand[band] = value;
+		} catch(ArrayIndexOutOfBoundsException ex) {
+			//No asignamos el elemento
+		}
+	}
+
+	/**
+	 * Devuelve el valor NoData para una banda en concreto.
+	 * @param band
+	 * @return
+	 */
+	public double getNoDataValue(int band) {
+		return noDataByBand[band];
+	}
+
+	/**
+	 * Devuelve el valor NoData en forma de array.
+	 * @return
+	 */
+	public double[] getNoDataValue() {
+		return noDataByBand;
+	}
+
+	/**
+	 * Obtiene los metadatos en forma de vector de cadenas
+	 * @return Vector de cadenas en el que cada cadena es atributo=valor
+	 */
+	public String[] getMetadataString() {
+		return metadataString;
+	}
+
+	/**
+	 * Devuelve si el valor NoData esta activo
+	 * @return
+	 */
+	public boolean isNoDataEnabled() {
+		return noDataEnabled;
+	}
+
+	/**
+	 * Establece si el valor NoData esta activo
+	 * @param noDataEnabled
+	 */
+	public void setNoDataEnabled(boolean noDataEnabled) {
+		this.noDataEnabled = noDataEnabled;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see java.lang.Object#finalize()
+	 */
+	protected void finalize() throws Throwable {
+		metadataString = null;
+		noDataByBand = null;
+		if(values != null) {
+			values.clear();
+			values = null;
+		}
+		if(metadata != null) {
+			metadata.clear();
+			metadata = null;
+		}
+	} 
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreMetadata.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorInterpretation.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorInterpretation.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorInterpretation.java	(revision 15423)
@@ -0,0 +1,400 @@
+/* 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.impl.store.properties;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.tools.ToolsLocator;
+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;
+/**
+ * Clase que contiene la interpretaci�n de color por banda. Inicialmente
+ * es inicializada con los valores contenidos en el raster si los tiene. Despu�s 
+ * estos valores pueden ser modificados.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DataStoreColorInterpretation implements ColorInterpretation {
+	/**
+	 * Interpretaci�n de color para cada banda
+	 */
+	private String[]           colorInterpretation = null;
+	/**
+	 * true si la imagen tiene una banda con el identificador de interpretaci�n de
+	 * color a Alpha
+	 */
+
+	/**
+	 * Constructor vacio. 
+	 */
+	public DataStoreColorInterpretation() {
+		this.colorInterpretation = new String[0];
+	}
+	
+	/**
+	 * Constructor que asigna los valores de interpretaci�n de color 
+	 */
+	public DataStoreColorInterpretation(String[] colorInterp) {
+		this.colorInterpretation = colorInterp;
+	}
+	
+	public static DataStoreColorInterpretation createDefaultInterpretation(int nBands) {
+		if(nBands <= 0)
+			return null;
+		if(nBands == 1)
+			return new DataStoreColorInterpretation(new String[]{GRAY_BAND});
+		if(nBands == 2)
+			return new DataStoreColorInterpretation(new String[]{GRAY_BAND, ALPHA_BAND});
+		if(nBands == 3)
+			return new DataStoreColorInterpretation(new String[]{RED_BAND, GREEN_BAND, BLUE_BAND});
+		return new DataStoreColorInterpretation(new String[]{RED_BAND, GREEN_BAND, BLUE_BAND, ALPHA_BAND});
+	}
+	
+	public static DataStoreColorInterpretation createPaletteInterpretation() {
+		return new DataStoreColorInterpretation(PALETTE);
+	}
+
+	/**
+	 * Obtiene una interpretaci�n de color GRAY
+	 * @return DatasetColorInterpretation
+	 */
+	public static DataStoreColorInterpretation createGrayInterpretation() {
+		return new DataStoreColorInterpretation(GRAYSCALE);
+	}
+	
+	/**
+	 * Obtiene una interpretaci�n de color ARGB
+	 * @return DatasetColorInterpretation
+	 */
+	public static DataStoreColorInterpretation createRGBAInterpretation() {
+		return new DataStoreColorInterpretation(ARGB);
+	}
+	
+	/**
+	 * Obtiene una interpretaci�n de color RGB
+	 * @return DatasetColorInterpretation
+	 */
+	public static DataStoreColorInterpretation createRGBInterpretation() {
+		return new DataStoreColorInterpretation(RGB);
+	}
+	
+	/**
+	 * Constructor que inicializa el n�mero de valores de la interpretaci�n de 
+	 * color. Implica asignar posteriormente los valores a las bandas.
+	 */
+	public DataStoreColorInterpretation(int bandCount) {
+		colorInterpretation = new String[bandCount];
+	}
+	
+	public DataStoreColorInterpretation(String colorInterpretationConstant) {
+		if(colorInterpretationConstant.equals(RGB)) {
+			colorInterpretation = new String[]{RED_BAND, GREEN_BAND, BLUE_BAND};
+		}
+		if(colorInterpretationConstant.equals(BGR)) {
+			colorInterpretation = new String[]{BLUE_BAND, GREEN_BAND, RED_BAND};
+		}
+		if(colorInterpretationConstant.equals(ARGB)) {
+			colorInterpretation = new String[]{RED_BAND, GREEN_BAND, BLUE_BAND, ALPHA_BAND};
+		}
+		if(colorInterpretationConstant.equals(GRAYSCALE)) {
+			colorInterpretation = new String[]{GRAY_BAND};
+		}
+		if(colorInterpretationConstant.equals(PALETTE)) {
+			colorInterpretation = new String[]{PAL_BAND};
+		}
+	}
+	
+	/**
+	 * Inicializa el vector de cadenas que contendr�n el nombre de la interpretaci�n 
+	 * de color asignada a cada banda. Este valor es el devuelto por la imagen.
+	 * @param values N�mero de valores
+	 */
+	public void initColorInterpretation(int values) {
+		colorInterpretation = new String[values];
+	}
+	
+	public boolean hasInterpretation() {
+		if(colorInterpretation == null)
+			return false;
+		for (int i = 0; i < colorInterpretation.length; i++) {
+			if(	colorInterpretation[i].equals(RED_BAND) || 
+				colorInterpretation[i].equals(GREEN_BAND) || 
+				colorInterpretation[i].equals(BLUE_BAND) ||
+				colorInterpretation[i].equals(RED_GREEN_BAND) ||
+				colorInterpretation[i].equals(RED_BLUE_BAND) ||
+				colorInterpretation[i].equals(GRAY_BAND) ||
+				colorInterpretation[i].equals(PAL_BAND))
+				return true;
+		}
+		return false;
+	}
+	
+	public boolean isBGR() {
+		if(colorInterpretation != null) {
+			if (colorInterpretation.length == 3 && 
+				colorInterpretation[0] == BLUE_BAND && 
+				colorInterpretation[1] == GREEN_BAND && 
+				colorInterpretation[2] == RED_BAND)
+				return true;
+		}
+		return false;
+	}
+	
+	public boolean isRGB() {
+		if(colorInterpretation != null) {
+			if (colorInterpretation.length == 3 && 
+				isColorInterpretation(0) && 
+				isColorInterpretation(1) && 
+				isColorInterpretation(2))
+				return true;
+		}
+		return false;
+	}
+	
+	public boolean isRGBA() {
+		if(colorInterpretation != null) {
+			if (colorInterpretation.length == 4 && 
+				isInterpretationDefinedAsColor(0) && 
+				isInterpretationDefinedAsColor(1) && 
+				isInterpretationDefinedAsColor(2) &&
+				isAlphaInterpretation(3))
+				return true;
+		}
+		return false;
+	}
+	
+	public boolean isPalette() {
+		if(colorInterpretation != null && 
+			colorInterpretation[0].length() >= 1 &&
+			colorInterpretation[0].equals(PAL_BAND)) 
+			return true;
+		return false;
+	}
+	
+	private boolean isInterpretationDefinedAsColor(int band) {
+		return isColorInterpretation(band) || isGrayInterpretation(band);
+	}
+	
+	public boolean isGrayInterpretation(int band) {
+		return colorInterpretation[band].equals(GRAY_BAND);
+	}
+	
+	public boolean isColorInterpretation(int band) {
+		return colorInterpretation[band].equals(RED_BAND) || colorInterpretation[band].equals(GREEN_BAND) || colorInterpretation[band].equals(BLUE_BAND); 
+	}
+	
+	public boolean isAlphaInterpretation(int band) {
+		return colorInterpretation[band].equals(ALPHA_BAND);
+	}
+	
+	public int getAlphaBand() {
+		String[] values = getValues();
+		for (int i = 0; i < values.length; i++) {
+			if(values[i] != null && values[i].equals(ALPHA_BAND))
+				return i;
+		}
+		return -1;
+	}	
+	
+	public String[] getValues() {
+		return colorInterpretation;
+	}
+	
+	/**
+	 * Asigna los valores de la interpretaci�n de color
+	 * @return String[]
+	 */
+	public void setValues(String[] colorInterp) {
+		colorInterpretation = colorInterp;
+	}
+	
+	public void setColorInterpValue(int band, String value) {
+		try{
+			//Si ya existia el valor se elimina
+			for (int i = 0; i < colorInterpretation.length; i++) {
+				if(colorInterpretation[i] != null && colorInterpretation[i].equals(value))
+					colorInterpretation[i] = UNDEF_BAND;
+			}
+			
+			//Se asigna el valor en su entrada. Si excede la longitud se construye uno nuevo m�s largo
+			//que en las celdas existentes es copia del anterior
+			if(band >= 0 && band < colorInterpretation.length)
+				colorInterpretation[band] = value;
+			else if(band >= colorInterpretation.length) {
+				ColorInterpretation copyCI = new DataStoreColorInterpretation(band + 1);
+				for (int i = 0; i < colorInterpretation.length; i++) {
+					copyCI.setColorInterpValue(i, colorInterpretation[i]);
+				}
+				colorInterpretation = copyCI.getValues();
+			}
+		}catch(ArrayIndexOutOfBoundsException ex) {
+			//No asignamos el elemento
+		}
+	}
+	
+	public int getBand(String id) {
+		if(colorInterpretation != null) {
+			for(int i = 0; i < colorInterpretation.length; i++)
+				if(colorInterpretation[i] != null && colorInterpretation[i].equals(id))
+					return i;
+		}
+		return -1;
+	}
+	
+	/**
+	 * Obtiene la posici�n de las bandas que contienen el identificador pasado por par�metro 
+	 * o null si no tiene dicho identificador.
+	 * @return Lista con las posiciones de las bandas que contienen el identificador o null si no lo tiene.
+	 */
+	public int[] getBands(String id) {
+		if(colorInterpretation != null){
+			List<Integer> array = new ArrayList<Integer>();
+			for(int i = 0; i < colorInterpretation.length; i++)
+				if(colorInterpretation[i].equals(id))
+					array.add(new Integer(i));
+			int[] list = new int[array.size()];
+			for (int i = 0; i < list.length; i++) 
+				list[i] = ((Integer)array.get(i)).intValue();
+			return list;
+		}
+		return null;
+	}
+
+	public boolean hasAlphaBand() {
+		String[] values = getValues();
+		for (int i = 0; i < values.length; i++) {
+			if(values[i]  != null && values[i].equals("Alpha"))
+				return true;
+		}
+		return false;
+	}	
+	
+	public int length() {
+		return colorInterpretation.length;
+	}
+	
+	public String get(int i) {
+		if (i >= colorInterpretation.length)
+			return null;
+		return colorInterpretation[i];
+	}
+	
+	public void addColorInterpretation(ColorInterpretation ci) {
+		String[] newCI = new String[colorInterpretation.length + ci.length()];
+		for (int i = 0; i < colorInterpretation.length; i++)
+			newCI[i] = colorInterpretation[i];
+		for (int i = 0; i < ci.length(); i++) {
+			newCI[colorInterpretation.length + i] = ci.get(i);
+		}
+		this.colorInterpretation = newCI;
+	}
+	
+	public boolean isUndefined() {
+		for (int i = 0; i < colorInterpretation.length; i++) {
+			if (colorInterpretation[i] != null) {
+				if (!colorInterpretation[i].equals(UNDEF_BAND) &&
+						!colorInterpretation[i].equals(ALPHA_BAND))
+					return false;
+			}
+		}
+		return true;
+	}
+	
+	public int[] buildRenderBands() {
+		if(colorInterpretation == null)
+			return null;
+		int[] renderBands = new int[]{-1, -1, -1, -1};
+		for (int i = 0; i < colorInterpretation.length; i++) {
+			if(colorInterpretation[i].equals(RED_BAND))
+				renderBands[0] = i;
+			if(colorInterpretation[i].equals(GREEN_BAND))
+				renderBands[1] = i;
+			if(colorInterpretation[i].equals(BLUE_BAND))
+				renderBands[2] = i;
+			if(colorInterpretation[i].equals(GRAY_BAND))
+				renderBands[0] = renderBands[1] = renderBands[2] = i;
+			if(colorInterpretation[i].equals(RED_GREEN_BAND))
+				renderBands[0] = renderBands[1] = i;
+			if(colorInterpretation[i].equals(RED_BLUE_BAND))
+				renderBands[0] = renderBands[2] = i;
+			if(colorInterpretation[i].equals(GREEN_BLUE_BAND))
+				renderBands[1] = renderBands[2] = i;
+			if(colorInterpretation[i].equals(PAL_BAND))
+				return new int[]{0, 0, 0, -1};
+		}
+		
+		//Ojo! esto no puede hacerse en el bucle anterior pq no detectaria bien casos 
+		//como ALPHA_BAND, GRAY_BAND
+		for (int i = 0; i < colorInterpretation.length; i++) {
+			if(colorInterpretation[i].equals(ALPHA_BAND))
+				renderBands[3] = i;
+		}
+		return renderBands;
+	}
+	
+	public ColorInterpretation cloneColorInterpretation() {
+		DataStoreColorInterpretation ci = new DataStoreColorInterpretation();
+		String[] l = new String[colorInterpretation.length];
+		for (int i = 0; i < l.length; i++) {
+			l[i] = colorInterpretation[i];
+		}
+		ci.colorInterpretation = l;
+		return ci;
+	}
+	
+	public static DynStruct registerDynClass() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("Color_Interpretation_Persistent");
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DataStoreColorInterpretation.class,
+					"Color_Interpretation_Persistent",
+					"Color interpretation Persistent definition (FIXME)",
+					null, 
+					null
+			);
+		}
+		
+		definition.addDynFieldList("colorinterpretation")
+		.setClassOfItems(String.class)
+		.setMandatory(false);
+		
+		return definition;
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		if(colorInterpretation != null && colorInterpretation.length > 0)
+			state.set("colorinterpretation", Arrays.asList(colorInterpretation));
+	}
+
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		List<String> descriptions = (List<String>) state.get("colorinterpretation");
+		setValues(descriptions.toArray(new String[descriptions.size()]));
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorInterpretation.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorTable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorTable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorTable.java	(revision 15423)
@@ -0,0 +1,922 @@
+/* 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.impl.store.properties;
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.tools.ToolsLocator;
+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;
+/**
+ * Paleta para raster. Esta consta de los valores RGB de la paleta que son
+ * almacenados en un vector donde cada elemento contiene en su interior el RGB
+ * completo y del vector de rangos.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class DataStoreColorTable implements ColorTable, Cloneable {
+	public static final String      PERSISTENT_NAME        = "DataStoreColorTable_Persistent";
+    public static final String      PERSISTENT_DESCRIPTION = "DataStoreColorTable Persistent";
+    
+	/**
+	 * Flag de activaci�n de la paleta cuando se visualiza o exporta.
+	 */
+	private boolean 		         paletteActive     = true;
+	/**
+	 * Lista de ColorItem donde estaran todos los valores de la paleta segun
+	 * el interfaz
+	 */
+	protected List<ColorItem>        colorItems        = null;
+	/**
+	 * Booleano que define si se interpolaran los valores de la paleta.
+	 */
+	protected boolean                interpolated      = true;
+	/**
+	 * Lista de rangos para paletas decimales
+	 */
+	protected double[]               range             = null;
+	/**
+	 * Lista de valores RGB
+	 */
+	protected byte[][]               paletteByBand     = null;
+	/**
+	 * Nombre de la clase asociada a la entrada
+	 */
+	protected String[]               nameClass         = null;
+	/**
+	 * Nombre de la paleta
+	 */
+	protected String                 name              = null;
+
+	/**
+	 * Ruta del fichero a la cual se asocia la paleta. Las bandas de un
+	 * GeoRasterMultiFile han de saber a que paleta van asociadas.
+	 */
+	protected String                 filePath          = null;
+	private int                      errorColor        = 8;
+
+	/**
+	 * Constructor vac�o.
+	 * @param uri
+	 */
+	public DataStoreColorTable() {
+		this.name = "";
+	}
+
+	/**
+	 * Constructor. Asigna el nombre de la paleta.
+	 * @param name
+	 */
+	public DataStoreColorTable(String name) {
+		this.name = name;
+	}
+	
+	/**
+	 * Constructor de copia
+	 * @param fp
+	 */
+	public DataStoreColorTable(ColorTable fp){
+		if (fp == null)
+			return;
+		DataStoreColorTable palette = null;
+		if(fp instanceof DataStoreColorTable)
+			palette = (DataStoreColorTable)fp;
+		else
+			return;
+		this.range = palette.getRange();
+		this.paletteActive = true;
+		this.paletteByBand = palette.getColorTableByBand();
+		this.nameClass = palette.getNameClass();
+		this.name = palette.getName();
+		this.filePath = palette.getFilePath();
+		this.colorItems = palette.getColorItems();
+		this.interpolated = palette.isInterpolated();
+	}
+	
+	/**
+	 * Constructor. Asigna el nombre de la paleta.
+	 * @param name
+	 */
+	public DataStoreColorTable(List<ColorItem> colorItems, boolean compress) {
+		this.colorItems = colorItems;
+		sortPalette(colorItems);
+
+		setInterpolated(false);
+		// Mira que valores se pueden descartar y asi dejamos la paleta reducida
+		// para poder hacer interpolaciones
+		if (compress)
+			compressPalette(colorItems);
+		
+		applyPalette(colorItems);
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+
+	public String getName() {
+		return name;
+	}
+
+	public void createPaletteFromColorItems(List<ColorItem> colorItems, boolean compress) {
+		this.colorItems = colorItems;
+
+		// Ordena la paleta
+		sortPalette(colorItems);
+
+		// Mira que valores se pueden descartar y asi dejamos la paleta reducida
+		// para poder hacer interpolaciones
+		if (compress)
+			compressPalette(colorItems);
+
+		// Genera la paleta final para poder ser usada
+		applyPalette(colorItems);
+
+		// Borra valores duplicados
+		removeDuplicatedValues();
+	}
+
+	private boolean isEqualColor(Color c1, Color c2, int error) {
+		if ((c2 == null) && (c1 != null))
+			return false;
+		if ((c1 == null) && (c2 != null))
+			return false;
+		if (c2.getRed() < (c1.getRed() - error))
+			return false;
+		if (c2.getGreen() < (c1.getGreen() - error))
+			return false;
+		if (c2.getBlue() < (c1.getBlue() - error))
+			return false;
+		if (c2.getAlpha() < (c1.getAlpha() - error))
+			return false;
+
+		if (c2.getRed() > (c1.getRed() + error))
+			return false;
+		if (c2.getGreen() > (c1.getGreen() + error))
+			return false;
+		if (c2.getBlue() > (c1.getBlue() + error))
+			return false;
+		if (c2.getAlpha() > (c1.getAlpha() + error))
+			return false;
+
+		return true;
+	}
+
+	/**
+	 * Informa de si el color c3 se encuentra en un rango valido entre c1 y c2.
+	 * Para colores con nombre de clase se devolver� false para no eliminar nunca
+	 * ese item. Para colores con interpolacion distinta al 50% tambien
+	 * devolveremos false.
+	 * @param c1
+	 * @param c2
+	 * @param c3
+	 * @return
+	 */
+	private boolean isCorrectColor(ColorItem c1, ColorItem c2, ColorItem c3) {
+		if ((c3.getNameClass() != null) && (c3.getNameClass().length() > 0))
+			return false;
+		if (c3.getInterpolated() != 50)
+			return false;
+		if (c2.getInterpolated() != 50)
+			return false;
+
+		double max = c2.getValue() - c1.getValue();
+		int r = c1.getColor().getRed() + (int) (((c2.getColor().getRed() - c1.getColor().getRed()) * (c3.getValue() - c1.getValue())) / max);
+		int g = c1.getColor().getGreen() + (int) (((c2.getColor().getGreen() - c1.getColor().getGreen()) * (c3.getValue() - c1.getValue())) / max);
+		int b = c1.getColor().getBlue() + (int) (((c2.getColor().getBlue() - c1.getColor().getBlue()) * (c3.getValue() - c1.getValue())) / max);
+		int a = c1.getColor().getAlpha() + (int) (((c2.getColor().getAlpha() - c1.getColor().getAlpha()) * (c3.getValue() - c1.getValue())) / max);
+		Color aux = new Color(r & 0xff, g & 0xff, b & 0xff, a & 0xff);
+
+		return isEqualColor(c3.getColor(), aux, errorColor);
+	}
+
+	private boolean canDelete(int first, int last) {
+		if (first >= getColorItems().size())
+			return false;
+		if (last >= getColorItems().size())
+			return false;
+		ColorItem c1 = (ColorItem) getColorItems().get(first);
+		ColorItem c2 = (ColorItem) getColorItems().get(last);
+		for (int i = (first + 1); i < last; i++) {
+			if (!isCorrectColor(c1, c2, (ColorItem) getColorItems().get(i)))
+				return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Borra valores duplicados de la paleta. Solo aquellos que coincidan en valor
+	 * y color.
+	 */
+	public void removeDuplicatedValues() {
+		for (int i = colorItems.size() - 2 ; i >= 0; i--) {
+			if ((i + 1) >= colorItems.size())
+				continue;
+			ColorItem colorItem = (ColorItem) colorItems.get(i + 1);
+			ColorItem colorItem2 = (ColorItem) colorItems.get(i);
+			// Si el valor es distinto no lo borramos
+			if (colorItem.getValue() != colorItem2.getValue())
+				continue;
+			// Si el color es distinto no lo borramos
+			if (!colorItem.getColor().equals(colorItem2.getColor()))
+				continue;
+			// Borraremos siempre el valor que no tenga nombre de clase, es un
+			// dato importante
+			if ((colorItem.getNameClass() == null) || (colorItem.getNameClass().length() == 0)) {
+				colorItems.remove(i + 1);
+				continue;
+			}
+			if ((colorItem2.getNameClass() == null) || (colorItem2.getNameClass().length() == 0)) {
+				colorItems.remove(i);
+				continue;
+			}
+			// Borramos solo uno de los dos si el nombre coincide
+			if ((colorItem.getNameClass() != null) || (colorItem.getNameClass().equals(colorItem2.getNameClass()))) {
+				colorItems.remove(i);
+				continue;
+			}
+		}
+	}
+
+	public boolean hasAlpha() {
+		for (int i = 0; i<colorItems.size(); i++) {
+			ColorItem colorItem = (ColorItem) colorItems.get(i);
+			if (colorItem.getColor().getAlpha() != 255)
+				return true;
+		}
+		return false;
+	}
+	
+	public void compressPalette() {
+		compressPalette(colorItems);
+	}
+
+	/**
+	 * Informa de si una tabla de color se puede comprimir
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public boolean isCompressible() {
+		List<ColorItem> cloneList = (List<ColorItem>)((ArrayList<?>) getColorItems()).clone();
+		compressPalette(cloneList);
+		return (cloneList.size() != getColorItems().size());
+	}
+
+	/**
+	 * Coge el array pasado por parametro y lo intenta comprimir
+	 * @param colorItems
+	 */
+	private void compressPalette(List<ColorItem> colorItems) {
+		removeDuplicatedValues();
+		int size = -1;
+
+		while (size != colorItems.size()) {
+			int init = 0;
+			int posMax = 2;
+
+			size = colorItems.size();
+			while (init < colorItems.size()) {
+				if ((posMax < colorItems.size()) && canDelete(init, posMax)) {
+					posMax++;
+					continue;
+				}
+				if ((init + 2) < posMax) {
+					if (canDelete(init, posMax - 1))
+						for (int i = (posMax - 2); i > init; i--)
+							if (i < colorItems.size())
+								colorItems.remove(i);
+				}
+				init++;
+				posMax = init + 2;
+			}
+		}
+	}
+
+	/**
+	 * Crea una paleta a partir de un objeto GdalColorTable. Esto es necesario
+	 * para los ficheros que tienen una paleta asignada, como los gif, y que son
+	 * tratados por Gdal. Se pasa la tabla de color le�da desde gdal y se crea
+	 * directamente un objeto Palette.
+	 * @param table
+	 */
+	/*public void createPaletteFromGdalColorTable(GdalColorTable table) {
+		try {
+			colorItems = new ArrayList<ColorItem>();
+			for (int iEntry = 0; iEntry < table.getColorEntryCount(); iEntry++) {
+				GdalColorEntry entry = table.getColorEntryAsRGB(iEntry);
+
+				ColorItem colorItem = new ColorItemImpl();
+				colorItem.setNameClass("");
+				colorItem.setValue(iEntry);
+				colorItem.setColor(new Color(	(int) (entry.c1 & 0xff),
+																			(int) (entry.c2 & 0xff),
+																			(int) (entry.c3 & 0xff),
+																			(int) (entry.c4 & 0xff)));
+
+				colorItems.add(colorItem);
+			}
+		} catch (GdalException ex) {
+			// No se crea la paleta
+		}
+		sortPalette(colorItems);
+
+		setInterpolated(false);
+		//compressPalette();
+		applyPalette(colorItems);
+	}*/
+
+	public byte[][] getColorTableByBand() {
+		return paletteByBand;
+	}
+
+
+	/**
+	 * Asigna una paleta
+	 * @param palette Paleta
+	 */
+	public void setColorTable(int[] palette) {
+		paletteByBand = new byte[palette.length][4];
+		for (int i = 0; i < palette.length; i++) {
+			paletteByBand[i][0] = (byte)((palette[i] & 0x00ff0000) >> 16);
+			paletteByBand[i][1] = (byte)((palette[i] & 0x0000ff00) >> 8);
+			paletteByBand[i][2] = (byte)(palette[i] & 0x000000ff);
+			paletteByBand[i][3] = (byte)(palette[i] & 0xff000000 >> 24);
+		}
+	}
+
+	/**
+	 * Obtiene los nombres de las clases de la paleta
+	 * @return Array de cadenas. Cada una corresponde con un nombre de clase
+	 * que corresponde a cada rango de tipos.
+	 */
+	public String[] getNameClass() {
+		return nameClass;
+	}
+
+	/**
+	 * Asigna los nombres de las clases de la paleta
+	 * @param names Array de cadenas. Cada una corresponde con un nombre de clase
+	 * que corresponde a cada rango de tipos.
+	 */
+	public void setNameClass(String[] names) {
+		nameClass = names;
+	}
+
+	/**
+	 * Obtiene la ruta del fichero al que va asociada la paleta.
+	 * @return Ruta del fichero al que va asociada la paleta.
+	 */
+	public String getFilePath() {
+		return filePath;
+	}
+
+	/**
+	 * Asigna la ruta del fichero al que va asociada la paleta.
+	 * @param Ruta del fichero al que va asociada la paleta.
+	 */
+	public void setFilePath(String filePath) {
+		this.filePath = filePath;
+	}
+
+	public Object clone() {
+		DataStoreColorTable clone = null;
+		try {
+			clone = (DataStoreColorTable) super.clone();
+		} catch (CloneNotSupportedException e) {
+		}
+
+		if (colorItems != null) {
+			clone.colorItems = new ArrayList<ColorItem>();
+			for (int i = 0; i < colorItems.size(); i++) {
+				clone.colorItems.add((ColorItemImpl) ((ColorItemImpl) colorItems.get(i)).clone());
+			}
+		}
+
+		clone.interpolated = interpolated;
+
+		if (filePath != null)
+			clone.filePath = new String(filePath);
+
+		if (name != null)
+			clone.name = new String(name);
+
+		if (nameClass != null) {
+			clone.nameClass = new String[nameClass.length];
+			for (int i = 0; i < nameClass.length; i++)
+				clone.nameClass[i] = nameClass[i];
+		}
+
+		if (paletteByBand != null) {
+			clone.paletteByBand = (byte[][]) paletteByBand.clone();
+			for (int i = 0; i < paletteByBand.length; i++)
+				clone.paletteByBand[i] = (byte[]) paletteByBand[i].clone();
+		}
+
+		if (range != null)
+			clone.range = (double[]) range.clone();
+
+		return clone;
+	}
+
+	/**
+	 * Devuelve un color de interpolacion entre dos colores
+	 * @param value
+	 * @param pos
+	 * @return
+	 */
+	private Color interpolatedColor(double value, int pos) {
+		if (colorItems.size() <= 0)
+			return Color.black;
+
+		if ((pos + 1) == colorItems.size())
+			return ((ColorItem) colorItems.get(pos)).getColor();
+
+		if (value <= ((ColorItem) colorItems.get(0)).getValue())
+			return ((ColorItem) colorItems.get(0)).getColor();
+
+		ColorItem item1 = (ColorItem) colorItems.get(pos);
+		ColorItem item2 = (ColorItem) colorItems.get(pos + 1);
+
+		double percValue = ((value - item1.getValue()) * 100) / (item2.getValue() - item1.getValue());
+
+		Color halfColor = new Color(
+				(item2.getColor().getRed() + item1.getColor().getRed()) >> 1,
+				(item2.getColor().getGreen() + item1.getColor().getGreen()) >> 1,
+				(item2.getColor().getBlue() + item1.getColor().getBlue()) >> 1,
+				(item2.getColor().getAlpha() + item1.getColor().getAlpha()) >> 1);
+
+		Color color1, color2;
+		double perc1, perc2;
+
+		if (percValue > item2.getInterpolated()) {
+			color1 = halfColor;
+			color2 = item2.getColor();
+			perc1 = item2.getInterpolated();
+			perc2 = 100;
+		} else {
+			color1 = item1.getColor();
+			color2 = halfColor;
+			perc1 = 0;
+			perc2 = item2.getInterpolated();
+		}
+
+		double percNew = (percValue - perc1) / (perc2 - perc1);
+
+		Color newColor = new Color(
+				(int) (color1.getRed() + ((color2.getRed() - color1.getRed()) * percNew)) & 0xff,
+				(int) (color1.getGreen() + ((color2.getGreen() - color1.getGreen()) * percNew)) & 0xff,
+				(int) (color1.getBlue() + ((color2.getBlue() - color1.getBlue()) * percNew)) & 0xff,
+				(int) (color1.getAlpha() + ((color2.getAlpha() - color1.getAlpha()) * percNew)) & 0xff);
+
+
+		return newColor;
+	}
+
+	/*
+	 * TODO: RENDIMIENTO: Incluir una heuristica que dado un valor se compare con
+	 * el valor de la mitad de la tabla y si es menor se empieza a recorrer desde
+	 * el principio sino se empieza a recorrer desde la mitad de la tabla hasta
+	 * abajo. Esto hace que se reduzca la tabla a la mitad de valores haciendo
+	 * solo una comparaci�n.
+	 */
+	public byte[] getRGBAByBand(double value) {
+		for (int i = 1; i <= range.length; i++) {
+			if (i < range.length) {
+				if (value < range[i])
+					return paletteByBand[i - 1];
+			} else {
+				return paletteByBand[i - 1];
+			}
+		}
+		return new byte[4];
+	}
+
+	/*
+	 * TODO: Usar el m�todo Quicksort para ordenar
+	 */
+	/**
+	 * Ordena el ColorItems de manera ascendente. De momento se usa el m�todo de
+	 * ordenaci�n por burbuja.
+	 */
+	private void sortPalette(List<ColorItem> colorItems) {
+		for (int i = 0; i < colorItems.size(); i++) {
+			for (int j = i + 1; j < colorItems.size(); j++) {
+				if (((ColorItem) colorItems.get(j)).getValue() < ((ColorItem) colorItems.get(i)).getValue()) {
+					ColorItem aux = (ColorItem) colorItems.get(i);
+					colorItems.set(i, colorItems.get(j));
+					colorItems.set(j, aux);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Genera una paleta intermedia para acelerar los calculos.
+	 */
+	private void applyPalette(List<ColorItem> colorItems) {
+		ArrayList<ColorItem> arrayColors = new ArrayList<ColorItem>();
+
+		range = new double[0];
+		nameClass = new String[0];
+
+		if (colorItems.size() == 0)
+			return;
+
+		// Nos preparamos para hacer las particiones, sabiendo el minimo y maximo
+		double min = ((ColorItem) colorItems.get(0)).getValue();
+		double max = ((ColorItem) colorItems.get(colorItems.size() - 1)).getValue();
+
+		if (min > max) {
+			double aux = max;
+			max = min;
+			min = aux;
+		}
+
+		Color color = Color.white;
+		Color colorOld = null;
+
+		// Hacemos las particiones, metiendo cada item calculado en un array
+		int defaultColors = RasterLibrary.defaultNumberOfColors;
+		for (int i = 0; i < defaultColors; i++) {
+			double value = min + ((i * (max - min)) / (defaultColors - 1));
+			int pos = 0;
+			for (int j = 1; j <= colorItems.size(); j++) {
+				if (j < colorItems.size()) {
+					if (value < ((ColorItem) colorItems.get(j)).getValue()) {
+						pos = j - 1;
+						break;
+					}
+				} else {
+					pos = j - 1;
+					break;
+				}
+			}
+
+			// Calculamos el color que corresponde, tanto interpolado como no
+			if (interpolated) {
+				color = interpolatedColor(value, pos);
+			} else {
+				if ((pos + 1) < colorItems.size()) {
+					double min2 = ((ColorItem) colorItems.get(pos)).getValue();
+					double max2 = ((ColorItem) colorItems.get(pos + 1)).getValue();
+					if ((min2 + ((max2 - min2) * ((ColorItem) colorItems.get(pos + 1)).getInterpolated() / 100)) < value)
+						pos++;
+				}
+				color = ((ColorItem) colorItems.get(pos)).getColor();
+			}
+
+			if (!isEqualColor(color, colorOld, 0)) {
+				ColorItem colorItem = new ColorItemImpl();
+				colorItem.setValue(value);
+				colorItem.setColor(color);
+				arrayColors.add(colorItem);
+			}
+
+			colorOld = color;
+		}
+
+		// Una vez tenemos una paleta de 256 colores o inferior, rellenamos
+		// los siguientes valores para hacer busquedas rapidas.
+
+		paletteByBand = new byte[arrayColors.size()][4];
+		range = new double[arrayColors.size()];
+		nameClass = new String[arrayColors.size()];
+
+		for (int i = 0; i < arrayColors.size(); i++) {
+			paletteByBand[i][0] = (byte) ((ColorItem) arrayColors.get(i)).getColor().getRed();
+			paletteByBand[i][1] = (byte) ((ColorItem) arrayColors.get(i)).getColor().getGreen();
+			paletteByBand[i][2] = (byte) ((ColorItem) arrayColors.get(i)).getColor().getBlue();
+			paletteByBand[i][3] = (byte) ((ColorItem) arrayColors.get(i)).getColor().getAlpha();
+			range[i] = ((ColorItem) arrayColors.get(i)).getValue();
+			nameClass[i] = ((ColorItem) arrayColors.get(i)).getNameClass();
+		}
+	}
+
+	public double[] getRange() {
+		return range;
+	}
+
+	public void setRange(double[] range) {
+		this.range = range;
+	}
+
+	public List<ColorItem> getColorItems() {
+		return colorItems;
+	}
+
+	public boolean isInterpolated() {
+		return interpolated;
+	}
+
+	public void setInterpolated(boolean interpolated) {
+		this.interpolated = interpolated;
+		applyPalette(colorItems);
+	}
+
+	public int hashCode() {
+		final int PRIME = 31;
+		int result = 1;
+		result = PRIME * result + ((colorItems == null) ? 0 : colorItems.hashCode());
+		result = PRIME * result + errorColor;
+		result = PRIME * result + ((filePath == null) ? 0 : filePath.hashCode());
+		result = PRIME * result + (interpolated ? 1231 : 1237);
+		result = PRIME * result + ((name == null) ? 0 : name.hashCode());
+		result = PRIME * result + DataStoreColorTable.hashCode(nameClass);
+		result = PRIME * result + DataStoreColorTable.hashCode(paletteByBand);
+		result = PRIME * result + DataStoreColorTable.hashCode(range);
+		return result;
+	}
+
+	private static int hashCode(Object[] array) {
+		final int PRIME = 31;
+		if (array == null)
+			return 0;
+		int result = 1;
+		for (int index = 0; index < array.length; index++) {
+			result = PRIME * result + (array[index] == null ? 0 : array[index].hashCode());
+		}
+		return result;
+	}
+
+	private static int hashCode(double[] array) {
+		final int PRIME = 31;
+		if (array == null)
+			return 0;
+		int result = 1;
+		for (int index = 0; index < array.length; index++) {
+			long temp = Double.doubleToLongBits(array[index]);
+			result = PRIME * result + (int) (temp ^ (temp >>> 32));
+		}
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final DataStoreColorTable other = (DataStoreColorTable) obj;
+
+		if ( ((colorItems == null) && (other.colorItems != null)) ||
+				((colorItems != null) && (other.colorItems == null)) )
+			return false;
+
+		if (colorItems != null) {
+			if (colorItems.size() != other.colorItems.size())
+				return false;
+			for (int i = 0; i < colorItems.size(); i++) {
+				if (!((ColorItem) colorItems.get(i)).equals(other.colorItems.get(i)))
+					return false;
+			}
+		}
+
+		if (filePath == null) {
+			if (other.filePath != null)
+				return false;
+		} else if (!filePath.equals(other.filePath))
+			return false;
+		if (name == null) {
+			if (other.name != null)
+				return false;
+		} else if (!name.equals(other.name))
+			return false;
+
+		if (nameClass != null) {
+			if (other.nameClass == null)
+				return false;
+
+			if (nameClass.length != other.nameClass.length)
+				return false;
+
+			for (int i = 0; i < nameClass.length; i++) {
+				if (nameClass[i] != null) {
+					if (!nameClass[i].equals(other.nameClass[i]))
+						return false;
+				} else {
+					if (other.nameClass[i] != null)
+						return false;
+				}
+			}
+		}
+
+		if ( ((paletteByBand == null) && (other.paletteByBand != null)) ||
+				((paletteByBand != null) && (other.paletteByBand == null)) )
+			return false;
+
+		if (paletteByBand != null) {
+			for (int i = 0; i < paletteByBand.length; i++) {
+				for (int j = 0; j < paletteByBand[i].length; j++) {
+					if (paletteByBand[i][j] != other.paletteByBand[i][j])
+						return false;
+				}
+			}
+		}
+
+		if (!Arrays.equals(range, other.range))
+			return false;
+
+		if ( ((colorItems == null) && (other.colorItems != null)) ||
+				((colorItems != null) && (other.colorItems == null)) )
+			return false;
+
+		return true;
+	}
+
+	/**
+	 * Establece la tabla de color actual en los rangos de limite especificados
+	 * por parametros, distribuyendolo proporcionalmente.
+	 * @param min
+	 * @param max
+	 * @param compress
+	 */
+	public void createColorTableInRange(double min, double max, boolean compress) {
+		ColorItem colorItem;
+		double max2 = Double.NEGATIVE_INFINITY;
+		double min2 = Double.POSITIVE_INFINITY;
+
+		if (min > max) {
+			double aux = min;
+			min = max;
+			max = aux;
+		}
+
+		ArrayList<ColorItem> arrayList = new ArrayList<ColorItem>();
+		List<ColorItem> items = getColorItems();
+
+		// Actualizamos el maximo y minimo del array
+		for (int i = 0; i < items.size(); i++) {
+			colorItem = (ColorItem) items.get(i);
+			if (colorItem.getValue() > max2)
+				max2 = colorItem.getValue();
+			if (colorItem.getValue() < min2)
+				min2 = colorItem.getValue();
+		}
+
+		// A�adir el minimo
+		if (items.size() > 0)
+			colorItem = (ColorItem) items.get(0);
+		else {
+			colorItem = new ColorItemImpl();
+			colorItem.setValue(0);
+			colorItem.setColor(Color.black);
+		}
+
+		arrayList.add(colorItem);
+
+		for (int i = 0; i < items.size(); i++) {
+			colorItem = (ColorItem) items.get(i);
+			colorItem.setValue(min + (((colorItem.getValue() - min2) * (max - min)) / (max2 - min2)));
+			arrayList.add(colorItem);
+		}
+
+		// A�adir el maximo
+		if (items.size() > 0)
+			colorItem = (ColorItem) items.get(items.size() - 1);
+		else {
+			colorItem = new ColorItemImpl();
+			colorItem.setValue(255);
+			colorItem.setColor(Color.white);
+		}
+		arrayList.add(colorItem);
+
+		createPaletteFromColorItems(arrayList, compress);
+	}
+	
+	public boolean isPaletteActive() {
+		return paletteActive;
+	}
+
+	public void setPaletteActive(boolean paletteActive) {
+		this.paletteActive = paletteActive;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		paletteActive = state.getBoolean("paletteActive");
+		interpolated = state.getBoolean("interpolated");
+		errorColor = state.getInt("errorColor");
+		filePath = state.getString("filePath");
+		name = state.getString("name");
+		
+		List<Double> range = state.getList("range");
+		if(range != null) {
+			this.range = new double[range.size()];
+			for (int i = 0; i < range.size(); i++) {
+				this.range[i] = range.get(i).doubleValue();
+			}
+		}
+		
+		List<String> nameClass = state.getList("nameClass");
+		if(nameClass != null) {
+			this.nameClass = new String[nameClass.size()];
+			nameClass.toArray(this.nameClass);
+		}
+		
+		List<ColorItem> colorItems = state.getList("colorItems");
+		if(colorItems != null) {
+			this.colorItems = new ArrayList<ColorItem>();
+			this.colorItems.addAll(colorItems);
+		}
+		
+		List<String> aux = state.getList("paletteByBand");
+		if(aux != null) {
+			this.paletteByBand = null;
+			for (int i = 0; i < aux.size(); i++) {
+				String[] values = aux.get(i).split("#");
+				if(paletteByBand == null) {
+					if(values.length == 3)
+						this.paletteByBand = new byte[aux.size()][3];
+					if(values.length == 4)
+						this.paletteByBand = new byte[aux.size()][4];
+				}
+				paletteByBand[i][0] = Byte.valueOf(values[0]).byteValue();
+				paletteByBand[i][1] = Byte.valueOf(values[1]).byteValue();
+				paletteByBand[i][2] = Byte.valueOf(values[2]).byteValue();
+				if(values.length == 4)
+					paletteByBand[i][3] = Byte.valueOf(values[3]).byteValue();
+			}
+		}
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("paletteActive", paletteActive);		
+		state.set("interpolated", interpolated);
+		state.set("errorColor", errorColor);	
+		state.set("filePath", filePath);	
+		state.set("name", name);	
+		state.set("range", range);	
+		state.set("nameClass", nameClass);	
+		state.set("colorItems", colorItems);
+		
+		ArrayList<String> list = new ArrayList<String>();
+		if(paletteByBand != null) {
+			String entry = null;
+			for (int i = 0; i < paletteByBand.length; i++) {
+				entry = paletteByBand[i][0] + "#" + paletteByBand[i][1] + "#" + paletteByBand[i][2];
+				if(paletteByBand[0].length > 3) {
+					entry += "#" + paletteByBand[i][3];
+				}
+				list.add(entry);
+			}
+			state.set("paletteByBand", list);
+		} else {
+			state.setNull("paletteByBand");
+		}
+	}	
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DataStoreColorTable.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			definition.addDynFieldBoolean("paletteActive").setMandatory(true);
+			definition.addDynFieldBoolean("interpolated").setMandatory(true);
+			definition.addDynFieldInt("errorColor").setMandatory(false);
+			definition.addDynFieldString("filePath").setMandatory(false);
+			definition.addDynFieldString("name").setMandatory(false);
+			definition.addDynFieldList("range").setClassOfItems(Double.class).setMandatory(false);
+			definition.addDynFieldList("nameClass").setClassOfItems(String.class).setMandatory(false);
+			definition.addDynFieldList("colorItems").setClassOfItems(ColorItem.class).setMandatory(false);
+			definition.addDynFieldList("paletteByBand").setClassOfItems(String.class).setMandatory(false);
+		}
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreColorTable.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteDataStoreStatistics.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteDataStoreStatistics.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteDataStoreStatistics.java	(revision 15423)
@@ -0,0 +1,204 @@
+/* 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.impl.store.properties;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.provider.RemoteRasterProvider;
+/**
+ * Statistics for a remote raster provider.
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RemoteDataStoreStatistics extends SimpleProviderStatistics {
+	
+	/**
+	 * Constructor. Asigna el fichero asociado.
+	 */
+	public RemoteDataStoreStatistics(RasterProvider prov) {
+		super(prov);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.impl.store.properties.SimpleProviderStatistics#calculate(double)
+	 */
+	public void calculate(double scale) throws FileNotOpenException, RasterDriverException, ProcessInterruptedException {
+		if (provider == null || !(provider instanceof RemoteRasterProvider))
+			return;
+		
+		RemoteRasterProvider prov = (RemoteRasterProvider)provider;
+		
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		percent = 0;
+		
+		bandCount = provider.getBandCount();
+		max = new double[bandCount];
+		min = new double[bandCount];
+		secondMax = new double[bandCount];
+		secondMin = new double[bandCount];
+		maxByteUnsigned = new double[bandCount];
+		minByteUnsigned = new double[bandCount];
+		secondMaxByteUnsigned = new double[bandCount];
+		secondMinByteUnsigned = new double[bandCount];
+		mean = new double[bandCount];
+		variance = new double[bandCount];
+
+		long[] iValues = new long[bandCount];
+		boolean[] initializedBand = new boolean[bandCount];
+		int[] type = new int[bandCount];
+		
+		double z = 0;
+		double rgb = 0;
+
+		for (int iBand = 0; iBand < bandCount; iBand++) {
+			max[iBand] = Double.NEGATIVE_INFINITY;
+			min[iBand] = Double.POSITIVE_INFINITY;
+			secondMax[iBand] = Double.NEGATIVE_INFINITY;
+			secondMin[iBand] = Double.POSITIVE_INFINITY;
+			maxByteUnsigned[iBand] = 0;
+			minByteUnsigned[iBand] = 255;
+			secondMaxByteUnsigned[iBand] = 0;
+			secondMinByteUnsigned[iBand] = 255;
+			initializedBand[iBand] = false;
+			type[iBand] = provider.getDataType()[iBand];
+		}
+
+		Buffer buf = prov.getBufferLastRequest();
+
+		if(buf == null)
+			return;
+
+		for (int iBand = 0; iBand < buf.getBandCount(); iBand++) {
+			for (int col = 0; col < buf.getWidth(); col++) {
+				for (int row = 0; row < buf.getHeight(); row++) {
+					z = (buf.getDataType() == Buffer.TYPE_BYTE) ? buf.getElemByte(row, col, iBand) :
+						(buf.getDataType() == Buffer.TYPE_SHORT) ? buf.getElemShort(row, col, iBand) :
+						(buf.getDataType() == Buffer.TYPE_DOUBLE) ? buf.getElemDouble(row, col, iBand) :
+						(buf.getDataType() == Buffer.TYPE_FLOAT) ? buf.getElemFloat(row, col, iBand) :
+						(buf.getDataType() == Buffer.TYPE_INT) ? buf.getElemInt(row, col, iBand) :
+						0;
+
+						if ((provider.getNoDataValue().isDefined()) && 
+							(z == provider.getNoDataValue().getValue().doubleValue()))
+							continue;
+
+						if (Double.isNaN(z))
+							continue;
+
+						rgb = 0;
+						if(buf.getDataType() == Buffer.TYPE_BYTE) {
+							rgb = ((byte) z) & 0xff;
+							mean[iBand] += rgb;
+							variance[iBand] += rgb * rgb;
+						} else {
+							//rgb = (b != null) ? ((byte) z) & 0xff : 0;
+							mean[iBand] += z;
+							variance[iBand] += z * z;
+						}
+						iValues[iBand]++;
+
+						if (!initializedBand[iBand]) {
+							secondMin[iBand] = min[iBand];
+							secondMax[iBand] = max[iBand];
+							min[iBand] = z;
+							max[iBand] = z;
+							secondMinByteUnsigned[iBand] = minByteUnsigned[iBand];
+							secondMaxByteUnsigned[iBand] = maxByteUnsigned[iBand];
+							minByteUnsigned[iBand] = rgb;
+							maxByteUnsigned[iBand] = rgb;
+							initializedBand[iBand] = true;
+							continue;
+						}
+
+						if (z < secondMin[iBand]) {
+							if (z < min[iBand]) {
+								secondMin[iBand] = min[iBand];
+								min[iBand] = z;
+							} else {
+								if (z > min[iBand])
+									secondMin[iBand] = z;
+							}
+						}
+
+						if (z > secondMax[iBand]) {
+							if (z > max[iBand]) {
+								secondMax[iBand] = max[iBand];
+								max[iBand] = z;
+							} else {
+								if (z < max[iBand])
+									secondMax[iBand] = z;
+							}
+						}
+
+						if (rgb < secondMinByteUnsigned[iBand]) {
+							if (rgb < minByteUnsigned[iBand]) {
+								secondMinByteUnsigned[iBand] = minByteUnsigned[iBand];
+								minByteUnsigned[iBand] = rgb;
+							} else {
+								if (rgb > minByteUnsigned[iBand])
+									secondMinByteUnsigned[iBand] = rgb;
+							}
+						}
+
+						if (rgb > secondMaxByteUnsigned[iBand]) {
+							if (rgb > maxByteUnsigned[iBand]) {
+								secondMaxByteUnsigned[iBand] = maxByteUnsigned[iBand];
+								maxByteUnsigned[iBand] = rgb;
+							} else {
+								if (rgb < maxByteUnsigned[iBand])
+									secondMaxByteUnsigned[iBand] = rgb;
+							}
+						}
+				}
+			}
+			if (task.getEvent() != null)
+				task.manageEvent(task.getEvent());
+			percent = ((bandCount * 100) / (int)buf.getBandCount());
+		}
+			
+		percent = 100;
+
+		for (int iBand = 0; iBand < bandCount; iBand++) {
+			if (iValues[iBand] > 0) {
+				mean[iBand] = mean[iBand] / (double) iValues[iBand];
+				variance[iBand] = variance[iBand] / (double) iValues[iBand] - mean[iBand] * mean[iBand];
+			}
+		}
+
+		calculated = true;
+		forceToRecalc = false;
+		try {
+			provider.saveObjectToRmf(Statistics.class, this);
+		} catch (RmfSerializerException e) {
+			// No salva a rmf
+		}
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/RemoteDataStoreStatistics.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/AbstractStatistics.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/AbstractStatistics.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/AbstractStatistics.java	(revision 15423)
@@ -0,0 +1,447 @@
+/* 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.impl.store.properties;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+
+import org.gvsig.fmap.dal.coverage.exception.GridException;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.tools.dynobject.DynStruct;
+/**
+ * Statistics for a raster.
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class AbstractStatistics implements Statistics {
+	/*
+	 * Esta a false si las estadisticas no son del fichero completo. Esto es posible porque podemos
+	 * tener unas estad�sticas calculadas a partir de una petici�n con subsampleo. Hay que tener en
+	 * cuenta que el raster puede ser muy grande y este calculo muy costoso.
+	 */
+	protected boolean         complete                = false;
+	protected double[]        max                     = null;
+	protected double[]        min                     = null;
+	protected double[]        secondMax               = null;
+	protected double[]        secondMin               = null;
+
+	protected double[]        maxByteUnsigned         = null;
+	protected double[]        minByteUnsigned         = null;
+	protected double[]        secondMaxByteUnsigned   = null;
+	protected double[]        secondMinByteUnsigned   = null;
+	
+	protected double[]        mean                    = null;
+	protected double[]        variance                = null;
+	protected long[]          nValues                 = null;
+
+	protected boolean         calculated              = false;
+	protected Hashtable<String, Object>     
+							  tailTrim                = null;
+	protected ArrayList<String>
+	                          tailTrimValues          = null;
+	protected int             bandCount               = 0;
+	
+	public AbstractStatistics() {
+		if(tailTrim == null)
+			tailTrim = new Hashtable<String, Object>();
+		if(tailTrimValues == null)
+			tailTrimValues = new ArrayList<String>();
+	}
+	
+	public static void registerPersistent(DynStruct definition) {
+		definition.addDynFieldList("tailTrimValues").setClassOfItems(String.class).setMandatory(false);
+		definition.addDynFieldBoolean("calculated").setMandatory(false);
+		definition.addDynFieldBoolean("complete").setMandatory(false);
+		definition.addDynFieldList("nValues").setClassOfItems(long.class).setMandatory(false);
+		definition.addDynFieldList("variance").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("mean").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("secondMinByteUnsigned").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("secondMaxByteUnsigned").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("minByteUnsigned").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("maxByteUnsigned").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("secondMin").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("secondMax").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("min").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("max").setClassOfItems(double.class).setMandatory(false);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#setNumberOfValues(long[])
+	 */
+	public void setNumberOfValues(long[] values) {
+		this.nValues = values;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getNumberOfValues()
+	 */
+	public long[] getNumberOfValues() {
+		return this.nValues;
+	}
+	
+	/**
+	 * Asigna el valor m�ximo del grid
+	 * @return Valor m�ximo
+	 */
+	public void setMax(double[] max) {
+		this.max = max;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�ximo
+	 * @return Valor del segundo m�ximo
+	 */
+	public void setSecondMax(double[] smax) {
+		this.secondMax = smax;
+	}
+	
+	/**
+	 * Asigna el valor m�ximo del grid
+	 * @return Valor m�ximo
+	 */
+	public void setMaxRGB(double[] max) {
+		this.maxByteUnsigned = max;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�ximo
+	 * @return Valor del segundo m�ximo
+	 */
+	public void setSecondMaxRGB(double[] smax) {
+		this.secondMaxByteUnsigned = smax;
+	}
+	
+	/**
+	 * Asigna el valor m�dio del grid
+	 * @return Valor medio
+	 */
+	public void setMean(double[] mean) {
+		this.mean = mean;
+	}
+
+	/**
+	 * Asigna el valor m�ximo del grid
+	 * @return Valor m�nimo
+	 */
+	public void setMin(double[] min) {
+		this.min = min;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�nimo
+	 * @return Valor del segundo m�nimo
+	 */
+	public void setSecondMin(double[] smin) {
+		this.secondMin = smin;
+	}
+	
+	/**
+	 * Asigna el valor m�ximo del grid
+	 * @return Valor m�nimo
+	 */
+	public void setMinRGB(double[] min) {
+		this.minByteUnsigned = min;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�nimo
+	 * @return Valor del segundo m�nimo
+	 */
+	public void setSecondMinRGB(double[] smin) {
+		this.secondMinByteUnsigned = smin;
+	}
+	
+	/**
+	 * Asigna la varianza
+	 * @return Varianza
+	 */
+	public void setVariance(double[] variance) {
+		this.variance = variance;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getMin()
+	 */
+	public double[] getMin() {
+		return min;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getMax()
+	 */
+	public double[] getMax() {
+		return max;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getSecondMax()
+	 */
+	public double[] getSecondMax() {
+		return secondMax;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getSecondMin()
+	 */
+	public double[] getSecondMin() {
+		return secondMin;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getMinRGB()
+	 */
+	public double[] getMinByteUnsigned() {
+		return minByteUnsigned;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getMaxRGB()
+	 */
+	public double[] getMaxByteUnsigned() {
+		return maxByteUnsigned;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getSecondMaxRGB()
+	 */
+	public double[] getSecondMaxByteUnsigned() {
+		return secondMaxByteUnsigned;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getSecondMinRGB()
+	 */
+	public double[] getSecondMinByteUnsigned() {
+		return secondMinByteUnsigned;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Statistics#getMaximun()
+	 */
+	public double getMaximun() {
+		double m = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < max.length; i++)
+			m = Math.max(m, max[i]);
+		return m;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Statistics#getMinimun()
+	 */
+	public double getMinimun() {
+		double m = Double.MAX_VALUE;
+		for (int i = 0; i < min.length; i++)
+			m = Math.min(m, min[i]);
+		return m;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Statistics#getMaximunByteUnsigned()
+	 */
+	public double getMaximunByteUnsigned() {
+		double m = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < maxByteUnsigned.length; i++)
+			m = Math.max(m, maxByteUnsigned[i]);
+		return m;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Statistics#getMinimunByteUnsigned()
+	 */
+	public double getMinimunByteUnsigned() {
+		double m = Double.MAX_VALUE;
+		for (int i = 0; i < minByteUnsigned.length; i++)
+			m = Math.min(m, minByteUnsigned[i]);
+		return m;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getMean()
+	 */
+	public double[] getMean() {
+		return mean;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getVariance()
+	 */
+	public double[] getVariance() {
+		return variance;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#isCalculated()
+	 */
+	public boolean isCalculated() {
+		return calculated;
+	}
+	
+	/**
+	 * Asigna el flag de estad�sticas calculadas.
+	 * @param calc
+	 */
+	public void setCalculated(boolean calc) {
+		calculated = calc;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#setTailTrimValue(double, java.lang.Object)
+	 */
+	public void setTailTrimValue(double percent, Object valueByBand){
+		tailTrim.put(percent + "", valueByBand);
+		for (int i = 0; i < tailTrimValues.size(); i++) {
+			if(tailTrimValues.get(i).equals(percent + "")) {
+				tailTrimValues.set(i, percent + "");
+				return;
+			}
+		}
+		tailTrimValues.add(percent + "");
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.hierarchy.IStatistics#getTailTrimValue(double)
+	 */
+	public Object getTailTrimValue(double percent){
+		return tailTrim.get(percent + "");
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.raster.shared.IStatistics#getTailTrimValue(int)
+	 */
+	public Object[] getTailTrimValue(int pos) {
+		return new Object[] { Double.valueOf(Double.parseDouble(tailTrimValues.get(pos) + "")), tailTrim.get(tailTrimValues.get(pos)) };
+	}
+	
+	/*
+	 *  (non-Javadoc)
+	 * @see org.gvsig.raster.shared.IStatistics#getTailTrimCount()
+	 */
+	public int getTailTrimCount() {
+		return tailTrimValues.size();
+	}
+
+	/**
+	 * Pone a cero el porcentaje de progreso del proceso de calculo de histograma
+	 */
+	public abstract void resetPercent();
+
+	/**
+	 * Obtiene el porcentaje de progreso del proceso de calculo de histograma
+	 * @return porcentaje de progreso
+	 */
+	public abstract int getPercent();
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getBandCount()
+	 */
+	public abstract int getBandCount();
+	
+	public abstract void setBandCount(int bandCount);
+	
+	 /**
+	  * Returns true if the advanced statistics are calculated and false if not
+	  * @return
+	  */
+	 public boolean isAdvancedStatisticsCalculated() {
+		 return false;
+	 }
+
+	 /*
+	  * (non-Javadoc)
+	  * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#calculateAdvanced()
+	  */
+	 public void calculateAdvanced() throws GridException {
+
+	 }
+
+	 /*
+	  * (non-Javadoc)
+	  * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getNumberOfCells()
+	  */
+	 public long[] getNumberOfCells() {
+		 return null;
+	 }
+
+	 /*
+	  * (non-Javadoc)
+	  * @see org.gvsig.fmap.dal.coverage.store.props.Statistics#getVarianceCovarianceMatrix()
+	  */
+	 public double[][] getVarianceCovarianceMatrix() {
+		 return null;
+	 }
+	 
+	 /*
+	  * (non-Javadoc)
+	  * @see java.lang.Object#clone()
+	  */
+	 public Statistics cloneStatistics(AbstractStatistics s) {
+		 s.setMax(getMax());
+		 s.setMin(getMin());
+		 s.setSecondMax(getSecondMax());
+		 s.setSecondMin(getSecondMin());
+		 s.setVariance(getVariance());
+		 s.setMean(getMean());
+		 s.setCalculated(calculated);
+		 s.tailTrim = tailTrim;
+		 s.tailTrimValues = tailTrimValues;
+		 return s;
+	 }
+	 
+	 /*
+	  * (non-Javadoc)
+	  * @see java.lang.Object#finalize()
+	  */
+	 protected void finalize() {
+		 max                     = null;
+		 min                     = null;
+		 secondMax               = null;
+		 secondMin               = null;
+		 maxByteUnsigned         = null;
+		 minByteUnsigned         = null;
+		 secondMaxByteUnsigned   = null;
+		 secondMinByteUnsigned   = null;
+		 mean                    = null;
+		 variance                = null;
+		 nValues                 = null;
+	 }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/AbstractStatistics.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderStatistics.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderStatistics.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderStatistics.java	(revision 15423)
@@ -0,0 +1,656 @@
+/* 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.impl.store.properties;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.gvsig.raster.impl.provider.RasterProvider;
+/**
+ * Statistics for a raster provider.
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SimpleProviderStatistics extends AbstractStatistics {
+	protected RasterProvider    provider                = null;
+	protected int               percent                 = 0;
+	protected boolean           forceToRecalc           = false;
+	
+	/**
+	 * Sets the provider to calculate statistics
+	 */
+	public SimpleProviderStatistics(RasterProvider prov) {
+		this.provider = prov;
+		if(provider != null)
+			bandCount = provider.getBandCount();
+	}
+	
+	/**
+	 * Constructor for persistence purposes
+	 */
+	public SimpleProviderStatistics() {
+
+	}
+	
+	/**
+	 * Gets the dataset 
+	 * @return
+	 */
+	public RasterProvider getDataProvider() {
+		return provider;
+	}
+	
+	/**
+	 * Sets the maximum value of the grid
+	 * @param Maximum value by band
+	 */
+	public void setMax(double[] max) {
+		this.max = max;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�ximo
+	 * @return Valor del segundo m�ximo
+	 */
+	public void setSecondMax(double[] smax) {
+		this.secondMax = smax;
+	}
+	
+	/**
+	 * Asigna el valor m�ximo del grid
+	 * @return Valor m�ximo
+	 */
+	public void setMaxRGB(double[] max) {
+		this.maxByteUnsigned = max;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�ximo
+	 * @return Valor del segundo m�ximo
+	 */
+	public void setSecondMaxRGB(double[] smax) {
+		this.secondMaxByteUnsigned = smax;
+	}
+	
+	/**
+	 * Asigna el valor m�dio del grid
+	 * @return Valor medio
+	 */
+	public void setMean(double[] mean) {
+		this.mean = mean;
+	}
+
+	/**
+	 * Asigna el valor m�ximo del grid
+	 * @return Valor m�nimo
+	 */
+	public void setMin(double[] min) {
+		this.min = min;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�nimo
+	 * @return Valor del segundo m�nimo
+	 */
+	public void setSecondMin(double[] smin) {
+		this.secondMin = smin;
+	}
+	
+	/**
+	 * Asigna el valor m�ximo del grid
+	 * @return Valor m�nimo
+	 */
+	public void setMinRGB(double[] min) {
+		this.minByteUnsigned = min;
+	}
+
+	/**
+	 * Asigna el valor del segundo m�nimo
+	 * @return Valor del segundo m�nimo
+	 */
+	public void setSecondMinRGB(double[] smin) {
+		this.secondMinByteUnsigned = smin;
+	}
+	
+	/**
+	 * Asigna la varianza
+	 * @return Varianza
+	 */
+	public void setVariance(double[] variance) {
+		this.variance = variance;
+	}
+	
+	public double[] getMin() {
+		return min;
+	}
+	
+	public double[] getMax() {
+		return max;
+	}
+	
+	public double[] getSecondMax() {
+		return secondMax;
+	}
+	
+	public double[] getSecondMin() {
+		return secondMin;
+	}
+	
+	public double[] getMinByteUnsigned() {
+		return minByteUnsigned;
+	}
+	
+	public double[] getMaxByteUnsigned() {
+		return maxByteUnsigned;
+	}
+	
+	public double[] getSecondMaxByteUnsigned() {
+		return secondMaxByteUnsigned;
+	}
+	
+	public double[] getSecondMinByteUnsigned() {
+		return secondMinByteUnsigned;
+	}
+	
+	public double getMaximun() {
+		double m = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < max.length; i++)
+			m = Math.max(m, max[i]);
+		return m;
+	}
+	
+	public double getMinimun() {
+		double m = Double.MAX_VALUE;
+		for (int i = 0; i < min.length; i++)
+			m = Math.min(m, min[i]);
+		return m;
+	}
+
+	public double getMaximunByteUnsigned() {
+		double m = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < maxByteUnsigned.length; i++)
+			m = Math.max(m, maxByteUnsigned[i]);
+		return m;
+	}
+
+	public double getMinimunByteUnsigned() {
+		double m = Double.MAX_VALUE;
+		for (int i = 0; i < minByteUnsigned.length; i++)
+			m = Math.min(m, minByteUnsigned[i]);
+		return m;
+	}
+
+	public double[] getMean() {
+		return mean;
+	}
+
+	public double[] getVariance() {
+		return variance;
+	}
+	
+	public int getBandCount() {
+		return this.bandCount;
+	}
+	
+	/**
+	 * Asigna el n�mero de bandas
+	 * @param bandCount
+	 */
+	public void setBandCount(int bandCount) {
+		this.bandCount = bandCount;
+	}
+	
+	public void calculate(double scale) throws FileNotOpenException, RasterDriverException, ProcessInterruptedException {
+		if (provider == null)
+			return;
+		
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		percent = 0;
+		provider.selectSubdataset();
+		
+		// Si no se fuerza su calculo, intentamos ver si estan calculadas y sino
+		// las intentamos cargar del RMF
+		if (!forceToRecalc) {
+			if (!isCalculated()) {
+				try {
+					provider.loadObjectFromRmf(SimpleProviderStatistics.class, this);
+				} catch (RmfSerializerException e) {
+					// Si no se puede cargar del RMF, recalcularemos las estadisticas.
+				}
+			}
+			if (isCalculated())
+				return;
+		}
+
+		bandCount = provider.getBandCount();
+		max = new double[bandCount];
+		min = new double[bandCount];
+		secondMax = new double[bandCount];
+		secondMin = new double[bandCount];
+		maxByteUnsigned = new double[bandCount];
+		minByteUnsigned = new double[bandCount];
+		secondMaxByteUnsigned = new double[bandCount];
+		secondMinByteUnsigned = new double[bandCount];
+		mean = new double[bandCount];
+		variance = new double[bandCount];
+
+		int blockHeight = RasterLibrary.blockHeight;
+		nValues = new long[bandCount];
+		boolean[] initializedBand = new boolean[bandCount];
+		int[] type = new int[bandCount];
+		byte[][][] b = null;
+		short[][][] s = null;
+		int[][][] i = null;
+		float[][][] f = null;
+		double[][][] d = null;
+		double z = 0;
+		double rgb = 0;
+
+		for (int iBand = 0; iBand < bandCount; iBand++) {
+			max[iBand] = Double.NEGATIVE_INFINITY;
+			min[iBand] = Double.POSITIVE_INFINITY;
+			secondMax[iBand] = Double.NEGATIVE_INFINITY;
+			secondMin[iBand] = Double.POSITIVE_INFINITY;
+			maxByteUnsigned[iBand] = 0;
+			minByteUnsigned[iBand] = 255;
+			secondMaxByteUnsigned[iBand] = 0;
+			secondMinByteUnsigned[iBand] = 255;
+			initializedBand[iBand] = false;
+			type[iBand] = provider.getDataType()[iBand];
+		}
+		
+		Buffer refToBuffer = null;
+
+		for (int height = 0; height < provider.getHeight(); height += blockHeight) {
+			Object buf = null;
+			try {
+				buf = provider.readBlock(height, blockHeight, scale);
+				if(buf == null)
+					return;
+				if(buf instanceof Buffer) {
+					refToBuffer = (Buffer)buf; //Guardamos la referencia para hacer un dispose al acabar
+					buf = getDataFromBuffer(type, (Buffer)buf);
+				}
+
+				switch (type[0]) {
+				case Buffer.TYPE_BYTE:	  b = (byte[][][]) buf; break;
+				case Buffer.TYPE_SHORT:  s = (short[][][]) buf; break;
+				case Buffer.TYPE_FLOAT:  f = (float[][][]) buf; break;
+				case Buffer.TYPE_DOUBLE: d = (double[][][]) buf; break;
+				case Buffer.TYPE_INT:    i = (int[][][]) buf; break;
+				}
+
+			} catch (InvalidSetViewException e) {
+				// La vista se asigna autom�ticamente
+				return;
+			}
+
+			int h = (int)(blockHeight * scale);
+			int datasetWidth = (int)(provider.getWidth() * scale);
+			int datasetHeight = (int)(provider.getHeight() * scale);
+			int scaledHeight = (int) (height * scale);
+			
+			if ((scaledHeight + h) > datasetHeight)
+				h = datasetHeight - scaledHeight;
+			
+			for (int iBand = 0; iBand < bandCount; iBand++) {
+				for (int col = 0; col < datasetWidth; col++) {
+					for (int row = 0; row < h; row++) {
+						z = (b != null) ? b[iBand][row][col] :
+								(s != null) ? s[iBand][row][col] :
+								(d != null) ? d[iBand][row][col] :
+								(f != null) ? f[iBand][row][col] :
+								(i != null) ? i[iBand][row][col] :
+								0;
+								
+						if ((provider.getNoDataValue().isDefined()) && 
+							(z == provider.getNoDataValue().getValue().doubleValue()))
+							continue;
+
+						if (Double.isNaN(z) || Double.isInfinite(z))
+							continue;
+
+						rgb = 0;
+						if(b != null) {
+							rgb = ((byte) z) & 0xff;
+							mean[iBand] += rgb;
+							variance[iBand] += rgb * rgb;
+						} else {
+							//rgb = (b != null) ? ((byte) z) & 0xff : 0;
+							mean[iBand] += z;
+							variance[iBand] += z * z;
+						}
+						nValues[iBand]++;
+
+						if (!initializedBand[iBand]) {
+							secondMin[iBand] = min[iBand];
+							secondMax[iBand] = max[iBand];
+							min[iBand] = z;
+							max[iBand] = z;
+							secondMinByteUnsigned[iBand] = minByteUnsigned[iBand];
+							secondMaxByteUnsigned[iBand] = maxByteUnsigned[iBand];
+							minByteUnsigned[iBand] = rgb;
+							maxByteUnsigned[iBand] = rgb;
+							initializedBand[iBand] = true;
+							continue;
+						}
+
+						if (z < secondMin[iBand]) {
+							if (z < min[iBand]) {
+								secondMin[iBand] = min[iBand];
+								min[iBand] = z;
+							} else {
+								if (z > min[iBand])
+									secondMin[iBand] = z;
+							}
+						}
+
+						if (z > secondMax[iBand]) {
+							if (z > max[iBand]) {
+								secondMax[iBand] = max[iBand];
+								max[iBand] = z;
+							} else {
+								if (z < max[iBand])
+									secondMax[iBand] = z;
+							}
+						}
+
+						if (rgb < secondMinByteUnsigned[iBand]) {
+							if (rgb < minByteUnsigned[iBand]) {
+								secondMinByteUnsigned[iBand] = minByteUnsigned[iBand];
+								minByteUnsigned[iBand] = rgb;
+							} else {
+								if (rgb > minByteUnsigned[iBand])
+									secondMinByteUnsigned[iBand] = rgb;
+							}
+						}
+
+						if (rgb > secondMaxByteUnsigned[iBand]) {
+							if (rgb > maxByteUnsigned[iBand]) {
+								secondMaxByteUnsigned[iBand] = maxByteUnsigned[iBand];
+								maxByteUnsigned[iBand] = rgb;
+							} else {
+								if (rgb < maxByteUnsigned[iBand])
+									secondMaxByteUnsigned[iBand] = rgb;
+							}
+						}
+					}
+				}
+				if (task.getEvent() != null)
+					task.manageEvent(task.getEvent());
+			}
+			percent = ((height * 100) / datasetHeight);
+			
+			if(refToBuffer != null && refToBuffer instanceof Buffer)
+				((Buffer)refToBuffer).dispose();
+			buf = null;
+		}
+		percent = 100;
+
+		for (int iBand = 0; iBand < bandCount; iBand++) {
+			if (nValues[iBand] > 0) {
+				mean[iBand] = mean[iBand] / (double) nValues[iBand];
+				variance[iBand] = variance[iBand] / (double) nValues[iBand] - mean[iBand] * mean[iBand];
+			}
+		}
+
+		calculated = true;
+		forceToRecalc = false;
+		try {
+			provider.saveObjectToRmf(Statistics.class, this);
+		} catch (RmfSerializerException e) {
+			// No salva a rmf
+		}
+	}
+	
+	/**
+	 * Gets an array of data from a buffer 
+	 * @param type
+	 * @param buf
+	 * @return
+	 */
+	private Object getDataFromBuffer(int[] type, Buffer buf) {
+		byte[][][] b = null;
+		short[][][] s = null;
+		int[][][] i = null;
+		float[][][] f = null;
+		double[][][] d = null;
+		switch (type[0]) {
+		case Buffer.TYPE_BYTE:
+			b = new byte[((Buffer)buf).getBandCount()][((Buffer)buf).getHeight()][0];
+			for (int j = 0; j < ((Buffer)buf).getHeight(); j++) { 
+				 byte[][] line = ((Buffer)buf).getLineByte(j);
+				 for (int k = 0; k < line.length; k++) {
+					b[k][j] = line[k];
+				 }
+			}
+			return b;
+		case Buffer.TYPE_SHORT:
+			s = new short[((Buffer)buf).getBandCount()][((Buffer)buf).getHeight()][0];
+			for (int j = 0; j < ((Buffer)buf).getHeight(); j++) { 
+				 short[][] line = ((Buffer)buf).getLineShort(j);
+				 for (int k = 0; k < line.length; k++) {
+					s[k][j] = line[k];
+				 }
+			}
+			return s;
+		case Buffer.TYPE_FLOAT:
+			f = new float[((Buffer)buf).getBandCount()][((Buffer)buf).getHeight()][0];
+			for (int j = 0; j < ((Buffer)buf).getHeight(); j++) { 
+				 float[][] line = ((Buffer)buf).getLineFloat(j);
+				 for (int k = 0; k < line.length; k++) {
+					f[k][j] = line[k];
+				 }
+			}
+			return f;
+		case Buffer.TYPE_DOUBLE:
+			d = new double[((Buffer)buf).getBandCount()][((Buffer)buf).getHeight()][0];
+			for (int j = 0; j < ((Buffer)buf).getHeight(); j++) { 
+				 double[][] line = ((Buffer)buf).getLineDouble(j);
+				 for (int k = 0; k < line.length; k++) {
+					d[k][j] = line[k];
+				 }
+			}
+			return d;
+		case Buffer.TYPE_INT:
+			i = new int[((Buffer)buf).getBandCount()][((Buffer)buf).getHeight()][0];
+			for (int j = 0; j < ((Buffer)buf).getHeight(); j++) { 
+				 int[][] line = ((Buffer)buf).getLineInt(j);
+				 for (int k = 0; k < line.length; k++) {
+					i[k][j] = line[k];
+				 }
+			}
+			return i;
+		}
+		return null;
+	}
+	
+	public boolean isCalculated() {
+		return calculated;
+	}
+	
+	/**
+	 * Sets the flag that report whether statistics are calculated
+	 * @param calc
+	 */
+	public void setCalculated(boolean calc) {
+		calculated = calc;
+	}
+	
+	public void setTailTrimValue(double percent, Object valueByBand){
+		tailTrim.put(percent + "", valueByBand);
+		for (int i = 0; i < tailTrimValues.size(); i++) {
+			if(tailTrimValues.get(i).equals(percent + "")) {
+				tailTrimValues.set(i, percent + "");
+				return;
+			}
+		}
+		tailTrimValues.add(percent + "");
+	}
+	
+	public Object getTailTrimValue(double percent){
+		return tailTrim.get(percent + "");
+	}
+	
+	public Object[] getTailTrimValue(int pos) {
+		return new Object[] { Double.valueOf(Double.parseDouble(tailTrimValues.get(pos) + "")), tailTrim.get(tailTrimValues.get(pos)) };
+	}
+	
+	public int getTailTrimCount() {
+		return tailTrimValues.size();
+	}
+
+	/**
+	 * Resets the percentaje of progress
+	 */
+	public void resetPercent() {
+		percent = 0;
+	}
+
+	/**
+	 * Gets the percentaje of progress calculating the histogram
+	 * @return porcentaje de progreso
+	 */
+	public int getPercent() {
+		return percent;
+	}
+
+	/**
+	 * This call force the next statistics request are not read from the RMF file.
+	 * After this call the statistics will be calculated completely
+	 * @param forceToRecalc
+	 */
+	public void forceToRecalc() {
+		this.forceToRecalc = true;
+	}
+	
+	/**
+	 * Joins the this statistic object with the parameter and
+	 * returns a new Statistics object.
+	 * @param stats
+	 * @return
+	 */
+	public static Statistics union(RasterProvider prov, List<RasterProvider> list) {
+		SimpleProviderStatistics s = new SimpleProviderStatistics(prov);
+		boolean isCalculated = true;
+		
+		for (int i = 0; i < list.size(); i++) {
+			Statistics newStat = list.get(i).getStatistics();
+			
+			if(newStat.isCalculated() == false)
+				isCalculated = false;
+			
+			double[] max = s.getMax();
+			if(max != null) {
+				for (int j = 0; j < max.length; j++) {
+					max[j] = Math.max(max[j], newStat.getMax()[j]);
+				}
+			}
+
+			double[] min = s.getMin();
+			if(min != null) {
+				for (int j = 0; j < min.length; j++) {
+					min[j] = Math.min(min[j], newStat.getMin()[j]);
+				}
+			}
+
+			double[] smax = s.getSecondMax();
+			if(smax != null) {
+				for (int j = 0; j < smax.length; j++) {
+					smax[j] = Math.max(smax[j], newStat.getSecondMax()[j]);
+				}
+			}
+
+			double[] smin = s.getSecondMin();
+			if(smin != null) {
+				for (int j = 0; j < smin.length; j++) {
+					smin[j] = Math.min(smin[j], newStat.getSecondMin()[j]);
+				}
+			}
+			
+			double[] maxbu = s.getMaxByteUnsigned();
+			if(maxbu != null) {
+				for (int j = 0; j < maxbu.length; j++) {
+					maxbu[j] = Math.max(maxbu[j], newStat.getMaxByteUnsigned()[j]);
+				}
+			}
+
+			double[] minbu = s.getMinByteUnsigned();
+			if(minbu != null) {
+				for (int j = 0; j < minbu.length; j++) {
+					minbu[j] = Math.min(minbu[j], newStat.getMinByteUnsigned()[j]);
+				}
+			}
+
+			double[] smaxbu = s.getSecondMaxByteUnsigned();
+			if(smaxbu != null) {
+				for (int j = 0; j < smaxbu.length; j++) {
+					smaxbu[j] = Math.max(smaxbu[j], newStat.getSecondMaxByteUnsigned()[j]);
+				}
+			}
+
+			double[] sminbu = s.getSecondMinByteUnsigned();
+			if(sminbu != null) {
+				for (int j = 0; j < sminbu.length; j++) {
+					sminbu[j] = Math.min(sminbu[j], newStat.getSecondMinByteUnsigned()[j]);
+				}
+			}
+			
+			double[] mean = s.getMean();
+			if(mean != null) {
+				for (int j = 0; j < mean.length; j++) {
+					mean[j] = (mean[j] + newStat.getMean()[j]) / 2;
+				}
+			}
+			
+			double[] var = s.getVariance();
+			long[] values = s.getNumberOfValues();
+			if(var != null) {
+				for (int j = 0; j < var.length; j++) {
+					var[j] = (var[j] + newStat.getVariance()[j]) / (values[j] + newStat.getNumberOfValues()[j]) - mean[j] * mean[j];
+				}
+			}
+		}
+		s.setCalculated(isCalculated);
+		try {
+			prov.saveObjectToRmf(Statistics.class, s);
+		} catch (RmfSerializerException e) {
+			// No salva a rmf
+		}
+		return s;
+	}
+	
+	public Statistics cloneStatistics() {
+		SimpleProviderStatistics s = new SimpleProviderStatistics(provider);
+		return super.cloneStatistics(s);
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderStatistics.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreTransparency.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreTransparency.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreTransparency.java	(revision 15423)
@@ -0,0 +1,514 @@
+/* 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.impl.store.properties;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.fmap.dal.coverage.util.PropertyEvent;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.Persistent;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+/**
+ * <p>
+ * Esta clase contiene informaci�n de transparencia de un objeto. Los objetos
+ * pueden ser dataset, grid u otros. Cuando un usuario quiere a�adir nueva
+ * informaci�n de transparencia crea un objeto de este tipo que debe ser
+ * mezclado (merge) con otros objetos de este tipo que existan para la misma
+ * fuente de datos.
+ * </p>
+ * <p>
+ * Un multirasterdatset obtiene los distintos objetos transparency de todos los
+ * ficheros que los componen. Para realizar un solo objeto transparency se har�
+ * un merge de todos ellos.
+ * </p>
+ * <p>
+ * Finalmente y antes de renderizar se necesita un objeto Transparency. Este
+ * estar� compuesto con toda la informaci�n de transparencia aplicar, es decir,
+ * todos los objetos Transparency mezclados.Transparency con tiene el
+ * m�todo de procesado de un pixel. Se le proporciona un pixel y devuelve este
+ * mismo pixel con la transparencia aplicada.
+ * </p>
+ * <p>
+ * Una transparencia que se aplica a un buffer puede tener cuatro procedencias distintas:
+ * <UL>
+ * <LI>Mascara: Un buffer de NxN aplicado sobre la zona a renderizar como una m�scara de
+ * transparencia. Las bandas alpha de las imagenes se comportan de esta forma.</LI>
+ * <LI>Opacidad global: Un valor de opacidad se aplicado a cada pixel a renderizar. Este es
+ * igual para todos los p�xeles.</LI>
+ * <LI>Rangos: Una lista de rangos de valores RGB. Cada pixel cuyo valor est� dentro de alguno
+ * de los rangos se aplica como transparente.</LI>
+ * <LI>Dato: Todos los valores del buffer que coincidan con ese dato son puestos como transparente.
+ * Para que esto sea posible tenemos que disponer del buffer de datos originales sin ning�n proceso.</LI>
+ * </UL>
+ * </p>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DataStoreTransparency implements Transparency, Persistent {
+	public static int     MAX_OPACITY           = 255;
+
+	/**
+	 * Alpha source
+	 */
+	protected ColorInterpretation
+	                      colorInterpretation   = null;
+	/**
+	 * Buffer con los datos originales (sin filtrar) correspondiente a la zona a renderizar.
+	 * Esto es util para aplicar el valor NoData ya que hay que consultar el valor original del
+	 * dato. Despu�s de hacer un process es recomendable hacer free para poner a null los buffers.
+	 */
+	protected Buffer     originalData           = null;
+	/**
+	 * Valor de dato transparente. Todos los p�xeles de originalData que correspondan con este
+	 * valor se pondr�n 100% transparentes.
+	 */
+	protected NoData     noData                 = null;
+
+	/**
+	 * Rangos de transparencia aplicados. Lista de TransparencyRange
+	 */
+	protected List<TransparencyRange>   
+	                      transparencyRanges    = new ArrayList<TransparencyRange>();
+	/**
+	 * Grado de opacidad de todo el raster
+	 */
+	protected int         opacity               = 0xff;
+
+	/**
+	 * Array de listeners que ser�n informados cuando cambia la propiedad de transparencia
+	 */
+	private List<PropertyListener>     
+	                      transparencyPropertyListener = new ArrayList<PropertyListener>();
+	/**
+	 * Flag de activaci�n de la transparencia cuando se visualiza o exporta.
+	 */
+	private boolean       transparencyActive    = false;
+
+	public DataStoreTransparency() {}
+	
+	/**
+	 * Constructor
+	 */
+	public DataStoreTransparency(ColorInterpretation colorInterpretation) {
+		this.colorInterpretation = colorInterpretation;
+	}
+	
+	public static void mergeBuffers(Buffer src1, Buffer src2) {
+		for (int y = 0; y < src1.getHeight(); y++)
+			for (int x = 0; x < src1.getWidth(); x++)
+				// ((a / 255) * (b / 255)) * 255
+				// Es lo mismo que:
+				// (a * b) / 255
+				src1.setElem(y, x, 0,
+						(byte) (((src1.getElemByte(y, x, 0) & 0xff) * (src2.getElemByte(y, x, 0) & 0xff)) / 255D));
+	}
+
+	public void addPropertyListener(PropertyListener listener) {
+		transparencyPropertyListener.add(listener);
+	}
+
+	/**
+	 * M�todo llamado cuando hay un cambio en una propiedad de transparencia
+	 */
+	private void callPropertyChanged(Object obj) {
+		for (int i = 0; i < transparencyPropertyListener.size(); i++) {
+			PropertyEvent ev = new PropertyEvent(this, "transparency", null, null);
+			((PropertyListener)transparencyPropertyListener.get(i)).actionValueChanged(ev);
+		}
+	}
+
+	public boolean existAlphaBand() {
+		return getAlphaBandNumber() >= 0;
+	}
+
+	/**
+	 * Obtiene el �rea de datos
+	 * @return M�scara de transparencia
+	 */
+	public Buffer getDataBuffer() {
+		return originalData;
+	}
+
+	public void setDataBuffer(Buffer b) {
+		originalData = b;
+	}
+
+	/**
+	 * Obtiene el valor noData
+	 * @return
+	 */
+	public NoData getNoData() {
+		return noData;
+	}
+
+	public void setNoData(NoData noData) {
+		if(this.noData != noData)
+			callPropertyChanged(this);
+		this.noData = noData;
+	}
+
+	/**
+	 * Obtiene los rangos de pixels que son transparentes en el raster.
+	 * @return Rangos de transparencias a aplicar
+	 */
+	public List<TransparencyRange> getTransparencyRange() {
+		return transparencyRanges;
+	}
+
+	public void setTransparencyRange(TransparencyRange range) {
+		this.transparencyRanges.add(range);
+		callPropertyChanged(this);
+	}
+
+	/**
+	 * Asigna la lista de rangos de transparencia
+	 * @param ranges
+	 */
+	public void setTransparencyRangeList(List<TransparencyRange> ranges) {
+		this.transparencyRanges = ranges;
+		callPropertyChanged(this);
+	}
+
+	public void clearListOfTransparencyRange() {
+		transparencyRanges.clear();
+		callPropertyChanged(this);
+	}
+
+	/**
+	 * Obtiene el grado de opacidad de todo el raster
+	 * @return valor del grado de opacidad.
+	 */
+	public int getOpacity() {
+		return opacity;
+	}
+
+	public void setOpacity(int opacity) {
+		if(opacity != this.opacity)
+			callPropertyChanged(this);
+		this.opacity = opacity;
+	}
+
+	/**
+	 * Asigna la transparencia a partir de un objeto con los metadatos del raster.
+	 * @param metadata
+	 */
+	public void setTransparencyByPixelFromMetadata(DataStoreMetadata metadata){
+		if (metadata != null) {
+			TransparencyRange[] noData = metadata.parserNodataInMetadata();
+			if (noData != null)
+				for (int i = 0; i < noData.length; i++)
+					getTransparencyRange().add(noData[i]);
+			TransparencyRange noDataValue = metadata.parserNodataByBand();
+			if (noData == null && noDataValue != null)
+				getTransparencyRange().add(noDataValue);
+		}
+	}
+
+	/**
+	 * Obtiene la banda de transpareci si existe o -1 si no existe.
+	 * @return n�mero de banda de transparencia o -1 si no existe.
+	 */
+	public int getAlphaBandNumber() {
+		return colorInterpretation.getAlphaBand();
+	}
+
+	/**
+	 * Asigna la informaci�n de si existe o no banda de transparencia cuando este
+	 * objeto va asociado a un dataset. Si tiene este tipo de banda en cada
+	 * dibujado se cargar� la informaci�n de m�scara de transparencia en el la
+	 * variable mask.
+	 * @param true si existe banda de transparencia y false si no lo es.
+	 */
+	public void setTransparencyBand(int alphaBandNumber) {
+		colorInterpretation.setColorInterpValue(alphaBandNumber, ColorInterpretation.ALPHA_BAND);
+	}
+
+	/**
+	 * Consulta si el valor de la posici�n (line, col) del buffer es considerado
+	 * NoData o no.
+	 * @param line Linea del buffer
+	 * @param col Columna del buffer
+	 * @return
+	 */
+	protected boolean isNoData(int line, int col) {
+		if(noData == null)
+			return false;
+		
+		if(noData.isDefined()) {
+			for (int iBand = 0; iBand < originalData.getBandCount(); iBand++) {
+				switch (originalData.getDataType()) {
+				case Buffer.TYPE_BYTE:
+					if(originalData.getElemByte(line, col, iBand) == noData.getValue().byteValue())
+						return true;
+					break;
+				case Buffer.TYPE_SHORT:
+					if(originalData.getElemShort(line, col, iBand) == noData.getValue().shortValue())
+						return true;
+					break;
+				case Buffer.TYPE_INT:
+					if(originalData.getElemInt(line, col, iBand) == noData.getValue().intValue())
+						return true;
+					break;
+				case Buffer.TYPE_FLOAT:
+					float f = originalData.getElemFloat(line, col, iBand);
+					if((f == noData.getValue().floatValue()) || Float.isNaN(f))
+						return true;
+					break;
+				case Buffer.TYPE_DOUBLE:
+					double d = originalData.getElemDouble(line, col, iBand);
+					if((d == noData.getValue().doubleValue()) || Double.isNaN(d))
+						return true;
+					break;
+				}
+			}
+		}
+		
+		return false;
+	}
+
+	public void activeTransparency() {
+		if(	existAlphaBand() || 
+			(getNoData() != null && getNoData().isDefined() && getNoData().isNoDataTransparent()) ||
+			(transparencyRanges.size() > 0) ||
+			(opacity != 0xff))
+			transparencyActive = true;
+		else
+			transparencyActive = false;
+	}
+	
+	public boolean isTransparencyActive() {
+		return transparencyActive;
+	}
+	
+	/**
+	 * Asigna el flag de transparencia activa o desactivada.
+	 * @param transparencyActive true activa la transparencia false la desactiva
+	 */
+	public void setTransparencyActive(boolean transparencyActive) {
+		this.transparencyActive = transparencyActive;
+	}
+	
+	public int processRGB(int r, int g, int b, int line, int col, Buffer buf) {
+		// Si el valor es noData se pone totalmente transparente y ya no se tiene en
+		// cuenta nada m�s.
+		if (originalData != null && (getNoData().isDefined() && getNoData().isNoDataTransparent())) {
+			if (isNoData(line, col))
+				// El alpha no se pone para dejarlo a 0, totalmente transparente
+				return (r << 16 | g << 8 | b);
+		}
+
+		/**
+		 * Para sacar el valor del nuevo alpha, lo que hacemos es convertir a
+		 * porcentajes todos los alphas posibles (en porcentajes) y multiplicarlos
+		 * entre si. Con esto conseguimos un nuevo porcentaje de alpha entre 0 y 1.
+		 * Una vez hecho esto se multiplica por 255 para tenerlo dentro del rango
+		 * deseado. Como queremos evitar operaciones de m�s, podemos quitar una
+		 * division de 255 y as� nos ahorramos luego multiplicarlo por 255 otra vez.
+		 */
+
+		// Quitada la division para optimizar
+		//double a = opacity / 255D;
+		double a = opacity;
+
+		int alphaRange = processRange(r, g, b);
+		if (alphaRange != 255)
+			a *= (alphaRange / 255D);
+
+		if (existAlphaBand() && buf != null)
+			a *= (buf.getElemByte(line, col, getAlphaBandNumber()) & 0xff) / 255D;
+
+		// Quitada la multiplicacion para optimizar
+		// a = (int)(a * 255D);
+
+		return ((int) a << 24) | r << 16 | g << 8 | b;
+	}
+	
+	/**
+	 * Aplica la transparecia por rangos al pixel pasado por par�metro. El valor
+	 * en la posici�n cero es el alpha por lo tanto ser� esta posici�n la que se
+	 * modificar�.
+	 * @param r
+	 * @param g
+	 * @param b
+	 * @return Un valor de 0 a 255. Donde 255 es totalmente opaco
+	 */
+	private int processRange(int r, int g, int b) {
+		for (int i = 0; i < transparencyRanges.size(); i++) {
+			TransparencyRange tr = ((TransparencyRange) transparencyRanges.get(i));
+			if (tr == null) continue;
+			if (tr.isAnd()) {
+				if (tr.getRed() == null ||
+						tr.getGreen() == null ||
+						tr.getBlue() == null ||
+						r < tr.getRed()[0]   || r > tr.getRed()[1] ||
+						g < tr.getGreen()[0] || g > tr.getGreen()[1] ||
+						b < tr.getBlue()[0]  || b > tr.getBlue()[1])
+					continue;
+
+				return tr.getAlpha();
+			} else {
+				if (tr.getRed() != null) {
+					if (r >= tr.getRed()[0] && r <= tr.getRed()[1]) {
+						return tr.getAlpha();
+					}
+				}
+				if (tr.getGreen() != null) {
+					if (g >= tr.getGreen()[0] && g <= tr.getGreen()[1]) {
+						return tr.getAlpha();
+					}
+				}
+				if (tr.getBlue() != null) {
+					if (b >= tr.getBlue()[0] && b <= tr.getBlue()[1]) {
+						return tr.getAlpha();
+					}
+				}
+			}
+		}
+		return 255;
+	}
+	
+	public void setColorInterpretation(ColorInterpretation colorInterpretation) {
+		this.colorInterpretation = colorInterpretation;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public Transparency cloneTransparency() {
+		DataStoreTransparency t = new DataStoreTransparency(this.colorInterpretation.cloneColorInterpretation());
+		
+		//TODO: FUNCIONALIDAD: Falta asignar lo necesario para la transparencia por selecci�n
+		t.transparencyRanges = (ArrayList<TransparencyRange>)((ArrayList<TransparencyRange>) getTransparencyRange()).clone();
+		//t.mask = getAlphaBand();
+		t.opacity = getOpacity();
+		t.noData = getNoData();
+		t.originalData = originalData;
+		t.transparencyActive = transparencyActive;
+		t.activeTransparency();
+		return t;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+	throws PersistenceException {		
+		this.colorInterpretation = (ColorInterpretation)state.get("colorinterpretation");
+		
+		if (state.hasValue("opacity")) {
+			opacity = state.getInt("opacity");
+		}
+		
+		List<TransparencyRange> tr = state.getList("transparencyRange");
+		if(tr != null) {
+			transparencyRanges = new ArrayList<TransparencyRange>(tr);	
+			if (state.hasValue("bandnumber")) {
+				int alphaBandNumber = state.getInt("bandnumber");
+				setTransparencyBand(alphaBandNumber);
+			}
+		}
+
+		this.transparencyActive = state.getBoolean("transparencyActive");
+		//this.noData = (NoData)state.get("noData");
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("colorinterpretation", colorInterpretation);
+		if(getOpacity() != 255) {
+			state.set("opacity", getOpacity());
+		}	
+
+		//Rangos de transparencia		
+		state.set("transparencyRange", transparencyRanges);
+
+		if(getAlphaBandNumber() != -1) {
+			state.set("bandnumber", getAlphaBandNumber());
+		}
+		
+		state.set("transparencyActive", transparencyActive);
+		//state.set("noData", noData);
+	}
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("Transparency_Persistent");
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DataStoreTransparency.class,
+					"Transparency_Persistent",
+					"Transparency Persistent definition (FIXME)",
+					null, 
+					null
+					);
+
+			definition.addDynFieldInt("opacity")
+			.setMandatory(false);
+
+			definition.addDynFieldInt("bandnumber")
+			.setMandatory(false);
+
+			definition.addDynFieldList("transparencyRange")
+			.setClassOfItems(TransparencyRange.class)
+			.setMandatory(false);
+
+			definition.addDynFieldBoolean("transparencyActive")
+			.setMandatory(false);
+
+			definition.addDynFieldObject("colorinterpretation")
+			.setClassOfValue(ColorInterpretation.class)
+			.setMandatory(false);
+
+			/*definition.addDynFieldDouble("noData")
+		.setMandatory(false);*/
+		}
+	}
+
+	public void dispose() {
+		if (originalData != null)
+			originalData.dispose();
+		originalData = null;
+	}
+	
+	public ColorInterpretation getColorInterpretation() {
+		return colorInterpretation;
+	}
+	
+	protected void finalize() throws Throwable {
+		noData           = null;
+		if(transparencyPropertyListener != null) {
+			transparencyPropertyListener.clear();
+			transparencyPropertyListener = null;
+		}
+		if(transparencyRanges != null) {
+			transparencyRanges.clear();
+			transparencyRanges = null;
+		}
+		super.finalize();
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/DataStoreTransparency.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderStatistics.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderStatistics.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderStatistics.java	(revision 15423)
@@ -0,0 +1,250 @@
+/* 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.impl.store.properties;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.raster.impl.provider.RasterProvider;
+
+
+/**
+ * Estadisticas asociadas a un fichero raster formado por multiples ficheros.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MultiProviderStatistics extends AbstractStatistics {
+	protected Statistics[]                 statList      = null;
+	protected int                          nBands        = 0;
+	protected boolean                      forceToRecalc = false;
+	protected RasterProvider               provider      = null;
+
+	/**
+	 * Constructor
+	 */
+	public MultiProviderStatistics() {
+	}
+	
+	/**
+	 * Constructor
+	 */
+	public MultiProviderStatistics(List<RasterProvider> providerList, RasterProvider provider) {
+		this(providerList);
+		this.provider = provider;
+	}
+	
+	/**
+	 * Constructor
+	 */
+	@SuppressWarnings("unused")
+	private MultiProviderStatistics(RasterProvider[] providerList) {
+		statList = new Statistics[providerList.length];
+		
+		for(int i = 0; i < providerList.length; i ++) {
+			statList[i] = providerList[i].getStatistics();
+			this.nBands += providerList[i].getBandCount();
+		}
+	}
+
+	/**
+	 * Constructor
+	 */
+	private MultiProviderStatistics(List<RasterProvider> providerList) {
+		statList = new Statistics[providerList.size()];
+		for(int i = 0; i < providerList.size(); i ++) {
+			if(providerList.get(i) != null) {
+				statList[i] = providerList.get(i).getStatistics();
+				this.nBands += providerList.get(i).getBandCount();
+			}
+		}
+	}
+
+	/**
+	 * Constructor
+	 */
+	@SuppressWarnings("unused")
+	private MultiProviderStatistics(Statistics[] statList, int nBands) {
+		this.nBands = nBands;
+		this.statList = statList;
+		for(int nDataset = 0; nDataset < statList.length; nDataset ++) {
+			try {
+				statList[nDataset].calculate(RasterLibrary.statisticsScale);
+			} catch (FileNotOpenException e) {
+			} catch (RasterDriverException e) {
+			} catch (ProcessInterruptedException e) {
+			}
+		}
+		constructStats(nBands);
+	}
+
+	/**
+	 * Adds a new data store to the statistics list
+	 * @param provider
+	 */
+	public void addProvider(RasterProvider provider) {
+		Statistics[] statListAux = new Statistics[statList.length + 1];
+		for(int i = 0; i < statList.length; i ++) {
+			statListAux[i] = statList[i];
+		}
+		statListAux[statList.length] = provider.getStatistics();
+		statList = statListAux;
+	}
+
+	/**
+	 * Calcula las estadisticas recorriendo todo el fichero.
+	 */
+	public void calculate(double scale)throws FileNotOpenException, RasterDriverException, ProcessInterruptedException {
+		if (!forceToRecalc) {
+			if (!isCalculated()) {
+				try {
+					provider.loadObjectFromRmf(SimpleProviderStatistics.class, this);
+				} catch (RmfSerializerException e) {
+					// Si no se puede cargar del RMF, recalcularemos las estadisticas.
+				}
+			}
+			if (isCalculated())
+				return;
+		}
+		
+		for(int nDataset = 0; nDataset < statList.length; nDataset ++) {
+			if(forceToRecalc)
+				statList[nDataset].forceToRecalc();
+			statList[nDataset].calculate(scale);
+		}
+
+		try {
+			constructStats(nBands);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			throw new RasterDriverException("Error en el acceso al array de m�ximos y m�nimos");
+		}
+
+		calculated = true;
+		forceToRecalc = false;
+		try {
+			provider.saveObjectToRmf(Statistics.class, this);
+		} catch (RmfSerializerException e) {
+			// No salva a rmf
+		}
+		
+	}
+	
+	public void resetPercent() {
+		for (int i = 0; i < statList.length; i++) {
+			statList[i].resetPercent();
+		}
+	}
+
+	public int getPercent() {
+		int sum = 0;
+		for (int i = 0; i < statList.length; i++) {
+			sum += statList[i].getPercent();
+		}
+		return sum / statList.length;
+	}
+
+	public void forceToRecalc() {
+		this.forceToRecalc = true;
+	}
+
+	/**
+	 * Construye todos los datos del DatasetStadistics actual a partir de toda la
+	 * lista de DatasetStatistics que tiene este objeto.
+	 *
+	 * @param len
+	 * @throws ArrayIndexOutOfBoundsException
+	 */
+	private void constructStats(int len) throws ArrayIndexOutOfBoundsException {
+		max = new double[len];
+		min = new double[len];
+		secondMax = new double[len];
+		secondMin = new double[len];
+		maxByteUnsigned = new double[len];
+		minByteUnsigned = new double[len];
+		secondMaxByteUnsigned = new double[len];
+		secondMinByteUnsigned = new double[len];
+		mean = new double[len];
+		variance = new double[len];
+		nValues = new long[len];
+
+		int count = 0;
+		for(int i = 0; i < statList.length; i ++) {
+			if(statList[i].getMax() == null)
+				return;
+			for(int j = 0; j < statList[i].getMax().length; j ++) {
+				max[count] = statList[i].getMax()[j];
+				min[count] = statList[i].getMin()[j];
+				secondMax[count] = statList[i].getSecondMax()[j];
+				secondMin[count] = statList[i].getSecondMin()[j];
+				maxByteUnsigned[count] = statList[i].getMaxByteUnsigned()[j];
+				minByteUnsigned[count] = statList[i].getMinByteUnsigned()[j];
+				secondMaxByteUnsigned[count] = statList[i].getSecondMaxByteUnsigned()[j];
+				secondMinByteUnsigned[count] = statList[i].getSecondMinByteUnsigned()[j];
+				mean[count] = statList[i].getMean()[j];
+				variance[count] = statList[i].getVariance()[j];
+				nValues[count] = statList[i].getNumberOfValues()[j];
+				count ++;
+			}
+		}
+	}
+
+	/**
+	 * Obtiene el flag que informa de si las estad�sticas est�n calculadas o no.
+	 * @return true indica que est�n calculadas y false que no lo est�n
+	 */
+	public boolean isCalculated() {
+		return calculated;
+	}
+
+	public int getBandCount() {
+		if(bandCount <= 0) {
+			for(int i = 0; i < statList.length; i ++)
+				bandCount += statList[i].getBandCount();
+		}
+		return bandCount;
+	}
+	
+	public void setBandCount(int bandCount) {
+		this.bandCount = bandCount;
+	}
+	
+	
+	/**
+	 * Returns the number of providers.
+	 * @return
+	 */
+	public int getNumberOfProviders() {
+		return statList != null ? statList.length :0;
+	}
+
+	public Statistics cloneStatistics() {
+		MultiProviderStatistics s = new MultiProviderStatistics();
+		s.statList = statList;
+		s.nBands = nBands;
+		return super.cloneStatistics(s);
+	}
+
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderStatistics.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderHistogramComputer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderHistogramComputer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderHistogramComputer.java	(revision 15423)
@@ -0,0 +1,334 @@
+/* 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.impl.store.properties;
+
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.InvalidSetViewException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Clase para la gesti�n de histogramas de un raster. Es la encargada del calculo de un histograma
+ * total o parcial de un raster a partir de los datos de disco. Adem�s tambi�n es la encargada de gestionar
+ * salvar este histograma a .rmf. En caso de que solicite un histograma del raster completo este ir�
+ * a buscarlo al fichero rmf asociado antes de calcularlo por si ya existise. Al realizar el calculo
+ * del histograma de la imagen completa este ser� salvado en el fichero .rmf asociado al raster.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SimpleProviderHistogramComputer implements HistogramComputer {
+	private static final Logger     logger    = LoggerFactory.getLogger(SimpleProviderHistogramComputer.class);
+	/**
+	 * Histograma de la imagen completa
+	 */
+	protected BufferHistogramImpl   histogram = null;
+	/**
+	 * Dataset del cual se calcula el histograma
+	 */
+	private RasterProvider          provider  = null;
+	private int                     percent   = 0;
+	private boolean                 refresh   = false;
+	private double                  scale     = 1;
+	
+	/**
+	 * Constructor
+	 * @param dataset
+	 */
+	public SimpleProviderHistogramComputer(RasterProvider provider) {
+		this.provider = provider;
+	}
+	
+	public void setScaleHistogram(double scale) {
+		this.scale = scale;
+	}
+
+	/**
+	 * Obtiene el minimo valor de las estadisticas de un histograma.
+	 * @return double
+	 */
+	public double getMinimum() {
+		return provider.getStatistics().getMinimun();
+	}
+
+	/**
+	 * Obtiene el maximo valor de las estadisticas de un histograma.
+	 * @return double
+	 */
+	public double getMaximum() {
+		return provider.getStatistics().getMaximun();
+	}
+	/**
+	 * Obtiene el histograma. Si puede conseguirlo del fichero rmf ir� all� a 
+	 * buscarlo sino lo calcular�.
+	 * @return histograma 
+	 */
+	public BufferHistogram getBufferHistogram() throws HistogramException, ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		if (provider != null) {
+			if(histogram == null || refresh) {
+				try {
+					provider.getStatistics().calculate(1);
+				} catch (FileNotOpenException e) {
+					throw new HistogramException("");
+				} catch (RasterDriverException e) {
+					throw new HistogramException("");
+				}
+
+				try {
+					histogram = (BufferHistogramImpl) provider.loadObjectFromRmf(BufferHistogram.class, histogram);
+					if (histogram != null)
+						return histogram;
+				} catch (RmfSerializerException e) {
+					//No carga desde rmf. No afecta a la funcionalidad
+				}
+
+				if(task.getEvent() != null)
+					task.manageEvent(task.getEvent());
+
+				histogram = new BufferHistogramImpl(provider.getBandCount(), 
+						provider.getStatistics().getMin(), 
+						provider.getStatistics().getMax(), 
+						provider.getDataType()[0]);
+
+				try {
+					histogram = (BufferHistogramImpl)getHistogramByDataType();
+				} catch (FileNotOpenException e) {
+					throw new HistogramException("", e);
+				} catch (RasterDriverException e) {
+					throw new HistogramException("", e);
+				} catch (Exception e) {
+					logger.info("Error calculando el histograma", e);
+				}
+
+				try {
+					provider.saveObjectToRmf(BufferHistogram.class, histogram);
+				} catch (RmfSerializerException e) {
+					//No salva a rmf. No afecta a la funcionalidad
+				}
+			}
+			return histogram;
+
+		}
+		return null;
+	}
+	
+	/**
+	 * Gets an array of data from a buffer 
+	 * @param type
+	 * @param buf
+	 * @return
+	 */
+	private void loadHistogramFromBuffer(Buffer buf) {
+		switch (buf.getDataType()) {
+		case Buffer.TYPE_BYTE:
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++)
+				for (int col = 0; col < buf.getWidth(); col++)
+					for (int row = 0; row < buf.getHeight(); row++)
+						histogram.incrementPxValue(iBand, (double) buf.getElemByte(row, col, iBand));
+			break;
+		case Buffer.TYPE_SHORT:
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++)
+				for (int col = 0; col < buf.getWidth(); col++)
+					for (int row = 0; row < buf.getHeight(); row++)
+						histogram.incrementPxValue(iBand, (double) buf.getElemShort(row, col, iBand));
+			break;
+		case Buffer.TYPE_FLOAT:
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++)
+				for (int col = 0; col < buf.getWidth(); col++)
+					for (int row = 0; row < buf.getHeight(); row++)
+						histogram.incrementPxValue(iBand, (double) buf.getElemFloat(row, col, iBand));
+			break;
+		case Buffer.TYPE_DOUBLE:
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++)
+				for (int col = 0; col < buf.getWidth(); col++)
+					for (int row = 0; row < buf.getHeight(); row++)
+						histogram.incrementPxValue(iBand, (double) buf.getElemDouble(row, col, iBand));
+			break;
+		case Buffer.TYPE_INT:
+			for (int iBand = 0; iBand < buf.getBandCount(); iBand++)
+				for (int col = 0; col < buf.getWidth(); col++)
+					for (int row = 0; row < buf.getHeight(); row++)
+						histogram.incrementPxValue(iBand, (double) buf.getElemInt(row, col, iBand));
+			break;
+		}
+	}
+
+	/**
+	 * Obtiene el histograma teniendo en cuenta la lista de clases
+	 * @return Histograma correspondiente a la lista de clases
+	 */
+	private BufferHistogram getHistogramByDataType() 
+		throws InvalidSetViewException, FileNotOpenException, RasterDriverException, ProcessInterruptedException {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		percent = 0;
+		int type = provider.getDataType()[0];
+		int h = RasterLibrary.blockHeight;
+
+		if(provider.getNoDataValue().isDefined())
+			histogram.setNoDataValue(provider.getNoDataValue());
+		for (int block = 0; block < provider.getHeight(); block += h) {
+			Object buf = null;
+			try {
+				buf = provider.readBlock(block, h, scale);
+			} catch (InvalidSetViewException e) {
+				// La vista se asigna autom�ticamente
+			}
+
+			int hB = h;
+			if ((block + hB) > provider.getHeight())
+				hB = Math.abs(((int)provider.getHeight()) - block);
+			
+			hB *= scale;
+
+			if(buf instanceof Buffer) {
+				loadHistogramFromBuffer((Buffer)buf);
+			} else {
+				switch (type) {
+				case Buffer.TYPE_BYTE:
+					byte[][][] bBlock = (byte[][][]) buf;
+					for (int iBand = 0; iBand < provider.getBandCount(); iBand++)
+						for (int col = 0; col < bBlock[iBand][0].length; col++)
+							for (int row = 0; row < hB; row++)
+								histogram.incrementPxValue(iBand, (double) bBlock[iBand][row][col]);
+					break;
+				case Buffer.TYPE_SHORT:
+					short[][][] sBlock = (short[][][]) buf;
+					for (int iBand = 0; iBand < provider.getBandCount(); iBand++)
+						for (int col = 0; col < sBlock[iBand][0].length; col++)
+							for (int row = 0; row < hB; row++)
+								histogram.incrementPxValue(iBand, (double) sBlock[iBand][row][col]);
+					break;
+				case Buffer.TYPE_INT:
+					int[][][] iBlock = (int[][][]) buf;
+					for (int iBand = 0; iBand < provider.getBandCount(); iBand++)
+						for (int col = 0; col < iBlock[iBand][0].length; col++)
+							for (int row = 0; row < hB; row++)
+								histogram.incrementPxValue(iBand, (double) iBlock[iBand][row][col]);
+					break;
+				case Buffer.TYPE_FLOAT:
+					float[][][] fBlock = (float[][][]) buf;
+					for (int iBand = 0; iBand < provider.getBandCount(); iBand++)
+						for (int col = 0; col < fBlock[iBand][0].length; col++)
+							for (int row = 0; row < hB; row++)
+								histogram.incrementPxValue(iBand, (double) (fBlock[iBand][row][col]));
+					break;
+				case Buffer.TYPE_DOUBLE:
+					double[][][] dBlock = (double[][][]) buf;
+					for (int iBand = 0; iBand < provider.getBandCount(); iBand++)
+						for (int col = 0; col < dBlock[iBand][0].length; col++)
+							for (int row = 0; row < hB; row++)
+								histogram.incrementPxValue(iBand, (double) (dBlock[iBand][row][col]));
+					break;
+				}
+			}
+			if (task.getEvent() != null)
+				task.manageEvent(task.getEvent());
+			percent += ((h * 100) / provider.getHeight());
+		}
+		percent = 100;
+		return histogram;
+	}
+
+	/**
+	 * Pone a cero el porcentaje de progreso del proceso de calculo de histograma
+	 */
+	public void resetPercent() {
+		percent = 0;
+	}
+
+	/**
+	 * Obtiene el porcentaje de progreso del proceso de calculo de histograma
+	 * @return porcentaje de progreso
+	 */
+	public int getPercent() {
+		return percent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.HistogramComputer#refreshHistogram()
+	 */
+	public void refreshHistogram() {
+		refresh = true;
+	}
+	
+	protected void setBufferHistogram(BufferHistogram bh) {
+		if(bh instanceof BufferHistogramImpl)
+			this.histogram = (BufferHistogramImpl)bh;
+	}
+	
+	/**
+	 * Joins the this histogram object with the parameter and
+	 * returns a new Histogram object.
+	 * @param stats
+	 * @return
+	 * @throws InterruptedException 
+	 * @throws HistogramException 
+	 */
+	public static HistogramComputer union(RasterProvider prov, List<RasterProvider> list) throws HistogramException, InterruptedException {
+		SimpleProviderHistogramComputer newHistogramComputer = new SimpleProviderHistogramComputer(prov);
+		for (int i = 0; i < list.size(); i++) {
+			HistogramComputer hc = list.get(0).getHistogramComputer();
+			try {
+				BufferHistogram bh = hc.getBufferHistogram();
+				if(newHistogramComputer.histogram == null) {
+					newHistogramComputer.setBufferHistogram(bh);
+				} else {
+					newHistogramComputer.histogram.union(bh);
+				}
+			} catch (ProcessInterruptedException e) {
+				throw new InterruptedException();
+			}
+		}
+		return newHistogramComputer;
+	}
+
+	public String getLog() {
+		return null;
+	}
+
+	public boolean isCancelable() {
+		return true;
+	}
+
+	public boolean isPausable() {
+		return false;
+	}
+
+	public void setPercent(int value) {
+		
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/SimpleProviderHistogramComputer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiDataStoreMetadata.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiDataStoreMetadata.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiDataStoreMetadata.java	(revision 15423)
@@ -0,0 +1,159 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.store.properties;
+
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+
+/**
+ * Class to store metadata in a RasterDataset
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MultiDataStoreMetadata extends ArrayList<Metadata> implements Metadata {
+	private static final long serialVersionUID = 1L;
+	private int[]             nBand            = null;
+	
+	public MultiDataStoreMetadata(int[] bands) {
+		this.nBand = bands;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Metadata#initNoDataByBand(int)
+	 */
+	public void initNoDataByBand(int values) {
+		if(size() != nBand.length)
+			return;
+		
+		for (int i = 0; i < size(); i++) 
+			get(i).initNoDataByBand(nBand[i]);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Metadata#setNoDataValue(int, double)
+	 */
+	public void setNoDataValue(int band, double value){
+		if(size() != nBand.length)
+			return;
+		int acc = 0;
+		int bandParcial = band;
+		for (int i = 0; i < size(); i++) {
+			acc += nBand[i];
+			if(band < acc) {
+				get(i).setNoDataValue(bandParcial, value);
+				return;
+			}
+			bandParcial -= nBand[i];
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Metadata#getNoDataValue(int)
+	 */
+	public double getNoDataValue(int band) {
+		if(size() != nBand.length)
+			return 0;
+		int acc = 0;
+		int bandParcial = band;
+		for (int i = 0; i < size(); i++) {
+			acc += nBand[i];
+			if(band < acc) 
+				return get(i).getNoDataValue(bandParcial);
+			bandParcial -= nBand[i];
+		}
+		return 0;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Metadata#getNoDataValue()
+	 */
+	public double[] getNoDataValue() {
+		if(size() != nBand.length)
+			return null;
+		
+		int bandCount = 0;
+		for (int i = 0; i < size(); i++)
+			bandCount += nBand[i];
+		
+		int cont = 0;
+		double[] res = new double[bandCount];
+		for (int i = 0; i < size(); i++) {
+			double[] p = get(i).getNoDataValue();
+			for (int j = 0; j < p.length; j++) {
+				res[cont] = p[j];
+				cont ++;
+			}
+		}
+		return res;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Metadata#getMetadataString()
+	 */
+	public String[] getMetadataString() {
+		if(size() != nBand.length)
+			return null;
+		
+		int bandCount = 0;
+		for (int i = 0; i < size(); i++)
+			bandCount += nBand[i];
+		
+		int cont = 0;
+		String[] res = new String[bandCount];
+		for (int i = 0; i < size(); i++) {
+			String[] p = get(i).getMetadataString();
+			for (int j = 0; j < p.length; j++) {
+				res[cont] = p[j];
+				cont ++;
+			}
+		}
+		return res;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Metadata#isNoDataEnabled()
+	 */
+	public boolean isNoDataEnabled() {
+		if(size() != nBand.length)
+			return true;
+		return get(0).isNoDataEnabled();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Metadata#setNoDataEnabled(boolean)
+	 */
+	public void setNoDataEnabled(boolean noDataEnabled) {
+		if(size() != nBand.length)
+			return;
+		
+		for (int i = 0; i < size(); i++) 
+			get(i).setNoDataEnabled(noDataEnabled);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiDataStoreMetadata.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderHistogramComputer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderHistogramComputer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderHistogramComputer.java	(revision 15423)
@@ -0,0 +1,198 @@
+/* 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.impl.store.properties;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.exception.FileNotOpenException;
+import org.gvsig.fmap.dal.coverage.exception.HistogramException;
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Histogramable;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.provider.RasterProvider;
+
+
+/**
+ * Clase para la gesti�n de histogramas de un raster formado por una lista de ficheros.
+ * Para devolver un histograma pedir� el histograma a todos los ficheros que
+ * componen el multifichero.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MultiProviderHistogramComputer implements HistogramComputer {
+	private BufferHistogram             histogram   = null;
+	private RasterProvider              provider    = null;
+	private boolean                     refresh     = false;
+	private int                         percent     = 0;
+	private int                         files       = 0;
+	private double                      scale       = 1;
+	
+	/**
+	 * Constructor
+	 * @param dataset
+	 */
+	public MultiProviderHistogramComputer(RasterProvider provider) {
+		this.provider = provider;
+		files = provider.getInternalProviderCount();
+	}
+	
+	public void setScaleHistogram(double scale) {
+		this.scale = scale;
+	}
+	
+	/**
+	 * Obtiene el histograma. Pregunta a todos los datasets que forman el multidataset
+	 * por su histograma y luego los fusiona.
+	 * @return histograma 
+	 * @throws HistogramException 
+	 */
+	public BufferHistogram getBufferHistogram()
+	throws ProcessInterruptedException, HistogramException {
+		if (provider != null) {
+			if(histogram == null || refresh) {
+				//Obtenemos los histogramas de cada dataset
+				BufferHistogram[] hList = new BufferHistogram[provider.getInternalProviderCount()];
+
+				for (int i = 0; i < hList.length; i++) {
+					RasterProvider internalProvider = provider.getInternalProvider(i);
+					hList[i] = ((Histogramable)internalProvider).getHistogramComputer().getBufferHistogram();
+					
+					if (hList[i] == null) 
+						return null;
+				}
+
+				if (hList[0].getNumBands() == 0)
+					return null;
+
+				try {
+					provider.getStatistics().calculate(scale);
+				} catch (FileNotOpenException e) {
+					throw new HistogramException("");
+				} catch (RasterDriverException e) {
+					throw new HistogramException("");
+				}
+
+				histogram = new BufferHistogramImpl(provider.getBandCount(), 
+						provider.getStatistics().getMin(), 
+						provider.getStatistics().getMax(), 
+						provider.getDataType()[0]);
+				
+				/*for (int i = 0; i < hList.length; i++) {
+					histogram.addTable(hList[i].getTable());
+				}*/
+
+				int band = 0;
+				for (int iDataset = 0; iDataset < hList.length; iDataset++) {
+					for (int iBand = 0; iBand < hList[iDataset].getNumBands(); iBand++) {
+						for (int iPxValue = 0; iPxValue < hList[iDataset].getBandLenght(iBand); iPxValue ++) {
+							histogram.setHistogramValueByPos(band, iPxValue, (long) hList[iDataset].getHistogramValueByPos(iBand, iPxValue));
+						}
+						band ++;
+					}	
+				}
+			}
+		}
+		return histogram;
+	}
+
+	/**
+	 * Pone a cero el porcentaje de progreso del proceso de calculo de histograma
+	 */
+	public void resetPercent() {
+		for (int i = 0; i < provider.getInternalProviderCount(); i++) {
+			((Histogramable)provider.getInternalProvider(i)).getHistogramComputer().resetPercent();
+		}
+	}
+
+	/**
+	 * Obtiene el porcentaje de proceso en la construcci�n del histograma,
+	 * @return porcentaje de progreso
+	 */
+	public int getPercent() {
+		int partial = 0;
+		for (int i = 0; i < provider.getInternalProviderCount(); i++)
+			partial += ((Histogramable)provider.getInternalProvider(i)).getHistogramComputer().getPercent();
+		percent += (int)(partial / provider.getInternalProviderCount());
+		return percent;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Histogram#getMaximum()
+	 */
+	public double getMaximum() {
+		double max = 0;
+		for (int i = 0; i < provider.getInternalProviderCount(); i++) {
+			double m = provider.getInternalProvider(i).getHistogramComputer().getMaximum();
+			if(m > max)
+				max = m;
+		}
+		return max;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.dataset.Histogram#getMinimum()
+	 */
+	public double getMinimum() {
+		double min = Double.POSITIVE_INFINITY;
+		for (int i = 0; i < provider.getInternalProviderCount(); i++) {
+			double m = provider.getInternalProvider(i).getHistogramComputer().getMinimum();
+			if(m < min)
+				min = m;
+		}
+		return min;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.store.props.HistogramComputer#refreshHistogram()
+	 */
+	public void refreshHistogram() {
+		refresh = true;
+	}
+	
+	/**
+	 * Returns the number of providers.
+	 * @return
+	 */
+	public int getNumberOfProviders() {
+		return files;
+	}
+
+	public String getLog() {
+		return null;
+	}
+
+	public boolean isCancelable() {
+		return true;
+	}
+
+	public boolean isPausable() {
+		return false;
+	}
+
+	public void setPercent(int value) {
+		
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/properties/MultiProviderHistogramComputer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java	(revision 15423)
@@ -0,0 +1,1128 @@
+package org.gvsig.raster.impl.store;
+
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.io.File;
+import java.net.URI;
+import java.util.ArrayList;
+import java.util.Collection;
+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.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataServerExplorer;
+import org.gvsig.fmap.dal.DataServerExplorerParameters;
+import org.gvsig.fmap.dal.DataStoreParameters;
+import org.gvsig.fmap.dal.DataStoreProviderFactory;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.datastruct.BandList;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPointList;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.BandAccessException;
+import org.gvsig.fmap.dal.coverage.exception.CloneException;
+import org.gvsig.fmap.dal.coverage.exception.ConnectException;
+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.OperationNotSupportedException;
+import org.gvsig.fmap.dal.coverage.exception.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.exception.TimeException;
+import org.gvsig.fmap.dal.coverage.grid.render.Render;
+import org.gvsig.fmap.dal.coverage.store.RasterDataServerExplorer;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.parameter.MultiDimensionalStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.RemoteStoreParameters;
+import org.gvsig.fmap.dal.coverage.store.parameter.TileDataParameters;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.fmap.dal.coverage.store.props.HistogramComputer;
+import org.gvsig.fmap.dal.coverage.store.props.Metadata;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.store.props.TimeSeries;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+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.raster.spi.CoverageStoreProvider;
+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.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.raster.cache.tile.Tile;
+import org.gvsig.raster.cache.tile.exception.TileGettingException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.buffer.SpiRasterQuery;
+import org.gvsig.raster.impl.datastruct.BandListImpl;
+import org.gvsig.raster.impl.grid.render.DefaultRender;
+import org.gvsig.raster.impl.grid.roi.VectorialROIsReader;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.raster.impl.provider.RasterProvider;
+import org.gvsig.raster.impl.provider.TiledRasterProvider;
+import org.gvsig.raster.impl.store.properties.MultiDataStoreMetadata;
+import org.gvsig.raster.roi.ROI;
+import org.gvsig.raster.roi.ROIReader;
+import org.gvsig.timesupport.Interval;
+import org.gvsig.timesupport.Time;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynObject;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Default data store for raster
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultRasterStore extends AbstractRasterDataStore {
+	public static final String              PERSISTENT_NAME        = "DefaultRasterStore_Persistent";
+    public static final String              PERSISTENT_DESCRIPTION = "DefaultRasterStore Persistent";
+    private static final Logger             logger                 = LoggerFactory.getLogger(DefaultRasterStore.class);
+
+	/*
+	 * TODO: Refactoring de ROIS
+	 * Una capa r�ster deber�a poder tener ROIs de tipo r�ster y de tipo vectorial asociados. Adem�s
+	 * debe poder tener una lista de estos por lo que ser�a necesario un interfaz en la que se pueda
+	 * seleccionar la capa de ROIs a utilizar.
+	 *
+	 * Por otro lado, las ROIs deben ser del proveedor de datos. Este con tendr� una lista de estos.
+	 * Las ROIs deber�an modelarse como proveedores de datos de tipo r�ster o de tipo vectorial, ya que
+	 * tener una lista de geometr�as en memoria como hasta ahora puede ser muy poco eficiente en caso
+	 * de que la lista de ROIs sea muy grande. Adem�s deber�a optimizarse el acceso isInside para que las
+	 * operaciones con ROIs asociados sean lo m�s r�pidas posible.
+	 */
+	private List<ROI>                        rois                           = null;
+
+	/**
+	 * Constructor
+	 */
+	public DefaultRasterStore() {
+		super();
+	}
+
+	public void reload() {
+		provider.reload();
+	}
+
+	/**
+	 * @param provider
+	 */
+	public void setProvider(RasterProvider provider) {
+		this.provider = provider;
+		parameters = (DataStoreParameters)provider.getDataParameters();
+		initializeBandList();
+	}
+
+	public void setParameters(DataStoreParameters p) {
+		this.parameters = p;
+	}
+
+	public void setProvider(CoverageStoreProvider prov) {
+		if(prov instanceof RasterProvider)
+			setProvider((RasterProvider)prov);
+	}
+
+	public String getName() {
+		if(provider != null)
+			return provider.getName();
+		return null;
+	}
+
+	public boolean needEnhanced() {
+		if(provider != null)
+			return provider.needEnhanced();
+		return false;
+	}
+
+	public boolean isTiled() {
+		return provider.isTiled();
+	}
+
+	public boolean isMosaic() {
+		return provider.isMosaic();
+	}
+
+	public Tile getTile(SpiRasterQuery q) throws TileGettingException {
+		TiledRasterProvider tiledProv = ((TiledRasterProvider)provider);
+		return tiledProv.getTile(q);
+	}
+
+	//******************************
+	//Setters and Getters
+	//******************************
+
+	/**
+	 * Calcula el tama�o de los ficheros en disco
+	 * @return tama�o en bytes de todos los ficheros de la lista
+	 */
+	public long getFileSize() {
+		if(provider != null) {
+			long size = 0;
+			long[] fSize = provider.getFileSizeByProvider();
+			if(fSize != null && fSize.length > 0) {
+				for (int j = 0; j < fSize.length; j++) {
+					size += fSize[j];
+				}
+			}
+			return size;
+		}
+		return 0;
+	}
+
+	public double getHeight() {
+		return provider.getHeight();
+	}
+
+	public double getWidth() {
+		return provider.getWidth();
+	}
+
+	public double getCellSize() {
+		try {
+			Extent e = getExtent();
+			double dCellsize = (e.getMax().getX() - e.getMin().getX() ) / getWidth();
+			return dCellsize;
+		} catch (NullPointerException e) {
+			return 1;
+		}
+	}
+
+	public int getBandCount() {
+		return provider.getBandCount();
+	}
+
+	public int[] getDataType() {
+		return provider.getDataType();
+	}
+
+	public BandList getBands() {
+		return storeBandList;
+	}
+
+	/**
+	 * Obtiene la coordenada X m�nima de toda la lista
+	 * @return Coordenada X m�nima
+	 */
+	public double getMinX() {
+		return provider.getExtent().getMin().getX();
+	}
+
+	/**
+	 * Obtiene la coordenada Y m�nima de toda la lista
+	 * @return Coordenada Y m�nima
+	 */
+	public double getMinY() {
+		return provider.getExtent().getMin().getY();
+	}
+
+	/**
+	 * Obtiene la coordenada Y m�xima de toda la lista
+	 * @return Coordenada Y m�xima
+	 */
+	public double getMaxX() {
+		return provider.getExtent().getMax().getX();	}
+
+	/**
+	 * Obtiene la coordenada Y m�xima de toda la lista
+	 * @return Coordenada Y m�xima
+	 */
+	public double getMaxY() {
+		return provider.getExtent().getMax().getY();
+	}
+
+	public NoData getNoDataValue() {
+		if(provider != null)
+			return provider.getNoDataValue();
+		return null;
+	}
+
+	public void setNoDataValue(NoData value) {
+		provider.setNoDataValue(value);
+	}
+
+	public Extent getExtent() {
+		return provider.getExtent();
+	}
+
+	/**
+	 * Este es el extent sobre el que se ajusta una petici�n para que esta no exceda el
+	 * extent m�ximo del raster. Para un raster sin rotar ser� igual al extent
+	 * pero para un raster rotado ser� igual al extent del raster como si no
+	 * tuviera rotaci�n. Esto ha de ser as� ya que la rotaci�n solo se hace sobre la
+	 * vista y las peticiones han de hacerse en coordenadas de la imagen sin shearing
+	 * aplicado.
+	 * @return Extent
+	 */
+	public Extent getExtentForRequest() {
+		return provider.getExtentWithoutRot();
+	}
+
+	/**
+	 * @return the extent
+	 */
+	public Extent getLastSelectedView(){
+		return provider.getView();
+	}
+
+	public ColorTable getColorTable(int i){
+		return provider.getColorTable();
+	}
+
+	/**
+	 * Obtiene la lista de paletas correspondiente a todos los ficheros que forman el GeoMultiRasterFile
+	 * @return Paleta asociada a este o null si no tiene. Una posici�n null en el array tambi�n indica que
+	 * para ese fichero no hay paletas asociadas.
+	 */
+	public ColorTable getColorTables() {
+		return provider.getColorTable();
+	}
+
+	public ColorTable getColorTable() {
+		//Solo tiene sentido si tiene un fichero y ese fichero tiene una sola banda
+		if(provider != null)
+			return provider.getColorTable();
+		return null;
+	}
+
+	/**
+	 * Sets the color table
+	 * @param colorTable
+	 */
+	public void setColorTable(ColorTable colorTable) {
+		provider.setColorTable(colorTable);
+	}
+
+	public ColorTable getColorTable(String fileName){
+		return provider.getColorTable();
+	}
+
+	public Point2D rasterToWorld(Point2D pt) {
+		return provider.rasterToWorld(pt);
+	}
+
+	public Point2D worldToRaster(Point2D pt) {
+		return provider.worldToRaster(pt);
+	}
+
+	public boolean isGeoreferenced() {
+		return provider.isGeoreferenced();
+	}
+
+	public double getPixelSizeX() {
+		return provider.getPixelSizeX();
+	}
+
+	public double getPixelSizeY() {
+		return provider.getPixelSizeY();
+	}
+
+	public Object getData(int x, int y, int band)throws InvalidSetViewException, FileNotOpenException, RasterDriverException {
+		return provider.getData(x, y, band);
+	}
+
+	public String getWktProjection() throws RasterDriverException {
+		if(provider != null)
+			return provider.getWktProjection();
+		return null;
+	}
+
+	public boolean isInside(Point2D p) {
+		if(provider != null)
+			return provider.isInside(p);
+		return false;
+	}
+
+	public RasterDataStore getDataStore() {
+		return this;
+	}
+
+	/**
+	 * @param band
+	 * @return the affine transform
+	 */
+	public AffineTransform getAffineTransform(int band){
+		return provider.getAffineTransform();
+	}
+
+	public void setAffineTransform(AffineTransform transf) {
+		provider.setAffineTransform(transf);
+	}
+
+	/**
+	 * Obtiene la matriz de transformaci�n del propio raster. Esta matriz es la encargada
+	 * de convertir las coordenadas de la petici�n en coordenadas a las que se pide a la libreria.
+	 * En gdal, por ejemplo, se piden las coordenadas a la libreria en coordenadas pixel por lo que
+	 * esta matriz tendr� la georreferenciaci�n asociada en el worldfile o cabecera. Otras librerias como
+	 * ermapper la petici�n a la libreria se hace en coordenadas geograficas que son las mismas en las
+	 * que pide el usuario de gvSIG por lo que esta matriz en este caso se inicializa con la identidad.
+	 * @return the own affine transform
+	 */
+	public AffineTransform getOwnTransformation() {
+		return provider.getOwnAffineTransform();
+	}
+
+	public boolean isRotated() {
+		if(provider != null)
+			return provider.isRotated();
+		return false;
+	}
+
+	public void setDrawableBands(int[] db) {
+		getBands().setDrawableBands(db);
+	}
+
+	public int[] getDrawableBands() {
+		return getBands().getDrawableBands();
+	}
+
+	public void clearDrawableBands() {
+		getBands().clearDrawableBands();
+	}
+
+	public void addDrawableBand(int posRasterBuf, int imageBand) {
+		getBands().addDrawableBand(posRasterBuf, imageBand);
+	}
+
+	public void deleteLayerFromCache() {
+		provider.deleteLayerFromCache();
+	}
+
+	public boolean isMultiFile() {
+		return provider.isMultiFile();
+	}
+
+	public int getOverviewWidth(int band, int overview) throws BandAccessException, RasterDriverException {
+		return provider.getOverviewWidth(band, overview);
+	}
+
+	public int getOverviewHeight(int band, int overview) throws BandAccessException, RasterDriverException {
+		return provider.getOverviewHeight(band, overview);
+	}
+
+	public int getOverviewCount(int band) throws BandAccessException, RasterDriverException {
+		if(band >= getBandCount())
+			throw new BandAccessException("Wrong band");
+		return provider.getOverviewCount(band);
+	}
+
+	public boolean overviewsSupport() {
+		if(provider != null)
+			return provider.isOverviewsSupported();
+		return false;
+	}
+
+	public void saveGeoreferencingToRmf() throws RmfSerializerException {
+		provider.saveObjectToRmf(AbstractRasterProvider.class, provider);
+	}
+
+	public void saveSerialInfoToRmf(TimeSeries serialInfo) throws RmfSerializerException {
+		provider.saveObjectToRmf(TimeSeries.class, serialInfo);
+	}
+
+	public void saveColorTableToRmf(ColorTable table) throws RmfSerializerException {
+		provider.saveObjectToRmf(ColorTable.class, table);
+	}
+
+	public void saveGeoPointListToRmf(GeoPointList pointList) throws RmfSerializerException {
+		provider.saveObjectToRmf(GeoPointList.class, pointList);
+	}
+
+	public void saveROIFileListToRmf(List<File> fileList) throws RmfSerializerException {
+		provider.saveObjectToRmf(List.class, fileList);
+	}
+
+	public List<File> getROIFileListFromRmf() {
+		try {
+			List<File> fileList = new ArrayList<File>();
+			provider.loadObjectFromRmf(List.class, fileList);
+			return fileList;
+		} catch (RmfSerializerException e) {
+		}
+		return null;
+	}
+
+	public boolean loadSerialInfoFromRmf(TimeSeries serialInfo) {
+		try {
+			provider.loadObjectFromRmf(TimeSeries.class, serialInfo);
+			return true;
+		} catch (RmfSerializerException e) {
+			//Prueba hasta que alguno tiene la informaci�n
+		}
+		return false;
+	}
+
+	public Extent getView() {
+		if(provider != null)
+			return provider.getView();
+		return null;
+	}
+
+	public Extent getExtentWithoutRot() {
+		if(provider != null)
+			return provider.getExtentWithoutRot();
+		return null;
+	}
+
+	public AffineTransform getOwnAffineTransform() {
+		if(provider != null)
+			return provider.getOwnAffineTransform();
+		return null;
+	}
+
+	public AffineTransform getAffineTransform() {
+		if(provider != null) {
+			return provider.getAffineTransform();
+		}
+		return null;
+	}
+
+	public IProjection getProjection() {
+		if(provider != null)
+			return provider.getProjection();
+		return null;
+	}
+
+	public void setProjection(IProjection proj, boolean persist) throws RmfSerializerException {
+		if(provider != null)
+			provider.setProjection(proj, persist);
+	}
+
+	public Statistics getStatistics() {
+		if(provider != null)
+			return provider.getStatistics();
+		return null;
+	}
+
+	public void setStatistics(Statistics stats) throws RmfSerializerException {
+		if(provider != null)
+			provider.setStatistics(stats);
+	}
+
+	public HistogramComputer getHistogramComputer() {
+		if(provider != null)
+			return provider.getHistogramComputer();
+		return null;
+	}
+
+	public Metadata getMetadata() {
+		if(provider != null)
+			return provider.getMetadata();
+		return null;
+	}
+
+	public Transparency getTransparency() {
+		if(provider != null) {
+			provider.getTransparency().setNoData(getNoDataValue());
+			return provider.getTransparency();
+		}
+		return null;
+	}
+
+	public ColorInterpretation getColorInterpretation() {
+		return provider.getColorInterpretation();
+	}
+
+	public void setColorInterpretation(ColorInterpretation ci) {
+		provider.setColorInterpretation(ci);
+	}
+
+	public boolean isReproyectable() {
+		if(provider != null)
+			return (provider.isReproyectable());
+		return false;
+	}
+
+	public String getMetadataName() {
+		if(provider != null)
+			return provider.getName();
+		return null;
+	}
+
+	public RasterDataStore cloneDataStore() throws CloneException {
+		DefaultRasterStore ds = new DefaultRasterStore();
+		ds.parameters = getParameters();
+		ds.provider = provider.cloneProvider();
+
+		int[] bands = new int[1];
+		bands[0] = provider.getBandCount();
+		ds.metadata = new MultiDataStoreMetadata(bands);
+		((MultiDataStoreMetadata)ds.metadata).add(provider.getMetadata());
+
+		ds.storeBandList = (BandListImpl)storeBandList.clone();
+		return ds;
+	}
+
+	public boolean isOpen() {
+		if(provider == null)
+			return false;
+		return provider.isOpen();
+	}
+
+	public CoverageStoreProvider getProvider() {
+		return provider;
+	}
+
+	public String getInfoByPoint(double x, double y, ICancellable cancellable) throws InfoByPointException {
+		return ((RasterProvider)getProvider()).getInfoByPoint(x, y, cancellable);
+	}
+
+	public String getInfoByPoint(double x, double y, Extent bbox, int w, int h, ICancellable cancellable) throws InfoByPointException {
+		return ((RasterProvider)getProvider()).getInfoByPoint((int)x, (int)y, bbox, w, h, cancellable);
+	}
+
+	public void goTo(int position) throws OperationNotSupportedException {
+		if(!isTimeSupportedByTheProvider())
+			throw new OperationNotSupportedException("Not supported for a RasterDataset");
+		if(getParameters() instanceof MultiDimensionalStoreParameters) {
+			((MultiDimensionalStoreParameters)getParameters()).goTo(position);
+		}
+	}
+
+	public void selectNext() throws OperationNotSupportedException {
+		if(!isTimeSupportedByTheProvider())
+			throw new OperationNotSupportedException("Not supported for a RasterDataset");
+		if(getParameters() instanceof MultiDimensionalStoreParameters) {
+			((MultiDimensionalStoreParameters)getParameters()).selectNextInstant();
+		}
+	}
+
+	public void selectPrev() throws OperationNotSupportedException {
+		if(!isTimeSupportedByTheProvider())
+			throw new OperationNotSupportedException("Not supported for a RasterDataset");
+		if(getParameters() instanceof MultiDimensionalStoreParameters) {
+			((MultiDimensionalStoreParameters)getParameters()).selectPrevInstant();
+		}
+	}
+
+	public void setTime(Time time) throws TimeException, OperationNotSupportedException {
+		if(!isTimeSupportedByTheProvider())
+			throw new OperationNotSupportedException("Not supported for a RasterDataset");
+
+	}
+
+	/**
+	 * Returns true whether all providers support time
+	 * @return
+	 */
+	private boolean isTimeSupportedByTheProvider() {
+		if(provider != null)
+			return provider.isTimeSupported();
+		return false;
+	}
+
+	public boolean isRasterEnclosed() {
+		if(provider != null)
+			return provider.isRasterEnclosed();
+		return false;
+	}
+
+	public Extent getCoordsInLevel(Point2D viewCenter, int level, int w, int h) {
+		try {
+			return ((TiledRasterProvider)provider).getCoordsInLevel(viewCenter, level, w, h);
+		} catch (ClassCastException e) {
+			return null;
+		}
+	}
+
+	public Extent getCoordsInTheNearestLevel(Extent extent, int w, int h) {
+		try {
+			return ((TiledRasterProvider)provider).getCoordsInTheNearestLevel(extent, w, h);
+		} catch (ClassCastException e) {
+			return null;
+		}
+	}
+
+	public int getZoomLevels() {
+		try {
+			return ((TiledRasterProvider)provider).getZoomLevels();
+		} catch (ClassCastException e) {
+			return -1;
+		}
+	}
+
+	public int getNearestLevel(double pixelSize) {
+		try {
+			return ((TiledRasterProvider)provider).getNearestLevel(pixelSize);
+		} catch (ClassCastException e) {
+			return -1;
+		}
+	}
+
+	public void setTileServer(Class<?> tileServer) throws InitializeException {
+		if(provider instanceof TiledRasterProvider) {
+			((TiledRasterProvider)provider).setTileServer(tileServer);
+		}
+	}
+
+	public RasterDataParameters getInternalParameters() {
+		if(provider instanceof TiledRasterProvider) {
+			AbstractRasterProvider prov = (AbstractRasterProvider)((TiledRasterProvider)provider).getInternalProvider();
+			return prov.getDataParameters();
+		}
+		return (RasterDataParameters)getParameters();
+	}
+
+	public RasterDataStore newDataStore() {
+		if(provider != null) {
+			RasterManager manager = (DefaultRasterManager)RasterLocator.getManager();
+			RasterDataStore newDataStore = null;
+			try {
+				newDataStore = manager.getProviderServices().open((DataStoreParameters)parameters);
+				if(newDataStore instanceof DefaultRasterStore) {
+					((DefaultRasterStore)newDataStore).setStatistics(getStatistics());
+				}
+				return newDataStore;
+			} catch (NotSupportedExtensionException e) {
+				return null;
+			} catch (RasterDriverException e) {
+				return null;
+			} catch (RmfSerializerException e) {
+				return newDataStore;
+			}
+		}
+		return null;
+	}
+
+	public RasterDataStore newNotTiledDataStore() {
+		if(provider != null) {
+			RasterManager manager = (DefaultRasterManager)RasterLocator.getManager();
+			RasterDataStore newDataStore = null;
+			try {
+				DataStoreParameters newParams = (DataStoreParameters)parameters;
+				if(this.isTiled()) {
+					newParams = ((TiledRasterProvider)getProvider()).getInternalProvider().getDataParameters();
+				}
+
+				newDataStore = manager.getProviderServices().open(newParams);
+				if(newDataStore instanceof DefaultRasterStore) {
+					((DefaultRasterStore)newDataStore).setStatistics(getStatistics());
+				}
+				return newDataStore;
+			} catch (NotSupportedExtensionException e) {
+				return null;
+			} catch (RasterDriverException e) {
+				return null;
+			} catch (RmfSerializerException e) {
+				return newDataStore;
+			}
+		}
+		return null;
+	}
+
+	public URI[] getURIByProvider() {
+		return provider.getURIByProvider();
+	}
+
+	public long[] getFileSizeByProvider() {
+		return provider.getFileSizeByProvider();
+	}
+
+	public int getProviderCount() {
+		return provider.getInternalProviderCount();
+	}
+
+	public int[] getBandCountByProvider() {
+		return provider.getBandCountByProvider();
+	}
+
+	public RasterDataParameters[] getDataParametersByProvider() {
+		RasterDataParameters[] res = new RasterDataParameters[getProviderCount()];
+		for (int i = 0; i < res.length; i++) {
+			res[i] = (RasterDataParameters)provider.getInternalProvider(i).getDataParameters();
+		}
+		return res;
+	}
+
+	public Metadata[] getMetadataByProvider() {
+		Metadata[] res = new Metadata[getProviderCount()];
+		for (int i = 0; i < res.length; i++) {
+			res[i] = provider.getInternalProvider(i).getMetadata();
+		}
+		return res;
+	}
+
+	public int[] getOverviewCountByProvider(int band) throws BandAccessException {
+		int[] res = new int[getProviderCount()];
+		for (int i = 0; i < res.length; i++) {
+			try {
+				res[i] = provider.getInternalProvider(i).getOverviewCount(band);
+			} catch (RasterDriverException e) {
+				throw new BandAccessException("", e);
+			}
+		}
+		return res;
+	}
+
+	public String[] getOverviewSizeByProvider(int band, int overview) throws BandAccessException {
+		String[] res = new String[getProviderCount()];
+		for (int i = 0; i < res.length; i++) {
+			try {
+				res[i] = provider.getInternalProvider(i).getOverviewWidth(band, overview) +
+						 "x" +
+						 provider.getInternalProvider(i).getOverviewHeight(band, overview);
+			} catch (RasterDriverException e) {
+				throw new BandAccessException("", e);
+			}
+		}
+		return res;
+	}
+
+	public AffineTransform[] getAffineTransformByProvider() {
+		AffineTransform[] res = new AffineTransform[getProviderCount()];
+		for (int i = 0; i < res.length; i++) {
+			res[i] = provider.getInternalProvider(i).getAffineTransform();
+		}
+		return res;
+	}
+
+	public double[] getHeightByProvider() {
+		double[] res = new double[getProviderCount()];
+		for (int i = 0; i < res.length; i++) {
+			res[i] = provider.getInternalProvider(i).getHeight();
+		}
+		return res;
+	}
+
+	public double[] getWidthByProvider() {
+		double[] res = new double[getProviderCount()];
+		for (int i = 0; i < res.length; i++) {
+			res[i] = provider.getInternalProvider(i).getWidth();
+		}
+		return res;
+	}
+
+	public void addFile(File file) throws InvalidSourceException {
+		provider.addFile(file);
+	}
+
+	public void removeFile(File file) {
+		provider.removeFile(file);
+		storeBandList.removeBands(file.getPath());
+	}
+
+	public URI getURIByBand(int band) {
+		return provider.getURIByBand(band);
+	}
+
+	/**
+	 * Gets the {@link Interval} of the store, that means the temporal
+	 * interval where the store has valid data.
+	 * In raster this method has sense in a mosaic. Therefore this has to be implemented
+	 * by the provider.
+	 * @return
+	 *         a time interval or null if there is not time support
+	 */
+	public Interval getInterval() {
+		return provider.getInterval();
+	}
+
+	/**
+	 * Gets all the possible values of time for which the store has data.
+	 * In raster this method has sense in a mosaic. Therefore this has to be implemented
+	 * by the provider.
+	 * @return
+	 *         a collection of {@link Time} objects.
+	 */
+	public Collection<?> getTimes() {
+		return provider.getTimes();
+	}
+
+	/**
+	 * Gets all the possible values of time for which the store has data
+	 * and intersects with an interval.
+	 * In raster this method has sense in a mosaic. Therefore this has to be implemented
+	 * by the provider.
+	 * @param interval
+	 *         the interval of time
+	 * @return
+	 *         a collection of {@link Time} objects.
+	 */
+	public Collection<?> getTimes(Interval interval) {
+		return provider.getTimes(interval);
+	}
+
+	public Image getImageLegend() {
+		if(provider != null)
+			return provider.getImageLegend();
+		return null;
+	}
+
+	/**
+	 * Gets the list of geo points associated to this provider
+	 * @return GeoPointList
+	 */
+	public GeoPointList getGeoPointList() {
+		return provider.getGeoPointList();
+	}
+
+	/**
+	 * Sets the list of geo points associated to this provider
+	 */
+	public void setGeoPointList(GeoPointList geoPointList) {
+		provider.setGeoPointList(geoPointList);
+	}
+
+	/**
+	 * @return the full envelope
+	 */
+	public Envelope getFullEnvelope() {
+		Rectangle2D e = getExtent().toRectangle2D();
+		try {
+			return GeometryLocator.getGeometryManager().createEnvelope(e.getX(), e.getY(), e.getMaxX(), e
+					.getMaxY(), SUBTYPES.GEOM2D);
+		} catch (CreateEnvelopeException e1) {
+			logger.error("Error creating the envelope", e);
+			return null;
+		}
+	}
+
+	public List<ROI> getRois(String epsg) throws ROIException {
+		IProjection proj = CRSFactory.getCRS(epsg);
+		return getRois(proj);
+	}
+
+	public List<ROI> getRois(IProjection defaultProjection) throws ROIException {
+		if(rois == null) {
+			try {
+				List<File> fileList = getDataStore().getROIFileListFromRmf();
+				if(fileList != null && fileList.size() > 0 && fileList.get(0) != null) {
+					File f = fileList.get(0);
+					IProjection proj = getProjection();
+					if(proj == null) {
+						proj = defaultProjection;
+					}
+					ROIReader reader = new VectorialROIsReader(
+							f.getPath(),
+							getDataStore(),
+							proj,
+							getFullEnvelope());
+					rois = new ArrayList<ROI>();
+					rois = reader.read(rois);
+				}
+			} catch (Exception e) {
+				throw new ROIException("error_getting_ROIS", e);
+			}
+		}
+		return rois;
+	}
+
+	public void setRois(List<ROI> rois) {
+		this.rois = rois;
+	}
+
+	/**
+	 * @param file
+	 * @throws RmfSerializerException
+	 */
+	public void setROIsFiles(List<File> file) throws RmfSerializerException {
+		getDataStore().saveROIFileListToRmf(file);
+	}
+
+	/**
+	 * @return the ROI files
+	 * @throws RmfSerializerException
+	 */
+	public List<File> getROIsFiles() throws RmfSerializerException {
+		return getDataStore().getROIFileListFromRmf();
+	}
+
+	public void close() {
+		if(provider != null)
+			provider.close();
+		if(storeBandList != null)
+			storeBandList.clear();
+		provider = null;
+		storeBandList = null;
+		super.close();
+		try {
+			finalize();
+		} catch (Throwable e) {
+		}
+	}
+
+	protected void finalize() throws Throwable {
+		provider               = null;
+		storeBandList               = null;
+		metadata               = null;
+		if(rois != null) {
+			rois.clear();
+			rois = null;
+		}
+		super.finalize();
+	}
+
+	//******************************
+	//Persistence
+	//******************************
+
+	/**
+	 * Register persistence
+	 */
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DefaultRasterStore.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null,
+					null
+			);
+
+			definition.addDynFieldObject("parameters")
+			.setClassOfValue(RasterDataParameters.class)
+			.setMandatory(true);
+
+			definition.addDynFieldString("explorername")
+			.setMandatory(false);
+
+			definition.addDynFieldObject("bandList")
+			.setClassOfValue(BandList.class)
+			.setMandatory(false);
+
+			definition.addDynFieldObject("metadata")
+			.setClassOfValue(Metadata.class)
+			.setMandatory(false);
+
+			definition.addDynFieldObject("render")
+			.setClassOfValue(Render.class)
+			.setMandatory(false);
+		}
+	}
+
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		this.parameters = (RasterDataParameters)state.get("parameters");
+
+		String explorerName = (String)state.get("explorername");
+		if(explorerName != null) {
+			if(initializePersistentParameters((RasterDataParameters)this.parameters, explorerName) == null) {
+				throw new PersistenceException();
+			}
+		}
+
+		try {
+			DataManagerProviderServices dataManager = (DataManagerProviderServices)DALLocator.getDataManager();
+			this.provider = (AbstractRasterProvider)dataManager.createProvider(this, this.parameters);
+		} catch (InitializeException e) {
+			throw new PersistenceException(e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new PersistenceException(e);
+		}
+
+		this.storeBandList = (BandListImpl)state.get("bandList");
+		if(parameters instanceof AbstractRasterFileDataParameters && !this.provider.isMultiFile()) {
+			//Esto solo es por si al cargar un proyecto se ha cambiado el fichero de sitio y el usuario
+			//lo introduce manualmente. En ese caso el bandList debe contener la misma ruta al fichero que el
+			//provider y no la que se grab� inicialmente
+		    try{
+    			for (int i = 0; i < storeBandList.getBandCount(); i++) {
+    				storeBandList.getBand(i).setFileName(new File(provider.getURI()).getAbsolutePath());
+    			}
+		    }catch (Exception e){
+		        logger.warn("Couldn't get file for "+provider.getURI()+" when creating Band List Store");
+		    }
+		}
+		this.metadata = (Metadata)state.get("metadata");
+
+		DefaultRender render = (DefaultRender)state.get("render");
+		if(render == null)
+			throw new PersistenceException();
+		setRender(render);
+		render.setDataStore(this);
+		render.buildFiltersFromPersistencyFilterParam(getStatistics());
+		if(getRender().getRenderingTransparency() != null)
+			getRender().getRenderingTransparency().setNoData(getNoDataValue());
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("parameters", provider.getDataParameters());
+		RasterDataParameters provParams = getInternalDataParameterFromState(provider.getDataParameters());
+		state.set("explorername", provParams.getDataStoreName());
+		state.set("bandList", storeBandList);
+		state.set("metadata", metadata);
+		state.set("render", getRender());
+	}
+
+	/**
+	 * Actions to initialize parameters before loaded more parts of the project
+	 * @param providerParams
+	 * @param explorerName
+	 * @return
+	 */
+	private RasterDataParameters initializePersistentParameters(RasterDataParameters providerParams, String explorerName) {
+		try {
+			if(!(getInternalDataParameterFromState(providerParams) instanceof RemoteStoreParameters))
+				return providerParams;
+
+			DataManager datamanager = DALLocator.getDataManager();
+			DataServerExplorerParameters explorerParams = null;
+			explorerParams = datamanager.createServerExplorerParameters(explorerName);
+			explorerParams.setDynValue("host", "");
+			DataServerExplorer e = datamanager.openServerExplorer(explorerName, explorerParams);
+			if(e instanceof RasterDataServerExplorer) {
+				explorer = (RasterDataServerExplorer)e;
+
+				explorerParams = explorer.getParameters();
+				explorerParams.setDynValue("host", providerParams.getURI());
+
+				if(!explorer.isHostReachable()) {
+					return null;
+				}
+
+				try {
+					explorer.connect(null);
+				} catch (ConnectException exc) {
+					return null;
+				}
+
+				RasterDataParameters newParameters = getInternalDataParameterFromState(explorer.getStoredParameters());
+				newParameters.assignFields(getInternalDataParameterFromState(providerParams), explorer);
+				if(providerParams instanceof TileDataParameters)
+					((TileDataParameters)providerParams).setDataParameters(newParameters);
+				return providerParams;
+			}
+		} catch (Exception e) {
+		    logger.warn("Error initializing persistent parameters", e);
+			return null;
+		}
+		return null;
+	}
+
+	private RasterDataParameters getInternalDataParameterFromState(Object obj) {
+		if(obj instanceof TileDataParameters) {
+			return (RasterDataParameters)((TileDataParameters) obj).getDataParameters();
+		} else {
+			return (RasterDataParameters)obj;
+		}
+	}
+
+    @Override
+    public void useCache(String providerName, DynObject parameters) throws DataException {
+        throw new UnsupportedOperationException("Not supported yet."); 
+    }
+
+    @Override
+    public DataStoreProviderFactory getProviderFactory() {
+        return DALLocator.getDataManager().getStoreProviderFactory(this.parameters.getDataStoreName());
+    }
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultRasterStore.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamImpl.java	(revision 15423)
@@ -0,0 +1,194 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.store;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Param;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.grid.RegistrableFilterListener;
+import org.gvsig.raster.util.persistence.GenericPersistentObject;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Generic parameter to store data for filters
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ParamImpl implements Param {
+	private Logger   log          = LoggerFactory.getLogger(ParamImpl.class);
+	private int      type         = -1;
+	private String   id           = null;
+	private Object   defaultValue = null;
+	private String[] list         = null;
+	
+	private String   managerID     = null;
+
+	public void setManagerID(String id) {
+		managerID = id;
+	}
+	
+	public int getType() {
+		return type;
+	}
+
+	public void setType(int type) {
+		this.type = type;
+	}
+
+	public String getId() {
+		return id;
+	}
+
+	public void setId(String id) {
+		this.id = id;
+	}
+
+	public Object getDefaultValue() {
+		return defaultValue;
+	}
+
+	public void setDefaultValue(Object defaultValue) {
+		this.defaultValue = defaultValue;
+	}
+
+	public String[] getList() {
+		return list;
+	}
+
+	public void setList(String[] list) {
+		this.list = list;
+	}
+
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state) throws PersistenceException {
+		this.type = state.getInt("type");
+		this.id = state.getString("id");
+		if(state.get("defaultValue") == null) {
+			loadPanel(state);
+		} else
+			this.defaultValue = ((GenericPersistentObject)state.get("defaultValue")).getObject();
+		List<String> list = state.getList("list");
+		if(list != null) {
+			this.list = new String[list.size()];
+			for (int i = 0; i < list.size(); i++) {
+				this.list[i] = list.get(i);
+			}
+		}
+	}
+	
+	private void loadPanel(PersistentState state) throws PersistenceException {
+		this.managerID = state.getString("managerID");
+		if(managerID == null)
+			return;
+		Params paramsForUI = (Params)state.get("paramsForUI");
+		RegistrableFilterListener panel = (RegistrableFilterListener)getPanelObject(managerID);
+		panel.setParams(paramsForUI);
+		this.defaultValue = panel;
+	}
+	
+	private Object getPanelObject(String filterID) {
+		try {
+			ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+			ExtensionPoint point = extensionPoints.get("PanelRasterFilter");
+			Class<?> c = point.get(filterID).getExtension();
+			Constructor<?> hazNuevo = c.getConstructor();
+			return hazNuevo.newInstance();
+		} catch (IllegalArgumentException e) {
+			log.debug("Error loading filter class", e);
+		} catch (InstantiationException e) {
+			log.debug("Error loading filter class", e);
+		} catch (IllegalAccessException e) {
+			log.debug("Error loading filter class", e);
+		} catch (InvocationTargetException e) {
+			log.debug("Error loading filter class", e);
+		} catch (SecurityException e) {
+			log.debug("Error loading filter class", e);
+		} catch (NoSuchMethodException e) {
+			log.debug("Error loading filter class", e);
+		}
+		return null;
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("type", type);
+		state.set("id", id);
+
+		if(defaultValue instanceof RegistrableFilterListener) {
+			savePanel(state);
+			state.setNull("defaultValue");
+		} else {
+			state.set("defaultValue", GenericPersistentObject.create(defaultValue));
+		}
+
+		state.set("list", list);
+	}	
+
+	private void savePanel(PersistentState state) throws PersistenceException {
+		Params p = ((RegistrableFilterListener)defaultValue).getParams();
+		state.set("paramsForUI", p);
+		state.set("managerID", managerID);
+	}
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+
+		DynStruct definition = manager.addDefinition(
+				ParamImpl.class,
+				"ParamImpl_Persistence",
+				"ParamImpl Persistence",
+				null, 
+				null
+		);
+		definition.addDynFieldInt("type")
+		.setMandatory(false);
+		
+		definition.addDynFieldString("id")
+		.setMandatory(false);
+		
+		definition.addDynFieldObject("defaultValue")
+		.setClassOfValue(GenericPersistentObject.class)
+		.setMandatory(false);
+		
+		definition.addDynFieldList("list")
+		.setClassOfItems(String.class)
+		.setMandatory(false);
+		
+		definition.addDynFieldObject("paramsForUI")
+		.setClassOfValue(Params.class)
+		.setMandatory(false);
+		
+		definition.addDynFieldString("managerID")
+		.setMandatory(false);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/ParamImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultCoverageStoreNotification.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultCoverageStoreNotification.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultCoverageStoreNotification.java	(revision 15423)
@@ -0,0 +1,58 @@
+/* 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.impl.store;
+
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.DataStoreNotification;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.tools.observer.BaseNotification;
+import org.gvsig.tools.undo.command.Command;
+
+public class DefaultCoverageStoreNotification 
+        extends BaseNotification
+        implements DataStoreNotification 
+  {
+  private static final int VALUE_STORE = 0;
+  private static final int VALUE_COMMAND = 1;
+  
+  private static final int VALUE_COUNT = 2;
+
+	public DefaultCoverageStoreNotification(
+			RasterDataStore store, String notification,
+			Command command) {
+    this(store, notification);
+    this.setValue(VALUE_COMMAND,command);
+	}
+
+	public DefaultCoverageStoreNotification(
+			RasterDataStore store, String notification) {
+    super(notification, VALUE_COUNT);
+    this.setValue(VALUE_STORE,store);
+	}
+
+  @Override
+	public DataStore getSource() {
+		return (DataStore) this.getValue(VALUE_STORE);
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/store/DefaultCoverageStoreNotification.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultSerialInfo.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultSerialInfo.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultSerialInfo.java	(revision 15423)
@@ -0,0 +1,272 @@
+/* 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.impl.datastruct;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+
+import org.gvsig.fmap.dal.coverage.datastruct.SerialInfo;
+import org.gvsig.timesupport.AbsoluteInstant;
+import org.gvsig.timesupport.AbsoluteInterval;
+import org.gvsig.timesupport.RelativeInstant;
+import org.gvsig.timesupport.RelativeInterval;
+import org.gvsig.timesupport.Time;
+
+/**
+ * Time information
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultSerialInfo implements SerialInfo {
+	public static final int    SINGLE_VALUES              = 0;
+	public static final int    RANGES                     = 1;
+	
+	private ArrayList<Date>    timeDate                   = new ArrayList<Date>();
+	private ArrayList<Double>  timeNumeric                = new ArrayList<Double>();
+	
+	private int                timeType                   = SINGLE_VALUES;
+	private int                dataType                   = DATE;
+	private String             timeFormat                 = null;
+	private String             serialName                 = null;
+	private String             description                = null;
+	
+	public DefaultSerialInfo() {
+		timeFormat = "dd/MM/yyyy-hh:mm:ss";
+	}
+	
+	public DefaultSerialInfo(String timeFormat) {
+		this.timeFormat = timeFormat;
+	}
+	
+	public DefaultSerialInfo(Time time, String description, String name) throws ParseException {
+		timeFormat = "dd/MM/yyyy-hh:mm:ss";
+		if(time instanceof RelativeInstant) {
+			setTimeType(DefaultSerialInfo.SINGLE_VALUES);
+			setDataType(SerialInfo.NUMERIC);
+			addValue((double)((RelativeInstant)time).toMillis());
+			setDescription(description);
+			setSerialName(name);
+		}
+		if(time instanceof AbsoluteInstant) {
+			AbsoluteInstant t = ((AbsoluteInstant)time);
+			String dateA = t.getDays() + "/" + t.getMonths() + "/" + t.getYears() + "-" + t.getHours() + "/" + t.getMinutes() + "/" + t.getSeconds();
+			setTimeType(DefaultSerialInfo.SINGLE_VALUES);
+			setDataType(SerialInfo.DATE);
+			addValue(dateA);
+			setDescription(description);
+			setSerialName(name);
+		}
+		if(time instanceof AbsoluteInterval) {
+			AbsoluteInstant t = ((AbsoluteInterval)time).getStart();
+			String dateA = t.getDays() + "/" + t.getMonths() + "/" + t.getYears() + "-" + t.getHours() + "/" + t.getMinutes() + "/" + t.getSeconds();
+			t = ((AbsoluteInterval)time).getEnd();
+			String dateB = t.getDays() + "/" + t.getMonths() + "/" + t.getYears() + "-" + t.getHours() + "/" + t.getMinutes() + "/" + t.getSeconds();
+			setTimeType(DefaultSerialInfo.RANGES);
+			setDataType(SerialInfo.DATE);
+			addValue(dateA);
+			addValue(dateB);
+			setDescription(description);
+			setSerialName(name);
+		}
+		if(time instanceof RelativeInterval) {
+			RelativeInstant t = ((RelativeInterval)time).getStart();
+			double dateA = t.toMillis();
+			t = ((RelativeInterval)time).getEnd();
+			double dateB = t.toMillis();
+			setTimeType(DefaultSerialInfo.RANGES);
+			setDataType(SerialInfo.NUMERIC);
+			addValue(dateA);
+			addValue(dateB);
+			setDescription(description);
+			setSerialName(name);
+		}
+	}
+	
+	public String getSerialName() {
+		return serialName;
+	}
+
+	public void setSerialName(String serialName) {
+		this.serialName = serialName;
+	}
+
+	public ArrayList<?> getTime() {
+		return dataType == DATE ? timeDate : timeNumeric ;
+	}
+
+	@SuppressWarnings("unchecked")
+	public void setTime(ArrayList<?> time) {
+		if(dataType == DATE)
+			timeDate = (ArrayList<Date>)time;
+		else
+			timeNumeric = (ArrayList<Double>)time;
+	}
+
+	public int getTimeType() {
+		return timeType;
+	}
+
+	public void setTimeType(int timeType) {
+		this.timeType = timeType;
+	}
+	
+	public int getDataType() {
+		return dataType;
+	}
+
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+	
+	public void setTimeType(String timeType) {
+		if(timeType.compareTo("Single values") == 0)
+			this.timeType = 0;
+		if(timeType.compareTo("Ranges") == 0)
+			this.timeType = 1;
+	}
+	
+	public void addValue(String value) throws ParseException {
+		this.dataType = DATE;
+		SimpleDateFormat formatter = new SimpleDateFormat(timeFormat);
+		Date date = null;
+		try {
+			date = formatter.parse(value);
+		} catch (ParseException e) {
+			date = formatter.parse(value + "-00:00:00");
+		}
+		
+		this.timeDate.add(date);
+	}
+	
+	public void addValue(double value) {
+		this.dataType = NUMERIC;
+		this.timeNumeric.add(new Double(value));
+	}
+	
+	public String getTimeInfo(int pos) {
+		if(dataType == DATE) {
+			SimpleDateFormat formatter = new SimpleDateFormat(timeFormat);
+			return formatter.format(timeDate.get(pos));
+		}
+		if(dataType == NUMERIC) {
+			return timeNumeric.get(pos).doubleValue() + "";
+		}
+		return null;
+	}
+
+	public String getDescription() {
+		return description;
+	}
+
+	public void setDescription(String description) {
+		this.description = description;
+	}
+	
+	public boolean isInRange(SerialInfo tInfo) {
+		if(dataType == DATE) {
+			return isInRangeDateType(tInfo);
+		}
+		if(dataType == NUMERIC) {
+			return isInRangeNumericType(tInfo);
+		}
+		return false;
+	}
+	
+	/**
+	 * Returns true if the range selected in the parameters is 
+	 * inside the current.
+	 * @param tInfo
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	private boolean isInRangeDateType(SerialInfo tInfo) {
+		ArrayList<Date> t1 = (ArrayList<Date>)tInfo.getTime();
+		ArrayList<Date> t2 = (ArrayList<Date>)getTime();
+		if(t1.size() == 1 && t2.size() == 1) {
+			long dif = t1.get(0).getTime() - t2.get(0).getTime();
+			if(dif == 0)
+				return true;
+		}
+		
+		if(t1.size() == 1 && t2.size() > 1) {
+			long dif1 = t1.get(0).getTime() - t2.get(0).getTime();
+			long dif2 = t1.get(0).getTime() - t2.get(t2.size() - 1).getTime();
+			if(dif1 > 0 && dif2 < 0)
+				return true;
+		}
+		
+		if(t1.size() > 1 && t2.size() == 1) {
+			long dif1 = t1.get(0).getTime() - t2.get(0).getTime();
+			long dif2 = t1.get(t1.size() - 1).getTime() - t2.get(0).getTime();
+			if(dif1 == 0 && dif2 == 0)
+				return true;
+		}
+		
+		if(t1.size() > 1 && t2.size() > 1) {
+			long dif1 = t1.get(0).getTime() - t2.get(0).getTime();
+			long dif2 = t1.get(t1.size() - 1).getTime() - t2.get(t2.size() - 1).getTime();
+			if(dif1 >= 0 && dif2 <= 0) 
+				return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Returns true if the range selected in the parameters is 
+	 * inside the current.
+	 * @param tInfo
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	private boolean isInRangeNumericType(SerialInfo tInfo) {
+		ArrayList<Double> t1 = (ArrayList<Double>)tInfo.getTime();
+		ArrayList<Double> t2 = (ArrayList<Double>)getTime();
+		if(t1.size() == 1 && t2.size() == 1) {
+			double dif = t1.get(0).doubleValue() - t2.get(0).doubleValue();
+			if(dif == 0)
+				return true;
+		}
+		
+		if(t1.size() == 1 && t2.size() > 1) {
+			double dif1 = t1.get(0).doubleValue() - t2.get(0).doubleValue();
+			double dif2 = t1.get(0).doubleValue() - t2.get(t2.size() - 1).doubleValue();
+			if(dif1 > 0 && dif2 < 0)
+				return true;
+		}
+		
+		if(t1.size() > 1 && t2.size() == 1) {
+			double dif1 = t1.get(0).doubleValue() - t2.get(0).doubleValue();
+			double dif2 = t1.get(t1.size() - 1).doubleValue() - t2.get(0).doubleValue();
+			if(dif1 == 0 && dif2 == 0)
+				return true;
+		}
+		
+		if(t1.size() > 1 && t2.size() > 1) {
+			double dif1 = t1.get(0).doubleValue() - t2.get(0).doubleValue();
+			double dif2 = t1.get(t1.size() - 1).doubleValue() - t2.get(t2.size() - 1).doubleValue();
+			if(dif1 >= 0 && dif2 <= 0) 
+				return true;
+		}
+		return false;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultSerialInfo.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/persistence/DefaultColorTableLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/persistence/DefaultColorTableLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/persistence/DefaultColorTableLibrary.java	(revision 15423)
@@ -0,0 +1,533 @@
+/* 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.impl.datastruct.persistence;
+
+import java.awt.Color;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
+import org.gvsig.fmap.dal.coverage.exception.FilePaletteException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.raster.impl.datastruct.legend.RasterLegendIO;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+import org.kxml2.io.KXmlParser;
+import org.kxml2.io.KXmlSerializer;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * La clase ColorTableLibraryPersistence sirve para controlar las tablas de color
+ * genericas, como si fuera una libreria de tablas de color. Aqu� se comprueban
+ * los cambios de versi�n.
+ *
+ * @version 02/07/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class DefaultColorTableLibrary implements ColorTableLibrary {
+	private static DefaultColorTableLibrary  instance = null;
+	
+	/**
+	 * Gets the ColorTableLibrary
+	 * @return
+	 */
+	public static ColorTableLibrary getInstance() {
+		if(instance == null)
+			instance = new DefaultColorTableLibrary();
+		return instance;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary#getFormats()
+	 */
+	public String[] getFormats() {
+		return RasterLegendIO.formats;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary#createColorItem()
+	 */
+	public ColorItem createColorItem() {
+		return new ColorItemImpl();
+	}
+
+	/*
+	 * (non-Javadoc)
+     * @see org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary#createColorTable()
+     */
+    public ColorTable createColorTable() {
+    	return new DataStoreColorTable();
+    }
+    
+	/**
+	 * Devuelve la lista de ficheros de paletas, si no existe el fichero devolvera
+	 * una lista vacia
+	 * @param palettesBasePath
+	 * @return
+	 * @throws FilePaletteException 
+	 */
+	private ArrayList<String> getPaletteFileListDisc(String palettesBasePath) throws FilePaletteException {
+		updateVersion(palettesBasePath);
+
+		File paletteFiles = new File(palettesBasePath);
+
+		ArrayList<String> fileList = new ArrayList<String>();
+
+		if (paletteFiles.exists()) {
+			File[] list = paletteFiles.listFiles();
+			for (int i = 0; i < list.length; i++)
+				fileList.add(list[i].getName());
+		}
+
+		return fileList;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary#getPaletteFileList(java.lang.String)
+	 */
+	public ArrayList<String> getPaletteFileList(String palettesBasePath) throws FilePaletteException {
+		return getPaletteFileList(palettesBasePath, true);
+	}
+
+	/**
+	 * Devuelve la lista de ficheros de paletas, en caso de que no exista la
+	 * paleta y se especifique forceCreate a true, se creara la paleta por defecto.
+	 * @param palettesBasePath
+	 * @param forceCreate
+	 * @return
+	 * @throws FilePaletteException 
+	 */
+	public ArrayList<String> getPaletteFileList(String palettesBasePath, boolean forceCreate) throws FilePaletteException {
+		ArrayList <String>fileList = getPaletteFileListDisc(palettesBasePath);
+
+		if (forceCreate && (fileList.size() == 0)) {
+			DefaultColorTableLibrary persistence = new DefaultColorTableLibrary();
+			createVersionFromXML(palettesBasePath, persistence.getDefaultPaletteXML());
+			fileList = getPaletteFileListDisc(palettesBasePath);
+		}
+
+		return fileList;
+	}
+
+	/**
+	 * Devuelve el XML de una paleta por defecto
+	 * @return
+	 * @throws FilePaletteException 
+	 */
+	public String getDefaultPaletteXML() throws FilePaletteException {
+		URL url = getClass().getResource("xml/palettes.xml");
+		StringBuffer contents = new StringBuffer();
+		try {
+			if(url == null)
+				throw new FilePaletteException(FilePaletteException.MESSAGE_FILENOTFOUND);
+			InputStream inputStream = url.openStream();
+
+			int i;
+			while (true) {
+				i = inputStream.read();
+				if (i == -1) break;
+				char c = (char) i;
+				contents.append(c);
+			}
+			inputStream.close();
+		} catch (IOException e) {
+			throw new FilePaletteException(FilePaletteException.MESSAGE_FILEFORMATERROR);
+		}
+
+		return contents.toString();
+	}
+
+	/**
+	 * Crea los ficheros que forman la paleta de color de la version 1.1 a traves
+	 * de un XML que se le pasa por parametro
+	 * @param palettesPath
+	 */
+	private void createVersionFromXML(String palettesBasePath, String xml) {
+		new File(palettesBasePath).mkdir();
+		KXmlParser parser = new KXmlParser();
+		StringReader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+			int tag = parser.nextTag();
+
+			parser.require(KXmlParser.START_TAG, null, "palettes");
+			tag = parser.nextTag();
+			parser.require(KXmlParser.START_TAG, null, "palette_list");
+			parser.skipSubTree();
+			parser.require(KXmlParser.END_TAG, null, "palette_list");
+			tag = parser.nextTag();
+
+			while (tag == KXmlParser.START_TAG) {
+				parser.require(KXmlParser.START_TAG, null, "palette");
+				if (parser.getAttributeCount() == 2) {
+					// Generar nuevo fichero
+					KXmlSerializer parserOutput = new KXmlSerializer();
+					FileOutputStream fileOutputStream = new FileOutputStream(palettesBasePath + File.separator + parser.getAttributeValue(0) + ".xml");
+
+					parserOutput.setOutput(fileOutputStream, null);
+					parserOutput.startDocument("UTF-8", null);
+					parserOutput.startTag(null, "ColorTable");
+					parserOutput.attribute(null, "name", parser.getAttributeValue(0));
+					parserOutput.attribute(null, "version", "1.1");
+
+					tag = parser.nextTag();
+					parser.require(KXmlParser.START_TAG, null, "table");
+					tag = parser.nextTag();
+
+					parserOutput.text("\n");
+					List<ColorItem> items = new ArrayList<ColorItem>();
+					while (tag == KXmlParser.START_TAG) {
+						parser.require(KXmlParser.START_TAG, null, "entry");
+						if (parser.getAttributeCount() == 3) {
+							String rgb = parser.getAttributeValue(1).substring(parser.getAttributeValue(1).indexOf(",") + 1, parser.getAttributeValue(1).length());
+
+							int a = Integer.valueOf(parser.getAttributeValue(1).substring(0, parser.getAttributeValue(1).indexOf(","))).intValue();
+							int r = Integer.valueOf(rgb.substring(0, rgb.indexOf(","))).intValue();
+							int g = Integer.valueOf(rgb.substring(rgb.indexOf(",") + 1, rgb.lastIndexOf(","))).intValue();
+							int b = Integer.valueOf(rgb.substring(rgb.lastIndexOf(",") + 1, rgb.length())).intValue();
+
+							ColorItem colorItem = new ColorItemImpl();
+							colorItem.setColor(new Color(r, g, b, a));
+							colorItem.setInterpolated(50);
+							colorItem.setNameClass(parser.getAttributeValue(0));
+							colorItem.setValue(Double.parseDouble(parser.getAttributeValue(2)));
+							items.add(colorItem);
+						}
+						tag = parser.nextTag();
+						parser.require(KXmlParser.END_TAG, null, "entry");
+						tag = parser.nextTag();
+					}
+					parser.require(KXmlParser.END_TAG, null, "table");
+					tag = parser.nextTag();
+
+					ColorTable colorTable = new DataStoreColorTable();
+					colorTable.createPaletteFromColorItems(items, true);
+					items = colorTable.getColorItems();
+					for (int i = 0; i < items.size(); i++) {
+						ColorItem colorItem = (ColorItem) items.get(i);
+						parserOutput.startTag(null, "Color");
+						parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+						parserOutput.attribute(null, "name", String.valueOf(colorItem.getNameClass()));
+						Color color = colorItem.getColor();
+						parserOutput.attribute(null, "rgb", String.valueOf(color.getRed() + "," + color.getGreen() + "," + color.getBlue()));
+						parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+						parserOutput.endTag(null, "Color");
+						parserOutput.text("\n");
+					}
+
+					for (int i = 0; i < items.size(); i++) {
+						ColorItem colorItem = (ColorItem) items.get(i);
+						parserOutput.startTag(null, "Alpha");
+						parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+						parserOutput.attribute(null, "alpha", String.valueOf(colorItem.getColor().getAlpha()));
+						parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+						parserOutput.endTag(null, "Alpha");
+						parserOutput.text("\n");
+					}
+
+					parserOutput.endTag(null, "ColorTable");
+					parserOutput.text("\n");
+					parserOutput.endDocument();
+					// Cerrar nuevo fichero
+					fileOutputStream.close();
+				}
+				parser.require(KXmlParser.END_TAG, null, "palette");
+				tag = parser.nextTag();
+			}
+			parser.require(KXmlParser.END_TAG, null, "palettes");
+		} catch (XmlPullParserException xmlEx) {
+			System.out.println("El fichero de paletas predeterminadas no tiene la estructura correcta:\n	" + xmlEx.getMessage());
+		} catch (IOException e) {
+		}
+	}
+
+	/**
+	 * Si existe la version de paleta 1.1, no lo actualizar�, en caso contrario,
+	 * buscara la version 1.0 y si lo encuentra lo subir� a la 1.1
+	 * @param palettesPath
+	 * @throws FilePaletteException 
+	 */
+	public void updateVersion_1_0_to_1_1(String palettesBasePath) throws FilePaletteException {
+		// Si no existe la paleta antigua, pero si que existe la copia de seguridad,
+		// la restauramos
+		File palettesFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml");
+		if (!palettesFile.exists()) {
+			// Cambiar nombre a antiguo fichero
+			File oldFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml~");
+			if (oldFile.exists()) {
+				oldFile.renameTo(new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml"));
+			} else {
+				DefaultColorTableLibrary ctlp = new DefaultColorTableLibrary();
+				String text = ctlp.getDefaultPaletteXML();
+				palettesFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml");
+				try {
+					FileWriter writer = new FileWriter(palettesFile);
+					writer.write(text);
+					writer.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+
+		// Si existe el directorio de la version 1.1 no hacemos la migraci�n
+		File directoryFile = new File(palettesBasePath);
+		if (directoryFile.exists())
+			return;
+
+		// Si no encontramos la paleta antigua, nos olvidamos de continuar
+		palettesFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml");
+		if (!palettesFile.exists())
+			return;
+
+		// Paleta antigua encontrada, podemos migrar a la versi�n nueva
+		try {
+			FileInputStream inputStream = new FileInputStream(palettesFile);
+
+			StringBuffer contents = new StringBuffer();
+			try {
+
+				int i;
+				while (true) {
+					i = inputStream.read();
+					if (i == -1) break;
+					char c = (char) i;
+					contents.append(c);
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			createVersionFromXML(palettesBasePath, contents.toString());
+
+			inputStream.close();
+
+		} catch (FileNotFoundException fnfEx) {
+			fnfEx.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary#save_to_1_1(java.lang.String, org.gvsig.fmap.dal.coverage.store.props.ColorTable)
+	 */
+	public void save_to_1_1(String palettesBasePath, ColorTable colorTable) {
+		try {
+			// Generar nuevo fichero
+			KXmlSerializer parserOutput = new KXmlSerializer();
+			FileOutputStream out = new FileOutputStream(palettesBasePath + File.separator + colorTable.getName() + ".xml");
+			OutputStreamWriter writer = new OutputStreamWriter(out, "UTF8");
+			parserOutput.setOutput(writer);
+			parserOutput.startDocument("UTF-8", null);
+			parserOutput.startTag(null, "ColorTable");
+			parserOutput.attribute(null, "name", colorTable.getName());
+			parserOutput.attribute(null, "version", "1.1");
+			parserOutput.text("\n");
+
+			List<ColorItem> items = colorTable.getColorItems();
+			for (int i = 0; i < items.size(); i++) {
+				ColorItem colorItem = (ColorItem) items.get(i);
+				parserOutput.startTag(null, "Color");
+				parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+				if (colorItem.getNameClass() != null)
+					parserOutput.attribute(null, "name", String.valueOf(colorItem.getNameClass()));
+				else
+					parserOutput.attribute(null, "name", "");
+				Color color = colorItem.getColor();
+				parserOutput.attribute(null, "rgb", String.valueOf(color.getRed() + "," + color.getGreen() + "," + color.getBlue()));
+				parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+				parserOutput.endTag(null, "Color");
+				parserOutput.text("\n");
+			}
+
+			for (int i = 0; i < items.size(); i++) {
+				ColorItem colorItem = (ColorItem) items.get(i);
+				parserOutput.startTag(null, "Alpha");
+				parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+				parserOutput.attribute(null, "alpha", String.valueOf(colorItem.getColor().getAlpha()));
+				parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+				parserOutput.endTag(null, "Alpha");
+				parserOutput.text("\n");
+			}
+
+			parserOutput.endTag(null, "ColorTable");
+			parserOutput.text("\n");
+			parserOutput.endDocument();
+			// Cerrar nuevo fichero
+			writer.close();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Invocar� todos los metodos de actualizaciones de version
+	 * @param palettesBasePath
+	 * @throws FilePaletteException 
+	 */
+	public void updateVersion(String palettesBasePath) throws FilePaletteException {
+		updateVersion_1_0_to_1_1(palettesBasePath);
+		//updateVersion_1_1_to_1_2(palettesBasePath);
+	}
+
+	/**
+	 * Devuelve el color si lo encuentra en el arraylist y lo elimina, en caso
+	 * contrario devuelve null
+	 * @param list
+	 * @param value
+	 * @return
+	 */
+	public ColorItem getColorItem(ArrayList<ColorItem> list, double value) {
+		for (int i = 0; i < list.size(); i++) {
+			if (((ColorItem) list.get(i)).getValue() == value) {
+				return (ColorItem) list.remove(i);
+			}
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary#loadPalette(java.lang.String, java.lang.String, java.util.ArrayList)
+	 */
+	public String loadPalette(String palettesBasePath, String paletteFileName, ArrayList<ColorItem> items) throws FilePaletteException {
+		updateVersion(palettesBasePath);
+
+		items.clear();
+
+		File palettesFile = new File(palettesBasePath + File.separator + paletteFileName);
+		if (!palettesFile.exists())
+			return null;
+
+		try {
+			String paletteName = "";
+			ArrayList<ColorItem> rows = new ArrayList<ColorItem>();
+
+			KXmlParser parser = new KXmlParser();
+			FileInputStream in = new FileInputStream(palettesBasePath + File.separator + paletteFileName);
+
+			InputStreamReader reader = new InputStreamReader(in, "UTF8");
+			parser.setInput(reader);
+			int tag = parser.nextTag();
+
+			parser.require(KXmlParser.START_TAG, null, "ColorTable");
+			for (int i = 0; i < parser.getAttributeCount(); i++) {
+				if (parser.getAttributeName(i).equals("name")) {
+					paletteName = parser.getAttributeValue(i);
+				}
+			}
+			tag = parser.nextTag();
+
+			while (!((tag == KXmlParser.END_TAG) && (parser.getName().equals("ColorTable")))) {
+				try {
+					if (tag == KXmlParser.START_TAG) {
+						if (parser.getName().equals("Color")) {
+							ColorItem colorItem = new ColorItemImpl();
+							int a = 255;
+							for (int i = 0; i < parser.getAttributeCount(); i++) {
+								if (parser.getAttributeName(i).equals("value")) {
+									colorItem.setValue(Double.parseDouble((String) parser.getAttributeValue(i)));
+									ColorItem aux = getColorItem(rows, Double.parseDouble((String) parser.getAttributeValue(i)));
+									if (aux != null)
+										a = aux.getColor().getAlpha();
+								}
+								if (parser.getAttributeName(i).equals("name")) {
+									colorItem.setNameClass((String) parser.getAttributeValue(i));
+								}
+								if (parser.getAttributeName(i).equals("rgb")) {
+									String rgb = parser.getAttributeValue(i);
+									int r = Integer.valueOf(rgb.substring(0, rgb.indexOf(","))).intValue();
+									int g = Integer.valueOf(rgb.substring(rgb.indexOf(",") + 1, rgb.lastIndexOf(","))).intValue();
+									int b = Integer.valueOf(rgb.substring(rgb.lastIndexOf(",") + 1, rgb.length())).intValue();
+
+									colorItem.setColor(new Color(r, g, b, a));
+								}
+								if (parser.getAttributeName(i).equals("interpolated")) {
+									colorItem.setInterpolated(Double.parseDouble((String) parser.getAttributeValue(i)));
+								}
+							}
+
+							rows.add(colorItem);
+							continue;
+						}
+						if (parser.getName().equals("Alpha")) {
+							ColorItem colorItem = new ColorItemImpl();
+							for (int i = 0; i < parser.getAttributeCount(); i++) {
+								if (parser.getAttributeName(i).equals("value")) {
+									colorItem.setValue(Double.parseDouble((String) parser.getAttributeValue(i)));
+									ColorItem aux = getColorItem(rows, Double.parseDouble((String) parser.getAttributeValue(i)));
+									if (aux != null) {
+										colorItem.setNameClass(aux.getNameClass());
+										colorItem.setInterpolated(aux.getInterpolated());
+										colorItem.setColor(new Color(aux.getColor().getRed(), aux.getColor().getGreen(), aux.getColor().getBlue(), colorItem.getColor().getAlpha()));
+									}
+								}
+								if (parser.getAttributeName(i).equals("alpha")) {
+									int a = Integer.parseInt(parser.getAttributeValue(i));
+
+									colorItem.setColor(new Color(colorItem.getColor().getRed(), colorItem.getColor().getGreen(), colorItem.getColor().getBlue(), a));
+								}
+								if (parser.getAttributeName(i).equals("interpolated")) {
+									colorItem.setInterpolated(Double.parseDouble((String) parser.getAttributeValue(i)));
+								}
+							}
+
+							rows.add(colorItem);
+							continue;
+						}
+					}
+				} finally {
+					tag = parser.nextTag();
+				}
+			}
+
+			for (int i = 0; i < rows.size(); i++)
+				items.add(rows.get(i));
+
+			reader.close();
+			return paletteName;
+		} catch (FileNotFoundException fnfEx) {
+			fnfEx.printStackTrace();
+		} catch (XmlPullParserException xmlEx) {
+			System.out.println("El fichero de paletas predeterminadas no tiene la estructura correcta:\n	" + xmlEx.getMessage());
+		} catch (IOException e) {
+		}
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/persistence/DefaultColorTableLibrary.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/HistogramClassImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/HistogramClassImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/HistogramClassImpl.java	(revision 15423)
@@ -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.impl.datastruct;
+
+import org.gvsig.fmap.dal.coverage.datastruct.HistogramClass;
+
+
+/**
+ * Clase que define un intervalo de datos. Es util para cosas como el calculo de histogramas
+ * con tipo de datos en coma flotante en el cual hay que dividir los intervalos en
+ * clases. Las clases se tendr�n en cuenta como un intervalo el cual el menor es cerrado y el 
+ * mayor abierto, es decir
+ * <PRE>
+ * En las clases:
+ * 0-1000
+ * 1000-2000
+ * los intervalos son 
+ * [0, 1000 [  de 0-999.9p
+ * [1000, 2000[ de 1000-1999.9p
+ * </PRE>
+ *  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class HistogramClassImpl implements HistogramClass {	
+	private double 	value = 0D;
+	private double 	min = 0D;
+	private double 	max = 0D;
+
+	/**
+	 * Constructor.
+	 * @param a Entero que representa al un valor de la clase
+	 * @param b Entero que representa al un valor de la clase
+	 */
+	public HistogramClassImpl(double a, double b){
+		this.max = (a >= b) ? a : b;
+		this.min = (a <= b) ? a : b;
+	}
+	
+	/**
+	 * Comprueba si el valor pasado por par�metro est� dentro del intervalo
+	 * @param value Valor a comprobar
+	 * @return true si est� dentro del intervalo y false si no lo est�
+	 */
+	public boolean isIn(double value){
+		return (value >= min && value < max);
+	}
+	
+	/**
+	 * Obtiene el valor m�ximo de la clase
+	 * @return Entero que representa al valor m�ximo de la clase
+	 */
+	public double getMax() {
+		return max;
+	}
+	
+	/**
+	 * Asigna el valor m�ximo de la clase
+	 * @param max Entero que representa al valor m�ximo de la clase
+	 */
+	public void setMax(double max) {
+		this.max = max;
+	}
+	
+	/**
+	 * Obtiene el valor m�nimo de la clase
+	 * @return Entero que representa al valor m�nimo de la clase
+	 */
+	public double getMin() {
+		return min;
+	}
+	
+	/**
+	 * ASigna el valor m�nimo de la clase
+	 * @param min Entero que representa al valor m�nimo de la clase
+	 */
+	public void setMin(double min) {
+		this.min = min;
+	}
+
+	/**
+	 * Obtiene el valor de la clase
+	 * @return double con el valor
+	 */
+	public double getValue() {
+		return value;
+	}
+
+	/**
+	 * Asigna el valor de la clase
+	 * @param double con el valor
+	 */
+	public void setValue(double value) {
+		this.value = value;
+	}	
+	
+	/**
+	 * Incrementa en n el valor especificado
+	 * @param double n
+	 */
+	public void increment(double n) {
+		this.value += n;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/HistogramClassImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/GeoPointImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/GeoPointImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/GeoPointImpl.java	(revision 15423)
@@ -0,0 +1,275 @@
+/* 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.impl.datastruct;
+
+import java.awt.Dimension;
+import java.awt.geom.Point2D;
+
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPoint;
+
+/**
+ * This class represents a ground control point which can be associated to a
+ * raster. This kind of points has information about real and pixel coordinates
+ * and other information like RMS errors related to it.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GeoPointImpl implements GeoPoint {
+	private Point2D        pixelPoint       = null;
+	private Point2D        mapPoint         = null;
+	private boolean        active           = true;
+	private double         errorX           = 0;
+	private double         errorY           = 0;
+	private double         rms              = 0;
+	private double         xEvaluate        = 0;
+	private double         yEvaluate        = 0;
+	private int            number           = 0;
+	private String         label            = null;
+	
+	//Compatibilidad viejo modelo
+	public static int      WIDTH_WINDOW     = 140;
+	public static int      HEIGHT_WINDOW    = 140;
+	public DefaultViewPortData   leftViewPort     = null, rightViewPort = null;
+	public Point2D         leftCenterPoint  = null, rightCenterPoint = null;
+	public double          zoomLeft         = 1, zoomRight = 1;
+	
+	/**
+	 * Constructor
+	 */
+	public GeoPointImpl(){}
+
+	/**
+	 * Constructor
+	 * @param p pixelPoint
+	 * @param m mapPoint
+	 */
+	public GeoPointImpl(Point2D p, Point2D m){
+		this.pixelPoint = p;
+		this.mapPoint = m;
+	}
+	
+	/**
+	 * Inicializa a 0 los valores de los errores
+	 */
+	public void resetErrors() {
+		xEvaluate = 0;
+		yEvaluate = 0;
+		errorX = 0;
+		errorY = 0;
+		rms = 0;
+	}
+	
+	/**
+	 * Obtiene la predicci�n de la coordenada X
+	 * @return double
+	 */
+	public double getEvaluateX() {
+		return xEvaluate;
+	}
+
+	/**
+	 * Asigna la predicci�n de la coordenada X
+	 * @param errorX
+	 */
+	public void setEvaluateX(double xEvaluate) {
+		this.xEvaluate = xEvaluate;
+	}
+
+	/**
+	 * Obtiene la predicci�n de la coordenada Y
+	 * @return double
+	 */
+	public double getEvaluateY() {
+		return yEvaluate;
+	}
+
+	/**
+	 * Asigna la predicci�n de la coordenada Y
+	 * @param errorY
+	 */
+	public void setEvaluateY(double yEvaluate) {
+		this.yEvaluate = yEvaluate;
+	}
+	
+	/**
+	 * Obtiene el error en X
+	 * @return double
+	 */
+	public double getErrorX() {
+		return errorX;
+	}
+
+	/**
+	 * Asigna el error en X
+	 * @param errorX
+	 */
+	public void setErrorX(double errorX) {
+		this.errorX = errorX;
+	}
+
+	/**
+	 * Obtiene el error en Y
+	 * @return double
+	 */
+	public double getErrorY() {
+		return errorY;
+	}
+
+	/**
+	 * Asigna el error en Y
+	 * @param errorY
+	 */
+	public void setErrorY(double errorY) {
+		this.errorY = errorY;
+	}
+
+	/**
+	 * Obtiene el error RMS
+	 * @return
+	 */
+	public double getRms() {
+		return rms;
+	}
+
+	/**
+	 * Asigna el error RMS
+	 * @param rms
+	 */
+	public void setRms(double rms) {
+		this.rms = rms;
+	}
+	
+	public Point2D getPixelPoint() {
+		return pixelPoint;
+	}
+
+	public void setPixelPoint(Point2D pixelPoint) {
+		this.pixelPoint = pixelPoint;
+	}
+
+	public Point2D getMapPoint() {
+		return mapPoint;
+	}
+
+	public void setMapPoint(Point2D mapPoint) {
+		this.mapPoint = mapPoint;
+	}
+
+	public boolean isActive() {
+		return active;
+	}
+
+	public void setActive(boolean active) {
+		this.active = active;
+	}
+
+	public double getxEvaluate() {
+		return xEvaluate;
+	}
+
+	public void setxEvaluate(double xEvaluate) {
+		this.xEvaluate = xEvaluate;
+	}
+
+	public double getyEvaluate() {
+		return yEvaluate;
+	}
+
+	public void setyEvaluate(double yEvaluate) {
+		this.yEvaluate = yEvaluate;
+	}
+
+	public int getNumber() {
+		return number;
+	}
+	
+	public String getLabel() {
+		return label;
+	}
+	
+	public void setNumber(int number) {
+		this.number = number;
+	}
+	
+	public void setLabel(String label) {
+		this.label = label;
+	}
+
+	/**
+	 * Hace una copia de la instancia del punto.
+	 * @return GeoPoint
+	 */
+	public GeoPointImpl cloneGeoPoint(){
+		Point2D pixel = null;
+		Point2D map = null;
+		if(pixelPoint != null)
+			pixel = (Point2D)pixelPoint.clone();
+
+		if(mapPoint != null)
+			map = (Point2D)mapPoint.clone();
+
+		GeoPointImpl gp = new GeoPointImpl(pixel, map);
+		gp.setErrorX(this.getErrorX());
+		gp.setErrorY(this.getErrorY());
+		gp.setRms(this.getRms());
+
+		if(leftViewPort != null){
+			gp.leftViewPort = new DefaultViewPortData();
+			gp.leftViewPort.setProjection(leftViewPort.getProjection());
+			gp.leftViewPort.setExtent(leftViewPort.getExtent());
+			gp.leftViewPort.setSize((Dimension)leftViewPort.getSize().clone());
+			gp.leftViewPort.reExtent();
+		}
+
+		if(rightViewPort != null){
+			gp.rightViewPort = new DefaultViewPortData();
+			gp.rightViewPort.setProjection(rightViewPort.getProjection());
+			gp.rightViewPort.setExtent(rightViewPort.getExtent());
+			gp.rightViewPort.setSize((Dimension)rightViewPort.getSize().clone());
+			gp.rightViewPort.reExtent();
+		}
+
+		if(leftCenterPoint != null)
+			gp.leftCenterPoint = (Point2D)this.leftCenterPoint.clone();
+		if(rightCenterPoint != null)
+			gp.rightCenterPoint = (Point2D)this.rightCenterPoint.clone();
+		gp.active = this.active;
+		gp.zoomLeft = this.zoomLeft;
+		gp.zoomRight = this.zoomRight;
+		return gp;
+	}
+	
+	/**
+	 * Muestra por consola algunos valores de un geopunto
+	 */
+	public void show(){
+		System.out.println("********GeoPoint**********");
+		System.out.println("Pixel: "+pixelPoint);
+		System.out.println("Map: "+mapPoint);
+		System.out.println("Left Zoom Center: "+leftCenterPoint);
+		System.out.println("Right Zoom Center: "+rightCenterPoint);
+		System.out.println("Active: "+active);
+		System.out.println("ZoomLeft: "+zoomLeft);
+		System.out.println("ZoomRight: "+zoomRight);
+		System.out.println("******End GeoPoint********");
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/GeoPointImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/TransparencyRangeImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/TransparencyRangeImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/TransparencyRangeImpl.java	(revision 15423)
@@ -0,0 +1,459 @@
+/* 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.impl.datastruct;
+
+import java.io.IOException;
+import java.util.Arrays;
+
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+import org.gvsig.tools.ToolsLocator;
+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;
+/**
+ * Clase que representa a un conjunto de pixeles con transparencia. Incluye los
+ * rangos de transparencia para cada banda, la cadena que va en la lista y la
+ * operaci�n que se realiza entre ellos. Un And significa que ser�n
+ * transparentes todos los pixeles que cumplan con R con G y con B. Un Or
+ * significar� que tendr�n transparencia todos los pixeles que cumplan con R con
+ * G o con B.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TransparencyRangeImpl implements TransparencyRange, Cloneable {
+	private String  strEntry = null;
+	private int[]   red      = null;
+	private int[]   green    = null;
+	private int[]   blue     = null;
+	private boolean and      = true;
+	private int     alpha    = 0;
+
+	/**
+	 * Constructor
+	 */
+	public TransparencyRangeImpl() {
+	}
+
+	/**
+	 * Crea un objeto TransparencyRange a partir de una cadena bien formada
+	 * @param value cadena bien formada que representa un intervalo
+	 */
+	public TransparencyRangeImpl(String value) {
+		try {
+			red = new int[2];
+			green = new int[2];
+			blue = new int[2];
+			and = stringToInterval(value, red, green, blue);
+			strEntry = value;
+		} catch (IOException e) {
+			// Cadena mal formada
+		}
+	}
+
+	
+	/**
+	 * Obtiene la operaci�n  utilizada
+	 * @param and Si es true significa que se usa un AND y false implica
+	 * que se usa un OR
+	 */
+	public boolean isAnd() {
+		return and;
+	}
+
+	/**
+	 * Asigna la operaci�n AND como la utilizada
+	 * @param and booleano que si est� a true significa que el la operaci�n
+	 * AND es la utilizada como operaci�n.
+	 */
+	public void setAnd(boolean and) {
+		this.and = and;
+	}
+
+	/**
+	 * Obtiene el intervalo de valores correspondiente a la banda del azul
+	 * @return Array bidimensional de enteros correspondiente a la banda del azul
+	 */
+	public int[] getBlue() {
+		return blue;
+	}
+
+	/**
+	 * Asigna los intervalos de valores correspondientes a las bandas del
+	 * rojo, azul y verde
+	 * @param red Array bidimensional de enteros correspondiente a la banda del rojo
+	 * @param green Array bidimensional de enteros correspondiente a la banda del verde
+	 * @param blue Array bidimensional de enteros correspondiente a la banda del azul
+	 */
+	public void setRGB(int[] red, int[] green, int[] blue) {
+		this.red = red;
+		this.green = green;
+		this.blue = blue;
+	}
+
+	/**
+	 * Asigna el intervalo de valores correspondiente a la banda del azul
+	 * @param blue Array bidimensional de enteros correspondiente a la banda del azul
+	 */
+	public void setBlue(int[] blue) {
+		this.blue = blue;
+	}
+
+	/**
+	 * Obtiene el intervalo de valores correspondiente a la banda del verde
+	 * @return Array bidimensional de enteros correspondiente a la banda del verde
+	 */
+	public int[] getGreen() {
+		return green;
+	}
+
+	/**
+	 * Asigna el intervalo de valores correspondiente a la banda del verde
+	 * @param green Array bidimensional de enteros correspondiente a la banda del verde
+	 */
+	public void setGreen(int[] green) {
+		this.green = green;
+	}
+
+	/**
+	 * Obtiene el intervalo de valores correspondiente a la banda del rojo
+	 * @return Array bidimensional de enteros correspondiente a la banda del rojo
+	 */
+	public int[] getRed() {
+		return red;
+	}
+
+	/**
+	 * Asigna el intervalo de valores correspondiente a la banda del rojo
+	 * @param red Array bidimensional de enteros correspondiente a la banda del rojo
+	 */
+	public void setRed(int[] red) {
+		this.red = red;
+	}
+
+	/**
+	 * Obtiene la cadena que representa una entrada en la tabla.
+	 * @return Cadena que representa una entrada en la tabla
+	 */
+	public String getStrEntry() {
+		return strEntry;
+	}
+
+	/**
+	 * Asigna la cadena que representa una entrada en la tabla.
+	 * @param strEntry Cadena que representa una entrada en la tabla.
+	 */
+	public void setStrEntry(String strEntry) {
+		this.strEntry = strEntry;
+	}
+
+	/**
+	 * Esta funci�n valida la cadena de entrada por medio de una m�quina de estados. Valida las
+	 * siguientes posibilidades en la cadena de entrada:
+	 * <LI>
+	 * <UL>(valor_rojo) & (Valor_verde) & (Valor_azul)</UL>
+	 * <UL>(valor_rojo) | (Valor_verde) | (Valor_azul)</UL>
+	 * </LI>
+	 * Despues de la validaci�n parsea el contenido y carga los par�metros r,g,b con los
+	 * intervalos de valores. Estos par�metros deben ser pasados como arrays de enteros de
+	 * dos elementos.
+	 * @param values
+	 * @param r	Intervalo de rojo
+	 * @param g Intervalo de verde
+	 * @param b Intervalo de azul
+	 * @return Devuelve true si la operaci�n usada en los intervalos es un AND y false si es un OR
+	 */
+	public boolean stringToInterval(String values, int[] r, int[] g, int[] b) throws IOException {
+		int status = 0;
+		int countAnd = 0, countOr = 0;
+		boolean and = true;
+		for (int i = 0; i < values.length(); i++) {
+			char c = values.charAt(i);
+			switch (status) {
+				case 0:
+					if (c == ' ')
+						status = 0;
+					else if ((c >= 48 && c <= 57) || c == '*')
+						status = 1;
+					else
+						status = 4;
+					break;
+				case 1:
+					if ((c >= 48 && c <= 57) || (c == ' '))
+						status = 1;
+					else if (c == ':')
+						status = 2;
+					else if (c == '&') {
+						status = 0;
+						countAnd++;
+					} else if (c == '|') {
+						status = 0;
+						countOr++;
+					} else
+						status = 4;
+					break;
+				case 2:
+					if (c >= 48 && c <= 57)
+						status = 3;
+					else
+						status = 4;
+					break;
+				case 3:
+					if ((c >= 48 && c <= 57) || (c == ' '))
+						status = 3;
+					else if (c == '&') {
+						status = 0;
+						countAnd++;
+					} else if (c == '|') {
+						status = 0;
+						countOr++;
+					} else
+						status = 4;
+					break;
+				case 4:
+					throw new IOException("Error en la cadena de entrada " + status);
+			}
+		}
+
+		// Si el analisis es correcto parseamos
+		if ((status == 1 || status == 3) && ((countAnd == 2 && countOr == 0) || (countAnd == 0 && countOr == 2))) {
+			String[] s = values.split(" & ");
+			if (s.length < 3) {
+				s = values.split(" \\| ");
+				and = false;
+			}
+			;
+			String[] val = s[0].split(":");
+			try {
+				r[0] = Integer.parseInt(val[0]);
+				if (val.length == 2)
+					r[1] = Integer.parseInt(val[1]);
+				else
+					r[1] = Integer.parseInt(val[0]);
+			} catch (NumberFormatException e) {
+				r[0] = -1;
+				r[1] = -1;
+			}
+
+			val = s[1].split(":");
+			try {
+				g[0] = Integer.parseInt(val[0]);
+				if (val.length == 2)
+					g[1] = Integer.parseInt(val[1]);
+				else
+					g[1] = Integer.parseInt(val[0]);
+			} catch (NumberFormatException e) {
+				g[0] = -1;
+				g[1] = -1;
+			}
+
+			val = s[2].split(":");
+			try {
+				b[0] = Integer.parseInt(val[0]);
+				if (val.length == 2)
+					b[1] = Integer.parseInt(val[1]);
+				else
+					b[1] = Integer.parseInt(val[0]);
+			} catch (NumberFormatException e) {
+				b[0] = -1;
+				b[1] = -1;
+			}
+		} else
+			throw new IOException("Error en la cadena de entrada ");
+
+		return and;
+	}
+
+	/**
+	 * Carga la cadena StrEntry leyendo los valores en los vectores que representa los intervalos.
+	 */
+	public void loadStrEntryFromValues(){
+		String separator = " | ";
+		if (and)
+			separator = " & ";
+		strEntry = String.valueOf(red[0] + separator+ green[0] + separator + blue[0]);
+	}
+
+	/**
+	 * Obtiene el alpha asociado al rango. Por defecto es de 0, es decir
+	 * totalmente transparente pero puede asociarsele un valor distinto
+	 * @return Alpha asociado
+	 */
+	public int getAlpha() {
+		return alpha;
+	}
+
+	/**
+	 * Asigna el alpha asociado al rango. Por defecto es de 0, es decir
+	 * totalmente transparente pero puede asociarsele un valor distinto
+	 * @param alpha asociado
+	 */
+	public void setAlpha(int alpha) {
+		this.alpha = alpha;
+	}
+
+	/**
+	 * Realiza la uni�n entre el intervalo actual y el pasado por par�metro
+	 * @param interval intervalo pasado
+	 * @param rgb
+	 * @return union de intervalos
+	 */
+	public int[] union(int[] interval, int rgb) {
+		switch (rgb) {
+			case AbstractRasterProvider.RED_BAND:
+				if ((red[1] >= interval[0] && red[0] <= interval[0]) || (red[0] <= interval[1] && red[0] >= interval[0]))
+					return new int[] { Math.min(red[0], interval[0]), Math.max(red[1], interval[1]) };
+			case AbstractRasterProvider.GREEN_BAND:
+				if ((green[1] >= interval[0] && green[0] <= interval[0]) || (green[0] <= interval[1] && green[0] >= interval[0]))
+					return new int[] { Math.min(green[0], interval[0]), Math.max(green[1], interval[1]) };
+			case AbstractRasterProvider.BLUE_BAND:
+				if ((blue[1] >= interval[0] && blue[0] <= interval[0]) || (blue[0] <= interval[1] && blue[0] >= interval[0]))
+					return new int[] { Math.min(blue[0], interval[0]), Math.max(blue[1], interval[1]) };
+		}
+		return null;
+	}
+
+	/**
+	 * Muestra los datos del objeto para depuraci�n.
+	 */
+	public void show(){
+		if (getRed() != null)
+			System.out.println(getRed()[0] + " " + getRed()[1]);
+		if (getGreen() != null)
+			System.out.println(getGreen()[0] + " " + getGreen()[1]);
+		if (getBlue() != null)
+			System.out.println(getBlue()[0] + " " + getBlue()[1]);
+		System.out.println(isAnd());
+		System.out.println(getStrEntry());
+		System.out.println("--------------------");
+	}
+
+	public Object clone() {
+		TransparencyRangeImpl clone = null;
+		try {
+			clone = (TransparencyRangeImpl) super.clone();
+		} catch (CloneNotSupportedException e) {
+		}
+
+		if (strEntry != null)
+			clone.strEntry = new String(strEntry);
+
+		if (red != null)
+			clone.red = (int[]) red.clone();
+
+		if (green != null)
+			clone.green = (int[]) green.clone();
+
+		if (blue != null)
+			clone.blue = (int[]) blue.clone();
+
+		return clone;
+	}
+
+	public int hashCode() {
+		final int PRIME = 31;
+		int result = 1;
+		result = PRIME * result + alpha;
+		result = PRIME * result + (and ? 1231 : 1237);
+		result = PRIME * result + TransparencyRangeImpl.hashCode(blue);
+		result = PRIME * result + TransparencyRangeImpl.hashCode(green);
+		result = PRIME * result + TransparencyRangeImpl.hashCode(red);
+		result = PRIME * result + ((strEntry == null) ? 0 : strEntry.hashCode());
+		return result;
+	}
+	
+	private static int hashCode(int[] array) {
+		final int PRIME = 31;
+		if (array == null)
+			return 0;
+		int result = 1;
+		for (int index = 0; index < array.length; index++) {
+			result = PRIME * result + array[index];
+		}
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final TransparencyRangeImpl other = (TransparencyRangeImpl) obj;
+		if (alpha != other.alpha)
+			return false;
+		if (and != other.and)
+			return false;
+		if (!Arrays.equals(blue, other.blue))
+			return false;
+		if (!Arrays.equals(green, other.green))
+			return false;
+		if (!Arrays.equals(red, other.red))
+			return false;
+		if (strEntry == null) {
+			if (other.strEntry != null)
+				return false;
+		} else if (!strEntry.equals(other.strEntry))
+			return false;
+		return true;
+	}
+
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		strEntry = state.getString("strEntry");
+		alpha = state.getInt("alpha");
+
+		red = (int[])state.getIntArray("red");
+		green = (int[])state.getIntArray("green");
+		blue = (int[])state.getIntArray("blue");
+
+		and = state.getBoolean("and");
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("strEntry", strEntry);
+		state.set("alpha", alpha);
+		state.set("red", red);
+		state.set("blue", blue);
+		state.set("green", green);
+		state.set("and", and);		
+	}
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.addDefinition(
+				TransparencyRangeImpl.class,
+				"TransparencyRange_Persistent",
+				"TransparencyRange Persistent definition",
+				null, 
+				null
+		);
+		definition.addDynFieldString("strEntry").setMandatory(false);
+		definition.addDynFieldInt("alpha").setMandatory(false);
+		definition.addDynFieldArray("red").setClassOfItems(int.class).setMandatory(false);
+		definition.addDynFieldArray("blue").setClassOfItems(int.class).setMandatory(false);
+		definition.addDynFieldArray("green").setClassOfItems(int.class).setMandatory(false);
+		definition.addDynFieldBoolean("and").setMandatory(false);
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/TransparencyRangeImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BufferHistogramImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BufferHistogramImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BufferHistogramImpl.java	(revision 15423)
@@ -0,0 +1,606 @@
+/* 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.impl.datastruct;
+
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.HistogramClass;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.slf4j.LoggerFactory;
+/**
+ * Representa un histograma.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class BufferHistogramImpl implements BufferHistogram {
+	/**
+	 * Variable que representa el histograma. La primera dimensi�n es el n�mero de 
+	 * bandas y la segunda un array de clases. En el caso b�sico de un RGB una clase tendr� el
+	 * valor m�nimo igual al m�ximo.
+	 */
+	private HistogramClass[][] histogram   = null;
+
+	private long[][]           table       = null;
+	private double[]           min         = null;
+	private double[]           max         = null;
+	private NoData             noDataValue = null;
+	private int                dataType    = Buffer.TYPE_UNDEFINED;
+	
+	private int                nClasses    = 0;
+
+	/**
+	 * Constructor
+	 * @param nBands N�mero de bandas
+	 * @param nClasses N�mero de clases en que hacemos la divisi�n
+	 * @param min Valor m�nimo del histograma
+	 * @param max Valor m�ximo del histograma
+	 */
+	public BufferHistogramImpl(int nBands, int nClasses, double[] min, double[] max) {
+		if ((nBands != min.length) || (nBands != max.length)) {
+			System.out.println("No tiene las mismas bandas");
+		}
+		constructorHistogramImpl(min, max, nClasses);
+	}
+	
+	private void constructorHistogramImpl(double[] min, double[] max, int nClasses) {
+		table = new long[min.length][nClasses];
+		for (int i = 0; i < table.length; i++)
+			for (int j = 0; j < table[0].length; j++)
+				table[i][j] = 0;
+		this.min = (double[]) min.clone();
+		this.max = (double[]) max.clone();
+
+		this.nClasses = getNumValues();
+	}
+
+	/**
+	 * Constructor
+	 * @param nBands N�mero de bandas
+	 * @param nClasses N�mero de clases en que hacemos la divisi�n
+	 * @param min Valor m�nimo del histograma
+	 * @param max Valor m�ximo del histograma
+	 */
+	public BufferHistogramImpl(int nBands, double[] min, double[] max, int dataType) {
+		int numberClasses;
+		this.dataType = dataType;
+		this.min = (double[]) min.clone();
+		this.max = (double[]) max.clone();
+		if (dataType == Buffer.TYPE_BYTE) {
+			numberClasses = RasterLibrary.defaultNumberOfColors;
+			boolean unsigned = false;
+			for (int i = 0; i < this.min.length; i++)
+				if (this.min[i] < 0)
+					unsigned = true;
+			for (int i = 0; i < this.min.length; i++) {
+				if (unsigned) {
+					this.min[i] = -128;
+					this.max[i] = 127;
+				} else {
+					this.min[i] = 0;
+					this.max[i] = 255;
+				}
+			}
+		} else {
+			numberClasses = RasterLibrary.defaultNumberOfClasses;
+		}
+		
+		constructorHistogramImpl(this.min, this.max, numberClasses);
+	}
+	
+	/**
+	 * Realiza la uni�n entre el histograma actual y el pasado 
+	 * por par�metro.
+	 * @param hist
+	 */
+	public boolean union(BufferHistogram hist) {
+		long[][] auxTable = hist.getTable();
+
+		if (auxTable.length != table.length)
+			return false;
+
+		if (auxTable.length == 0)
+			return true;
+
+		if (auxTable[0].length != table[0].length)
+			return false;
+
+		for (int i = 0; i < table.length; i++)
+			for (int j = 0; j < table[i].length; j++)
+				table[i][j] += auxTable[i][j];
+
+		return true;
+	}
+
+	/**
+	 * Asigna la tabla
+	 * @param t
+	 */
+	public void setTable(long[][] t) {
+		table = new long[t.length][t[0].length];
+		for (int i = 0; i < table.length; i++)
+			for (int j = 0; j < table[0].length; j++)
+				table[i][j] = t[i][j];
+		
+		this.nClasses = getNumValues();
+	}
+	
+	/**
+	 * Devuelve el minimo valor del histograma
+	 * @return
+	 */
+	public double getMin(int band) {
+		return min[band];
+	}
+
+	/**
+	 * Devuelve el maximo valor del histograma
+	 * @return
+	 */
+	public double getMax(int band) {
+		return max[band];
+	}
+
+	/**
+	 * Devuelve los minimos valores del histograma
+	 * @return
+	 */
+	public double[] getMinims() {
+		return min;
+	}
+
+	/**
+	 * Devuelve los maximos valores del histograma
+	 * @return
+	 */
+	public double[] getMaxims() {
+		return max;
+	}
+
+	/**
+	 * Devuelve si un histograma esta en un rango RGB aceptable
+	 * @return
+	 */
+	public boolean isInRangeRGB() {
+		if (dataType == Buffer.TYPE_BYTE)
+			return true;
+		return true;
+	}
+
+	/**
+	 * Obtiene el histograma sin modificar
+	 * @return array bidimensional donde el primer elemento es el valor del pixel
+	 * o rango y el segundo el n�mero de elementos que aparecen.
+	 */
+	public HistogramClass[][] getHistogram() {
+		if (nClasses == 0)
+			return null;
+		
+		histogram = new HistogramClass[table.length][nClasses];
+				
+		for (int i = 0; i < table.length; i++) {
+			for (int j = 0; j < table[i].length; j++) {
+				HistogramClass hc = new HistogramClassImpl(	min[i] + ((j * (max[i] - min[i])) / (nClasses - 1)), 
+														min[i] + (((j + 1) * (max[i] - min[i])) / (nClasses - 1)));
+				hc.setValue(table[i][j]);
+				histogram[i][j] = hc;
+			}
+		}
+		return histogram;
+	}
+	
+	/**
+	 * Obtiene el n�mero de bandas del histograma 
+	 * @return entero que representa el n�mero de bandas 
+	 */
+	public int getNumBands() {
+		if (table != null)
+			return table.length;
+		return 0;
+	}
+	
+	/**
+	 * Obtiene el tipo de datos del histograma original
+	 * @return
+	 */
+	public int getDataType() {
+		return dataType;
+	}
+	
+	/**
+	 * Obtiene la longitud (n�mero de valores) de una banda determinada
+	 * @param band Banda o obtener la longitud
+	 * @return entero con la longitud de la banda
+	 * rangos de valores y DataclassList.
+	 */
+	public int getBandLenght(int band) {
+		if (table != null)
+			return table[band].length;
+		return 0;
+	}
+	
+	/**
+	 * Obtiene el n�mero de valores o clases del histograma
+	 * @return entero que representa el n�mero de valores o clases del histograma
+	 */
+	public int getNumValues() {
+		if (table == null)
+			return 0;
+
+		if (table.length == 0)
+			return 0;
+		
+		return table[0].length;
+	}
+	
+	/**
+	 * Asigna un histograma
+	 * @param hist histograma asignado
+	 */
+	public void setHistogram(HistogramClass[][] hist){
+		histogram = hist;
+	}
+		
+	/**
+	 * Asigna un valor para una posici�n del histograma
+	 * @param band Valor del pixel o clase a asignar
+	 * @param px Valor del pixel
+	 * @param value Valor a asignar
+	 */
+	public void setHistogramValue(int band, double px, long value) {
+		int pos = (int) (((nClasses - 1) * (px - min[band])) / (max[band] - min[band]));
+		if (pos < 0)
+			pos = 0;
+		if (pos >= nClasses)
+			pos = nClasses - 1;
+		table[band][pos] = value;
+	}
+	
+	/**
+	 * Asigna un valor para una posici�n del histograma segun la posicion en las
+	 * clases
+	 * @param band Valor del pixel o clase a asignar
+	 * @param pos Posicion dentro de la clase. Ejemplo 0..63
+	 * @param value Valor a asignar
+	 */
+	public void setHistogramValueByPos(int band, int pos, long value) {
+		if (pos < 0)
+			pos = 0;
+		if (pos >= nClasses)
+			pos = nClasses - 1;
+		table[band][pos] = value;
+	}
+
+	/**
+	 * Obtiene un valor del histograma
+	 * @param band N�mero de banda del valor a recuperar
+	 * @param px Pixel o valor de la clase del valor a recuperar
+	 * @return valor
+	 */
+	public double getHistogramValue(int band, double px) {
+		if (histogram == null)
+			getHistogram();
+
+		for (int i = 0; i < histogram[band].length; i++)
+			if (((HistogramClass) histogram[band][i]).isIn(px))
+				return ((HistogramClass) histogram[band][i]).getValue();
+
+		return 0;
+	}
+	
+	/**
+	 * Obtiene un valor del histograma segun la posicion dentro de las clases
+	 * @param band N�mero de banda del valor a recuperar
+	 * @param px Pixel o valor de la clase del valor a recuperar
+	 * @return valor
+	 */
+	public double getHistogramValueByPos(int band, int pos) {
+		if (pos < 0)
+			pos = 0;
+
+		if (pos >= nClasses)
+			pos = nClasses - 1;
+
+		return table[band][pos];
+	}
+	
+	/**
+	 * Incrementa un valor de una posici�n del histograma
+	 * @param band N�mero de banda
+	 * @param px Pixel o valor de la clase
+	 */
+	public void incrementPxValue(int band, double px) {
+		if (Double.isNaN(px))
+			return;
+
+		if (noDataValue != null && noDataValue.isDefined()) {
+			switch (dataType) {
+			case Buffer.TYPE_BYTE:
+				if(((byte)px) == noDataValue.getValue().byteValue())
+						return;
+				break;
+			case Buffer.TYPE_SHORT:
+				if(((short)px) == noDataValue.getValue().shortValue())
+					return;
+				break;
+			case Buffer.TYPE_INT:
+				if(((int)px) == noDataValue.getValue().intValue())
+					return;
+				break;
+			case Buffer.TYPE_FLOAT:
+				if(((float)px) == noDataValue.getValue().floatValue())
+					return;
+				break;
+			case Buffer.TYPE_DOUBLE:
+				if(((double)px) == noDataValue.getValue().doubleValue())
+					return;
+				break;
+			}
+		}
+			
+
+		int pos = (int) (((nClasses - 1) * (px - min[band])) / (max[band] - min[band]));
+
+		if (pos < 0)
+			pos = 0;
+
+		if (pos >= nClasses)
+			pos = nClasses - 1;
+
+		table[band][pos]++;
+	}
+
+	/**
+	 * Calculo de estad�sticas a partir de un histograma. El resultado de la funci�n es un array
+	 * bidimensional donde el primer �ndice inndica la estadistica y el segundo el n�mero de banda.
+	 * 
+	 * <UL>
+	 * <LI>m�nimo</LI>
+	 * <LI>m�ximo</LI>
+	 * <LI>media</LI>
+	 * <LI>mediana</LI>
+	 * <LI>N�mero de pixels</LI>
+	 * </UL>
+	 * @param histogram
+	 * @param bandas solicitadas. Cada elemento del vector representa una banda. Si est� a true se calcula la 
+	 * estadistica para esa banda y si est� a false no se calcular�.
+	 * @return
+	 */
+	public double[][] getBasicStats(boolean[] bands) {
+		if (histogram == null)
+			return null;
+		return getBasicStats(0, histogram[0].length - 1, bands);
+	}
+
+	/**
+	 * Calculo de estad�sticas a partir de un histograma. El resultado de la funci�n es un array
+	 * bidimensional donde el primer �ndice inndica la estadistica y el segundo el n�mero de banda.
+	 * 
+	 * <UL>
+	 * <LI>m�nimo</LI>
+	 * <LI>m�ximo</LI>
+	 * <LI>media</LI>
+	 * <LI>mediana</LI>
+	 * <LI>N�mero de pixels</LI>
+	 * </UL>
+	 * @param histogram
+	 * @param beginPos Posici�n de inicio del histograma para contabilizar estadisticas
+	 * @param endPos Posici�n de fin del histograma para contabilizar estadisticas
+	 * @param bandas solicitadas. Cada elemento del vector representa una banda. Si est� a true se calcula la 
+	 * estadistica para esa banda y si est� a false no se calcular�.
+	 * @return
+	 */
+	public double[][] getBasicStats(double beginPos2, double endPos2, boolean[] bands) {
+		if (histogram == null)
+			getHistogram();
+		
+		int beginPos = (int) ((beginPos2 * (nClasses - 1)) / 100.0);
+		int endPos = (int) ((endPos2 * (nClasses - 1)) / 100.0);
+
+		// Contamos el n�mero de bandas para las cuales se calcula la estad�stica
+		int bandCount = 0;
+		for (int iBand = 0; iBand < bands.length; iBand++)
+			if (bands[iBand])
+				bandCount++;
+
+		double[][] res = new double[5][];
+
+		double[] average = new double[bandCount]; // Valor de pixel medio (Media)
+		double[] middle = new double[bandCount]; // Mediana
+		double[] nPixelsBand = new double[bandCount];// N�mero de pixels por banda
+
+		int showBandCounter = 0; // Contador de bandas de las que hay calcular la
+															// estadistica
+		for (int iBand = 0; iBand < histogram.length; iBand++) {
+			if (bands[iBand]) {
+				for (int i = beginPos; i <= endPos; i++) {
+					// Calculo del n�mero de pixeles
+					nPixelsBand[showBandCounter] += histogram[iBand][i].getValue();
+					average[showBandCounter] += histogram[iBand][i].getValue() * ((histogram[iBand][i].getMax() + histogram[iBand][i].getMin())/2);
+				}
+				// Calculo de la media
+				try {
+					average[showBandCounter] /= nPixelsBand[showBandCounter];
+				} catch (ArithmeticException exc) {
+					average[showBandCounter] = 0;
+				}
+
+				// Calculo de mediana
+				double stopPos = nPixelsBand[showBandCounter] / 2;
+				double aux = 0;
+				int i = beginPos;
+				for (i = beginPos; aux <= stopPos; i++) {
+					if (i >= histogram[iBand].length)
+						break;
+					try {
+						aux += histogram[iBand][i].getValue();
+					} catch (ArrayIndexOutOfBoundsException e) {
+						LoggerFactory.getLogger(getClass().getName()).debug("Acceso a un valor de histogram (Banda: " + iBand + " Posici�n: " + i + ") fuera de l�mites. (NBandas: " + histogram.length + " Valores:" + histogram[iBand].length + ")", e);
+					}
+				}
+				middle[showBandCounter] = (histogram[iBand][i - 1].getMax() + histogram[iBand][i - 1].getMin()) / 2;
+				showBandCounter++;
+			}
+		}
+	 
+		res[0] = min;
+		res[1] = max;
+		res[2] = average;
+		res[3] = middle;
+		res[4] = nPixelsBand;
+		return res;
+	}
+	
+	/**
+	 * Obtiene la tabla de valores
+	 * @return
+	 */
+	public long[][] getTable() {
+		return table;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram#addTable(long[][])
+	 */
+	public void addTable(long[][] table) {
+		if(this.table == null) {
+			this.table = table;
+			return;
+		}
+		long[][] newTable = new long[this.table.length + table.length][];
+		for (int i = 0; i < this.table.length; i++) {
+			newTable[i] = this.table[i];
+		}
+		for (int i = this.table.length; i < (this.table.length + table.length); i++) {
+			newTable[i] = table[i];
+		}
+		table = newTable;
+	}
+	
+	/**
+	 * Obtiene la tabla de valores normalizada. Divide todos los elementos por el n�mero de
+	 * pixeles total.
+	 * @return tabla de valores normalizada
+	 */
+	public static double[][] convertToNormalizeHistogram(long[][] tableToConvert) {
+		long[] nValues = new long[tableToConvert.length];
+		for (int i = 0; i < tableToConvert.length; i++)
+			for (int j = 0; j < tableToConvert[i].length; j++)
+				nValues[i] += tableToConvert[i][j];
+		
+		double[][] res = new double[tableToConvert.length][tableToConvert[0].length];
+		for (int i = 0; i < tableToConvert.length; i++)
+			for (int j = 0; j < tableToConvert[i].length; j++) 
+				res[i][j] = (double)((double)tableToConvert[i][j] / (double)nValues[i]);
+
+		return res;
+	}
+	
+	/**
+	 * Obtiene la tabla de valores normalizada y acumulada. Divide todos los elementos por el n�mero de
+	 * pixeles total.
+	 * @return tabla de valores normalizada
+	 */
+	public static double[][] convertTableToNormalizeAccumulate(long[][] tableToConvert) {
+		double[][] res = convertToNormalizeHistogram(tableToConvert);
+		for (int i = 0; i < tableToConvert.length; i++)
+			for (int j = 0; j < tableToConvert[i].length; j++)
+				if(j > 0)
+					res[i][j] += res[i][j - 1];
+
+		return res;
+	}
+	
+	/**
+	 * Obtiene el histograma de la imagen negativa.
+	 * @return long[][]
+	 */
+	public long[][] getNegativeTable() {
+		long[][] tableNeg = new long[table.length][table[0].length];
+		for (int i = 0; i < tableNeg.length; i++) 
+			for (int j = 0; j < tableNeg[i].length; j++) 
+				tableNeg[i][table[i].length - j - 1] = table[i][j];
+		return tableNeg;
+	}
+
+	/**
+	 * Convierte un histograma al rango de valores de RGB, en pocas palabras
+	 * aplica una operacion 0xff a cada pixel para quitar los numeros negativos
+	 * y desplazarlos a su rango visual.
+	 * @param histogram
+	 */
+	public static BufferHistogram convertHistogramToRGB(BufferHistogram histogram) {
+		if (histogram == null)
+			return null;
+
+		if (histogram.getDataType() != Buffer.TYPE_BYTE)
+			return histogram;
+
+		double min = histogram.getMin(0);
+		double max = histogram.getMax(0);
+
+		long table2[][] = histogram.getTable();
+
+		long newTable[][] = new long[table2.length][table2[0].length];
+
+		// Ponemos a cero todos los valores
+		for (int i = 0; i < table2.length; i++)
+			for (int j = 0; j < table2[i].length; j++)
+				newTable[i][j] = 0;
+
+		// Sumamos en la posicion calculada nueva el valor correspondiente
+		for (int i = 0; i < table2.length; i++) {
+			for (int j = 0; j < table2[i].length; j++) {
+				double val = ((j * (max - min)) / 255) + min;
+				int pos = ((int) val) & 0xff;
+				if (pos < 0)
+					pos = 0;
+				if (pos >= newTable[i].length)
+					pos = newTable[i].length - 1;
+
+				newTable[i][pos] += table2[i][j];
+			}
+		}
+
+		double mins[] = new double[histogram.getNumBands()];
+		double maxs[] = new double[histogram.getNumBands()];
+		
+		for (int i = 0; i < mins.length; i++) {
+			mins[i] = 0;
+			maxs[i] = 255;
+		}
+
+		BufferHistogramImpl histogramNew = new BufferHistogramImpl(histogram.getNumBands(), mins, maxs, Buffer.TYPE_BYTE);
+
+		histogramNew.setTable(newTable);
+
+		return histogramNew;
+	}
+
+	/**
+	 * @param noDataValue the noDataValue to set
+	 */
+	public void setNoDataValue(NoData noDataValue) {
+		this.noDataValue = noDataValue;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BufferHistogramImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultDataStructFactory.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultDataStructFactory.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultDataStructFactory.java	(revision 15423)
@@ -0,0 +1,137 @@
+/* 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.impl.datastruct;
+
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.ColorTableLibrary;
+import org.gvsig.fmap.dal.coverage.datastruct.DataStructFactory;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GeoPoint;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.datastruct.TransparencyRange;
+import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.props.ColorInterpretation;
+import org.gvsig.fmap.dal.coverage.store.props.Transparency;
+import org.gvsig.raster.impl.datastruct.persistence.DefaultColorTableLibrary;
+import org.gvsig.raster.impl.store.DefaultRasterStore;
+import org.gvsig.raster.impl.store.properties.DataStoreColorInterpretation;
+import org.gvsig.raster.impl.store.properties.DataStoreTransparency;
+
+/**
+ * Factory for data structures
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class DefaultDataStructFactory implements DataStructFactory {
+
+	public TransparencyRange createTransparencyRange() {
+		return new TransparencyRangeImpl();
+	}
+	
+	public Transparency createTransparency(int nBands) {
+		return new DataStoreTransparency(new DataStoreColorInterpretation(nBands));
+	}
+
+    public ColorTableLibrary getColorTableLibrary() {
+    	return DefaultColorTableLibrary.getInstance();
+    }
+    
+    public Extent createExtent(Point2D ul, Point2D lr) {
+    	return new ExtentImpl(ul, lr);
+    }
+    
+    public Extent createExtent(Point2D ul, Point2D lr, Point2D ur, Point2D ll) {
+    	return new ExtentImpl(ul, lr, ur, ll);
+    }
+
+    public Extent createExtent(double x1, double y1, double x2, double y2) {
+    	return new ExtentImpl(x1, y1, x2, y2);
+    }
+
+    public Extent createExtent(Rectangle2D r) {
+    	return new ExtentImpl(r);
+    }
+    
+    public Extent createExtent() {
+    	return new ExtentImpl();
+    }
+    
+	public NoData createNoData(Number noData, Number nativeNoData, String fileName, int bandCount) {
+		return new DefaultNoData(noData, nativeNoData, fileName, bandCount);
+	}
+	
+	public NoData createNoData(Number noData, Number nativeNoData, String fileName) {
+		return new DefaultNoData(noData, nativeNoData, fileName);
+	}
+	
+	public NoData createDefaultNoData(int bandCount, int dataType) {
+		switch (dataType) {
+		case Buffer.TYPE_BYTE:
+			return new DefaultNoData(new Byte(RasterLibrary.defaultByteNoDataValue), new Byte(RasterLibrary.defaultByteNoDataValue), null);
+		case Buffer.TYPE_SHORT:
+			return new DefaultNoData(new Short(RasterLibrary.defaultShortNoDataValue), new Short(RasterLibrary.defaultShortNoDataValue), null);
+		case Buffer.TYPE_INT:
+			return new DefaultNoData(new Integer(RasterLibrary.defaultIntegerNoDataValue), new Integer(RasterLibrary.defaultIntegerNoDataValue), null);
+		case Buffer.TYPE_FLOAT:
+			return new DefaultNoData(new Float(RasterLibrary.defaultFloatNoDataValue), new Float(RasterLibrary.defaultFloatNoDataValue), null);
+		case Buffer.TYPE_DOUBLE:
+			return new DefaultNoData(new Double(RasterLibrary.defaultDoubleNoDataValue), new Double(RasterLibrary.defaultDoubleNoDataValue), null);
+		}
+		return null;
+	}
+
+	public RasterDataStore createDataStore() {
+		return new DefaultRasterStore();
+	}
+	
+	public GeoPoint createGeoPoint() {
+		return new GeoPointImpl();
+	}
+	
+	public GeoPoint createGeoPoint(Point2D p, Point2D m) {
+		return new GeoPointImpl(p, m);
+	}
+
+	public ColorInterpretation createColorInterpretation(String[] colorInterp) {
+		return new DataStoreColorInterpretation(colorInterp);
+	}
+	
+	public ColorInterpretation createColorInterpretation(String colorInterpretationConstant) {
+		return new DataStoreColorInterpretation(colorInterpretationConstant);
+	}
+
+	public ViewPortData createViewPortData(IProjection proj, Extent extent,
+			Dimension2D size) {
+		return new DefaultViewPortData(proj, extent, size);
+	}
+
+	public ViewPortData createViewPortData() {
+		return new DefaultViewPortData();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultDataStructFactory.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultNoData.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultNoData.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultNoData.java	(revision 15423)
@@ -0,0 +1,294 @@
+/* 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.impl.datastruct;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.NoData;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.raster.impl.datastruct.serializer.NoDataRmfSerializer;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.raster.impl.store.rmf.RmfBlocksManager;
+
+/**
+ * This class represents the implementation of a nodata value.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultNoData implements NoData {
+	private List<Number>             noDataByBand        = new ArrayList<Number>();
+	private List<Number>             nativeNoDataByBand  = new ArrayList<Number>();
+	private int                      bandCount           = 1;
+	private String                   fileName            = null;
+	private boolean                  noDataAsTransparent = true;
+	private int                      dataType            = Buffer.TYPE_UNDEFINED;
+	private final static Logger      log                 = Logger.getLogger(DefaultNoData.class.toString());
+	
+	/**
+	 * Constructor
+	 */
+	public DefaultNoData() {
+	}
+	
+	/**
+	 * Constructor.
+	 * @param fileName
+	 * 	      Name of file owner of this nodata value. This string is useful to 
+	 *        save and load throw the rmf.
+	 */
+	public DefaultNoData(String fileName) {
+		this.fileName = fileName;
+	}
+	
+	/**
+	 * Constructor. Only for rasters with one band
+	 * 
+	 * @param noData
+	 *        value to assign to all bands
+	 * @param nativeNoData
+	 *        The native is the original value
+	 *        saved in the head of the file or its metadata.
+	 * @param fileName
+	 *        Name of file owner of this nodata value. This string is useful to 
+	 *        save and load throw the rmf.
+	 */
+	public DefaultNoData(Number noData, Number nativeNoData, String fileName) {
+		setValue(noData);
+		setNativeValue(nativeNoData);
+		this.fileName = fileName;
+		setDataType(noData);
+	}
+	
+	private void setDataType(Number number) {
+		if(number instanceof Byte)
+			dataType = Buffer.TYPE_BYTE;
+		if(number instanceof Short)
+			dataType = Buffer.TYPE_SHORT;
+		if(number instanceof Integer)
+			dataType = Buffer.TYPE_INT;
+		if(number instanceof Float)
+			dataType = Buffer.TYPE_FLOAT;
+		if(number instanceof Double)
+			dataType = Buffer.TYPE_DOUBLE;
+	}
+	
+	/**
+	 * Constructor
+	 * 
+	 * @param noData
+	 *        value to assign to all bands
+	 * @param nativeNoData
+	 *        The native is the original value
+	 *        saved in the head of the file or its metadata.
+	 * @param fileName
+	 *        Name of file owner of this nodata value. This string is useful to
+	 *        save the rmf file
+	 * @param bandCount
+	 *        Number of bands of the file
+	 */
+	public DefaultNoData(Number noData, Number nativeNoData, String fileName, int bandCount) {
+		setValue(noData);
+		setNativeValue(nativeNoData);
+		this.fileName = fileName;
+		setDataType(noData);
+		if(bandCount > 1)
+			this.bandCount = bandCount;
+	}
+	
+	public Number getValue() {
+		try {
+			return noDataByBand.get(0);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			return null;
+		}
+	}
+	
+	public boolean isDefined() {
+		return (getValue() != null);
+	}
+	
+	public void setValue(Number noData) {
+		noDataByBand.clear();
+		for (int i = 0; i < bandCount; i++) {
+			noDataByBand.add(noData);	
+		}
+		setDataType(noData);
+	}
+	
+	public Number getNativeValue() {
+		try {
+			return nativeNoDataByBand.get(0);
+		} catch (ArrayIndexOutOfBoundsException e) {
+			return null;
+		}
+	}
+	
+	public void setNativeValue(Number nativeNoDataValue) {
+		nativeNoDataByBand.clear();
+		for (int i = 0; i < bandCount; i++) {
+			nativeNoDataByBand.add(nativeNoDataValue);	
+		}
+		setDataType(nativeNoDataValue);
+	}
+
+	public void delete() {
+		noDataByBand.clear();
+		for (int i = 0; i < bandCount; i++) {
+			noDataByBand.add(null);	
+		}
+	}
+
+	public void restore() {
+		if(nativeNoDataByBand != null && nativeNoDataByBand.size() == bandCount) {
+			noDataByBand.clear();
+			for (int i = 0; i < bandCount; i++) {
+				noDataByBand.add(nativeNoDataByBand.get(i));	
+			}
+		}
+	}
+
+	public void save() {
+		try {
+			String fileRMF = RasterLocator.getManager().getFileUtils().getNameWithoutExtension(fileName) + ".rmf";
+			RmfBlocksManager blocksManager = new RmfBlocksManager(fileRMF);
+			ClassSerializer serializerObject = new NoDataRmfSerializer(this);
+
+			if (!blocksManager.checkRmf())
+				throw new RmfSerializerException("Error al comprobar el fichero Rmf");
+
+			blocksManager.addClient(serializerObject);
+			try {
+				blocksManager.write(true);
+			} catch (IOException e) {
+				throw new RmfSerializerException("Error al escribir el fichero Rmf", e);
+			}
+			blocksManager.removeAllClients();
+		} catch (RmfSerializerException e) {
+			log.log(Level.SEVERE, "error_salvando_rmf", e);
+		}
+	}
+	
+	public void load() {
+		String fileRMF = RasterLocator.getManager().getFileUtils().getNameWithoutExtension(fileName) + ".rmf";
+		RmfBlocksManager blocksManager = new RmfBlocksManager(fileRMF);
+		ClassSerializer serializerObject = new NoDataRmfSerializer(this);
+
+		if (!blocksManager.checkRmf()) {
+			log.info("Error al comprobar el fichero Rmf " + fileRMF);
+		}
+
+		blocksManager.addClient(serializerObject);
+		try {
+			if(new File(fileRMF).exists())
+				blocksManager.read(null);
+		} catch (Exception e) {
+			log.log(Level.WARNING, "Error al escribir el fichero Rmf", e);
+		}
+		blocksManager.removeAllClients();
+	}
+	
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+	
+	public boolean isNoDataTransparent() {
+		return noDataAsTransparent;
+	}
+
+	public void setNoDataTransparent(boolean noDataAsTransparent) {
+		this.noDataAsTransparent = noDataAsTransparent;
+	}
+	
+	public int getDataType() {
+		return dataType;
+	}
+	
+	public void setDataType(int datatype) {
+		this.dataType = datatype;
+	}
+	
+	@SuppressWarnings("unchecked")
+	public boolean compare(NoData noData) {	
+		String f = ((DefaultNoData)noData).fileName;
+		
+		if((f == null || fileName == null) && f != fileName)
+			return false;
+		
+		if( fileName != null &&  f != null &&
+			fileName.compareTo(f) != 0)
+			return false;
+		
+		if(bandCount != ((DefaultNoData)noData).bandCount)
+			return false;
+		
+		if(dataType != ((DefaultNoData)noData).dataType)
+			return false;
+		
+		for (int i = 0; i < noDataByBand.size(); i++) {
+			if(((Comparable<Number>)noDataByBand.get(i)).compareTo(noData.getValue()) != 0)
+				return false;
+		}
+		for (int i = 0; i < nativeNoDataByBand.size(); i++) {
+			if(((Comparable<Number>)nativeNoDataByBand.get(i)).compareTo(noData.getValue()) != 0)
+				return false;
+		}
+		return true;
+	}
+	
+	public Object clone() {
+		DefaultNoData copy = new DefaultNoData(getValue(), getNativeValue(), fileName, bandCount);
+		copy.noDataAsTransparent = noDataAsTransparent;
+		return copy;
+	}
+	
+	//***********************************************
+	//Only for file with more than one band
+	
+	public Number getValueByBand(int nBand) {
+		try {
+			return noDataByBand.get(nBand);
+		} catch (IndexOutOfBoundsException e) {
+			return null;
+		}
+	}
+	
+	public void setValueByBand(Number noDataValue, int nBand) {
+		noDataByBand.add(nBand, noDataValue);
+		setDataType(noDataValue);
+	}
+
+	public int getBandCount() {
+		return bandCount;
+	}
+	
+	public void setBandCount(int bandCount) {
+		this.bandCount = bandCount;
+	}
+	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultNoData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultViewPortData.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultViewPortData.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultViewPortData.java	(revision 15423)
@@ -0,0 +1,369 @@
+/* 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.impl.datastruct;
+
+import java.awt.Dimension;
+import java.awt.geom.AffineTransform;
+import java.awt.geom.Dimension2D;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+
+import org.cresques.cts.ICoordTrans;
+import org.cresques.cts.IProjection;
+
+import org.gvsig.compat.CompatLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.ViewPortData;
+import org.gvsig.timesupport.Time;
+
+
+/**
+ * Datos de vista sobre las capas.
+ *
+ * Mantiene un conjunto de datos necesarios, que describen el modo de
+ * ver las capas actual.
+ *
+ * @author "Luis W. Sevilla"
+ */
+public class DefaultViewPortData implements ViewPortData {
+    /**
+     * Tipo de proyecci�n de la vista.
+     */
+    IProjection proj = null;
+
+    /**
+     * Sistema de coordenadas de la vista.
+     */
+    IProjection cs = null;
+
+    /**
+     * Amplitud de la vista, en coordenadas proyectadas.
+     */
+    Extent extent = null;
+
+    /**
+     * Tama�o de la vista, en coordenadas de dispositivo.
+     */
+    Dimension2D viewSize = null;
+
+    /**
+     * Transformaci�n af�n usada en la vista actual.
+     */
+    public AffineTransform mat = null;
+
+    /**
+     * Informaci�n de tama�o en pixeles. Esta no es calculada. Solo se almacena
+     * si el usuario la necesita.
+     */
+    public Point2D pxSize = null;
+
+    private Time time = null;
+
+	/**
+     * Resoluci�n (Puntos por pulgada) de la vista actual.
+     * Se necesita para los c�lculos de escala geogr�fica.
+     *
+     * Ojo: la vista podr�a tener una resoluci�n distinta que la pantalla (por
+     * ejemplo en el Layout), por lo que los usuarios de esta clase deber�an
+     * hacer un setDPI con la resoluci�n correcta (normalmente la del ViewPort).
+     *
+     * @see ViewPort#getDPI()
+     */
+    int dpi = CompatLocator.getGraphicsUtils().getScreenDPI();
+
+    public DefaultViewPortData() {
+    	mat = new AffineTransform();
+    	mat.scale(1.0, -1.0);
+    }
+
+    public DefaultViewPortData(IProjection proj, Extent extent, Dimension2D size) {
+        this.proj = proj;
+        this.extent = extent;
+        this.viewSize = size;
+        mat = new AffineTransform();
+        mat.scale(1.0, -1.0);
+    }
+
+    public IProjection getProjection() {
+        return proj;
+    }
+
+    public void setProjection(IProjection proj) {
+        this.proj = proj;
+    }
+
+    public void reProject(ICoordTrans rp) {
+        // TODO metodo reProject pendiente de implementar
+    }
+
+    public void setCoordSys(IProjection cs) {
+        this.cs = cs;
+    }
+
+    //public void setCoordTrans(ICoordTrans ct) { this.ct = ct; }
+    public AffineTransform getMat() {
+        return mat;
+    }
+
+    public void setMat(AffineTransform mat) {
+        this.mat = mat;
+    }
+
+    public Object clone() {
+        DefaultViewPortData vp = new DefaultViewPortData();
+
+        if (mat != null) {
+            vp.mat = new AffineTransform(mat);
+        }
+
+        if (extent != null) {
+            vp.extent = new ExtentImpl(extent);
+        }
+
+        vp.proj = proj;
+        vp.viewSize = viewSize;
+        vp.dpi = dpi;
+
+        return vp;
+    }
+
+    /**
+     * Obtiene el ancho de la vista
+     * @return
+     */
+    public double getWidth() {
+        return viewSize.getWidth();
+    }
+
+    /**
+     * Obtiene el alto de la vista
+     * @return
+     */
+    public double getHeight() {
+        return viewSize.getHeight();
+    }
+
+    /**
+     * Obtiene el tama�o de la vista
+     */
+    public Dimension2D getSize() {
+        return viewSize;
+    }
+
+    /**
+     * Asigna el ancho y alto de la vista
+     * @param w Ancho
+     * @param h Alto
+     */
+    public void setSize(double w, double h) {
+        setSize(new Dimension((int) w, (int) h));
+    }
+
+    public void setSize(Dimension2D sz) {
+    	viewSize = sz;
+        reExtent();
+    }
+
+    public Extent getExtent() {
+        return extent;
+    }
+
+    public void setExtent(Dimension2D sz) {
+        Point2D.Double pt0 = new Point2D.Double(0, 0);
+        Point2D.Double ptSz = new Point2D.Double(sz.getWidth(), sz.getHeight());
+
+        try {
+            mat.inverseTransform(pt0, pt0);
+            mat.inverseTransform(ptSz, ptSz);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        extent = new ExtentImpl(pt0, ptSz);
+    }
+
+    /**
+     * Asigna la extensi�n del raster
+     * @param ext Extent
+     */
+    public void setExtent(Extent ext) {
+    	extent = ext;
+    }
+
+    public void reExtent() {
+        setExtent(viewSize);
+    }
+
+    public void setDPI(int dpi) {
+        this.dpi = dpi;
+    }
+
+    public int getDPI() {
+        return this.dpi;
+    }
+
+    /**
+     * zoom a un marco.
+     *
+     * @param extent
+     */
+    public void zoom(Extent extent) {
+        double[] scale = extent.getScale(getWidth(), getHeight());
+        double escala = Math.min(scale[0], scale[1]);
+
+        mat.setToIdentity();
+        mat.scale(escala, -escala);
+        mat.translate(-extent.minX(), -extent.maxY());
+        this.extent = extent;
+        reExtent();
+    }
+
+    /**
+     * zoom centrado en un punto.
+     *
+     * @param zoom
+     * @param pt
+     */
+    public void zoom(double zoom, Point2D pt) {
+        zoom(zoom, zoom, pt);
+    }
+
+    public void zoom(double zx, double zy, Point2D pt) {
+        centerAt(pt);
+        mat.scale(zx, zy);
+        centerAt(pt);
+        reExtent();
+    }
+
+    /**
+     * Zoom a una escala (geogr�fica);
+     *
+     * @param scale
+     */
+    public void zoomToCenter(double f) {
+        Point2D.Double ptCenter = new Point2D.Double(getWidth() / 2.0,
+                                                     getHeight() / 2.0);
+
+        try {
+            mat.inverseTransform(ptCenter, ptCenter);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        zoom(f, ptCenter);
+    }
+
+    /**
+     * Centrar en un punto.
+     *
+     * @param pt
+     */
+    public void centerAt(Point2D pt) {
+        Point2D.Double ptCenter = new Point2D.Double(getWidth() / 2.0,
+                                                     getHeight() / 2.0);
+
+        try {
+            mat.inverseTransform(ptCenter, ptCenter);
+            mat.translate(ptCenter.x - pt.getX(), ptCenter.y - pt.getY());
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        reExtent();
+    }
+
+    /**
+     * Desplaza la vista actual.
+     *
+     * @param pt
+     */
+    public void pan(Point2D ptIni, Point2D ptFin) {
+        mat.translate(ptFin.getX() - ptIni.getX(), ptFin.getY() - ptIni.getY());
+        reExtent();
+    }
+
+    public Point2D getCenter() {
+        Point2D.Double ptCenter = new Point2D.Double(getWidth() / 2.0,
+                                                     getHeight() / 2.0);
+
+        try {
+            mat.inverseTransform(ptCenter, ptCenter);
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+
+        return ptCenter;
+    }
+
+    /**
+     * Calcula la transformaci�n af�n.
+     */
+	public void calculateAffineTransform() {
+		if ((viewSize == null) || (extent == null) ||
+			(viewSize.getWidth() <= 0) || (viewSize.getHeight() <= 0))
+			return;
+
+		AffineTransform escalado = new AffineTransform();
+		AffineTransform translacion = new AffineTransform();
+
+		double escalaX;
+		double escalaY;
+
+		escalaX = viewSize.getWidth() / extent.width();
+		escalaY = viewSize.getHeight() / extent.height();
+
+		double xCenter = extent.getCenterX();
+		double yCenter = extent.getCenterY();
+		double newHeight;
+		double newWidth;
+
+		Rectangle2D adjustedExtent = new Rectangle2D.Double();
+		double scale = 0;
+
+		if (escalaX < escalaY) {
+			scale = escalaX;
+			newHeight = viewSize.getHeight() / scale;
+			adjustedExtent.setRect(xCenter - (extent.width() / 2.0),
+					yCenter - (newHeight / 2.0), extent.width(), newHeight);
+		} else {
+			scale = escalaY;
+			newWidth = viewSize.getWidth() / scale;
+			adjustedExtent.setRect(xCenter - (newWidth / 2.0),
+					yCenter - (extent.height() / 2.0), newWidth,
+					extent.height());
+		}
+		escalado.setToScale(scale, -scale);
+		translacion.setToTranslation(-extent.getULX(), -extent.getULY());
+
+		mat.setToIdentity();
+		mat.concatenate(escalado);
+		mat.concatenate(translacion);
+	}
+
+	public Time getTime() {
+		return time;
+	}
+
+	public void setTime(Time time) {
+		this.time = time;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultViewPortData.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/RasterLegendIO.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/RasterLegendIO.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/RasterLegendIO.java	(revision 15423)
@@ -0,0 +1,68 @@
+/* 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.impl.datastruct.legend;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.datastruct.RasterLegend;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+/**
+ * Clase de la que debe heredar todo aquel que quiera hacer una clase
+ * de importaci�n o exportaci�n de una tabla de color.
+ *
+ * @version 20/11/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public abstract class RasterLegendIO implements RasterLegend {
+	public static String[]                   formats = {"rmf", "ggr", "gpl"};
+	
+	public String[] getFormats() {
+		return formats;
+	}
+	
+	/**
+	 * Devuelve la descripcion a mostrar en los paneles de JFileChooser.
+	 * Si se devuelve null se mostrar� la decripci�n por defecto.
+	 */
+	public String getDescription() {
+		return null;
+	}
+
+	/**
+	 * Lee una tabla de color del fichero pasado por parametro
+	 *
+	 * @param input
+	 * @return
+	 * @throws IOException cuando ha fallado la carga
+	 */
+	abstract public ColorTable read(File input) throws IOException;
+
+	/**
+	 * Guarda una tabla de color en el fichero pasado por parametro
+	 *
+	 * @param colorTable
+	 * @param output
+	 * @throws IOException cuando ha fallado la escritura
+	 */
+	abstract public void write(ColorTable colorTable, File output) throws IOException;
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/RasterLegendIO.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpGradients.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpGradients.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpGradients.java	(revision 15423)
@@ -0,0 +1,179 @@
+/* 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.impl.datastruct.legend;
+
+import java.awt.Color;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.NumberFormat;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+/**
+ * Clase GimpGradients sirve para importar y exportar gradientes de Gimp
+ * Los ficheros de gradientes de gimp tienen la extension .ggr
+ *
+ * @version 03/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class GimpGradients extends RasterLegendIO {
+
+	/**
+	 * Devuelve el ColorItem asociado a una linea de un fichero de gradientes de
+	 * Gimp
+	 * @param strings
+	 * @param pos
+	 * @return
+	 */
+	private ColorItem parseColorItem(String[] strings, int pos) {
+		ColorItem item = new ColorItemImpl();
+
+		double pos1 = Double.valueOf(strings[0]).doubleValue();
+		double pos2 = Double.valueOf(strings[1]).doubleValue();
+		double pos3 = Double.valueOf(strings[2]).doubleValue();
+		if (pos == 0)
+			item.setValue(pos1 * 255);
+		else
+			item.setValue(pos3 * 255);
+		if (pos == 0)
+			item.setInterpolated((100 * (pos2 - pos1)) / (pos3 - pos1));
+		if (pos == 0)
+			item.setColor(new Color(
+				(int) (Double.valueOf(strings[3]).doubleValue() * 255.0),
+				(int) (Double.valueOf(strings[4]).doubleValue() * 255.0),
+				(int) (Double.valueOf(strings[5]).doubleValue() * 255.0),
+				(int) (Double.valueOf(strings[6]).doubleValue() * 255.0)
+				));
+		else
+			item.setColor(new Color(
+					(int) (Double.valueOf(strings[7]).doubleValue() * 255.0),
+					(int) (Double.valueOf(strings[8]).doubleValue() * 255.0),
+					(int) (Double.valueOf(strings[9]).doubleValue() * 255.0),
+					(int) (Double.valueOf(strings[10]).doubleValue() * 255.0)
+					));
+		return item;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#read(java.io.File)
+	 */
+	public ColorTable read(File input) throws IOException {
+		ArrayList<ColorItem> colorItems = new ArrayList<ColorItem>();
+		ColorTable colorTable = new DataStoreColorTable();
+		try {
+			BufferedReader reader = new BufferedReader(new FileReader(input));
+			String currentLine;
+			int cont = 0;
+			while ((currentLine = reader.readLine()) != null) {
+				if (cont == 1)
+					colorTable.setName(currentLine.substring(6));
+
+				if (cont > 1) {
+					String[] strings = currentLine.split("\\s+");
+
+					if (strings.length < 13)
+						continue;
+
+					colorItems.add(parseColorItem(strings, 0));
+					colorItems.add(parseColorItem(strings, 1));
+				}
+				cont++;
+			}
+			reader.close();
+		} catch (IOException ex) {
+			throw new IOException();
+		}
+
+		colorTable.createPaletteFromColorItems(colorItems, true);
+		return colorTable;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#write(org.gvsig.raster.datastruct.ColorTable, java.io.File)
+	 */
+	public void write(ColorTable colorTable, File output) throws IOException {
+		List<ColorItem> colorItems = colorTable.getColorItems();
+		try {
+			BufferedWriter writer = new BufferedWriter(new FileWriter(output));
+			writer.write("GIMP Gradient\n");
+			writer.write("Name: " + colorTable.getName() + "\n");
+			writer.write((colorItems.size() - 1) + "\n");
+			String line;
+
+			for (int i = 1; i < colorItems.size(); i++) {
+				double min = ((ColorItem) colorItems.get(0)).getValue();
+				double max = ((ColorItem) colorItems.get(colorItems.size() - 1)).getValue();
+
+				line = "";
+				ColorItem item1 = (ColorItem) colorItems.get(i - 1);
+				ColorItem item2 = (ColorItem) colorItems.get(i);
+
+				double pos1 = (item1.getValue() - min) / (max - min);
+				double pos2 = (item2.getValue() - min) / (max - min);
+
+				NumberFormat format = NumberFormat.getNumberInstance();
+				format.setMaximumFractionDigits(6);
+				format.setMinimumFractionDigits(6);
+				line += format.format(pos1).replaceAll(",", ".") + " ";
+				double interp = pos1 + (((pos2 - pos1) * item1.getInterpolated()) / 100.0);
+				line += format.format(interp).replaceAll(",", ".") + " ";
+				line += format.format(pos2).replaceAll(",", ".") + " ";
+
+				Color color = item1.getColor();
+				line += format.format(color.getRed() / 255.0).replaceAll(",", ".") + " ";
+				line += format.format(color.getGreen() / 255.0).replaceAll(",", ".") + " ";
+				line += format.format(color.getBlue() / 255.0).replaceAll(",", ".") + " ";
+				line += format.format(color.getAlpha() / 255.0).replaceAll(",", ".") + " ";
+
+				color = item2.getColor();
+				line += format.format(color.getRed() / 255.0).replaceAll(",", ".") + " ";
+				line += format.format(color.getGreen() / 255.0).replaceAll(",", ".") + " ";
+				line += format.format(color.getBlue() / 255.0).replaceAll(",", ".") + " ";
+				line += format.format(color.getAlpha() / 255.0).replaceAll(",", ".") + " ";
+
+				line += "0 0\n";
+				writer.write(line);
+			}
+			writer.close();
+		} catch (IOException ex) {
+			throw new IOException();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#getDescription()
+	 */
+	public String getDescription() {
+		return "Gimp Gradients";
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpGradients.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpPalettes.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpPalettes.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpPalettes.java	(revision 15423)
@@ -0,0 +1,153 @@
+/* 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.impl.datastruct.legend;
+
+import java.awt.Color;
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+/**
+ * Clase GimpPalettes sirve para importar y exportar tablas de color de Gimp.
+ * Los ficheros de Paletas de gimp tienen la extension .gpl
+ *
+ * @version 03/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class GimpPalettes extends RasterLegendIO {
+
+	/**
+	 * Devuelve el ColorItem asociado a una linea de un fichero de tablas de color
+	 * de Gimp
+	 * @param strings
+	 * @param pos
+	 * @return
+	 */
+	private ColorItem parseColorItem(String[] strings) {
+		if (strings.length < 4)
+			return null;
+
+		ColorItem item = new ColorItemImpl();
+
+		item.setInterpolated(100);
+
+		item.setColor(new Color(
+				Integer.valueOf(strings[1]).intValue(),
+				Integer.valueOf(strings[2]).intValue(),
+				Integer.valueOf(strings[3]).intValue()
+			));
+		return item;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#read(java.io.File)
+	 */
+	public ColorTable read(File input) throws IOException {
+		ArrayList<ColorItem> colorItems = new ArrayList<ColorItem>();
+		ColorTable colorTable = new DataStoreColorTable();
+		try {
+			BufferedReader reader = new BufferedReader(new FileReader(input));
+			String currentLine;
+			int cont = 0;
+			while ((currentLine = reader.readLine()) != null) {
+				if (currentLine.charAt(0) == '#')
+					continue;
+				if (cont == 1)
+					colorTable.setName(currentLine.substring(6));
+				if (cont > 1) {
+					String[] strings = (" " + currentLine).split("\\s+");
+
+					ColorItem colorItem = parseColorItem(strings);
+					if (colorItem == null)
+						continue;
+
+					strings = (" " + currentLine).split("\\s+\\d+\\s+\\d+\\s+\\d+\\s+");
+
+					if (!strings[1].equals("Untitled"))
+						colorItem.setNameClass(strings[1]);
+					else
+						colorItem.setNameClass("");
+
+					colorItem.setValue(cont - 2);
+					colorItems.add(colorItem);
+				}
+				cont++;
+			}
+			reader.close();
+		} catch (IOException ex) {
+			throw new IOException();
+		}
+
+		colorTable.createPaletteFromColorItems(colorItems, false);
+		return colorTable;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#write(org.gvsig.raster.datastruct.ColorTable, java.io.File)
+	 */
+	public void write(ColorTable colorTable, File output) throws IOException {
+		List<ColorItem> colorItems = colorTable.getColorItems();
+
+		try {
+			BufferedWriter writer = new BufferedWriter(new FileWriter(output));
+			writer.write("GIMP Palette\n");
+			writer.write("Name: " + colorTable.getName() + "\n");
+			writer.write("#\n");
+
+			for (int i = 0; i < colorItems.size(); i++) {
+				String line = "";
+				ColorItem item1 = (ColorItem) colorItems.get(i);
+				Color color = item1.getColor();
+				line += color.getRed() + " ";
+				line += color.getGreen() + " ";
+				line += color.getBlue() + "\t";
+				if ((item1.getNameClass() != null) && (item1.getNameClass().length() > 0))
+					line += item1.getNameClass() + "\n";
+				else
+					line += "Untitled\n";
+				writer.write(line);
+			}
+			writer.close();
+		} catch (IOException ex) {
+			throw new IOException();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#getDescription()
+	 */
+	public String getDescription() {
+		return "Gimp Palettes";
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/GimpPalettes.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/LegendgvSIG.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/LegendgvSIG.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/LegendgvSIG.java	(revision 15423)
@@ -0,0 +1,65 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.datastruct.legend;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.RmfSerializerException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.provider.AbstractRasterProvider;
+/**
+ * Clase LegendgvSIG para la exportacion e importacion de ficheros rmf.
+ * Permite coger cualquier tipo de rmf generado con gvSIG y cargar de
+ * ellos solo la tabla de color o sustituir su tabla de color sin
+ * perder el rmf.
+ *
+ * @version 20/11/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class LegendgvSIG extends RasterLegendIO {
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#read(java.io.File)
+	 */
+	public ColorTable read(File input) throws IOException {
+		try {
+			return (ColorTable) AbstractRasterProvider.loadObjectFromRmfFile(input.toString(), ColorTable.class, null);
+		} catch (RmfSerializerException e) {
+			throw new IOException("No se ha podido leer del RMF la tabla de color"); 
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.datastruct.io.RasterLegendIO#write(org.gvsig.raster.datastruct.ColorTable, java.io.File)
+	 */
+	public void write(ColorTable colorTable, File output) throws IOException {
+		try {
+			RasterLocator.getManager().getProviderServices().saveObjectToRmfFile(output.toString(), ColorTable.class, colorTable);
+		} catch (RmfSerializerException e) {
+			throw new IOException("No se ha podido guardar en el RMF la tabla de color"); 
+		}
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/legend/LegendgvSIG.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ColorItemImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ColorItemImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ColorItemImpl.java	(revision 15423)
@@ -0,0 +1,208 @@
+/* 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.impl.datastruct;
+
+import java.awt.Color;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.tools.ToolsLocator;
+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;
+/**
+ * Valor minimo para un item de una tabla de color. Este tendr� que pixel afecta,
+ * nombre de esa clase, color y como estar� interpolado con el siguiente.
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ColorItemImpl implements ColorItem, Cloneable {
+	public static final String      PERSISTENT_NAME        = "ColorItemImpl_Persistent";
+	public static final String      PERSISTENT_DESCRIPTION = "ColorItemImpl Persistent";
+	
+	private double                  value                  = 0.0f;
+	private String                  nameClass              = null;
+	private Color                   color                  = Color.black;
+	private double                  interpolated           = 50;
+
+	/**
+	 * Devuelve el color
+	 * @return
+	 */
+	public Color getColor() {
+		return color;
+	}
+
+	/**
+	 * Definir el color
+	 * @param color
+	 */
+	public void setColor(Color color) {
+		this.color = color;
+	}
+
+	/**
+	 * Devuelve el valor de interpolaci�n con el siguiente color.
+	 * L�mites: 0..100
+	 * @return
+	 */
+	public double getInterpolated() {
+		return interpolated;
+	}
+
+	/**
+	 * Definir el valor de interpolaci�n. Si es mayor a 100 o menor a 0 se pone
+	 * entre los valores correctos.
+	 * @param interpolated
+	 */
+	public void setInterpolated(double interpolated) {
+		if (interpolated > 100)
+			this.interpolated = 100;
+		else
+			if (interpolated < 0)
+				this.interpolated = 0;
+			else
+				this.interpolated = interpolated;
+	}
+
+	/**
+	 * Obtener en que valor estar� dicho color
+	 * @return
+	 */
+	public double getValue() {
+		return value;
+	}
+
+	/**
+	 * Definir el valor del ColorItem.
+	 * @param value
+	 */
+	public void setValue(double value) {
+		if (Double.isNaN(value))
+			return;
+		this.value = value;
+	}
+
+	/**
+	 * Devuelve el nombre de la clase
+	 * @return
+	 */
+	public String getNameClass() {
+		return nameClass;
+	}
+
+	/**
+	 * Define el nombre de la clase
+	 * @param nameClass
+	 */
+	public void setNameClass(String nameClass) {
+		this.nameClass = nameClass;
+	}
+
+	public Object clone() {
+		ColorItemImpl clone = null;
+		try {
+			clone = (ColorItemImpl) super.clone();
+		} catch (CloneNotSupportedException e) {
+		}
+
+		if (color != null)
+			clone.color = new Color(color.getRGB(), (color.getAlpha() != 255));
+
+		if (nameClass != null)
+			clone.nameClass = new String(nameClass);
+
+		return clone;
+	}
+
+	public int hashCode() {
+		final int PRIME = 31;
+		int result = 1;
+		result = PRIME * result + ((color == null) ? 0 : color.hashCode());
+		result = PRIME * result + (int) interpolated;
+		result = PRIME * result + ((nameClass == null) ? 0 : nameClass.hashCode());
+		long temp;
+		temp = Double.doubleToLongBits(value);
+		result = PRIME * result + (int) (temp ^ (temp >>> 32));
+		return result;
+	}
+
+	public boolean equals(Object obj) {
+		if (this == obj)
+			return true;
+		if (obj == null)
+			return false;
+		if (getClass() != obj.getClass())
+			return false;
+		final ColorItemImpl other = (ColorItemImpl) obj;
+		if (color == null) {
+			if (other.color != null)
+				return false;
+		} else
+			if (!color.equals(other.color))
+				return false;
+		if (interpolated != other.interpolated)
+			return false;
+		if (nameClass == null) {
+			if (other.nameClass != null)
+				return false;
+		} else
+			if (!nameClass.equals(other.nameClass))
+				return false;
+		if (Double.doubleToLongBits(value) != Double.doubleToLongBits(other.value))
+			return false;
+		return true;
+	}
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					ColorItemImpl.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			definition.addDynFieldDouble("value").setMandatory(false);
+			definition.addDynFieldDouble("interpolated").setMandatory(false);
+			definition.addDynFieldObject("color").setClassOfValue(Color.class).setMandatory(false);
+			definition.addDynFieldString("nameClass").setMandatory(false);
+		}
+	}
+	
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		value = state.getDouble("value");
+		interpolated = state.getDouble("interpolated");
+		color = (Color)state.get("color");
+		nameClass = state.getString("nameClass");
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("value", value);		
+		state.set("interpolated", interpolated);
+		state.set("color", color);	
+		state.set("nameClass", nameClass);	
+	}	
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ColorItemImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/Kernel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/Kernel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/Kernel.java	(revision 15423)
@@ -0,0 +1,191 @@
+/* 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.impl.datastruct;
+
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.Persistent;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+
+/**
+ * Clase que representa un kernel de NxN p�xeles para realizar operaciones sobre
+ * un pixel.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class Kernel implements Persistent {
+	public double[][]	kernel	= null;
+	protected double	divisor = 0;
+
+	/**
+	 * This constructor is useful only for persistence
+	 */
+	public Kernel() {
+	}
+	
+	/**
+	 * Constructor. Crea la matriz de datos para el kernel.
+	 * @param k datos del kernel
+	 */
+	public Kernel(double[][] k) {
+		this.kernel = k;
+
+		for (int i = 0; i < kernel.length; i++)
+			for (int j = 0; j < kernel[0].length; j++)
+				divisor = divisor + kernel[i][j];
+	}
+
+	/**
+	 * Constructor. Crea la matriz de datos para el kernel.
+	 * @param k datos del kernel
+	 */
+	public Kernel(double[][] k, double divisor) {
+		this.kernel = k;
+		this.divisor = divisor;
+	}
+
+	public double kernelOperation(Kernel k) {
+		double res = 0;
+		for (int i = 0; i < kernel.length; i++)
+			for (int j = 0; j < kernel[0].length; j++)
+				res += kernel[i][j] * k.kernel[i][j];
+		return res;
+	}
+
+	/**
+	 * Aplica la operaci�n de convoluci�n del kernel con otro kernel
+	 * pasado por par�metro
+	 * @param k
+	 * @return
+	 */
+	public double convolution(Kernel k) {
+		double res = this.kernelOperation(k);
+		if (this.divisor != 0)
+			res = res / divisor;
+		//return Math.abs(res);
+		return res;
+	}
+
+	public double getDivisor() {
+		return divisor;
+	}
+
+	public void setDivisor(double divisor) {
+		this.divisor = divisor;
+	}
+
+	/**
+	 * Obtiene el tama�o del kernel que viene dado por
+	 * el n�mero de pixeles de su lado.
+	 * @return
+	 */
+	public int getLado() {
+		return kernel.length;
+	}
+
+	/**
+	 * Aplica ls operaci�n 0xff para todos los elementos del
+	 * kernel. Presupone que este es de tipo byte y no hace ninguna
+	 * comprobaci�n al respecto. Se deja en manos del usuario aplicar esta
+	 * operaci�n solo cuando los elementos del kernel sean de este tipo de dato.
+	 */
+	public void rgbNormalization() {
+		for (int i = 0; i < kernel.length; i++)
+			for (int j = 0; j < kernel[0].length; j++)
+				kernel[i][j] = ((byte)kernel[i][j]) & 0xff;
+	}
+	
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		int side = state.getInt("side");
+		kernel = new double[side][side];
+		if(side >= 3) {
+			kernel[0] = (double[])state.getDoubleArray("row_0");
+			kernel[1] = (double[])state.getDoubleArray("row_1");
+			kernel[2] = (double[])state.getDoubleArray("row_2");
+		}
+		if(side >= 5) {
+			kernel[3] = (double[])state.getDoubleArray("row_3");
+			kernel[4] = (double[])state.getDoubleArray("row_4");
+		}
+		if(side >= 7) {
+			kernel[5] = (double[])state.getDoubleArray("row_5");
+			kernel[6] = (double[])state.getDoubleArray("row_6");
+		}
+	}
+	
+	public void saveToState(PersistentState state) throws PersistenceException {
+		if(kernel == null)
+			return;
+
+		state.set("row_0", kernel[0]);
+		state.set("row_1", kernel[1]);
+		state.set("row_2", kernel[2]);
+		
+		if(kernel.length == 3) {
+			state.set("side", 3);
+			return;
+		}
+
+		state.set("row_3", kernel[3]);
+		state.set("row_4", kernel[4]);
+		
+		if(kernel.length == 5) {
+			state.set("side", 5);
+			return;
+		}
+
+		state.set("row_5", kernel[5]);
+		state.set("row_6", kernel[6]);
+		
+		if(kernel.length == 7) {
+			state.set("side", 7);
+			return;
+		}
+
+	}	
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition("Kernel_Persistent");
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					Kernel.class,
+					"Kernel_Persistent",
+					"Kernel Persistency",
+					null, 
+					null
+			);
+		}
+		
+		definition.addDynFieldInt("side").setMandatory(false);
+		definition.addDynFieldList("row_0").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("row_1").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("row_2").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("row_3").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("row_4").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("row_5").setClassOfItems(double.class).setMandatory(false);
+		definition.addDynFieldList("row_6").setClassOfItems(double.class).setMandatory(false);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/Kernel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultStretch.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultStretch.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultStretch.java	(revision 15423)
@@ -0,0 +1,202 @@
+/* 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.impl.datastruct;
+
+import org.gvsig.fmap.dal.coverage.datastruct.Stretch;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+
+public class DefaultStretch implements Stretch {
+	/**
+	 * Valores de los datos de entrada correspondientes al m�nimo y al m�ximo de 
+	 * cada tramo. Estos tendr�n un rango entre el m�nimo y el m�ximo en cada banda
+	 * de la imagen. 
+	 */
+	public double[]        stretchIn           = null;
+	/**
+	 * Valores de los datos de salida correspondientes al m�nimo y al m�ximo de 
+	 * cada tramo. Estos tendr�n un rango entre 0 y 255.
+	 */
+	public int[]           stretchOut          = null;
+	/**
+	 * Porcentajes de recorte de colas (Valores de entrada)
+	 */
+	public double          tailTrimMin         = 0;
+	public double          tailTrimMax         = 0;
+	/**
+	 * Valores de recorte de colas (Valores de salida calculados por el filtro TailTrim)
+	 */
+	public double          tailTrimValueMin    = 0;
+	public double          tailTrimValueMax    = 0;
+	/**
+	 * Valores de escala a calcular por el filtro lineal por tramos.
+	 * Cada elemento del array es un tramo.
+	 */
+	public double[]        scale               = null;
+	/**
+	 * Valores de desplazamiento a calcular por el filtro lineal por tramos.
+	 * Cada elemento del array es un tramo.
+	 */
+	public double[]        offset              = null;
+	/**
+	 * Valores m�ximos y m�nimos
+	 */
+	public double          maxValue            = 0;
+	public double          minValue            = 0;
+	
+	/**
+	 * Funcion grafica que se ha usado para generar el LinearStretchParams
+	 * 0 - Lineal
+	 * 1 - Exponencial / Logaritmica
+	 * 2 - Raiz cuadrada / Cuadrada
+	 * 3 - Level slice
+	 */
+	public int             functionType        = 0;
+
+	/**
+	 * Valor de la gr�fica para la funci�n. No se usa en una gr�fica lineal.
+	 */
+	public double          valueFunction       = 0.0;
+	
+	/**
+	 * Aplica el recorte de colas sobre los extremos de los m�ximos y m�nimos de entrada.
+	 * La aplicaci�n de esta funci�n considera que ya se han calculado los valores con 
+	 * loadTailTrimValues.
+	 */
+	public void applyTrimToStretchs() {
+		if(stretchIn != null && stretchIn.length >= 2) {
+			minValue = stretchIn[0] = tailTrimValueMin;
+			maxValue = stretchIn[stretchIn.length - 1] = tailTrimValueMax;
+		}
+	}
+	
+	/**
+	 * Consulta si tiene alg�n valor el recorte de colas
+	 * @return true si tiene valor el recorte de colas y false si no lo tiene
+	 */
+	public boolean hasTailTrim() {
+		return (tailTrimMin != 0 || tailTrimMax != 0);
+	}
+	
+	/**
+	 * Calcula la escala y el desplazamiento teniendo en cuenta que
+	 * ya tenga todos los valores de entrada asignados.
+	 *
+	 */
+	public void calcLinearScaleAndOffset() {
+		if(stretchIn != null && stretchOut != null) {
+			//simplifyStretch();
+			scale = new double[stretchIn.length - 1];
+			offset = new double[stretchIn.length - 1];
+			for (int i = 0; i < scale.length; i++) {
+				double rgbRange = (stretchOut[i + 1] - stretchOut[i]);
+				if((stretchIn[i + 1] - stretchIn[i]) == 0)
+					scale[i] = 0;
+				else
+					scale[i] = rgbRange / (stretchIn[i + 1] - stretchIn[i]);
+				offset[i] = stretchOut[i];
+			}
+		}
+	}
+	
+	/**
+	 * Asigna el m�ximo y el m�nimo
+	 * @param stats
+	 * @param type
+	 * @param band
+	 */
+	public void setMaxMin(Statistics stats, int band, boolean rgb) {
+		try {
+			if (rgb) {
+				if (stats.getMinByteUnsigned() != null)
+					minValue = stats.getMinByteUnsigned()[band];
+				if (stats.getMaxByteUnsigned() != null)
+					maxValue = stats.getMaxByteUnsigned()[band];
+			} else {
+				if (stats.getMin() != null) {
+					minValue = stats.getMin()[band];
+				}
+				if (stats.getMax() != null) {
+					maxValue = stats.getMax()[band];
+				}
+			}
+			if (stretchIn == null) {
+				stretchIn = new double[] { minValue, maxValue };
+			} else {
+				stretchIn[0] = minValue;
+				stretchIn[stretchIn.length - 1] = maxValue;
+			}
+		} catch (ArrayIndexOutOfBoundsException ex) {
+			// No se asigna el m�ximo o m�nimo
+		}
+	}
+	
+	/**
+	 * Aplica el eliminado de extremos. Para ello utiliza el segundo m�ximo y m�nimo de entrada.
+	 */
+	public void applyRemoveEndsToStretchs(Statistics stats, boolean rgb, int band) {
+		if(stretchIn == null)
+			return;
+		try {
+			if(rgb) {
+				if(stats.getSecondMinByteUnsigned() != null)
+					stretchIn[0] = minValue = stats.getSecondMinByteUnsigned()[band];
+				if(stats.getSecondMaxByteUnsigned() != null)
+					stretchIn[stretchIn.length - 1] = maxValue = stats.getSecondMaxByteUnsigned()[band];
+			} else {
+				if(stats.getSecondMin() != null)
+					stretchIn[0] = minValue = stats.getSecondMin()[band];
+				if(stats.getMax() != null)
+					stretchIn[stretchIn.length - 1] = maxValue = stats.getSecondMax()[band];
+			}
+		} catch (ArrayIndexOutOfBoundsException ex) {
+			//No se asigna el m�ximo o m�nimo 
+		}
+	}
+
+	public double[] getOffset() {
+		return offset;
+	}
+
+	public double getMaxValue() {
+		return maxValue;
+	}
+
+	public double getMinValue() {
+		return minValue;
+	}
+
+	public int getFunctionType() {
+		return functionType;
+	}
+
+	public double[] getStretchIn() {
+		return stretchIn;
+	}
+
+	public int[] getStretchOut() {
+		return stretchOut;
+	}
+
+	public double getValueFunction() {
+		return valueFunction;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DefaultStretch.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BandListImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BandListImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BandListImpl.java	(revision 15423)
@@ -0,0 +1,423 @@
+/* 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.impl.datastruct;
+
+import java.util.ArrayList;
+import java.util.List;
+
+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.exception.BandNotFoundInListException;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.Persistent;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+
+/**
+ * Esta clase gestiona una lista de bandas que puede pertenecer
+ * a un fichero (la tiene un Dataset) o puede ser una lista 
+ * de bandas de multiples ficheros. Las bandas son
+ * almacenadas en un array donde la posici�n en este es el n�mero de banda.  
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class BandListImpl implements BandList, Persistent {
+	public static final String      PERSISTENT_NAME        = "BandListImpl_Persistent";
+    public static final String      PERSISTENT_DESCRIPTION = "BandListImpl Persistent";
+    
+	//Band array
+	private ArrayList<DatasetBand> bands         = new ArrayList<DatasetBand>();
+	private int[]	               drawableBands = null;
+		
+	public BandListImpl() {
+		
+	}
+	
+	public BandListImpl(String fName, int bandCount, int dataType) {
+		int[] drawBands = new int[bandCount];
+		for (int i = 0; i < bandCount; i++) {
+			try {
+				addBand(new DatasetBandImpl(fName, i, dataType, bandCount), i);
+			} catch (BandNotFoundInListException e1) {
+			}
+			drawBands[i] = i;
+		}
+		setDrawableBands(drawBands);
+	}
+	
+	public Object clone() {
+		BandListImpl result = new BandListImpl();
+		
+		ArrayList<DatasetBand> b = new ArrayList<DatasetBand>();
+		for (int i = 0; i < bands.size(); i++) 
+			b.add((DatasetBand)((DatasetBandImpl)bands.get(i)).clone());
+		result.setBandArray(b);
+		
+		if(drawableBands != null) {
+			int[] drawBands = new int[drawableBands.length];
+			for (int i = 0; i < drawableBands.length; i++) 
+				drawBands[i] = drawableBands[i];
+			result.setDrawableBands(drawBands);
+		}
+		
+		return result;
+	}
+	
+	/**
+	 * Asigna el �ltimo array de bandas a escribir solicitadas.
+	 * @param drawableBands
+	 */
+	public void setDrawableBands(int[] drawableBands) {
+		clearDrawableBands();
+		this.drawableBands = drawableBands;
+		for(int i = 0; i< drawableBands.length; i++) {
+			if(drawableBands[i] < 0 || drawableBands[i] >= getBandCount())
+				continue;
+			addDrawableBand(i, drawableBands[i]);
+		}
+	}
+	
+	/**
+	 * Asigna el array de bandas
+	 * @param bands
+	 */
+	public void setBandArray(ArrayList<DatasetBand> bands) {
+		this.bands = bands;
+	}
+	
+	/**
+	 * Obtiene el �ltimo array de bandas a escribir solicitadas.
+	 * @return
+	 */
+	public int[] getDrawableBands() {	
+		return drawableBands;
+	}
+	
+	/**
+	 * Encuentra una banda en la lista.
+	 * @param file Fichero al que pertenece la banda buscada.
+	 * @param pos Posici�n que ocupa en el fichero.
+	 * @return true si se ha hallado la banda y false si no se 
+	 * ha encontrado
+	 */
+	public boolean findBand(DatasetBand band) {
+		for(int i = 0; i < bands.size(); i++) {
+			DatasetBand b = (DatasetBand)bands.get(i); 
+			if(	b.getFileName().equals(band.getFileName()) &&
+				b.getPosition() == band.getPosition())
+				return true;
+		}
+		return false;
+	}
+		
+	/**
+	 * Obtiene la lista de bandas a pintar sobre el buffer de 
+	 * salida en forma de array. Cada elemento del array es una banda
+	 * del RasterBuf de salida que ha de dibujarse y el valor que contiene
+	 * ese elemento es la banda de la imagen que va pintada en esa banda 
+	 * del RasterBuf.
+	 * <table border=1>
+	 * <tr><td>Elem</td><td>Valor</td></tr>
+	 * <tr><td>0</td><td>1</td></tr>
+	 * <tr><td>1</td><td>0</td></tr>
+	 * <tr><td>2</td><td>-1</td></tr>
+	 * <tr><td>3</td><td>0</td></tr>
+	 * <tr><td>4</td><td>2</td></tr>
+	 * </table>
+	 * El RasterBuf tendra en la banda 0 dibujada la banda 1 de este GeoRasterFile, 
+	 * en la banda 1 la 0 del dataset, en la banda 2 no habr� ninguna de este dataset,
+	 * en la 3 la 0 y en la 4 la 2 de este GeoRasterFile.
+	 * @return lista de bandas a dibujar o un array de un elemento con valor -1.
+	 */
+	public int[] bandsToDrawList(int nBandsDataImage) {
+		
+		int[] bandsToRead = new int[nBandsDataImage];
+		for(int dataImageBand = 0;dataImageBand < nBandsDataImage;dataImageBand++) {
+			bandsToRead[dataImageBand] = -1;
+			for(int band = 0;band < bands.size();band++) {
+				if(	((DatasetBand)bands.get(band)) != null &&
+					((DatasetBand)bands.get(band)).getBufferBandListToDraw() != null) {
+					for(int dest=0;dest<((DatasetBand)bands.get(band)).getBufferBandListToDraw().length;dest++) {
+						if(dataImageBand == ((DatasetBand)bands.get(band)).getBufferBandListToDraw()[dest])
+							bandsToRead[dataImageBand] = band;
+					}
+				}
+			}
+		}
+	
+		return bandsToRead;
+	}
+	
+	/**
+	 * Checkea si alguna banda de la lista se est�a dibujando en el buffer de salida.
+	 * @return	true si alguna banda se est� dibujando y false si no
+	 */
+	public boolean isDrawingAnyBand() {
+		for(int band = 0;band < bands.size();band++) {
+			if(((DatasetBand)bands.get(band)).isDrawing())
+				return true;
+		}
+		return false;
+	}
+	
+	//******************************
+	//Setters and Getters
+	//******************************
+	
+	
+	public void addBand(DatasetBand b, int pos)throws BandNotFoundInListException {
+		bands.add(b);
+	}
+	
+	public void addBand(DatasetBand b)throws BandNotFoundInListException {
+		bands.add(b);
+	}
+	
+	/**
+	 * A�ade la lista de bandas pasada por par�metro a la lista
+	 * actual. Si alguna banda ya existe no la a�ade y continua.
+	 * @param bl Lista de bandas
+	 */
+	public void addBandList(BandList bl) {
+		for(int i = 0; i < bl.getBandCount(); i++) {
+			if(!findBand(bl.getBand(i)))
+				bands.add(bl.getBand(i));
+		}
+	}
+	
+	/**
+	 * ELimina todas las bandas que tienen un nombre determinado.
+	 * @param name Nombre de las bandas a eliminar
+	 */
+	public void removeBands(String name) {
+		for(int i = 0; i < getBandCount(); i++) {
+			DatasetBand band = getBand(i);
+			if(band.getFileName().equals(name))
+				bands.remove(i);
+		}
+	}
+	
+	/**
+	 * Resetea la asignaci�n de dibujado de las bandas de la imagen
+	 * sobre el DataImage cuando se hace un update para esta banda.
+	 */
+	public void clearDrawableBands() {
+		drawableBands = null;
+		for(int i = 0; i < getBandCount(); i++)
+			((DatasetBand)bands.get(i)).clearDrawableBands();
+	}
+	
+	/**
+	 * Para este GeoRasterFile asigna que bandas se pintaran
+	 * sobre el RasterBuf cuando se haga un update. Especificamos a 
+	 * trav�s de los par�metros para que posici�n del RasterBuf ir� 
+	 * dibujada con que banda del fichero de imagen.
+	 * @param posRasterBuf	Posici�n del RasterBuf que queremos pintar.
+	 * @param imageBand	Banda de la imagen que se pintar�
+	 */
+	public void addDrawableBand(int posRasterBuf, int imageBand) {
+		try {
+			((DatasetBand)bands.get(imageBand)).addPositionToDrawInBuffer(posRasterBuf);
+		} catch(IndexOutOfBoundsException exc) {
+			//No hacemos nada simplemente no inserta la banda.
+		}
+	}
+	
+	/**
+	 * Obtiene el n�mero de bandas de un RasterBuf sobre las que se pintara
+	 * alguna banda de este fichero cuando se llama a un updateBuffer. 
+	 * @return N�mero de bandas. Cero en caso de no tener ninguna asignada. 
+	 */
+	public int getDrawableBandsCount() {
+		int nbands = 0;
+		for(int i = 0;i < bands.size();i++) {
+			DatasetBand b = (DatasetBand)bands.get(i);
+			if(b.getBufferBandListToDraw() != null)
+				nbands += b.getBufferBandListToDraw().length;
+		}
+		return nbands;
+	}
+	
+	/**
+	 * Obtiene la banda de la posici�n i.
+	 * @param i Posici�n de la banda a obtener.
+	 * @return Banda.
+	 */
+	public DatasetBand getBand(int i) {
+		if(i < 0 || i >= bands.size())
+			return null;
+		return (DatasetBand)bands.get(i);
+	}
+	
+	/**
+	 * Obtiene el n�mero de bandas.
+	 * @return entero con el n�mero de bandas.
+	 */
+	public int getBandCount() {
+		return bands.size();
+	}
+	
+	public int[] getBufferBandToDraw(String fileName, int band) {
+		for(int i = 0; i < bands.size(); i++) {
+			if(((DatasetBand)bands.get(i)).getFileName().equals(fileName))
+				if(((DatasetBand)bands.get(i)).getPosition() == band)
+					return ((DatasetBand)bands.get(i)).getBufferBandListToDraw();
+		}
+		int[] r = {-1};
+		return r;
+	}
+	
+	public int[] getLocalBufferBandToDraw(String fileName, int band) {
+		for(int i = 0; i < bands.size(); i++) {
+			if(((DatasetBand)bands.get(i)).getFileName().equals(fileName))
+				if(((DatasetBand)bands.get(i)).getPosition() == band)
+					return ((DatasetBand)bands.get(i)).getLocalBufferBandListToDraw();
+		}
+		int[] r = {-1};
+		return r;
+	}
+	
+	/**
+	 * Obtiene en un array de String la lista de nombres de ficheros
+	 * @return lista de nombres de los ficheros del GeoRasterMultiFile
+	 */
+	public String[] getBandStringList() {
+		String[] list = new String[bands.size()];
+		for(int i = 0; i < bands.size(); i++)
+			list[i] = ((DatasetBand)bands.get(i)).getFileName();
+		return list;
+	}
+	
+	/**
+	 * Obtiene en un array de enteros con la lista de la posici�n de bandas
+	 * @return lista de la posici�n de bandas
+	 */
+	public int[] getBandPositionList() {
+		int[] list = new int[bands.size()];
+		for(int i = 0; i < bands.size(); i++)
+			list[i] = ((DatasetBand)bands.get(i)).getPosition();
+		return list;
+	}
+	
+	/**
+	 * Obtiene el tipo de dato de las bandas. Esta llamada supone que todos los tipos de dato
+	 * de las bandas son igual por lo que devolver� el primero. 
+	 * @return Entero que representa el tipo de datos de las bandas
+	 */
+	public int getBandsDataType() {
+		if(bands.size() <= 0)
+			return Buffer.TYPE_UNDEFINED;
+		return ((DatasetBand)bands.get(0)).getDataType();
+	}
+	
+	/**
+	 * Obtiene la posici�n del fichero en la lista a partir del nombre 
+	 * @param fileName Nombre del fichero
+	 * @return Posici�n del fichero o -1 si no existe. 
+	 */
+	public int getFileNumber(String fileName) {
+		if(fileName == null)
+			return -1;
+		String aux = "";
+		int count = -1;
+		for(int i = 0; i < bands.size(); i++) {
+			if(((DatasetBand)bands.get(i)).getFileName().indexOf(aux) != 0) {
+				count ++;
+				aux = ((DatasetBand)bands.get(i)).getFileName();
+			}
+			if(((DatasetBand)bands.get(i)).getFileName().indexOf(fileName) == 0)
+				return count;
+		}
+		return -1;
+	}
+	
+	/**
+	 * Limpia la lista de bandas
+	 */
+	public void clear() {
+		bands.clear();
+		drawableBands = null;
+	}
+	
+	/**
+	 *Muestra la lista de bandas en modo texto
+	 */
+	public void show() {
+		System.out.println("BandCount: " + getBandCount());
+		System.out.println("DrawableBandsCount: " + getDrawableBandsCount());
+		for (int i = 0; i < getBandCount(); i++) {
+			System.out.println("");
+			System.out.println("***********************");
+			System.out.println("Band: " + i);
+			System.out.println("DataType: " + ((DatasetBand)getBand(i)).getDataType());
+			System.out.println("FileName: " + ((DatasetBand)getBand(i)).getFileName());
+			System.out.println("Position: " + ((DatasetBand)getBand(i)).getPosition());
+			if(((DatasetBand)getBand(i)).getBufferBandListToDraw() != null) {
+				System.out.print("Band Dst: ");
+				for (int j = 0; j < ((DatasetBand)getBand(i)).getBufferBandListToDraw().length; j++)
+					System.out.print(((DatasetBand)getBand(i)).getBufferBandListToDraw()[j] + " ");
+			}
+			System.out.println();
+		}
+		
+	}
+	
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		List<DatasetBand> rois = state.getList("bands");
+		this.bands = new ArrayList<DatasetBand>();
+		this.bands.addAll(rois);
+
+		drawableBands = (int[])state.getIntArray("drawableBands");
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("bands", bands);		
+		state.set("drawableBands", drawableBands);
+	}	
+	
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					BandListImpl.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null, 
+					null
+			);
+			definition.addDynFieldList("bands")
+			.setClassOfItems(DatasetBand.class)
+			.setMandatory(true);
+			
+			definition.addDynFieldList("drawableBands")
+			.setClassOfItems(int.class)
+			.setMandatory(false);
+		}
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/BandListImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/HistogramRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/HistogramRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/HistogramRmfSerializer.java	(revision 15423)
@@ -0,0 +1,266 @@
+/* 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.impl.datastruct.serializer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.gvsig.fmap.dal.coverage.datastruct.BufferHistogram;
+import org.gvsig.fmap.dal.coverage.datastruct.HistogramClass;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.raster.impl.datastruct.BufferHistogramImpl;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML un histograma y obtener el histograma desde XML.
+ * Esta clase implementa el interfaz IRmfBlock con los m�todos de escritura y
+ * lectura. Estos ser�n utilizados por el gestor de ficheros RMF para escribir y
+ * leer datos.
+ * </P>
+ * <P>
+ * La estructura XML de un histograma es la siguiente:
+ * </P>
+ * <P>
+ *\<Histogram\> <BR>
+ *&nbsp;\<ClassInterval\>1.0\</ClassInterval\><BR>
+ *&nbsp;\<Min\>0.0\</Min\><BR>
+ *&nbsp;\<Max\>255.0\</Max\><BR>
+ *&nbsp;\<BandCount\>3\</BandCount\><BR>
+ *&nbsp;\<Band\><BR>
+ *&nbsp;&nbsp;\<Values\>13 2 0 ... 2 1 6\</Values\><BR>
+ *&nbsp;\</Band\><BR>
+ *&nbsp;\<Band\><BR>
+ *&nbsp;&nbsp;\<Values\>6 2 2 ... 3 2 8\</Values\><BR>
+ *&nbsp;\</Band\><BR>
+ *&nbsp;\<Band\><BR>
+ *&nbsp;&nbsp;\<Values\>16 1 1 ... 1 1 9\</Values\><BR>
+ *&nbsp;\</Band\><BR\>
+ *\</Histogram\><BR>
+ *\</P\>
+ *
+ * @version 23/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class HistogramRmfSerializer extends ClassSerializer {
+	//TAGS
+	public static final String MAIN_TAG   = "Histogram";
+	public static final String MIN        = "Min";
+	public static final String MAX        = "Max";
+	public static final String BAND       = "Band";
+	public static final String VALUES     = "Values";
+	public static final String BAND_COUNT = "BandCount";
+	public static final String DATA_TYPE  = "DataType";
+
+	private BufferHistogram    histogram  = null;
+
+	/**
+	 * Registra HistogramRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("Histogram", "", HistogramRmfSerializer.class);
+	}
+
+	/**
+	 * Constructor. Asigna el histograma a serializar.
+	 * @param RasterBufferHistogram histograma a convertir en XML
+	 */
+	public HistogramRmfSerializer(BufferHistogram hist) {
+		this.histogram = hist;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public HistogramRmfSerializer() {}
+
+	/**
+	 * Convierte una lista de valores en un solo String en un array de long
+	 * @param list Cadena con la lista de valores
+	 * @return Array de valores long
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 */
+	private long[] parseLongList(String list) throws XmlPullParserException, IOException {
+		String[] sValues = list.split(" ");
+		long[] dValues = new long[sValues.length];
+		for (int i = 0; i < sValues.length; i++)
+			dValues[i] = Long.parseLong(sValues[i]);
+		return dValues;
+	}
+
+	/**
+	 * Parsea el tag Band para extraer la lista de valores (Values) asociada a una banda.
+	 * @param parser KXmlParser
+	 * @return Array de long
+	 * @throws XmlPullParserException
+	 * @throws IOException
+	 */
+	private long[] parserHistogramListValues(KXmlParser parser)  throws XmlPullParserException, IOException {
+		long[] valueList = null;
+		boolean end = false;
+		boolean tagOk = false;
+		int tag = parser.next();
+		while (!end) {
+			switch (tag) {
+				case KXmlParser.START_TAG:
+					if (parser.getName() != null) {
+						if (parser.getName().compareTo(VALUES) == 0)
+							tagOk = true;
+					}
+					break;
+				case KXmlParser.END_TAG:
+					if (parser.getName().compareTo(BAND) == 0)
+						end = true;
+					break;
+				case KXmlParser.TEXT:
+					if (tagOk) {
+						valueList = parseLongList(parser.getText());
+						tagOk = false;
+					}
+					break;
+			}
+			if (!end)
+				tag = parser.next();
+		}
+		return valueList;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#read(java.lang.String)
+	 */
+	public void read(String xml) throws ParsingException {
+//		double interval = 0D;
+		double min = 0D;
+		double max = 0D;
+		int numBands = 0;
+		int dataType = 0;
+		long[][] values = null;
+
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+		try {
+			int tag = parser.nextTag();
+
+			if (parser.getEventType() != KXmlParser.END_DOCUMENT) {
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+				while (tag != KXmlParser.END_DOCUMENT) {
+					switch (tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName() != null) {
+								if (parser.getName().compareTo(MAIN_TAG) == 0) {
+									numBands = (int) Double.parseDouble(parserString(parser, BAND_COUNT, null));
+									dataType = Integer.parseInt(parserString(parser, DATA_TYPE, null));
+									values = new long[numBands][];
+									for (int iBand = 0; iBand < numBands; iBand++) {
+										min = Double.parseDouble(parserString(parser, MIN, null));
+										max = Double.parseDouble(parserString(parser, MAX, null));
+										values[iBand] = parserHistogramListValues(parser);
+									}
+								}
+							}
+							break;
+						case KXmlParser.END_TAG:
+							break;
+						case KXmlParser.TEXT:
+							break;
+					}
+					tag = parser.next();
+				}
+				parser.require(KXmlParser.END_DOCUMENT, null, null);
+			}
+
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+
+		double[] mins = new double[numBands];
+		double[] maxs = new double[numBands];
+		for (int i = 0; i < numBands; i++) {
+			mins[i] = min;
+			maxs[i] = max;
+		}
+		histogram = new BufferHistogramImpl(numBands, mins, maxs, dataType);
+		histogram.setTable(values);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#write()
+	 */
+	public String write() {
+		StringBuffer b = new StringBuffer();
+		HistogramClass[][] c = histogram.getHistogram();
+
+		b.append("<" + MAIN_TAG + ">\n");
+
+		putProperty(b, BAND_COUNT, histogram.getNumBands(), 1);
+		putProperty(b, DATA_TYPE, histogram.getDataType(), 1);
+
+		for (int iBand = 0; iBand < histogram.getNumBands(); iBand++) {
+			b.append("\t<" + BAND + ">\n");
+			putProperty(b, MIN, c[iBand][0].getMin(), 2);
+			putProperty(b, MAX, c[iBand][c[iBand].length - 1].getMin(), 2);
+			b.append("\t\t<" + VALUES + ">");
+			for (int iValues = 0; iValues < histogram.getNumValues(); iValues++) {
+				if (iValues != 0)
+					b.append(" ");
+				b.append((long) histogram.getHistogramValueByPos(iBand, iValues));
+			}
+			b.append("</" + VALUES + ">\n");
+			b.append("\t</" + BAND + ">\n");
+		}
+		b.append("</" + MAIN_TAG + ">\n");
+		return b.toString();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getResult()
+	 */
+	public Object getResult() {
+		return (BufferHistogram) histogram;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getMainTag()
+	 */
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/HistogramRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableLibraryPersistence.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableLibraryPersistence.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableLibraryPersistence.java	(revision 15423)
@@ -0,0 +1,494 @@
+/* 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.impl.datastruct.serializer;
+
+import java.awt.Color;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStreamWriter;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+import org.kxml2.io.KXmlParser;
+import org.kxml2.io.KXmlSerializer;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * La clase ColorTableLibraryPersistence sirve para controlar las tablas de color
+ * genericas, como si fuera una libreria de tablas de color. Aqu� se comprueban
+ * los cambios de versi�n.
+ *
+ * @version 02/07/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ColorTableLibraryPersistence {
+
+	/**
+	 * Devuelve la lista de ficheros de paletas, si no existe el fichero devolvera
+	 * una lista vacia
+	 * @param palettesBasePath
+	 * @return
+	 */
+	private static ArrayList<String> getPaletteFileListDisc(String palettesBasePath) {
+		updateVersion(palettesBasePath);
+
+		File paletteFiles = new File(palettesBasePath);
+
+		ArrayList<String> fileList = new ArrayList<String>();
+
+		if (paletteFiles.exists()) {
+			File[] list = paletteFiles.listFiles();
+			for (int i = 0; i < list.length; i++)
+				fileList.add(list[i].getName());
+		}
+
+		return fileList;
+	}
+
+	/**
+	 * Devuelve la lista de ficheros de paletas, si no existe el fichero creara
+	 * una paleta por defecto y la devolvera.
+	 * @param palettesBasePath
+	 * @return
+	 */
+	public static ArrayList<String> getPaletteFileList(String palettesBasePath) {
+		return getPaletteFileList(palettesBasePath, true);
+	}
+
+	/**
+	 * Devuelve la lista de ficheros de paletas, en caso de que no exista la
+	 * paleta y se especifique forceCreate a true, se creara la paleta por defecto.
+	 * @param palettesBasePath
+	 * @param forceCreate
+	 * @return
+	 */
+	public static ArrayList<String> getPaletteFileList(String palettesBasePath, boolean forceCreate) {
+		ArrayList<String> fileList = getPaletteFileListDisc(palettesBasePath);
+
+		if (forceCreate && (fileList.size() == 0)) {
+			ColorTableLibraryPersistence persistence = new ColorTableLibraryPersistence();
+			createVersionFromXML(palettesBasePath, persistence.getDefaultPaletteXML());
+			fileList = getPaletteFileListDisc(palettesBasePath);
+		}
+
+		return fileList;
+	}
+
+	/**
+	 * Devuelve el XML de una paleta por defecto
+	 * @return
+	 */
+	public String getDefaultPaletteXML() {
+		URL url = getClass().getResource("palettes.xml");
+		StringBuffer contents = new StringBuffer();
+		try {
+			InputStream inputStream = url.openStream();
+
+			int i;
+			while (true) {
+				i = inputStream.read();
+				if (i == -1) break;
+				char c = (char) i;
+				contents.append(c);
+			}
+			inputStream.close();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+
+		return contents.toString();
+	}
+
+	/**
+	 * Crea los ficheros que forman la paleta de color de la version 1.1 a traves
+	 * de un XML que se le pasa por parametro
+	 * @param palettesPath
+	 */
+	private static void createVersionFromXML(String palettesBasePath, String xml) {
+		new File(palettesBasePath).mkdir();
+		KXmlParser parser = new KXmlParser();
+		StringReader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+			int tag = parser.nextTag();
+
+			parser.require(KXmlParser.START_TAG, null, "palettes");
+			tag = parser.nextTag();
+			parser.require(KXmlParser.START_TAG, null, "palette_list");
+			parser.skipSubTree();
+			parser.require(KXmlParser.END_TAG, null, "palette_list");
+			tag = parser.nextTag();
+
+			while (tag == KXmlParser.START_TAG) {
+				parser.require(KXmlParser.START_TAG, null, "palette");
+				if (parser.getAttributeCount() == 2) {
+					// Generar nuevo fichero
+					KXmlSerializer parserOutput = new KXmlSerializer();
+					FileOutputStream fileOutputStream = new FileOutputStream(palettesBasePath + File.separator + parser.getAttributeValue(0) + ".xml");
+
+					parserOutput.setOutput(fileOutputStream, null);
+					parserOutput.startDocument("UTF-8", null);
+					parserOutput.startTag(null, "ColorTable");
+					parserOutput.attribute(null, "name", parser.getAttributeValue(0));
+					parserOutput.attribute(null, "version", "1.1");
+
+					tag = parser.nextTag();
+					parser.require(KXmlParser.START_TAG, null, "table");
+					tag = parser.nextTag();
+
+					parserOutput.text("\n");
+					List<ColorItem> items = new ArrayList<ColorItem>();
+					while (tag == KXmlParser.START_TAG) {
+						parser.require(KXmlParser.START_TAG, null, "entry");
+						if (parser.getAttributeCount() == 3) {
+							String rgb = parser.getAttributeValue(1).substring(parser.getAttributeValue(1).indexOf(",") + 1, parser.getAttributeValue(1).length());
+
+							int a = Integer.valueOf(parser.getAttributeValue(1).substring(0, parser.getAttributeValue(1).indexOf(","))).intValue();
+							int r = Integer.valueOf(rgb.substring(0, rgb.indexOf(","))).intValue();
+							int g = Integer.valueOf(rgb.substring(rgb.indexOf(",") + 1, rgb.lastIndexOf(","))).intValue();
+							int b = Integer.valueOf(rgb.substring(rgb.lastIndexOf(",") + 1, rgb.length())).intValue();
+
+							ColorItem colorItem = new ColorItemImpl();
+							colorItem.setColor(new Color(r, g, b, a));
+							colorItem.setInterpolated(50);
+							colorItem.setNameClass(parser.getAttributeValue(0));
+							colorItem.setValue(Double.parseDouble(parser.getAttributeValue(2)));
+							items.add(colorItem);
+						}
+						tag = parser.nextTag();
+						parser.require(KXmlParser.END_TAG, null, "entry");
+						tag = parser.nextTag();
+					}
+					parser.require(KXmlParser.END_TAG, null, "table");
+					tag = parser.nextTag();
+
+					ColorTable colorTable = new DataStoreColorTable();
+					colorTable.createPaletteFromColorItems(items, true);
+					items = colorTable.getColorItems();
+					for (int i = 0; i < items.size(); i++) {
+						ColorItem colorItem = (ColorItem) items.get(i);
+						parserOutput.startTag(null, "Color");
+						parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+						parserOutput.attribute(null, "name", String.valueOf(colorItem.getNameClass()));
+						Color color = colorItem.getColor();
+						parserOutput.attribute(null, "rgb", String.valueOf(color.getRed() + "," + color.getGreen() + "," + color.getBlue()));
+						parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+						parserOutput.endTag(null, "Color");
+						parserOutput.text("\n");
+					}
+
+					for (int i = 0; i < items.size(); i++) {
+						ColorItem colorItem = (ColorItem) items.get(i);
+						parserOutput.startTag(null, "Alpha");
+						parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+						parserOutput.attribute(null, "alpha", String.valueOf(colorItem.getColor().getAlpha()));
+						parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+						parserOutput.endTag(null, "Alpha");
+						parserOutput.text("\n");
+					}
+
+					parserOutput.endTag(null, "ColorTable");
+					parserOutput.text("\n");
+					parserOutput.endDocument();
+					// Cerrar nuevo fichero
+					fileOutputStream.close();
+				}
+				parser.require(KXmlParser.END_TAG, null, "palette");
+				tag = parser.nextTag();
+			}
+			parser.require(KXmlParser.END_TAG, null, "palettes");
+		} catch (XmlPullParserException xmlEx) {
+			System.out.println("El fichero de paletas predeterminadas no tiene la estructura correcta:\n	" + xmlEx.getMessage());
+		} catch (IOException e) {
+		}
+	}
+
+	/**
+	 * Si existe la version de paleta 1.1, no lo actualizar�, en caso contrario,
+	 * buscara la version 1.0 y si lo encuentra lo subir� a la 1.1
+	 * @param palettesPath
+	 */
+	public static void updateVersion_1_0_to_1_1(String palettesBasePath) {
+		// Si no existe la paleta antigua, pero si que existe la copia de seguridad,
+		// la restauramos
+		File palettesFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml");
+		if (!palettesFile.exists()) {
+			// Cambiar nombre a antiguo fichero
+			File oldFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml~");
+			if (oldFile.exists()) {
+				oldFile.renameTo(new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml"));
+			} else {
+				ColorTableLibraryPersistence ctlp = new ColorTableLibraryPersistence();
+				String text = ctlp.getDefaultPaletteXML();
+				palettesFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml");
+				try {
+					FileWriter writer = new FileWriter(palettesFile);
+					writer.write(text);
+					writer.close();
+				} catch (IOException e) {
+				}
+			}
+		}
+
+		// Si existe el directorio de la version 1.1 no hacemos la migraci�n
+		File directoryFile = new File(palettesBasePath);
+		if (directoryFile.exists())
+			return;
+
+		// Si no encontramos la paleta antigua, nos olvidamos de continuar
+		palettesFile = new File(new File(palettesBasePath).getParent().toString() + File.separator + "palettes.xml");
+		if (!palettesFile.exists())
+			return;
+
+		// Paleta antigua encontrada, podemos migrar a la versi�n nueva
+		try {
+			FileInputStream inputStream = new FileInputStream(palettesFile);
+
+			StringBuffer contents = new StringBuffer();
+			try {
+
+				int i;
+				while (true) {
+					i = inputStream.read();
+					if (i == -1) break;
+					char c = (char) i;
+					contents.append(c);
+				}
+			} catch (IOException e) {
+				e.printStackTrace();
+			}
+
+			createVersionFromXML(palettesBasePath, contents.toString());
+
+			inputStream.close();
+
+		} catch (FileNotFoundException fnfEx) {
+			fnfEx.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Si existe la version de paleta 1.0, la actualizara a la 1.1 y renombrar� la
+	 * antigua version.
+	 * @param palettesBasePath
+	 * @param colorTable
+	 */
+	public static void save_to_1_1(String palettesBasePath, ColorTable colorTable) {
+		try {
+			// Generar nuevo fichero
+			KXmlSerializer parserOutput = new KXmlSerializer();
+			FileOutputStream out = new FileOutputStream(palettesBasePath + File.separator + colorTable.getName() + ".xml");
+			OutputStreamWriter writer = new OutputStreamWriter(out, "UTF8");
+			parserOutput.setOutput(writer);
+			parserOutput.startDocument("UTF-8", null);
+			parserOutput.startTag(null, "ColorTable");
+			parserOutput.attribute(null, "name", colorTable.getName());
+			parserOutput.attribute(null, "version", "1.1");
+			parserOutput.text("\n");
+
+			List<ColorItem> items = colorTable.getColorItems();
+			for (int i = 0; i < items.size(); i++) {
+				ColorItem colorItem = (ColorItem) items.get(i);
+				parserOutput.startTag(null, "Color");
+				parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+				if (colorItem.getNameClass() != null)
+					parserOutput.attribute(null, "name", String.valueOf(colorItem.getNameClass()));
+				else
+					parserOutput.attribute(null, "name", "");
+				Color color = colorItem.getColor();
+				parserOutput.attribute(null, "rgb", String.valueOf(color.getRed() + "," + color.getGreen() + "," + color.getBlue()));
+				parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+				parserOutput.endTag(null, "Color");
+				parserOutput.text("\n");
+			}
+
+			for (int i = 0; i < items.size(); i++) {
+				ColorItem colorItem = (ColorItem) items.get(i);
+				parserOutput.startTag(null, "Alpha");
+				parserOutput.attribute(null, "value", String.valueOf(colorItem.getValue()));
+				parserOutput.attribute(null, "alpha", String.valueOf(colorItem.getColor().getAlpha()));
+				parserOutput.attribute(null, "interpolated", String.valueOf(colorItem.getInterpolated()));
+				parserOutput.endTag(null, "Alpha");
+				parserOutput.text("\n");
+			}
+
+			parserOutput.endTag(null, "ColorTable");
+			parserOutput.text("\n");
+			parserOutput.endDocument();
+			// Cerrar nuevo fichero
+			writer.close();
+		} catch (FileNotFoundException e) {
+			e.printStackTrace();
+		} catch (IOException e) {
+			e.printStackTrace();
+		}
+	}
+
+	/**
+	 * Invocar� todos los metodos de actualizaciones de version
+	 * @param palettesBasePath
+	 */
+	public static void updateVersion(String palettesBasePath) {
+		updateVersion_1_0_to_1_1(palettesBasePath);
+		//updateVersion_1_1_to_1_2(palettesBasePath);
+	}
+
+	/**
+	 * Devuelve el color si lo encuentra en el arraylist y lo elimina, en caso
+	 * contrario devuelve null
+	 * @param list
+	 * @param value
+	 * @return
+	 */
+	public static ColorItem getColorItem(ArrayList<ColorItem> list, double value) {
+		for (int i = 0; i < list.size(); i++) {
+			if (((ColorItem) list.get(i)).getValue() == value) {
+				return (ColorItem) list.remove(i);
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * Lee una paleta del fichero xml de paletas y la carga en la tabla del panel.
+	 * @param palettesPath Camino al fichero de paletas predefinidas.
+	 * @param paletteName Nombre de paleta a cargar desde el fichero xml.
+	 * @return Nombre de la paleta
+	 */
+	public static String loadPalette(String palettesBasePath, String paletteFileName, ArrayList<ColorItem> items) {
+		updateVersion(palettesBasePath);
+
+		items.clear();
+
+		File palettesFile = new File(palettesBasePath + File.separator + paletteFileName);
+		if (!palettesFile.exists())
+			return null;
+
+		try {
+			String paletteName = "";
+			ArrayList<ColorItem> rows = new ArrayList<ColorItem>();
+
+			KXmlParser parser = new KXmlParser();
+			FileInputStream in = new FileInputStream(palettesBasePath + File.separator + paletteFileName);
+
+			InputStreamReader reader = new InputStreamReader(in, "UTF8");
+			parser.setInput(reader);
+			int tag = parser.nextTag();
+
+			parser.require(KXmlParser.START_TAG, null, "ColorTable");
+			for (int i = 0; i < parser.getAttributeCount(); i++) {
+				if (parser.getAttributeName(i).equals("name")) {
+					paletteName = parser.getAttributeValue(i);
+				}
+			}
+			tag = parser.nextTag();
+
+			while (!((tag == KXmlParser.END_TAG) && (parser.getName().equals("ColorTable")))) {
+				try {
+					if (tag == KXmlParser.START_TAG) {
+						if (parser.getName().equals("Color")) {
+							ColorItem colorItem = new ColorItemImpl();
+							int a = 255;
+							for (int i = 0; i < parser.getAttributeCount(); i++) {
+								if (parser.getAttributeName(i).equals("value")) {
+									colorItem.setValue(Double.parseDouble((String) parser.getAttributeValue(i)));
+									ColorItem aux = getColorItem(rows, Double.parseDouble((String) parser.getAttributeValue(i)));
+									if (aux != null)
+										a = aux.getColor().getAlpha();
+								}
+								if (parser.getAttributeName(i).equals("name")) {
+									colorItem.setNameClass((String) parser.getAttributeValue(i));
+								}
+								if (parser.getAttributeName(i).equals("rgb")) {
+									String rgb = parser.getAttributeValue(i);
+									int r = Integer.valueOf(rgb.substring(0, rgb.indexOf(","))).intValue();
+									int g = Integer.valueOf(rgb.substring(rgb.indexOf(",") + 1, rgb.lastIndexOf(","))).intValue();
+									int b = Integer.valueOf(rgb.substring(rgb.lastIndexOf(",") + 1, rgb.length())).intValue();
+
+									colorItem.setColor(new Color(r, g, b, a));
+								}
+								if (parser.getAttributeName(i).equals("interpolated")) {
+									colorItem.setInterpolated(Double.parseDouble((String) parser.getAttributeValue(i)));
+								}
+							}
+
+							rows.add(colorItem);
+							continue;
+						}
+						if (parser.getName().equals("Alpha")) {
+							ColorItem colorItem = new ColorItemImpl();
+							for (int i = 0; i < parser.getAttributeCount(); i++) {
+								if (parser.getAttributeName(i).equals("value")) {
+									colorItem.setValue(Double.parseDouble((String) parser.getAttributeValue(i)));
+									ColorItem aux = getColorItem(rows, Double.parseDouble((String) parser.getAttributeValue(i)));
+									if (aux != null) {
+										colorItem.setNameClass(aux.getNameClass());
+										colorItem.setInterpolated(aux.getInterpolated());
+										colorItem.setColor(new Color(aux.getColor().getRed(), aux.getColor().getGreen(), aux.getColor().getBlue(), colorItem.getColor().getAlpha()));
+									}
+								}
+								if (parser.getAttributeName(i).equals("alpha")) {
+									int a = Integer.parseInt(parser.getAttributeValue(i));
+
+									colorItem.setColor(new Color(colorItem.getColor().getRed(), colorItem.getColor().getGreen(), colorItem.getColor().getBlue(), a));
+								}
+								if (parser.getAttributeName(i).equals("interpolated")) {
+									colorItem.setInterpolated(Double.parseDouble((String) parser.getAttributeValue(i)));
+								}
+							}
+
+							rows.add(colorItem);
+							continue;
+						}
+					}
+				} finally {
+					tag = parser.nextTag();
+				}
+			}
+
+			for (int i = 0; i < rows.size(); i++)
+				items.add(rows.get(i));
+
+			reader.close();
+			return paletteName;
+		} catch (FileNotFoundException fnfEx) {
+			fnfEx.printStackTrace();
+		} catch (XmlPullParserException xmlEx) {
+			System.out.println("El fichero de paletas predeterminadas no tiene la estructura correcta:\n	" + xmlEx.getMessage());
+		} catch (IOException e) {
+		}
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableLibraryPersistence.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableRmfSerializer.java	(revision 15423)
@@ -0,0 +1,265 @@
+/* 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.impl.datastruct.serializer;
+
+import java.awt.Color;
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+import java.util.ArrayList;
+
+import org.gvsig.fmap.dal.coverage.datastruct.ColorItem;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.fmap.dal.coverage.store.props.ColorTable;
+import org.gvsig.raster.impl.datastruct.ColorItemImpl;
+import org.gvsig.raster.impl.store.properties.DataStoreColorTable;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * Clase para convertir a XML una tabla de color y obtener la tabla desde XML.
+ * Esta clase implementa el interfaz IRmfBlock con los m�todos de escritura y
+ * lectura. Estos ser�n utilizados por el gestor de ficheros RMF para escribir y
+ * leer datos.
+ * </P>
+ * <P>
+ * La estructura XML de una tabla de color es la siguiente:
+ * </P>
+ * <P>
+ * &lt;ColorTable name="nombre" version="1.1"><BR>
+ * &nbsp;&lt;Color value="0.0" name="rojo" rgb="#FF34FF" interpolated="50"/><BR>
+ * &nbsp;&lt;Color value="1.0" name="rojo" rgb="#FF34FF" interpolated="50"/><BR>
+ * &nbsp;&lt;Alpha value="0.0" number="255" interpolated="50"/><BR>
+ * &nbsp;&lt;NoData rgba="#"><BR>
+ * &lt;/ColorTable><BR>
+ *
+ * @version 23/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ColorTableRmfSerializer extends ClassSerializer {
+	private final String MAIN_TAG = "ColorTable";
+
+	private ColorTable  colorTable = null;
+
+	/**
+	 * Registra ColorTableRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point=extensionPoints.get("Serializer");
+		point.append("ColorTable", "", ColorTableRmfSerializer.class);
+	}
+
+	/**
+	 * Constructor. Asigna la tabla a serializar.
+	 * @param ColorTable tabla a convertir en XML
+	 */
+	public ColorTableRmfSerializer(ColorTable colorTable) {
+		this.colorTable = colorTable;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public ColorTableRmfSerializer() {
+	}
+
+	/**
+	 * Devuelve el color si lo encuentra en el arraylist y lo elimina, en caso
+	 * contrario devuelve null
+	 * @param list
+	 * @param value
+	 * @return
+	 */
+	private static ColorItem getColorItem(ArrayList<ColorItem> list, double value) {
+		for (int i = 0; i < list.size(); i++) {
+			if (((ColorItem) list.get(i)).getValue() == value) {
+				return (ColorItem) list.remove(i);
+			}
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#read(java.lang.String)
+	 */
+	public void read(String xml) throws ParsingException {
+		String paletteName = "";
+		boolean interpolated = true;
+
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+
+		try {
+			ArrayList<ColorItem> rows = new ArrayList<ColorItem>();
+
+			int tag = parser.nextTag();
+
+			if (parser.getEventType() != KXmlParser.END_DOCUMENT) {
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+
+				for (int i = 0; i < parser.getAttributeCount(); i++) {
+					if (parser.getAttributeName(i).equals("name"))
+						paletteName = parser.getAttributeValue(i);
+					if (parser.getAttributeName(i).equals("interpolated"))
+						interpolated = parser.getAttributeValue(i).equals("1");
+				}
+
+				while (tag != KXmlParser.END_DOCUMENT) {
+					switch (tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().equals("Color")) {
+								ColorItem colorItem = new ColorItemImpl();
+								int a = 255;
+								for (int i = 0; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeName(i).equals("value")) {
+										colorItem.setValue(Double.parseDouble((String) parser.getAttributeValue(i)));
+										ColorItem aux = getColorItem(rows, Double.parseDouble((String) parser.getAttributeValue(i)));
+										if (aux != null)
+											a = aux.getColor().getAlpha();
+									}
+									if (parser.getAttributeName(i).equals("name")) {
+										colorItem.setNameClass((String) parser.getAttributeValue(i));
+									}
+									if (parser.getAttributeName(i).equals("rgb")) {
+										String rgb = parser.getAttributeValue(i);
+										int r = Integer.valueOf(rgb.substring(0, rgb.indexOf(","))).intValue();
+										int g = Integer.valueOf(rgb.substring(rgb.indexOf(",") + 1, rgb.lastIndexOf(","))).intValue();
+										int b = Integer.valueOf(rgb.substring(rgb.lastIndexOf(",") + 1, rgb.length())).intValue();
+
+										colorItem.setColor(new Color(r, g, b, a));
+									}
+									if (parser.getAttributeName(i).equals("interpolated")) {
+										colorItem.setInterpolated(Double.parseDouble((String) parser.getAttributeValue(i)));
+									}
+								}
+
+								rows.add(colorItem);
+								break;
+							}
+							if (parser.getName().equals("Alpha")) {
+								ColorItem colorItem = new ColorItemImpl();
+								for (int i = 0; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeName(i).equals("value")) {
+										colorItem.setValue(Double.parseDouble((String) parser.getAttributeValue(i)));
+										ColorItem aux = getColorItem(rows, Double.parseDouble((String) parser.getAttributeValue(i)));
+										if (aux != null) {
+											colorItem.setNameClass(aux.getNameClass());
+											colorItem.setInterpolated(aux.getInterpolated());
+											colorItem.setColor(new Color(aux.getColor().getRed(), aux.getColor().getGreen(), aux.getColor().getBlue(), colorItem.getColor().getAlpha()));
+										}
+									}
+									if (parser.getAttributeName(i).equals("alpha")) {
+										int a = Integer.parseInt(parser.getAttributeValue(i));
+
+										colorItem.setColor(new Color(colorItem.getColor().getRed(), colorItem.getColor().getGreen(), colorItem.getColor().getBlue(), a));
+									}
+									if (parser.getAttributeName(i).equals("interpolated")) {
+										colorItem.setInterpolated(Double.parseDouble((String) parser.getAttributeValue(i)));
+									}
+								}
+
+								rows.add(colorItem);
+								break;
+							}
+							break;
+					}
+
+					tag = parser.next();
+				}
+				parser.require(KXmlParser.END_DOCUMENT, null, null);
+			}
+
+			colorTable = new DataStoreColorTable();
+			colorTable.setName(paletteName);
+			colorTable.createPaletteFromColorItems(rows, false);
+			colorTable.setInterpolated(interpolated);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#write()
+	 */
+	public String write() {
+		StringBuffer b = new StringBuffer();
+
+		if (colorTable == null)
+			return "";
+
+		b.append("<" + MAIN_TAG + " name=\"" + colorTable.getName() + "\" interpolated=\"" + (colorTable.isInterpolated()?"1":"0") + "\" version=\"1.1\">\n");
+
+		for (int i = 0; i < colorTable.getColorItems().size(); i++) {
+			b.append("\t<Color");
+			ColorItem colorItem = (ColorItem) colorTable.getColorItems().get(i);
+			b.append(" value=\"" + colorItem.getValue() + "\"");
+			b.append(" name=\"" + colorItem.getNameClass() + "\"");
+			Color c = colorItem.getColor();
+			b.append(" rgb=\"" + c.getRed() + "," + c.getGreen() + "," + c.getBlue() + "\"");
+			b.append(" interpolated=\"" + colorItem.getInterpolated() + "\"");
+			b.append("/>\n");
+		}
+		for (int i = 0; i < colorTable.getColorItems().size(); i++) {
+			b.append("\t<Alpha");
+			ColorItem colorItem = (ColorItem) colorTable.getColorItems().get(i);
+			b.append(" value=\"" + colorItem.getValue() + "\"");
+			Color c = colorItem.getColor();
+			b.append(" alpha=\"" + c.getAlpha() + "\"");
+			b.append(" interpolated=\"" + colorItem.getInterpolated() + "\"");
+			b.append("/>\n");
+		}
+
+		b.append("</" + MAIN_TAG + ">\n");
+
+		return b.toString();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getResult()
+	 */
+	public Object getResult() {
+		return colorTable;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.dataset.io.rmf.IRmfBlock#getMainTag()
+	 */
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/ColorTableRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/NoDataRmfSerializer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/NoDataRmfSerializer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/NoDataRmfSerializer.java	(revision 15423)
@@ -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.impl.datastruct.serializer;
+
+import java.io.IOException;
+import java.io.Reader;
+import java.io.StringReader;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.exception.ParsingException;
+import org.gvsig.raster.impl.datastruct.DefaultNoData;
+import org.gvsig.raster.impl.store.rmf.ClassSerializer;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.kxml2.io.KXmlParser;
+import org.xmlpull.v1.XmlPullParserException;
+/**
+ * <P>
+ * This object converts a nodata value to XML. This class implements an IRmfBlock
+ * interface with the method to read and write. These will be used by the RMF file
+ * manager to read and write data.  
+ * </P>
+ * <P>
+ * A raster will have a nodata value by band and its structure will be something like that:
+ * </P>
+ * <P>
+ * \<NoDataValue datatype=3 transparent=true\><BR>
+ * &nbsp;\<Band number=0 value=-99999 \><BR>
+ * &nbsp;\<Band number=1 value=-99999 \><BR>
+ * &nbsp;\<Band number=2 value=-99999 \><BR>
+ * \</NoDataValue\><BR>
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class NoDataRmfSerializer extends ClassSerializer {
+	private final String MAIN_TAG = "NoDataValue";
+	private DefaultNoData noData = null;
+
+	/**
+	 * Registra NoDataRmfSerializer en los puntos de extension de Serializer
+	 */
+	public static void register() {
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("Serializer");
+		point.append("NoDataValue", "", NoDataRmfSerializer.class);
+	}
+
+	/**
+	 * Sets the nodata value to serialize
+	 * @param noData   Valor NoData
+	 */
+	public NoDataRmfSerializer(DefaultNoData noData) {
+		this.noData = noData;
+	}
+
+	/**
+	 * Constructor.
+	 */
+	public NoDataRmfSerializer() {}
+
+	public String getMainTag() {
+		return MAIN_TAG;
+	}
+
+	/**
+	 * Devuelve el valor noData, en caso de no existir lo crea.
+	 * @return
+	 */
+	private DefaultNoData getNoData() {
+		if (noData == null)
+			noData = new DefaultNoData();
+		return noData;
+	}
+
+	public Object getResult() {
+		return noData;
+	}
+
+	public void read(String xml) throws ParsingException {
+		KXmlParser parser = new KXmlParser();
+		Reader reader = new StringReader(xml);
+		try {
+			parser.setInput(reader);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		}
+
+		getNoData().delete();
+		int bands = 0;
+		try {
+			int tag = parser.nextTag();
+
+			if (parser.getEventType() != KXmlParser.END_DOCUMENT) {
+				parser.require(KXmlParser.START_TAG, null, MAIN_TAG);
+				for (int i = 0; i < parser.getAttributeCount(); i++) {
+					if (parser.getAttributeName(i).equals("transparent")) {
+						getNoData().setNoDataTransparent(new Boolean(parser.getAttributeValue(i)));
+					}
+					if (parser.getAttributeName(i).equals("datatype")) {
+						getNoData().setDataType(new Integer(parser.getAttributeValue(i)));
+					}
+				}
+				
+				
+				while (tag != KXmlParser.END_DOCUMENT) {
+					switch (tag) {
+						case KXmlParser.START_TAG:
+							if (parser.getName().equals("Band")) {
+								bands ++;
+								for (int i = 0; i < parser.getAttributeCount(); i++) {
+									if (parser.getAttributeName(i).equals("value")) {
+										String str = (String) parser.getAttributeValue(i);
+										if(str.compareTo("null") == 0)
+											getNoData().setValue(null);
+										else
+											getNoData().setValue(Double.parseDouble(str));
+									}
+								}
+							}
+					}
+					tag = parser.next();
+				}
+			}
+			reader.close();
+			getNoData().setBandCount(bands);
+		} catch (XmlPullParserException e) {
+			throw new ParsingException(xml);
+		} catch (IOException e) {
+			throw new ParsingException(xml);
+		}
+	}
+
+	public String write() throws IOException {
+		if (noData == null)
+			return "";
+
+		StringBuffer b = new StringBuffer();
+
+		b.append("<" + MAIN_TAG + " datatype=\"" + getNoData().getDataType() + "\" transparent=\"" + getNoData().isNoDataTransparent() + "\">\n");
+		for (int i = 0; i < getNoData().getBandCount(); i++) {
+			Number value = getNoData().getValueByBand(i);
+			b.append("\t<Band");
+			b.append(" number=\"" + i + "\"");
+			if(value != null) {
+				switch (getNoData().getDataType()) {
+				case Buffer.TYPE_BYTE:
+					b.append(" value=\"" + value.byteValue() + "\"/>\n");
+					break;
+				case Buffer.TYPE_SHORT:
+					b.append(" value=\"" + value.shortValue() + "\"/>\n");
+					break;
+				case Buffer.TYPE_INT:
+					b.append(" value=\"" + value.intValue() + "\"/>\n");
+					break;
+				case Buffer.TYPE_FLOAT:
+					b.append(" value=\"" + value.floatValue() + "\"/>\n");
+					break;
+				case Buffer.TYPE_DOUBLE:
+					b.append(" value=\"" + value.doubleValue() + "\"/>\n");
+					break; 
+				}
+			} else {
+				b.append(" value=\"null\"/>\n");
+			}
+		}
+		b.append("</" + MAIN_TAG + ">\n");
+
+		return b.toString();
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/serializer/NoDataRmfSerializer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ExtentImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ExtentImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ExtentImpl.java	(revision 15423)
@@ -0,0 +1,623 @@
+/* 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.impl.datastruct;
+
+import java.awt.geom.AffineTransform;
+import java.awt.geom.NoninvertibleTransformException;
+import java.awt.geom.Point2D;
+import java.awt.geom.Rectangle2D;
+import java.text.DecimalFormat;
+
+import org.cresques.cts.ICoordTrans;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Extent;
+import org.gvsig.fmap.dal.coverage.datastruct.GridExtent;
+import org.gvsig.fmap.geom.GeometryLocator;
+import org.gvsig.fmap.geom.Geometry.SUBTYPES;
+import org.gvsig.fmap.geom.exception.CreateEnvelopeException;
+import org.gvsig.fmap.geom.primitive.Envelope;
+import org.gvsig.raster.impl.grid.GridExtentImpl;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.dynobject.DynStruct;
+import org.gvsig.tools.locator.LocatorException;
+import org.gvsig.tools.persistence.PersistenceManager;
+import org.gvsig.tools.persistence.PersistentState;
+import org.gvsig.tools.persistence.exception.PersistenceException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ *	Clase que getiona el extent de una imagen
+ *
+ *  @author Luis W.Sevilla (sevilla_lui@gva.es)
+ */
+public class ExtentImpl implements Extent {
+    
+    private static final Logger LOG = LoggerFactory.getLogger(ExtentImpl.class);
+    
+	public static final String PERSISTENT_NAME        = "Extent_Persistent";
+    public static final String PERSISTENT_DESCRIPTION = "Extent Persistent";
+
+    Point2D min = null;
+    Point2D max = null;
+
+    Point2D ul = new Point2D.Double(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
+    Point2D lr = new Point2D.Double(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
+    Point2D ur = new Point2D.Double(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
+    Point2D ll = new Point2D.Double(Double.POSITIVE_INFINITY, Double.POSITIVE_INFINITY);
+
+    /**
+     * Constructor sin par�metros
+     */
+    public ExtentImpl() {
+        min = new Point2D.Double(999999999.0, 999999999.0);
+        max = new Point2D.Double(-999999999.0, -999999999.0);
+    }
+
+    /**
+     * Constructor
+     * @param ul punto que representa la esquina superior izquierda
+     * @param lr punto que representa la esquina inferior derecha
+     */
+    public ExtentImpl(Point2D ul, Point2D lr) {
+    	this.ul = ul;
+    	this.lr = lr;
+        newExtent(ul.getX(), ul.getY(), lr.getX(), lr.getY());
+    }
+
+    /**
+     * Constructor
+     * @param ul punto que representa la esquina superior izquierda
+     * @param lr punto que representa la esquina inferior derecha
+     * @param ur punto que representa la esquina superior derecha
+     * @param ll punto que representa la esquina inferior izquierda
+     */
+    public ExtentImpl(Point2D ul, Point2D lr, Point2D ur, Point2D ll) {
+    	this.ul = ul;
+    	this.lr = lr;
+    	this.ur = ur;
+    	this.ll = ll;
+    	min = new Point2D.Double(
+    				Math.min(Math.min(ul.getX(), lr.getX()), Math.min(ur.getX(), ll.getX())),
+    				Math.min(Math.min(ul.getY(), lr.getY()), Math.min(ur.getY(), ll.getY())));
+      	max = new Point2D.Double(
+      				Math.max(Math.max(ul.getX(), lr.getX()), Math.max(ur.getX(), ll.getX())),
+      				Math.max(Math.max(ul.getY(), lr.getY()), Math.max(ur.getY(), ll.getY())));
+    }
+
+    /**
+     * Contructor
+     * @param x1 punto que representa la coordenada X de la esquina superior izquierda
+     * @param y1 punto que representa la coordenada Y de la esquina superior izquierda
+     * @param x2 punto que representa la coordenada X de la esquina inferior derecha
+     * @param y2 punto que representa la coordenada Y de la esquina inferior derecha
+     */
+    public ExtentImpl(double x1, double y1, double x2, double y2) {
+    	ul.setLocation(x1, y1);
+    	lr.setLocation(x2, y2);
+        newExtent(x1, y1, x2, y2);
+    }
+
+    /**
+     * Constructor
+     * @param r	Rectangulo 2D
+     */
+    public ExtentImpl(Rectangle2D r) {
+    	ul.setLocation(r.getX(), r.getY() + r.getHeight());
+    	lr.setLocation(r.getX() + r.getWidth(), r.getY());
+        newExtent(r.getX(), r.getY(), r.getX() + r.getWidth(),
+                  r.getY() + r.getHeight());
+    }
+
+    /**
+     * Constructor de copia
+     * @param ext	Objeto Extent
+     */
+    public ExtentImpl(Extent ext) {
+    	ul.setLocation(ext.getULX(), ext.getULY());
+    	lr.setLocation(ext.getLRX(), ext.getLRY());
+    	ur.setLocation(ext.getURX(), ext.getURY());
+    	ll.setLocation(ext.getLLX(), ext.getLLY());
+        min = new Point2D.Double(ext.minX(), ext.minY());
+        max = new Point2D.Double(ext.maxX(), ext.maxY());
+    }
+
+    public Extent encloseBoundinBoxes(Extent ext) {
+    	Point2D pUl = new Point2D.Double(
+    			Math.min(getULX(), ext.getULX()),
+    			Math.max(getULY(), ext.getULY()));
+    	Point2D pLr = new Point2D.Double(
+    			Math.max(getLRX(), ext.getLRX()),
+    			Math.min(getLRY(), ext.getLRY()));
+    	return new ExtentImpl(pUl, pLr);
+    }
+
+    public Extent intersection(Extent ext) {
+    	if(intersects(ext)) {
+    		Point2D pUl = new Point2D.Double(
+    				Math.max(getULX(), ext.getULX()),
+    				Math.min(getULY(), ext.getULY()));
+    		Point2D pLr = new Point2D.Double(
+    				Math.min(getLRX(), ext.getLRX()),
+    				Math.max(getLRY(), ext.getLRY()));
+    		return new ExtentImpl(pUl, pLr);
+    	}
+    	return null;
+    }
+
+    public boolean intersects(Extent ext) {
+    	if (getMin().getX() > ext.getMax().getX())
+    		return false;
+    	else if (getMax().getX() < ext.getMin().getX())
+    		return false;
+    	if (getMin().getY() > ext.getMax().getY())
+    		return false;
+    	else if (getMax().getY() < ext.getMin().getY())
+    		return false;
+    	return true;
+    }
+
+    public GridExtent getGridExtent(double cellSize) {
+    	return new GridExtentImpl(this, cellSize);
+    }
+
+    public Extent clone() {
+    	ExtentImpl e = new ExtentImpl();
+        e.min = min != null ? (Point2D) min.clone() : null;
+        e.max = max != null ? (Point2D) max.clone() : null;
+
+        e.ul = ul != null ? (Point2D) ul.clone() : null;
+        e.lr = lr != null ? (Point2D) lr.clone() : null;
+        e.ur = ur != null ? (Point2D) ur.clone() : null;
+        e.ll = ll != null ? (Point2D) ll.clone() : null;
+        return e;
+    }
+
+    private void newExtent(double x1, double y1, double x2, double y2) {
+        min = new Point2D.Double(Math.min(x1, x2), Math.min(y1, y2));
+        max = new Point2D.Double(Math.max(x1, x2), Math.max(y1, y2));
+    }
+
+    /**
+     * Obtiene la coordenada X m�nima
+     * @return valor de la coordenada X m�nima
+     */
+    public double minX() {
+        return min.getX();
+    }
+
+    /**
+     * Obtiene la coordenada Y m�nima
+     * @return valor de la coordenada X m�nima
+     */
+    public double minY() {
+        return min.getY();
+    }
+
+    /**
+     * Obtiene la coordenada X m�xima
+     * @return valor de la coordenada X m�xima
+     */
+    public double maxX() {
+        return max.getX();
+    }
+
+    /**
+     * Obtiene la coordenada Y m�xima
+     * @return valor de la coordenada Y m�xima
+     */
+    public double maxY() {
+        return max.getY();
+    }
+
+    /**
+     * Obtiene el punto m�nimo
+     * @return m�nimo
+     */
+    public Point2D getMin() {
+        return min;
+    }
+
+    /**
+     * Obtiene el punto m�ximo
+     * @return m�ximo
+     */
+    public Point2D getMax() {
+        return max;
+    }
+
+    public boolean isAt(Point2D pt) {
+        if (pt.getX() < minX())
+            return false;
+
+        if (pt.getX() > maxX())
+            return false;
+
+        if (pt.getY() < minY())
+            return false;
+
+        if (pt.getY() > maxY())
+            return false;
+
+        return true;
+    }
+
+    public double width() {
+        return Math.abs(maxX() - minX());
+    }
+
+    public double height() {
+        return Math.abs(maxY() - minY());
+    }
+
+    /**
+     * Obtiene el centro en X del extent
+     * @return coordinate X of center
+     */
+    public double getCenterX() {
+    	return minX() + (width() / 2);
+    }
+
+    /**
+     * Obtiene el centro en Y del extent
+     * @return coordinate Y of center
+     */
+    public double getCenterY() {
+    	return minY() + (height() / 2);
+    }
+
+    /**
+     * Verifica un punto, y modifica el extent si no est� incluido
+     * @param pt
+     */
+    public void add(Point2D pt) {
+        if (pt == null) {
+            return;
+        }
+
+        min.setLocation(Math.min(pt.getX(), minX()), Math.min(pt.getY(), minY()));
+        max.setLocation(Math.max(pt.getX(), maxX()), Math.max(pt.getY(), maxY()));
+    }
+
+    public void add(Extent ext) {
+        if (ext == null) {
+            return;
+        }
+
+        min.setLocation(Math.min(ext.minX(), minX()),
+                        Math.min(ext.minY(), minY()));
+        max.setLocation(Math.max(ext.maxX(), maxX()),
+                        Math.max(ext.maxY(), maxY()));
+    }
+
+    /**
+     * Obtiene la escala
+     * @param width	Ancho
+     * @param height	Alto
+     * @return the scale
+     */
+    public double[] getScale(int width, int height) {
+        return getScale((double) width, (double) height);
+    }
+
+    public double[] getScale(double width, double height) {
+        double[] scale = new double[2];
+        scale[0] = ((float) width) / width();
+        scale[1] = ((float) height) / height();
+
+        return scale;
+    }
+
+    public Rectangle2D toRectangle2D() {
+        return new Rectangle2D.Double(minX(), minY(), width(), height());
+    }
+
+    public String toString() {
+        DecimalFormat format = new DecimalFormat("####.000");
+
+        return "Extent: (" + format.format(minX()) + "," +
+               format.format(minY()) + "), (" + format.format(maxX()) + "," +
+               format.format(maxY()) + ")";
+    }
+
+    public interface Has {
+        public Extent getExtent();
+    }
+
+    public Point2D getUL() {
+    	return (Point2D)ul.clone();
+    }
+
+    public Point2D getLR() {
+    	return (Point2D)lr.clone();
+    }
+
+    /**
+     * Obtiene la coordenada X de la esquina superior izquierda. Esta, en condiciones normales
+     * conincide con el minimo en X pero cuando un raster est� rotado esto puede variar.
+     * @return ulx
+     */
+    public double getULX() {
+    	if(ul.getX() == -999999999.0)
+    		return minX();
+    	return ul.getX();
+    }
+
+    /**
+     * Obtiene la coordenada Y de la esquina superior izquierda. Esta, en condiciones normales
+     * conincide con el maximo en Y pero cuando un raster est� rotado esto puede variar.
+     * @return uly
+     */
+    public double getULY() {
+    	if(ul.getY() == -999999999.0)
+    		return maxY();
+    	return ul.getY();
+    }
+
+    /**
+     * Obtiene la coordenada X de la esquina inferior derecha. Esta, en condiciones normales
+     * conincide con el m�ximo en X pero cuando un raster est� rotado esto puede variar.
+     * @return lrx
+     */
+    public double getLRX() {
+    	if(lr.getX() == -999999999.0)
+    		return maxX();
+    	return lr.getX();
+    }
+
+    /**
+     * Obtiene la coordenada Y de la esquina inferior derecha. Esta, en condiciones normales
+     * conincide con el minimo en Y pero cuando un raster est� rotado esto puede variar.
+     * @return lry
+     */
+    public double getLRY() {
+    	if(lr.getY() == -999999999.0)
+    		return minY();
+    	return lr.getY();
+    }
+
+    /**
+     * Obtiene la coordenada X de la esquina superior derecha.
+     * @return urx
+     */
+    public double getURX() {
+    	return ur.getX();
+    }
+
+    /**
+     * Obtiene la coordenada Y de la esquina superior derecha.
+     * @return uly
+     */
+    public double getURY() {
+    	return ur.getY();
+    }
+
+    /**
+     * Obtiene la coordenada X de la esquina inferior izquierda.
+     * @return lrx
+     */
+    public double getLLX() {
+    	return ll.getX();
+    }
+
+    /**
+     * Obtiene la coordenada Y de la esquina inferior izquierda.
+     * @return lly
+     */
+    public double getLLY() {
+    	return ll.getY();
+    }
+
+    /**
+     * Asigna la coordenada X de la esquina superior izquierda al m�nimo X
+     */
+    public void setULXToMin() {
+    	ul.setLocation(minX(), ul.getY());
+    	lr.setLocation(maxX(), lr.getY());
+    }
+
+    /**
+     * Asigna la coordenada X de la esquina superior izquierda al m�ximo X
+     */
+    public void setULXToMax() {
+    	ul.setLocation(maxX(), ul.getY());
+    	lr.setLocation(minX(), lr.getY());
+    }
+
+    /**
+     * Asigna la coordenada Y de la esquina superior izquierda al m�nimo Y
+     */
+    public void setULYToMin() {
+    	ul.setLocation(ul.getX(), minY());
+    	lr.setLocation(lr.getX(), maxY());
+    }
+
+    /**
+     * Asigna la coordenada Y de la esquina superior izquierda al m�ximo Y
+     */
+    public void setULYToMax() {
+    	ul.setLocation(ul.getX(), maxY());
+    	lr.setLocation(lr.getX(), minY());
+    }
+
+    /**
+     * Asigna la coordenada X de la esquina inferior derecha al m�nimo X
+     */
+    public void setLRXToMin() {
+    	lr.setLocation(minX(), lr.getY());
+    	ul.setLocation(maxX(), ul.getY());
+
+    }
+
+    /**
+     * Asigna la coordenada X de la esquina inferior derecha al m�ximo X
+     */
+    public void setLRXToMax() {
+    	lr.setLocation(maxX(), lr.getY());
+    	ul.setLocation(minX(), ul.getY());
+    }
+
+    /**
+     * Asigna la coordenada Y de la esquina inferior derecha al m�nimo Y
+     */
+    public void setLRYToMin() {
+    	lr.setLocation(lr.getX(), minY());
+    	ul.setLocation(ul.getX(), maxX());
+    }
+
+    /**
+     * Asigna la coordenada Y de la esquina inferior derecha al m�ximo Y
+     */
+    public void setLRYToMax() {
+    	lr.setLocation(lr.getX(), maxY());
+    	ul.setLocation(ul.getX(), minY());
+    }
+
+	public Extent convert(ICoordTrans trans) {
+	    try {
+            Envelope envelope = GeometryLocator.getGeometryManager().createEnvelope(getMin().getX(),
+                getMin().getY(), getMax().getX(), getMax().getY(), SUBTYPES.GEOM2D);
+            envelope = envelope.convert(trans);
+            
+            Point2D ul = new Point2D.Double(envelope.getMinimum(0), envelope.getMaximum(1));
+            Point2D lr = new Point2D.Double(envelope.getMaximum(0), envelope.getMinimum(1));
+            
+            return RasterLocator.getManager().getDataStructFactory().createExtent(ul, lr);
+        } catch (LocatorException | CreateEnvelopeException e) {
+            LOG.error("Can not convert data extent. []");
+            return null;
+        }
+	}
+
+	public boolean equals(Object obj) {
+		if(!(obj instanceof Extent))
+			return false;
+		Extent e1 = (Extent)obj;
+		return (this.getULX() == e1.getULX() &&
+				this.getULY() == e1.getULY() &&
+				this.getLRX() == e1.getLRX() &&
+				this.getLRY() == e1.getLRY() &&
+				this.getURX() == e1.getURX() &&
+				this.getURY() == e1.getURY() &&
+				this.getLLX() == e1.getLLX() &&
+				this.getLLY() == e1.getLLY());
+	}
+
+	/**
+	 * Given a cell size, converts a point in raster coordinates to world coordinates
+	 * @param pt Point to transform
+	 */
+	public Point2D rasterToWorld(Point2D pt, double cellsize) {
+		Point2D p = new Point2D.Double();
+		AffineTransform at = new AffineTransform(cellsize, 0, 0, -cellsize, getULX(), getULY());
+		at.transform(pt, p);
+		return p;
+	}
+
+	/**
+	 * Given a cell size, converts a point in world coordinates to pixel coordinates
+	 * @param pt Point to transform
+	 */
+	public Point2D worldToRaster(Point2D pt, double cellsize) {
+		Point2D p = new Point2D.Double();
+		AffineTransform at = new AffineTransform(cellsize, 0, 0, -cellsize, getULX(), getULY());
+		try {
+			at.inverseTransform(pt, p);
+		} catch (NoninvertibleTransformException e) {
+			return pt;
+		}
+		return p;
+	}
+
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		double ulx = state.getDouble("ulx");
+		double uly = state.getDouble("uly");
+		double lrx = state.getDouble("lrx");
+		double lry = state.getDouble("lry");
+		double urx = state.getDouble("urx");
+		double ury = state.getDouble("ury");
+		double llx = state.getDouble("llx");
+		double lly = state.getDouble("lly");
+		ul.setLocation(ulx, uly);
+    	lr.setLocation(lrx, lry);
+    	ur.setLocation(urx, ury);
+    	ll.setLocation(llx, lly);
+    	if(	ur.getX() != Double.POSITIVE_INFINITY &&
+    		ur.getY() != Double.POSITIVE_INFINITY &&
+    		ll.getX() != Double.POSITIVE_INFINITY &&
+    		ll.getY() != Double.POSITIVE_INFINITY) {
+    		min = new Point2D.Double(
+    				Math.min(Math.min(ul.getX(), lr.getX()), Math.min(ur.getX(), ll.getX())),
+    				Math.min(Math.min(ul.getY(), lr.getY()), Math.min(ur.getY(), ll.getY())));
+    		max = new Point2D.Double(
+      				Math.max(Math.max(ul.getX(), lr.getX()), Math.max(ur.getX(), ll.getX())),
+      				Math.max(Math.max(ul.getY(), lr.getY()), Math.max(ur.getY(), ll.getY())));
+    	} else {
+    		newExtent(ulx, uly, lrx, lry);
+    	}
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		state.set("ulx", getULX());
+		state.set("uly", getULY());
+		state.set("lrx", getLRX());
+		state.set("lry", getLRY());
+		state.set("urx", getURX());
+		state.set("ury", getURY());
+		state.set("llx", getLLX());
+		state.set("lly", getLLY());
+	}
+
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					Extent.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null,
+					null
+			);
+
+			definition.addDynFieldDouble("ulx").setMandatory(true);
+			definition.addDynFieldDouble("uly").setMandatory(true);
+			definition.addDynFieldDouble("lrx").setMandatory(true);
+			definition.addDynFieldDouble("lry").setMandatory(true);
+			definition.addDynFieldDouble("urx").setMandatory(false);
+			definition.addDynFieldDouble("ury").setMandatory(false);
+			definition.addDynFieldDouble("llx").setMandatory(false);
+			definition.addDynFieldDouble("lly").setMandatory(false);
+		}
+	}
+
+	protected void finalize() throws Throwable {
+		min = null;
+	    max = null;
+	    ul  = null;
+	    lr  = null;
+	    ur  = null;
+	    ll  = null;
+		super.finalize();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/ExtentImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DatasetBandImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DatasetBandImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DatasetBandImpl.java	(revision 15423)
@@ -0,0 +1,319 @@
+/* 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.impl.datastruct;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.DatasetBand;
+import org.gvsig.tools.ToolsLocator;
+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.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/**
+ * Clase que representa a una banda de un fichero.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DatasetBandImpl implements DatasetBand {
+	public static final String     PERSISTENT_NAME         = "DatasetBand_Persistent";
+    public static final String     PERSISTENT_DESCRIPTION  = "DatasetBand Persistent";
+
+    private final Logger           logger                  = LoggerFactory.getLogger(DatasetBandImpl.class);
+	//Nombre del fichero al que pertenece la banda
+	private String 		           fileName                = "";
+	//Lista de nombre de otros ficheros que forman la banda. Esto es util para CompositeDataset que est� compuesto por un mosaico de ficheros.
+	private List<String>	       additionalName          = new ArrayList<String>();
+	//Posici�n en el fichero de la  banda
+	private int 		           position                = -1;
+	//Tipo de dato de la banda
+	private int 		           dataType                = Buffer.TYPE_BYTE;
+	//lista de bandas del buffer donde se dibuja esta banda de imagen. Cada elemento
+	//del vector es un n�mero que corresponde con el n�mero de banda del buffer donde se escribe esta
+	private int[]		           rasterBufBandToDrawList = null;
+	//
+	private int                    nBandsInThisProvider    = 0;
+
+	/**
+	 * Constructor
+	 */
+	public DatasetBandImpl() {
+
+	}
+
+	/**
+	 * Creates a new <code>DatasetBand</code>
+	 * @param fileName
+	 * 			File name
+	 * @param position
+	 * 			Position of this band inside the provider
+	 * @param dataType
+	 * 			Data type
+	 * @param nBands
+	 * 			Number of bands of the provider
+	 */
+	public DatasetBandImpl(String fileName, int position, int dataType, int nBands){
+		setFileName(fileName);
+		setPosition(position);
+		setDataType(dataType);
+		nBandsInThisProvider = nBands;
+	}
+
+	   /**
+     * Creates a new <code>DatasetBand</code>
+     * @param uri
+     *          URI
+     * @param position
+     *          Position of this band inside the provider
+     * @param dataType
+     *          Data type
+     * @param nBands
+     *          Number of bands of the provider
+     */
+    public DatasetBandImpl(URI uri, int position, int dataType, int nBands){
+        setFileName(new File(uri).getAbsolutePath());
+        setPosition(position);
+        setDataType(dataType);
+        nBandsInThisProvider = nBands;
+    }
+
+	/*
+	 *  (non-Javadoc)
+	 * @see java.lang.Object#clone()
+	 */
+	public Object clone() {
+		DatasetBandImpl result = new DatasetBandImpl(fileName, position, dataType, nBandsInThisProvider);
+		if(rasterBufBandToDrawList != null) {
+			int[] drawBands = new int[rasterBufBandToDrawList.length];
+			for (int i = 0; i < rasterBufBandToDrawList.length; i++)
+				drawBands[i] = rasterBufBandToDrawList[i];
+			result.rasterBufBandToDrawList = drawBands;
+		}
+		return result;
+	}
+
+	/**
+	 * Resetea la asignaci�n de dibujado de las bandas de la imagen
+	 * sobre el DataImage cuando se hace un update para esta banda.
+	 */
+	public void clearDrawableBands(){
+		rasterBufBandToDrawList = null;
+	}
+
+	//******************************
+	//Setters and Getters
+	//******************************
+
+	/**
+	 * Obtiene las banda del RasterBuf sobre la que se pinta
+	 * este objeto banda
+	 * @return bandas del RasterBuf
+	 */
+	public int[] getBufferBandListToDraw() {
+		return rasterBufBandToDrawList;
+	}
+
+	/**
+	 * Obtiene las banda del RasterBuf sobre la que se pinta
+	 * este objeto banda
+	 * @return bandas del RasterBuf
+	 */
+	public int[] getLocalBufferBandListToDraw() {
+		return rasterBufBandToDrawList;
+	}
+
+	/**
+	 * Dice si la banda se est� dibujando en el buffers de salida.
+	 * @return true si la banda se est� dibujando y false si no se est� haciendo
+	 */
+	public boolean isDrawing(){
+		if(this.rasterBufBandToDrawList == null)
+			return false;
+		return true;
+	}
+
+	/**
+	 * Adds a band of the output buffer where the input band is drawn. <code>rasterBufBandToDraw</code>
+	 * is the number of band of the output buffer. This number is added to the list of numbers.
+	 * @param rasterBufBandToDraw number of band of the <code>Buffer</code>
+	 */
+	public void addPositionToDrawInBuffer(int rasterBufBandToDraw) {
+		if (rasterBufBandToDrawList == null) {
+			rasterBufBandToDrawList = new int[1];
+			rasterBufBandToDrawList[0] = rasterBufBandToDraw;
+		} else {
+			int[] auxList = new int[rasterBufBandToDrawList.length + 1];
+			for (int i = 0; i < rasterBufBandToDrawList.length; i++)
+				auxList[i] = rasterBufBandToDrawList[i];
+			auxList[rasterBufBandToDrawList.length] = rasterBufBandToDraw;
+			rasterBufBandToDrawList = auxList;
+		}
+	}
+
+	/**
+	 * Obtiene el nombre del fichero al que pertenece la banda
+	 * @return String con el nombre del fichero al
+	 * que pertenece la banda
+	 */
+	public String getFileName() {
+		return fileName;
+	}
+
+	/**
+	 * Asigna el nombre del fichero al que pertenece la banda
+	 * @param fileName String con el nombre del fichero al
+	 * que pertenece la banda
+	 */
+	public void setFileName(String fileName) {
+		this.fileName = fileName;
+	}
+
+	/**
+	 * Obtiene la posici�n de la banda en el fichero
+	 * @return entero con la posici�n de la banda en el fichero
+	 */
+	public int getPosition() {
+		return position;
+	}
+
+	/**
+	 * Asigna la posici�n de la banda en el fichero
+	 * @param position Posici�n de la banda en el fichero
+	 */
+	public void setPosition(int position) {
+		this.position = position;
+	}
+
+	/**
+	 * Obtiene el tipo de dato de la banda
+	 * @return entero con el tipo de dato
+	 */
+	public int getDataType() {
+		return dataType;
+	}
+
+	/**
+	 * Asigna el tipo de dato de la banda
+	 * @param datatype entero con el tipo de dato de la banda
+	 */
+	public void setDataType(int dataType) {
+		this.dataType = dataType;
+	}
+
+	/**
+	 * Asigna un nombre de fichero adicional al principal. Esto es util para
+	 * mosaicos de raster donde una banda est� compuesta por multiples ficheros.
+	 */
+	public void setAdditionalName(String fileName) {
+		additionalName.add(fileName);
+	}
+
+	/**
+	 * Obtiene la lista de nombres de fichero adicionales.
+	 * @return String[]
+	 */
+	public String[] getAdditionalName() {
+		return (String[]) additionalName.toArray();
+	}
+
+	@SuppressWarnings("unchecked")
+	public void loadFromState(PersistentState state)
+			throws PersistenceException {
+		List<String> aux = state.getList("additionalName");
+		this.additionalName = new ArrayList<String>();
+		this.additionalName.addAll(aux);
+
+		try {
+			URI uri = state.getURI("fileName");
+			if(uri != null) {
+			    fileName = uri.toString();
+                if (uri.getScheme() != null && "FILE".equalsIgnoreCase(uri.getScheme())) {
+                    File file = new File(uri);
+                    if (file.isFile() && file.exists()) {
+                        fileName = file.getAbsolutePath();
+                    } else {
+                        fileName = uri.getPath();
+                    }
+                }
+			}
+		} catch(ClassCastException e) {
+			fileName = state.getString("fileName");
+		}
+
+		this.position = state.getInt("position");
+		this.dataType = state.getInt("dataType");
+		this.nBandsInThisProvider = state.getInt("nBandsInThisProvider");
+		this.rasterBufBandToDrawList = (int[])state.getIntArray("rasterBufBandToDrawList");
+	}
+
+	public void saveToState(PersistentState state) throws PersistenceException {
+		try {
+			File file = new File(fileName);
+			if(file.exists())
+				state.set("fileName", file.toURI());
+			else
+				state.set("fileName", new URI(fileName));
+		} catch (URISyntaxException e) {
+			logger.debug("Error saving the URI " + fileName);
+			//Es mejor no propagar la excepci�n.
+			//Mejor que solo afecte al fichero que a todo el proyecto
+			//throw new PersistenceException(e);
+		}
+		state.set("position", position);
+		state.set("dataType", dataType);
+		state.set("nBandsInThisProvider", nBandsInThisProvider);
+		state.set("additionalName", additionalName);
+		state.set("rasterBufBandToDrawList", rasterBufBandToDrawList);
+	}
+
+	/**
+	 * Register persistence
+	 */
+	public static void registerPersistence() {
+		PersistenceManager manager = ToolsLocator.getPersistenceManager();
+		DynStruct definition = manager.getDefinition(PERSISTENT_NAME);
+		if( definition == null ) {
+			definition = manager.addDefinition(
+					DatasetBandImpl.class,
+					PERSISTENT_NAME,
+					PERSISTENT_DESCRIPTION,
+					null,
+					null
+			);
+
+			definition.addDynFieldURI("fileName").setMandatory(false);
+			definition.addDynFieldInt("position").setMandatory(false);
+			definition.addDynFieldList("additionalName").setClassOfItems(String.class).setMandatory(false);
+			definition.addDynFieldList("rasterBufBandToDrawList").setClassOfItems(int.class).setMandatory(false);
+			definition.addDynFieldInt("dataType").setMandatory(false);
+			definition.addDynFieldInt("nBandsInThisProvider").setMandatory(false);
+		}
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/datastruct/DatasetBandImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/package.html
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/package.html	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/package.html	(revision 15423)
@@ -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 package documentation</title>
+</head>
+<body>
+
+	<p>Raster library API default implementation.</p>
+
+</body>
+</html>
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/DefaultTaskEventManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/DefaultTaskEventManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/DefaultTaskEventManager.java	(revision 15423)
@@ -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.impl.process;
+
+import java.util.EventObject;
+
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+/**
+ * This class manages a raster task. 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultTaskEventManager implements TaskEventManager {
+	private RasterTask task = null;
+	
+	/**
+	 * This constructor creates this object but it doesn't register
+	 * the task
+	 * @param process
+	 */
+	public DefaultTaskEventManager() {
+	}
+	
+	/**
+	 * This constructor creates the task and register this
+	 * in the repository
+	 * @param process
+	 */
+	public DefaultTaskEventManager(Object process) {
+		task = new RasterTask(process);
+		RasterTaskQueue.register(task);
+	}
+	
+	/*
+	 * O(non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.process.TaskEventManager#removeTask()
+	 */
+	public void removeTask() {
+		RasterTaskQueue.remove(task);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.process.TaskEventManager#setEvent(java.util.EventObject)
+	 */
+	public void setEvent(EventObject ev) {
+		task.setEvent(ev);
+	}
+	
+	/**
+	 * Assigns a task without register.
+	 * @param task
+	 */
+	public void setTask(RasterTask task) {
+		this.task = task;
+	}
+	
+	public RasterTask getTask() {
+		return task;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.dal.coverage.process.TaskEventManager#getEvent()
+	 */
+	public EventObject getEvent() {
+		return task.getEvent();
+	}
+	
+	/**
+	 * Gesti�n de las se�ales. Este m�todo define las acciones por defecto para
+	 * cada se�al. No es necesario utilizar estas. Se puede en cada caso, hacer un m�todo
+	 * manageEvent en el que se gestione las acciones concretas de una se�al.
+	 * 
+	 * @param ev Evento a gestionar
+	 */
+	public  void manageEvent(EventObject ev) throws ProcessInterruptedException {
+		task.manageEvent(ev);
+	}
+	
+	/**
+	 * Obtiene un proceso a partir de su identificador
+	 * @param id Identificador del proceso
+	 * @return Proceso
+	 */
+	public static TaskEventManager get() {
+		RasterTask task = RasterTaskQueue.get(Thread.currentThread().getId() + "");
+		DefaultTaskEventManager taskEventManager = new DefaultTaskEventManager();
+		taskEventManager.setTask(task);
+		return taskEventManager;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/DefaultTaskEventManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTaskQueue.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTaskQueue.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTaskQueue.java	(revision 15423)
@@ -0,0 +1,106 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.impl.process;
+
+import java.util.ArrayList;
+import java.util.EventObject;
+import java.util.TreeMap;
+
+/**
+ * Clase donde se registran todos los procesos raster para poder ser accedidos por distintos
+ * objetos y puedan mandarles se�ales.
+ * 
+ * @version 30/08/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public class RasterTaskQueue {
+	
+	private static TreeMap<String, RasterTask> processPool = new TreeMap<String, RasterTask>();
+	private static ArrayList<String>           processID   = new ArrayList<String>();
+	
+	/**
+	 * Registra procesos para que puedan ser accedidos
+	 * @param id Identificador del proceso
+	 * @param process Proceso
+	 */
+	public static void register(RasterTask process) {
+		processPool.put(process.getID(), process);
+		processID.add(process.getID());
+	}	
+	
+	/**
+	 * Saca un proceso del repositorio
+	 * @param id Identificador del proceso.
+	 */
+	public static void remove(RasterTask process) {
+		processPool.remove(process.getID());
+		for (int i = 0; i < processID.size(); i++) {
+			if(((String)processID.get(i)).compareTo(process.getID()) == 0) {
+				processID.remove(i);
+				break;
+			}
+		}
+	}
+	
+	/**
+	 * Gets a process from its identifier. If the object is null, this method will create a new RasterTask
+	 * @param id Process identifier
+	 * @return Process
+	 */
+	public static RasterTask get(String id) {
+		return ((RasterTask)processPool.get(id) == null) ? new RasterTask(null) : (RasterTask)processPool.get(id);
+	}
+	
+	/**
+	 * Gets a process from its identifier
+	 * @param id Process identifier
+	 * @return Process
+	 */
+	public static RasterTask getRasterTask(String id) {
+		return (RasterTask)processPool.get(id);
+	}
+	
+	/**
+	 * Envia un evento al proceso cuyo id coincide con el par�metro
+	 * @param id Identificador del proceso
+	 * @param ev Evento
+	 */
+	public static void sendSignal(String id, EventObject ev) {
+		Object obj = processPool.get(id);
+		if(obj != null && obj instanceof RasterTask) 
+			((RasterTask)obj).setEvent(ev);
+	}
+	
+	/**
+	 * Envia un evento a todos los procesos
+	 * @param id Identificador del proceso
+	 * @param ev Evento
+	 */
+	public static void sendSignal(EventObject ev) {
+		for (int i = 0; i < processID.size(); i++) {
+			String id = (String)processID.get(i);
+			sendSignal(id, ev);
+		}
+	}
+	
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTaskQueue.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/vector/PotraceVectorization.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/vector/PotraceVectorization.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/vector/PotraceVectorization.java	(revision 15423)
@@ -0,0 +1,337 @@
+/* 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.impl.process.vector;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+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.process.vector.Vectorization;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.exception.InitializeException;
+import org.gvsig.fmap.dal.exception.ProviderNotRegisteredException;
+import org.gvsig.jpotrace.Potrace;
+import org.gvsig.jpotrace.PotraceException;
+import org.gvsig.raster.impl.DefaultRasterManager;
+import org.gvsig.raster.impl.store.QueryableRaster;
+/**
+ * La clase VectorizationBinding se usa para poder vectorizar una capa raster.<p>
+ * 
+ * La entrada es una capa raster, ya sea en un fichero, BufferFactory o un
+ * RasterDataset.<p>
+ * 
+ * El uso de comunicacion con la libreria jpotrace es como funciona el comando
+ * potrace, de hecho, se pueden a�adir mas opciones si potrace los admite por
+ * linea de comandos.<p>
+ * 
+ * Una vez creada una instancia a VectorizationBinding. Se definen todos los
+ * parametros deseables o en caso de no definirlos se usaran los valores por
+ * defecto y se invoca al metodo VectorizeBuffer()<p>
+ * 
+ * Este ultimo metodo, devuelve un array de doubles indicando si lo que se ha
+ * devuelto son operaciones tipicas de shapes... MoveTo, LineTo, CurveTo, etc...<p>
+ * 
+ * En la primera posicion se devuelve el tama�o del array.<p>
+ * 
+ * 03/09/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class PotraceVectorization implements Vectorization {
+	private Buffer          buffer                = null;
+	private Double          cornerThreshold       = null;
+	private Integer         despeckle             = null;
+	private Integer         policy                = null;
+	private Double          optimizationTolerance = null;
+	private boolean         curveOptimization     = true;
+	private Integer         outputQuantization    = null;
+	private RasterQuery     query                 = null;
+
+	/**
+	 * Construye un VectorizationBinding a partir de la ruta de un Raster
+	 * @param file
+	 * @throws NotSupportedExtensionException
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 */
+	public PotraceVectorization(String file) throws QueryException, NotSupportedExtensionException, RasterDriverException, ProcessInterruptedException {
+		this.setFile(file);
+	}
+
+	/**
+	 * Construye un VectorizationBinding a partir de un RasterDataset
+	 * @param dataset
+	 * @throws RasterDriverException 
+	 * @throws ProcessInterruptedException 
+	 * @throws ProcessInterruptedException
+	 * @throws RasterDriverException
+	 */
+	public PotraceVectorization(QueryableRaster dataset) throws ProcessInterruptedException, QueryException {
+		setDataSource((RasterDataStore)dataset);
+	}
+
+	/**
+	 * Construye un VectorizationBinding a partir de un BufferFactory
+	 * @param bufferFactory
+	 * @throws RasterDriverException 
+	 * @throws ProcessInterruptedException 
+	 * @throws ProcessInterruptedException
+	 * @throws RasterDriverException
+	 */
+	public PotraceVectorization(RasterDataStore dataSource) throws ProcessInterruptedException, QueryException {
+		setDataSource(dataSource);
+	}
+	
+	/**
+	 * Se especifica el fichero del raster
+	 * @param file
+	 * @throws NotSupportedExtensionException
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 */
+	private void setFile(String file) throws QueryException, NotSupportedExtensionException, RasterDriverException, ProcessInterruptedException {
+		RasterDataStore ds = null;
+		try {
+			ds = DefaultRasterManager.getInstance().getProviderServices().open(file);
+		} catch (InitializeException e) {
+			throw new RasterDriverException("Error opening file", e);
+		} catch (ProviderNotRegisteredException e) {
+			throw new RasterDriverException("Error opening file", e);
+		}
+		setDataSource(ds);
+	}
+
+	/**
+	 * Se especifica el BufferFactory
+	 * @param bufferFactory
+	 * @throws ProcessInterruptedException
+	 * @throws RasterDriverException
+	 */
+	private void setDataSource(RasterDataStore dataSource) throws ProcessInterruptedException, QueryException {
+		query.setAllDrawableBands();
+		query.setAreaOfInterest();
+		setRasterBuffer(dataSource.query(query));
+	}
+
+	/**
+	 * Se establece el RasterBuffer
+	 * @param buffer
+	 */
+	private void setRasterBuffer(Buffer buffer) {
+		this.buffer = buffer;
+	}
+
+	/**
+	 * Pone a 1 la posici�n del bit pasado por parametro en el value. Operaci�n binaria OR
+	 * @param value
+	 * @param pos
+	 * @return
+	 */
+	private int enableBit(int value, int pos) {
+		value = (value | ((int)1 << pos));
+		return value;
+	}
+	
+	/**
+	 * Set the corner threshold parameter (default 1)
+	 * @param value
+	 */
+	public void setCornerThreshold(double value) {
+		cornerThreshold = new Double(value);
+	}
+
+	/**
+	 * Quantize output to 1/unit pixels (default 10)
+	 * @param value
+	 */
+	public void setOutputQuantization(int value) {
+		outputQuantization = new Integer(value);
+	}
+
+	/**
+	 * Suppress speckles of up to this size (default 2)
+	 * @param value
+	 */
+	public void setDespeckle(int value) {
+		despeckle = new Integer(value);
+	}
+
+	/**
+	 * Set how to resolve ambiguities in path decomposition<p>
+	 * 
+	 * Use:<br><b>
+	 * 	 POLICY_BLACK<br>
+	 *   POLICY_LEFT<br>
+	 *   POLICY_MAJORITY<br>
+	 *   POLICY_MINORITY<br>
+	 *   POLICY_RANDOM<br>
+	 *   POLICY_RIGHT<br>
+	 *   POLICY_WHITE</b>
+	 *  
+	 * @param value
+	 */
+	public void setPolicy(int value) {
+		policy = new Integer(value);
+	}
+	
+	/**
+	 * Set the curve optimization tolerance (default 0.2)
+	 * @param value
+	 */
+	public void setOptimizationTolerance(double value) {
+		optimizationTolerance = new Double(value);
+	}
+
+	/**
+	 * Return if the curve optimization is enabled or disabled
+	 * @param value
+	 */
+	public boolean isEnabledCurveOptimization() {
+		return curveOptimization;
+	}
+
+	/**
+	 * Enable/Disable the curve optimization (default enabled)
+	 * @param value
+	 */
+	public void setEnabledCurveOptimization(boolean value) {
+		curveOptimization = value;
+	}
+	
+	/**
+	 * Devuelve los parametros en formato de array (Similar a como los recibe el
+	 * main de un fichero en c) indicando la llamada entera al comando potrace.
+	 * @return
+	 */
+	private String[] getParams() {
+		List<String> params = new ArrayList<String>();
+		params.add("./potrace");
+
+		if (cornerThreshold != null) {
+			params.add("-a");
+			params.add(cornerThreshold.toString());
+		}
+
+		if (despeckle != null) {
+			params.add("-t");
+			params.add(despeckle.toString());
+		}
+		
+		if (outputQuantization != null) {
+			params.add("-u");
+			params.add(outputQuantization.toString());
+		}
+		
+		if (policy != null) {
+			String param = null;
+			switch (policy.intValue()) {
+				case POLICY_BLACK:
+					param = "black";
+					break;
+				case POLICY_WHITE:
+					param = "white";
+					break;
+				case POLICY_LEFT:
+					param = "left";
+					break;
+				case POLICY_RIGHT:
+					param = "right";
+					break;
+				case POLICY_MINORITY:
+					param = "minority";
+					break;
+				case POLICY_MAJORITY:
+					param = "majority";
+					break;
+				case POLICY_RANDOM:
+					param = "random";
+					break;
+			}
+			if (param != null) {
+				params.add("-z");
+				params.add(param);
+			}
+		}
+		
+		if (optimizationTolerance != null) {
+			// Curve optimization tolerance
+			params.add("-O");
+			params.add(optimizationTolerance.toString());
+		}
+		
+		if (!curveOptimization) {
+			// turn off curve optimization
+			params.add("-n"); 
+		}
+
+		String[] strings = new String[params.size()];
+		for (int i = 0; i < strings.length; i++) {
+			strings[i] = (String) params.get(i);
+		}
+
+		return strings;
+	}
+
+	/**
+	 * Hace el proeso de Vectorizacion de un Raster
+	 * @return
+	 * @throws PotraceException
+	 */
+	public double[] VectorizeBuffer() {
+		int dy = (buffer.getWidth() + 32 - 1) / 32;
+
+		int[] bufferBits = new int[buffer.getHeight() * dy];
+
+		for (int i = 0; i < bufferBits.length; i++)
+			bufferBits[i] = 0;
+		
+		int bit = 0;
+		int pos = 0;
+		for (int i = 0; i < buffer.getHeight(); i++) {
+			pos = (buffer.getHeight() - i - 1) * dy;
+			bit = 0;
+			for (int j = 0; j < buffer.getWidth(); j++) {
+				byte data = buffer.getElemByte(i, j, 0);
+
+				if (data == 0) {
+					bufferBits[pos] = enableBit(bufferBits[pos], 31 - bit);
+				}
+
+				bit++;
+				if (bit >= 32) {
+					bit = 0;
+					pos++;
+				}
+			}
+		}
+
+		try {
+			return Potrace.vectorizeBufferRaster(bufferBits, buffer.getWidth(), buffer.getHeight(), getParams());
+		} catch (PotraceException e) {
+		}
+		return null;
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/vector/PotraceVectorization.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTask.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTask.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTask.java	(revision 15423)
@@ -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.impl.process;
+
+import java.util.EventObject;
+
+import org.gvsig.fmap.dal.coverage.exception.ProcessInterruptedException;
+import org.gvsig.fmap.dal.coverage.process.CancelEvent;
+/**
+ * Clase que deben contener los procesos de raster. Un proceso debe registrarse
+ * al arrancar y eliminarse al terminar o ser cancelado. El proceso debe ser
+ * el encargado de realizar estas acciones.
+ * 
+ * @version 30/08/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterTask {
+	public EventObject activeEvent = null;
+	public Object      process     = null;
+	private String     idThread    = "";
+
+	/**
+	 * Asigna la clase que contiene el proceso.
+	 * @param process
+	 */
+	public RasterTask(Object process) {
+		idThread = Thread.currentThread().getId() + "";
+		this.process = process;
+	}
+	/**
+	 * Asigna el evento
+	 * @param ev EventObject
+	 */
+	public void setEvent(EventObject ev) {
+		activeEvent = ev;
+	}
+	
+	/**
+	 * Obtiene el evento
+	 * @return EventObject
+	 */
+	public EventObject getEvent() {
+		return activeEvent;
+	}
+	
+	/**
+	 * Obtiene el identificador �nico del proceso. 
+	 * @return Identificador del proceso
+	 */
+	public String getID() {
+		return idThread;
+	}
+	
+	/**
+	 * Gesti�n de las se�ales. Este m�todo define las acciones por defecto para
+	 * cada se�al. No es necesario utilizar estas. Se puede en cada caso, hacer un m�todo
+	 * manageEvent en el que se gestione las acciones concretas de una se�al.
+	 * 
+	 * @param ev Evento a gestionar
+	 */
+	public  void manageEvent(EventObject ev) throws ProcessInterruptedException {
+		if (ev instanceof CancelEvent)
+			throw new ProcessInterruptedException("Proceso cancelado por se�al del usuario.");
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/process/RasterTask.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterManager.java	(revision 15423)
@@ -0,0 +1,440 @@
+/* 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.impl;
+
+import java.awt.geom.AffineTransform;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Set;
+
+import org.cresques.cts.IProjection;
+import org.gvsig.fmap.dal.coverage.BufferFactory;
+import org.gvsig.fmap.dal.coverage.RasterLibrary;
+import org.gvsig.fmap.dal.coverage.RasterManager;
+import org.gvsig.fmap.dal.coverage.RasterService;
+import org.gvsig.fmap.dal.coverage.dataset.Buffer;
+import org.gvsig.fmap.dal.coverage.datastruct.DataStructFactory;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.datastruct.RasterLegend;
+import org.gvsig.fmap.dal.coverage.exception.FileNotExistsException;
+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.ROIException;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.exception.RasterLegendIONotFound;
+import org.gvsig.fmap.dal.coverage.filter.FilterLoader;
+import org.gvsig.fmap.dal.coverage.grid.RasterFilterList;
+import org.gvsig.fmap.dal.coverage.grid.render.ImageDrawer;
+import org.gvsig.fmap.dal.coverage.process.TaskEventManager;
+import org.gvsig.fmap.dal.coverage.process.overview.OverviewBuilder;
+import org.gvsig.fmap.dal.coverage.process.vector.Vectorization;
+import org.gvsig.fmap.dal.coverage.store.DataServerWriter;
+import org.gvsig.fmap.dal.coverage.store.RasterDataStore;
+import org.gvsig.fmap.dal.coverage.store.RasterQuery;
+import org.gvsig.fmap.dal.coverage.store.RasterWriter;
+import org.gvsig.fmap.dal.coverage.store.props.Statistics;
+import org.gvsig.fmap.dal.coverage.util.CRSUtils;
+import org.gvsig.fmap.dal.coverage.util.ColorConversion;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.Historical;
+import org.gvsig.fmap.dal.coverage.util.MathUtils;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+import org.gvsig.fmap.dal.coverage.util.RasterUtils;
+import org.gvsig.fmap.dal.feature.FeatureStore;
+import org.gvsig.raster.impl.buffer.DefaultDataServerWriter;
+import org.gvsig.raster.impl.buffer.DefaultRasterQuery;
+import org.gvsig.raster.impl.buffer.RasterBuffer;
+import org.gvsig.raster.impl.buffer.RasterMemoryBuffer;
+import org.gvsig.raster.impl.buffer.cache.RasterCache;
+import org.gvsig.raster.impl.buffer.cache.RasterReadOnlyBuffer;
+import org.gvsig.raster.impl.datastruct.DefaultDataStructFactory;
+import org.gvsig.raster.impl.datastruct.legend.GimpGradients;
+import org.gvsig.raster.impl.datastruct.legend.GimpPalettes;
+import org.gvsig.raster.impl.datastruct.legend.LegendgvSIG;
+import org.gvsig.raster.impl.datastruct.legend.RasterLegendIO;
+import org.gvsig.raster.impl.grid.filter.DefaultRasterFilterList;
+import org.gvsig.raster.impl.grid.filter.FilterLoaderImpl;
+import org.gvsig.raster.impl.grid.render.ImageDrawerImpl;
+import org.gvsig.raster.impl.grid.roi.ROIStatistic;
+import org.gvsig.raster.impl.grid.roi.VectorialROIImpl;
+import org.gvsig.raster.impl.grid.roi.VectorialROIsReader;
+import org.gvsig.raster.impl.grid.roi.VectorialROIsWriter;
+import org.gvsig.raster.impl.process.DefaultTaskEventManager;
+import org.gvsig.raster.impl.process.RasterTask;
+import org.gvsig.raster.impl.process.RasterTaskQueue;
+import org.gvsig.raster.impl.process.vector.PotraceVectorization;
+import org.gvsig.raster.impl.store.ParamsImpl;
+import org.gvsig.raster.impl.store.QueryableRaster;
+import org.gvsig.raster.impl.store.writer.DefaultRasterWriter;
+import org.gvsig.raster.roi.AbstractROI;
+import org.gvsig.raster.roi.ROIReader;
+import org.gvsig.raster.roi.ROIWriter;
+import org.gvsig.raster.roi.VectorialROI;
+import org.gvsig.raster.util.DefaultColorConversion;
+import org.gvsig.raster.util.DefaultFileUtils;
+import org.gvsig.raster.util.DefaultHistorical;
+import org.gvsig.raster.util.DefaultMathUtils;
+import org.gvsig.raster.util.DefaultProviderServices;
+import org.gvsig.raster.util.DefaultRasterUtils;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+import org.gvsig.tools.service.ServiceException;
+
+/**
+ * Default {@link RasterManager} implementation.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class DefaultRasterManager implements RasterManager {
+	private static DefaultRasterManager internalInstance  = new DefaultRasterManager();
+	//private static final Logger         logger            = LoggerFactory.getLogger(DefaultRasterManager.class);
+	private FileUtils                   file              = null;
+	private MathUtils                   math              = null;
+	private RasterUtils                 util              = null;
+	private ProviderServices            pInfo             = null;
+	private DefaultColorConversion      colorConversion   = null;
+	private DataStructFactory           dataStructFactory = null;
+	
+	public static HashMap<String, OverviewBuilder>
+    									overviewBuilderRegistry   = new HashMap<String, OverviewBuilder>();
+	public static CRSUtils              crsUtilRegistry   = null;
+	
+	/**
+	 * Gets an instance of this object for internal use.
+	 * @return DefaultRasterManager
+	 */
+	public static DefaultRasterManager getInstance() {
+		return internalInstance;
+	}
+	
+	public DataStructFactory getDataStructFactory() {
+		if(dataStructFactory == null)
+			dataStructFactory = new DefaultDataStructFactory();
+		return dataStructFactory;
+	}
+	
+	public ProviderServices getProviderServices() {
+		if(pInfo == null)
+			pInfo = new DefaultProviderServices();
+		return pInfo;
+	}
+	
+	public boolean isCRSUtilSupported() {
+		return crsUtilRegistry != null;
+	}
+	
+	public CRSUtils getCRSUtils() {
+		return crsUtilRegistry;
+	}
+	
+	public FileUtils getFileUtils() {
+		if(file == null)
+			file = new DefaultFileUtils();
+		return file;
+	}
+	
+	public RasterUtils getRasterUtils() {
+		if(util == null)
+			util = new DefaultRasterUtils();
+		return util;
+	}
+	
+	public MathUtils getMathUtils() {
+		if(math == null)
+			math = new DefaultMathUtils();
+		return math;
+	}
+	
+    public RasterService getRasterService()
+        throws ServiceException {
+        RasterService fc = new DefaultRasterService(this);
+        return fc;
+    }
+    
+	public String[] getLegendFormats() {
+		return RasterLegendIO.formats;
+	}
+	
+	public RasterLegend getRasterLegendIO(String formatName) throws RasterLegendIONotFound {
+		if (formatName.equals(RasterLegendIO.formats[0]))
+			return new LegendgvSIG();
+
+		if (formatName.equals(RasterLegendIO.formats[1]))
+			return new GimpGradients();
+
+		if (formatName.equals(RasterLegendIO.formats[2]))
+			return new GimpPalettes();
+
+		// Incluir mas formatos de la misma manera
+		throw new RasterLegendIONotFound();
+	}
+	
+	public DataServerWriter createDataServerWriter() {
+		return new DefaultDataServerWriter();
+	}
+	
+	public RasterQuery createQuery() {
+		return new DefaultRasterQuery();
+	}
+	
+	public Buffer createBuffer(int dataType, int width, int height, int bandNr, boolean malloc) {
+		//Opci�n de cachear siempre activada (Solo DEBUG)
+		if(RasterBuffer.forceToLoadInCache)
+			return new RasterCache(dataType, width, height, bandNr);
+		if(RasterBuffer.forceToLoadInReadOnlyCache){
+		return new RasterReadOnlyBuffer(dataType, width, height, bandNr);
+		}
+			
+		if(RasterBuffer.cacheOn){
+			long size = (long)((long)getRasterUtils().getBytesFromRasterBufType(dataType) * (long)width * (long)height * (long)bandNr) / 1024L;
+			long ms1 = RasterLibrary.cacheSize * 1024L;
+			if(size <= ms1)
+				return new RasterMemoryBuffer(dataType, width, height, bandNr, malloc);
+			else
+				return new RasterCache(dataType, width, height, bandNr);
+		}else
+			return new RasterMemoryBuffer(dataType, width, height, bandNr, malloc);
+	}
+	
+	public Buffer createReadOnlyBuffer(int dataType, int width, int height, int bandNr) {
+		return new RasterReadOnlyBuffer(dataType, width, height, bandNr);
+	}
+	
+	public Buffer createMemoryBuffer(int dataType, int width, int height, int bandNr, boolean malloc) {
+		return new RasterMemoryBuffer(dataType, width, height, bandNr, malloc);
+	}
+
+	public RasterWriter createWriter(String fName) throws NotSupportedExtensionException, RasterDriverException {
+		String ext = getFileUtils().getExtensionFromFileName(fName);
+		DefaultRasterWriter grw = null;
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterWriter");
+//		ExtensionPoint extensionPoint = ExtensionPoint.getExtensionPoint("RasterWriter");
+
+		if (!point.has(ext))
+			return grw;
+
+		Class<?> clase = point.get(ext).getExtension();
+		Class<?>[] args = { String.class };
+		try {
+			Constructor<?> hazNuevo = clase.getConstructor(args);
+			Object[] args2 = { fName };
+			grw = (DefaultRasterWriter) hazNuevo.newInstance(args2);
+		} catch (SecurityException e) {
+			throw new RasterDriverException("Error SecurityException in open", e);
+		} catch (NoSuchMethodException e) {
+			throw new RasterDriverException("Error NoSuchMethodException in open", e);
+		} catch (IllegalArgumentException e) {
+			throw new RasterDriverException("Error IllegalArgumentException in open", e);
+		} catch (InstantiationException e) {
+			throw new RasterDriverException("Error InstantiationException in open", e);
+		} catch (IllegalAccessException e) {
+			throw new RasterDriverException("Error IllegalAccessException in open", e);
+		} catch (InvocationTargetException e) {
+			throw new NotSupportedExtensionException("Error in open", e);
+		}
+		return grw;
+	}
+
+	public RasterWriter createWriter(DataServerWriter dataWriter,
+												 String outFileName,
+												 int nBands,
+												 AffineTransform at,
+												 int outSizeX,
+												 int outSizeY,
+												 int dataType,
+												 Params params,
+												 IProjection proj) throws NotSupportedExtensionException, RasterDriverException {
+		return createWriter(dataWriter, outFileName, nBands, at, outSizeX, outSizeY, dataType, params, proj, true);
+	}
+
+	public RasterWriter createWriter(DataServerWriter dataWriter,
+												 String outFileName,
+												 int nBands,
+												 AffineTransform at,
+												 int outSizeX,
+												 int outSizeY,
+												 int dataType,
+												 Params params,
+												 IProjection proj,
+												 boolean geo) throws NotSupportedExtensionException, RasterDriverException {
+		String ext = outFileName.toLowerCase().substring(outFileName.lastIndexOf('.') + 1);
+		DefaultRasterWriter grw = null;
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("RasterWriter");
+
+		if (!point.has(ext))
+			return grw;
+
+		Class<?> clase = point.get(ext).getExtension();
+		Class<?>[] args = { DataServerWriter.class, String.class, Integer.class, AffineTransform.class, Integer.class, Integer.class, Integer.class, Params.class, IProjection.class, Boolean.class };
+		try {
+			Constructor<?> hazNuevo = clase.getConstructor(args);
+			Object [] args2 = {dataWriter, outFileName, new Integer(nBands), at,
+								new Integer(outSizeX), new Integer(outSizeY), new Integer(dataType),
+								params, proj, new Boolean(geo)};
+			grw = (DefaultRasterWriter) hazNuevo.newInstance(args2);
+		} catch (SecurityException e) {
+			throw new RasterDriverException("Error SecurityException in open", e);
+		} catch (NoSuchMethodException e) {
+			throw new RasterDriverException("Error NoSuchMethodException in open", e);
+		} catch (IllegalArgumentException e) {
+			throw new RasterDriverException("Error IllegalArgumentException in open", e);
+		} catch (InstantiationException e) {
+			throw new RasterDriverException("Error InstantiationException in open", e);
+		} catch (IllegalAccessException e) {
+			throw new RasterDriverException("Error IllegalAccessException in open", e);
+		} catch (InvocationTargetException e) {
+			throw new NotSupportedExtensionException("Error in open. Problemas con las librer�as nativas.", e);
+		}
+		return grw;
+	}
+	
+	public Params createWriterParams(String fileName) {
+		try {
+			return createWriter(fileName).getParams();
+		} catch (NotSupportedExtensionException e) {
+			return null;
+		} catch (RasterDriverException e) {
+			return null;
+		}
+	}
+	
+	/**
+	 * Gets an object which vectorize a raster
+	 * @param dataStore
+	 * @return
+	 * @throws RasterDriverException
+	 * @throws ProcessInterruptedException
+	 *         When the object Vectorization is built the raster data buffer is loaded. 
+	 *         This operation can be interrupted
+	 */
+	public Vectorization getVectorizeObject(QueryableRaster queryable) throws QueryException, ProcessInterruptedException {
+		return new PotraceVectorization(queryable);
+	}
+	
+	public OverviewBuilder getOverviewBuilder(String id) {
+		return overviewBuilderRegistry.get(id);
+	}
+	
+	public boolean isOverviewBuilderSupported() {
+		return overviewBuilderRegistry.size() > 0;
+	}
+	
+
+	public Set<String> getOverviewBuilderKeyList() {
+		return overviewBuilderRegistry.keySet();
+	}
+	
+	public FilterLoader createFilterLoader(int dataType) {
+		return new FilterLoaderImpl(dataType);
+	}
+	
+	public FilterLoader createFilterLoader(RasterFilterList filterList) {
+		return new FilterLoaderImpl(filterList);
+	}
+	
+    public Historical createHistoricalService() {
+    	return new DefaultHistorical();
+    }
+    
+    public ColorConversion getColorConversion() {
+    	if(colorConversion == null)
+    		colorConversion = new DefaultColorConversion();
+    	return colorConversion;
+    }
+	
+	public Statistics createROIStatistics(AbstractROI roi) {
+		return new ROIStatistic(roi);
+	}
+	
+	public RasterFilterList createEmptyFilterList(int type) {
+		DefaultRasterFilterList fl = new DefaultRasterFilterList();
+		fl.setInitDataType(type);
+		return fl;
+	}
+	
+	public TaskEventManager getRasterTask() {
+		return DefaultTaskEventManager.get();
+	}
+	
+	public TaskEventManager createRasterTask(Object process) {
+		RasterTask task = RasterTaskQueue.getRasterTask(Thread.currentThread().getId() + "");
+		if(task != null) {
+			DefaultTaskEventManager man = new DefaultTaskEventManager();
+			man.setTask(task);
+			return man;
+		}
+		DefaultTaskEventManager man = new DefaultTaskEventManager(process);
+		return man;
+	}
+	
+	/**
+	 * Builds a new parameter object. These parameters represents the fieds of a filter
+	 * panel.
+	 * @param id
+	 * @param value
+	 * @param type
+	 * @param list
+	 * @return
+	 */
+	public Params createParams(String id, Object value, int type, String[] list) {
+		ParamsImpl params = new ParamsImpl();
+		params.setParam(id, 
+				value, 
+				type, 
+				list);
+		return params;
+	}
+	
+	public ImageDrawer createImageDrawerService() {
+		return new ImageDrawerImpl();
+	}
+
+	public BufferFactory getBufferFactory() {
+		return new BufferFactoryImpl();
+	}
+
+	public ROIReader createROIReader(String filename, RasterDataStore store,
+			IProjection projection) throws ROIException, FileNotExistsException {
+		//Actualmente solo puede ser vectorial pero filename puede ser raster tambi�n
+		return new VectorialROIsReader(filename, store, projection);
+	}
+
+	public ROIWriter createROIWriter(String filename, IProjection projection) {
+		//Actualmente solo puede ser vectorial pero filename puede ser raster tambi�n
+		return new VectorialROIsWriter(filename, projection);
+	}
+
+	public VectorialROI createVectorialROI(RasterDataStore store) {
+		return new VectorialROIImpl(store);
+	}
+
+	public ROIReader createVectorialROIReader(FeatureStore roiStore,
+			RasterDataStore store, IProjection projection) {
+		return new VectorialROIsReader(roiStore, store, projection);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/src/main/java/org/gvsig/raster/impl/DefaultRasterManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl/pom.xml	(revision 15423)
@@ -0,0 +1,150 @@
+<?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.lib.impl</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.lib</artifactId>
+		<version>2.2.171</version>
+	</parent>
+	<dependencies>
+		<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.cache.lib.api</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.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.file.shp</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>
+        -->
+        <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.jpotrace</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.remoteclient</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <!-- <dependency>
+    		<groupId>org.opengis</groupId>
+    		<artifactId>geoapi</artifactId>
+    		<scope>compile</scope>
+  		</dependency>
+  		<dependency>
+  			<groupId>org.geotools</groupId>
+  			<artifactId>gt2-main</artifactId>
+  			<scope>compile</scope>
+		</dependency>
+		<dependency>
+  			<groupId>org.geotools</groupId>
+  			<artifactId>gt2-legacy</artifactId>
+  			<scope>compile</scope>
+		</dependency>
+		 <dependency>
+            <groupId>org.geotools</groupId>
+            <artifactId>gt2-referencing</artifactId>
+            <scope>compile</scope>
+        </dependency>-->
+	</dependencies>
+	<build>
+		<resources>
+			<resource>
+				<directory>src/main/java</directory>
+				<includes>
+					<include>**/*.gif</include>
+					<include>**/*.png</include>
+					<include>**/*.PNG</include>
+					<include> **/*.bmp</include>
+					<include> **/*.jpg</include>
+					<include> **/*.jpeg</include>
+					<include> **/*.properties</include>
+				</includes>
+			</resource>
+			<resource>
+				<directory>src/main/resources</directory>
+				<includes>
+					<include>**/*</include>
+				</includes>
+			</resource>
+		</resources>
+	</build>
+</project>

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


Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/org.gvsig.raster.lib.impl
___________________________________________________________________
Added: svn:ignore
   + target

.settings

.classpath

.project


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.lib/pom.xml	(revision 15423)
@@ -0,0 +1,17 @@
+<?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.lib</artifactId>
+	<packaging>pom</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster</artifactId>
+		<version>2.2.171</version>
+	</parent>
+	<modules>
+		<module>org.gvsig.raster.lib.api</module>
+		<module>org.gvsig.raster.lib.impl</module>
+	</modules>
+</project>

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 15423)
@@ -0,0 +1 @@
+org.gvsig.raster.swing.impl.RasterSwingImplLibrary
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/buttonbar/ButtonBar.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/buttonbar/ButtonBar.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/buttonbar/ButtonBar.java	(revision 15423)
@@ -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.swing.buttonbar;
+
+import javax.swing.JButton;
+
+
+/**
+ * Bar of buttons of 16x16 pixels
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface ButtonBar {
+	/**
+	 * A�ade un boton al ArrayList de los botones.
+	 *
+	 * @param iconName: nombre del icono asignado al boton. La imagen tendr�a que
+	 * 					estar dentro de la carpeta "images/"
+	 * @param tip: tip del boton;
+	 * @param order: orden que ocupar� el boton dentro del control
+	 */
+	public void addButton(String iconName, String tip, int order);
+
+	/**
+	 * Elimina el bot�n correspondiente al indice que le pasamos.
+	 * @param index
+	 */
+	public void delButton(int index);
+
+	/**
+	 * A�ade en el panel los botones que tenemos en el ArrayList.
+	 *
+	 */
+	public void addList();
+
+
+	/**
+	 * Esta funci�n deshabilita todos los controles y guarda sus valores
+	 * de habilitado o deshabilitado para que cuando se ejecute restoreControlsValue
+	 * se vuelvan a quedar como estaba
+	 */
+	public void disableAllControls();
+
+	/**
+	 * Esta funci�n deja los controles como estaban al ejecutar la funci�n
+	 * disableAllControls
+	 */
+	public void restoreControlsValue();
+
+	/**
+	 * M�todo para acceder a los botones del control;
+	 * @param index
+	 * @return
+	 */
+	public JButton getButton(int index);
+
+	/**
+	 * M�todo para establecer la posici�n de los botones dentro del control.
+	 * @param align: "left" o "right"
+	 */
+	public void setButtonAlignment(String align);
+
+	public void setComponentBorder(boolean br);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/infobypoint/MainInfoByPointPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/infobypoint/MainInfoByPointPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/infobypoint/MainInfoByPointPanel.java	(revision 15423)
@@ -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.swing.infobypoint;
+
+import java.awt.event.ActionListener;
+import java.util.Observer;
+
+import org.gvsig.raster.swing.pixelinspector.PixelInspector;
+
+
+/**
+ * Main panel for the information by point
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface MainInfoByPointPanel extends Observer {
+	/**
+	 * Gets the data model
+	 * @return
+	 */
+	public InfoByPointDataModel getInfoByPointDataModel();
+	
+	/**
+	 * Gets the pixel inspector panel
+	 * @return
+	 */
+	public PixelInspector getPixelInspectorPanel();
+	
+	/**
+	 * Adds a listener to the extended button
+	 * @param listener
+	 */
+	public void addListenerExtendedButton(ActionListener listener);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/infobypoint/InfoByPointDataModel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/infobypoint/InfoByPointDataModel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/infobypoint/InfoByPointDataModel.java	(revision 15423)
@@ -0,0 +1,55 @@
+/* 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.swing.infobypoint;
+
+import java.util.List;
+
+/**
+ * Data model for the information by point
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface InfoByPointDataModel {
+	public void setBandValues(double[] list);
+	
+	public void setNumberOfBands(int n);
+	
+	public void setLayerList(List<String> list);
+	
+	public void setARGB(int r, int g, int b);
+	
+	public void setCMYK(double[] cmyk);
+	
+	public void setHSL(double h, double s, double l);
+	
+	public void setPixelPoint(double x, double y);
+	
+	public void setWorldPoint(double x, double y);
+	
+	public void setViewPoint(double x, double y);
+	
+	public String getFormatedLayerName(int i);
+	
+	public void notifyObservers();
+	
+	public void setProjected(boolean projected);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/openfile/OpenFileContainer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/openfile/OpenFileContainer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/openfile/OpenFileContainer.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.swing.openfile;
+
+import java.io.File;
+
+/**
+ * Panel to choose a file from disk
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface OpenFileContainer {
+	/**
+	 * Gets the selected file
+	 * @return
+	 */
+	public File getFile();
+	
+	/**
+	 * Sets a path in the field of text
+	 * @param path
+	 */
+	public void setPath(String path);
+	
+	public void setEnabled(boolean enabled);
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/openfile/FileFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/openfile/FileFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/openfile/FileFilter.java	(revision 15423)
@@ -0,0 +1,14 @@
+package org.gvsig.raster.swing.openfile;
+
+
+public abstract class FileFilter extends javax.swing.filechooser.FileFilter {
+
+	/**
+	 * <p>Gets the default file extension, which will be
+	 * added to the selected file if its extension is not
+	 * valid.</p>
+	 * 
+	 * @return
+	 */
+	public abstract String getDefaultExtension();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterWindowManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterWindowManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterWindowManager.java	(revision 15423)
@@ -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.swing;
+
+import javax.swing.JPanel;
+
+/**
+ * Responsible of the window management to show the panels of the
+ * Validation swing library.
+ * 
+ * @see RasterSwingManager
+ * @see JValidationServicePanel
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public interface RasterWindowManager {
+
+    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/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterWindowManager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pixelinspector/PixelInspector.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pixelinspector/PixelInspector.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pixelinspector/PixelInspector.java	(revision 15423)
@@ -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.swing.pixelinspector;
+
+import java.awt.image.BufferedImage;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface PixelInspector {
+
+	public void setClear(boolean clear);
+	
+	/**
+	 * Gets the with of the control
+	 * @return
+	 */
+	public int getWidth();
+	
+	/**
+	 * Gets the height of the control
+	 * @return
+	 */
+	public int getHeight();
+	
+	/**
+	 * Gets the scale factor
+	 * @return
+	 */
+	public int getScale();
+	
+	/**
+	 * Assigns view coordinates 
+	 * @param pixX
+	 * @param pixY
+	 */
+	public void setViewCoordinates(int pixX, int pixY);
+	
+	public void setDataBuffer(BufferedImage view);
+	
+	public BufferedImage getDataBuffer();
+	
+	/**
+	 * Sets the X position of the control where the painted starts
+	 * 
+	 * @param posX 
+	 */
+	public void setPosX(int posX);
+
+	/**
+	 * Sets the Y position of the control where the painted starts
+	 * 
+	 * @param posY 
+	 */
+	public void setPosY(int posY);
+	
+	/**
+	 * Repaints the control
+	 */
+	public void repaint();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/BasePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/BasePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/BasePanel.java	(revision 15423)
@@ -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.swing;
+
+import java.awt.Component;
+import java.awt.event.ActionListener;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+
+import javax.swing.AbstractButton;
+import javax.swing.JPanel;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Clase base para los paneles gr�ficos. 
+ * 
+ * 17/07/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public abstract class BasePanel extends JPanel {
+	private static final long    serialVersionUID         = -8877600252349334979L;
+	private boolean	             enableValueChangedEvent  = true;
+	
+	public static final int      KEYLISTENER              = 0;
+	public static final int      ACTIONLISTENER           = 1;
+	public static final int      MOUSELISTENER            = 2;
+	private static final Logger  logger                   = LoggerFactory.getLogger(BasePanel.class);
+	
+	/**
+	 * Obtiene la traducci�n de la cadena de texto
+	 * @param parent Ventana padre
+	 * @param text Cadena a traducir
+	 * @return Cadena de texto traducida
+	 */
+	public String getText(Object parent, String key) {
+		 if (key == null)
+	            return null;
+	        String translation = org.gvsig.i18n.Messages.getText(key, false);
+	        if (translation != null)
+	            return translation;
+	        else {
+	            logger.debug("Can't find translation for ''{1}''.", key);
+	            return key;
+	        }
+	}
+	
+	/**
+	 * Obtiene la traducci�n de la cadena de texto
+	 * @param text Cadena a traducir
+	 * @return Cadena de texto traducida
+	 */
+	public String getText(String text) {
+		return getText(this, text);
+	}
+	
+	/**
+	 * Asigna el valor para la activaci�n y desactivaci�n del evento de cambio de valor en
+	 * las cajas de texto.
+	 * @param enableValueChangedEvent
+	 */
+	public void setEnableValueChangedEvent(boolean enableValueChangedEvent) {
+		this.enableValueChangedEvent = enableValueChangedEvent;
+	}
+	
+	/**
+	 * Obtiene el valor para la activaci�n y desactivaci�n del evento de cambio de valor en
+	 * las cajas de texto.
+	 * @param enableValueChangedEvent
+	 */
+	public boolean isEnableValueChangedEvent() {
+		return this.enableValueChangedEvent;
+	}
+	
+	/**
+	 * Obtiene la lista de componentes del panel. Si dentro tiene alg�n BasePanel
+	 * consulta la lista de componentes de este y la devuelve.
+	 * @return
+	 */
+	@SuppressWarnings("unchecked")
+	public ArrayList getComponentList() {
+		ArrayList listComp = new ArrayList();
+		for (int i = 0; i < this.getComponentCount(); i++) {
+			if(getComponent(i) instanceof BasePanel) {
+				ArrayList list = ((BasePanel)getComponent(i)).getComponentList();
+				for (int j = 0; j < list.size(); j++) 
+					listComp.add(list.get(j));
+			} else
+				listComp.add(getComponent(i));
+		}
+		return listComp;
+	}
+	
+	/**
+	 * Registra un listener en todos los componentes contenidos en este panel.
+	 * @param type Tipo de listener definido por las variables est�ticas en esta clase
+	 * @param listener Objeto listener del tipo correcto
+	 */
+	@SuppressWarnings("unchecked")
+	public void registerListener(int type, Object listener) {
+		ArrayList listComp = getComponentList();
+		if(type == KEYLISTENER) {
+			if(listener instanceof KeyListener) {
+				for (int i = 0; i < listComp.size(); i++)
+					if(listComp.get(i) instanceof Component)
+						((Component)listComp.get(i)).addKeyListener((KeyListener)listener);
+			}
+		}
+		if(type == ACTIONLISTENER) {
+			if(listener instanceof ActionListener) {
+				for (int i = 0; i < listComp.size(); i++)
+					if(listComp.get(i) instanceof AbstractButton)
+						((AbstractButton)listComp.get(i)).addActionListener((ActionListener)listener);
+			}
+		}
+		if(type == MOUSELISTENER) {
+			if(listener instanceof MouseListener) {
+				for (int i = 0; i < listComp.size(); i++)
+					if(listComp.get(i) instanceof Component)
+						((Component)listComp.get(i)).addMouseListener((MouseListener)listener);
+			}
+		}
+	}
+	
+	/**
+	 * Traducci�n centralizada de los componentes de una panel
+	 */
+	protected abstract void translate();
+	
+	/**
+	 * Acciones de inicializaci�n
+	 */
+	protected abstract void init();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingLocator.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingLocator.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingLocator.java	(revision 15423)
@@ -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.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 RasterSwingManager} .
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class RasterSwingLocator extends BaseLocator {
+
+    /**
+     * Validation swing manager name.
+     */
+    public static final String SWING_MANAGER_NAME =
+        "Raster.swing.manager";
+
+    /**
+     * Validation swing manager description.
+     */
+    public static final String SWING_MANAGER_DESCRIPTION =
+        "Raster UIManager";
+
+    private static final String LOCATOR_NAME = "Raster.swing.locator";
+
+    /**
+     * Unique instance.
+     */
+    private static final RasterSwingLocator INSTANCE =
+        new RasterSwingLocator();
+
+    /**
+     * Return the singleton instance.
+     * 
+     * @return the singleton instance
+     */
+    public static RasterSwingLocator 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 RasterSwingManager> clazz) {
+        getInstance().register(SWING_MANAGER_NAME, SWING_MANAGER_DESCRIPTION,
+            clazz);
+    }
+
+    /**
+     * Gets the instance of the {@link ScriptingUIManager} registered.
+     * 
+     * @return {@link ScriptingUIManager}
+     */
+    public static RasterSwingManager getSwingManager() {
+        return (RasterSwingManager) getInstance()
+            .get(SWING_MANAGER_NAME);
+    }
+
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingLibrary.java	(revision 15423)
@@ -0,0 +1,140 @@
+/* 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.swing;
+
+import java.awt.Component;
+import java.util.List;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.tools.library.AbstractLibrary;
+import org.gvsig.tools.library.LibraryException;
+import org.gvsig.tools.locator.ReferenceNotRegisteredException;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Library for Swing API initialization and configuration.
+ * 
+ * @author gvSIG team
+ * @version $Id$
+ */
+public class RasterSwingLibrary extends AbstractLibrary {
+
+    @Override
+    protected void doInitialize() throws LibraryException {
+        // Do nothing
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+        // Validate there is any implementation registered.
+        RasterSwingManager manager =
+            RasterSwingLocator.getSwingManager();
+        if (manager == null) {
+            throw new ReferenceNotRegisteredException(
+                RasterSwingLocator.SWING_MANAGER_NAME,
+                RasterSwingLocator.getInstance());
+        }
+    }
+    
+    public static boolean messageBoxYesOrNot(String msg, Object parentWindow){
+		String string1 = Messages.getText("yes");
+		String string2 = Messages.getText("no");
+		Object[] options = {string1, string2};
+		Component parent = null;
+		if(parentWindow instanceof Component)
+			parent = (Component)parentWindow;
+		int n = JOptionPane.showOptionDialog(parent,
+					"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>",
+					Messages.getText("confirmacion"),
+					JOptionPane.YES_NO_OPTION,
+					JOptionPane.QUESTION_MESSAGE,
+					null,
+					options,
+					string1);
+		if (n == JOptionPane.YES_OPTION)
+			return true;
+		else
+			return false;
+	}
+
+	public static void messageBoxError(String msg, Object parentWindow) {
+		String string = Messages.getText("accept");
+		Object[] options = {string};
+		Component parent = null;
+		if(parentWindow instanceof Component)
+			parent = (Component)parentWindow;
+		JOptionPane.showOptionDialog(parent,
+					"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>",
+					Messages.getText("confirmacion"),
+					JOptionPane.OK_OPTION,
+					JOptionPane.ERROR_MESSAGE,
+					null,
+					options,
+					string);
+	}
+
+	public static void messageBoxInfo(String msg, Object parentWindow) {
+		String string = Messages.getText("accept");
+		Object[] options = {string};
+		Component parent = null;
+		if(parentWindow instanceof Component)
+			parent = (Component)parentWindow;
+		JOptionPane.showOptionDialog(parent,
+					"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>",
+					Messages.getText("confirmacion"),
+					JOptionPane.OK_OPTION,
+					JOptionPane.INFORMATION_MESSAGE,
+					null,
+					options,
+					string);
+	}
+
+	public static void debug(String msg, Object parent, Exception exception) {
+		if(parent != null)
+		    LoggerFactory
+            .getLogger(parent.getClass()).debug(Messages.getText(msg), exception);
+	}
+
+	public static void messageBoxError(String msg, Object parentWindow, Exception exception) {
+		debug(msg, parentWindow, exception);
+		messageBoxError(msg, parentWindow);
+	}
+	
+	public static void messageBoxError(String msg, Object parentWindow, List<Exception> exception) {
+		for (int i = 0; i < exception.size(); i++) 
+			debug(msg, parentWindow, exception.get(i));
+		messageBoxError(msg, parentWindow);
+	}
+
+	public static void messageBoxInfo(String msg, Object parentWindow, Exception exception) {
+		debug(msg, parentWindow, exception);
+		messageBoxInfo(msg, parentWindow);
+	}
+
+	public static boolean messageBoxYesOrNot(String msg, Object parentWindow, Exception exception) {
+		debug(msg, parentWindow, exception);
+		return messageBoxYesOrNot(msg, parentWindow);
+	}
+
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/DataSourcePreview.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/DataSourcePreview.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/DataSourcePreview.java	(revision 15423)
@@ -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.swing.preview;
+
+import java.awt.Graphics2D;
+import java.awt.geom.Rectangle2D;
+import java.awt.image.BufferedImage;
+
+import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException;
+import org.gvsig.tools.task.Cancellable;
+
+/**
+ * Data source for the raster preview
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+@SuppressWarnings("deprecation")
+public interface DataSourcePreview {
+
+	public void draw(BufferedImage image, Graphics2D g, double[] coords, int w, int h, Cancellable cancel, double scale) throws ImageUnavailableException;
+	
+	public Rectangle2D getBBoxRectangle();
+	
+	public double getCellSize();
+	
+	public void closePreviewLayer();
+	
+	public void pushStatus();
+	
+	public void popStatus();
+	
+	public DataSourcePreview cloneDataSourcePreview();
+	
+	public Object getSource();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewRenderProcess.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewRenderProcess.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewRenderProcess.java	(revision 15423)
@@ -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.swing.preview;
+
+import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException;
+
+/**
+ * Interfaz para el procesado del rendering antes de dibujar la preview.
+ * El cliente puede obtener la lista de filtros del rendering de la imagen 
+ * que va a dibujarse como preview y modificarla para visulizar la preview 
+ * modificada. En caso de no modificar la preview se ver� la imagen sin variaciones
+ * con respecto a la original.
+ * 
+ * 19/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface PreviewRenderProcess {
+	
+	/**
+	 * Procesado del rendering
+	 * @param rendering
+	 * @throws ImageUnavailable Cuando se ha producido un error y hay que mostrar un mensaje en la 
+	 * previsualizaci�n porque no se puede mostrar la imagen
+	 */
+	public void process(DataSourcePreview lyr) throws ImageUnavailableException;
+	
+	/**
+	 * Obtiene el flag que informa de si se est� mostrando la previsualizaci�n o no.
+	 * En caso de no mostrarse deber�a lanzarse una excepci�n ImageUnavailableExcepcion al
+	 * hacer un process.
+	 * @return
+	 */
+	public boolean isShowPreview();
+	
+	/**
+	 * Asigna el flag para mostrar u ocultar la preview. En caso de no mostrarse deber�a lanzarse una 
+	 * excepci�n ImageUnavailableExcepcion cuando se hace un process.
+	 * @param showPreview
+	 */
+	public void setShowPreview(boolean showPreview);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewPanel.java	(revision 15423)
@@ -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.swing.preview;
+
+import java.awt.Dimension;
+
+import javax.swing.JTabbedPane;
+
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.imagenavigator.ImageNavigator;
+
+/**
+ * Base interface for panels with preview
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface PreviewPanel {
+	
+	/**
+	 * Gets the data source of the preview
+	 * @return
+	 */
+	public DataSourcePreview getDataSourcePreview();
+	
+	/**
+	 * Obtiene el componente con los tabs donde se a�aden las pesta�as del usuario.
+	 * @return JTabbedPane
+	 */
+	public JTabbedPane getTabbedPane();
+	
+	/**
+	 * Obtener el objeto <code>ButtonsPanel</code> del <code>DialogPanel</code>.
+	 * En caso de no estar creado, lo crear�.
+	 *
+	 * @return El componente bp
+	 */
+	public ButtonsPanel getButtonsPanel();
+	
+	/**
+	 * Devuelve el componente para la vista previa
+	 * @return
+	 */
+	public ImageNavigator getImageNavigator();
+	
+	/**
+	 * Preview refresh
+	 */
+	public void refreshPreview();
+	
+	public void addButtonPressedListener(ButtonsPanelListener listener);
+	
+	/**
+	 * Sets the size of the preview
+	 * @param dimension
+	 */
+	public void setPreviewSize(Dimension dimension);
+	
+	/**
+	 * Sets the data source for the preview. 
+	 * 
+	 * @param layer
+	 */
+	public void setLayer(DataSourcePreview fLayer);
+	
+	/**
+	 * Initializes the preview size and coordinates. This function should
+	 * be called after the window has been opened because this call
+	 * assigns the size of the preview panel.
+	 * 
+	 * @param layer
+	 */
+	public void previewInitializeSizes();
+	
+	/**
+	 * Cierra la capa abierta para previsualizaci�n
+	 */
+	public void closePreviewLayer();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewBasePanelTab.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewBasePanelTab.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/preview/PreviewBasePanelTab.java	(revision 15423)
@@ -0,0 +1,46 @@
+/* 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.swing.preview;
+
+import javax.swing.JPanel;
+
+
+/**
+ * Interfaz que implementan los paneles que se incorporan al PreviewBasePanel
+ * 
+ * 19/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public interface PreviewBasePanelTab {
+	/**
+	 * Obtiene el t�tulo del panel. Esta ser� la etiqueta que se ponga en 
+	 * la pesta�a del tab.
+	 * @return Cadena con el t�tulo.
+	 */
+	public String getTitle();
+	
+	/**
+	 * Obtiene el panel que se a�ade en el tab
+	 * @return JPanel
+	 */
+	public JPanel getPanel();
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderText.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderText.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderText.java	(revision 15423)
@@ -0,0 +1,91 @@
+package org.gvsig.raster.swing.slider;
+
+import javax.swing.JComponent;
+
+import org.gvsig.gui.beans.slidertext.listeners.SliderListener;
+
+public interface SliderText {
+	
+	/**
+	 * Adds a listener to receive changes in this component
+	 * @param listener
+	 */
+	public void addValueChangedListener(SliderListener listener);
+	
+	/**
+	 * Obtiene el valor del control.
+	 * @return Valor del control en formato double.
+	 */
+	public double getValue();
+
+	/**
+	 * Asigna el valor del control.
+	 * @return Valor del control en formato double.
+	 */
+	public void setValue(double value);
+
+	/**
+	 * Activa o desactiva el control del panel
+	 * @param active
+	 */
+	public void setControlEnabled(boolean active);
+
+	/**
+	 * Asigna el flag que dice si el valor del campo de texto ser�
+	 * decimal o entero
+	 * @param dec true si se admiten valores decimales y false si no se admiten
+	 */
+	public void setDecimal (boolean dec);
+
+	/**
+	 * Obtiene el flag que dice si el valor del campo de texto es
+	 * decimal o entero
+	 * @return true si se admiten valores decimales y false si no se admiten
+	 */
+	public boolean getDecimal ();
+
+	/**
+	 * Obtiene el valor m�ximo del slider
+	 * @return Entero con el valor m�ximo
+	 */
+	public int getMax();
+
+	/**
+	 * Asigna el valor m�ximo del slider
+	 * @param Entero con el valor m�ximo
+	 */
+	public void setMaximum(int max);
+
+	/**
+	 * Obtiene el valor m�nimo del slider
+	 * @return Entero con el valor m�nimo
+	 */
+	public int getMin();
+
+	/**
+	 * Asigna el valor m�nimo del slider
+	 * @param Entero con el valor m�nimo
+	 */
+	public void setMinimum(int min);
+
+	/**
+	 * Definir un intervalo para el slider
+	 * @param value
+	 */
+	public void setInterval(double value);
+
+	/**
+	 * Obtener el intervalo definido para el slider
+	 * @return
+	 */
+	public double getInterval();
+	
+	/**
+	 * Asigna un borde al componente con el texto pasado como
+	 * par�metro
+	 * @param name
+	 */
+	public void setBorder(String name);
+	
+	public JComponent getComponent();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderListener.java	(revision 15423)
@@ -0,0 +1,19 @@
+package org.gvsig.raster.swing.slider;
+
+import java.util.EventListener;
+
+public interface SliderListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando cambia el valor del componente. Nunca
+	 * se dispara mientras se hace un dragged con el rat�n.
+	 * @param e
+	 */
+	public void actionValueChanged(SliderEvent e);
+
+	/**
+	 * Evento que se dispara cuando cambia el valor del componente mientras se
+	 * hace un dragged con el rat�n.
+	 * @param e
+	 */
+	public void actionValueDragged(SliderEvent e);
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/slider/SliderEvent.java	(revision 15423)
@@ -0,0 +1,15 @@
+package org.gvsig.raster.swing.slider;
+
+import java.util.EventObject;
+
+public class SliderEvent extends EventObject {
+	private static final long serialVersionUID = -128111523373280522L;
+
+	/**
+	 * Construye un SliderEvent
+	 * @param source
+	 */
+	public SliderEvent(Object source) {
+		super(source);
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/StraightLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/StraightLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/StraightLine.java	(revision 15423)
@@ -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.swing.gcanvas;
+
+
+/**
+ * Graphic layer to paint a straight line
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface  StraightLine extends BaseFunction {
+	/**
+	 * En una funci�n lineal da igual lo que devuelva, pero es interesante para sus
+	 * clases derivadas
+	 * @return
+	 */
+	public double getValueFunction();
+	
+	/**
+	 * Borra la lista de puntos
+	 */
+	public void clearSquares();
+	
+	/**
+	 * A�ade un punto a la lista de puntos
+	 * @param x
+	 * @param y
+	 */
+	public void addSquare(double x, double y);
+	
+	/**
+	 * Valores de los datos de entrada correspondientes al m�nimo y al m�ximo de 
+	 * cada tramo devuelto en forma de porcentaje
+	 * 
+	 * @param min
+	 * @param max
+	 * @return
+	 */
+	public double[] getPercentInValues();
+
+	/**
+	 * Valores de los datos de salida correspondientes al m�nimo y al m�ximo de
+	 * cada tramo, devueltos en forma de porcentaje.
+	 * @return
+	 */
+	public double[] getPercentOutValues();
+	
+	/**
+	 * Valores de los datos de entrada correspondientes al m�nimo y al m�ximo de 
+	 * cada tramo. Estos tendr�n un rango entre el m�nimo y el m�ximo en cada
+	 * banda de la imagen.
+	 * @param min
+	 * @param max
+	 * @return
+	 */
+	public double[] getInValues(double min, double max);
+
+	/**
+	 * Valores de los datos de salida correspondientes al m�nimo y al m�ximo de
+	 * cada tramo. Estos tendr�n un rango entre 0 y 255.
+	 * @return
+	 */
+	public int[] getOutValues();
+	
+	/**
+	 * Devuelve 0 para indicar que estamos en una funcion lineal.
+	 * @return
+	 */
+	public int getFunctionType();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/BaseFunction.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/BaseFunction.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/BaseFunction.java	(revision 15423)
@@ -0,0 +1,29 @@
+/* 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.swing.gcanvas;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface BaseFunction {
+
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DensitySlicingLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DensitySlicingLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DensitySlicingLine.java	(revision 15423)
@@ -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.swing.gcanvas;
+
+/**
+ * Graphic layer to paint a straight line
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface DensitySlicingLine extends BaseFunction {
+	/**
+	 * Pone la forma a la l�nea escalonada dependiendo del n�mero de 
+	 * escalones existentes.
+	 * 
+	 * @param levels
+	 */
+	public void setShape(int levels);
+	
+	/**
+	 * @return the levels
+	 */
+	public int getLevels();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/IGCanvasListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/IGCanvasListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/IGCanvasListener.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.swing.gcanvas;
+
+import java.util.EventListener;
+/**
+ * Listener que deben implementar las clases que quieran recibir cambios
+ * del GCanvas.
+ * 
+ * @version 28/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface IGCanvasListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando el GCanvas cambia el valor de alg�n elemento
+	 * @param e
+	 */
+	public void actionDataChanged(GCanvasEvent e);
+	
+	/**
+	 * Evento que se dispara mientras se esta produciendo la acci�n
+	 * @param e
+	 */
+	public void actionDataDragged(GCanvasEvent e);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvas.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvas.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvas.java	(revision 15423)
@@ -0,0 +1,202 @@
+/* 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.swing.gcanvas;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.MouseListener;
+import java.awt.event.MouseMotionListener;
+import java.util.List;
+
+/**
+ * Canvas where graphic elements are painted
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface GCanvas extends MouseListener, MouseMotionListener {
+	/**
+     * Creates a border layer to the graphic canvas
+     * @param color
+     * @return
+     */
+    public DrawableElement createBorderLayerForGCanvas(Color color);
+    
+    /**
+     * Creates a information layer for the graphic canvas
+     * @param colorLayer
+     * @return
+     */
+    public InfoLayer createInfoLayerForGCanvas(Color colorLayer);
+    
+    /**
+     * Creates a histogram for the graphic canvas
+     * @param data
+     * @param color
+     * @return
+     */
+    public GraphicHistogram createHistogramForGCanvas(double[] data, Color color);
+    
+    /**
+     * Creates a minmax layer for the graphic canvas
+     * @param color
+     * @return
+     */
+    public MinMaxLines createMinMaxLinesForGCanvas(Color color);
+    
+    /**
+     * Creates a straight line layer for the graphic canvas
+     * @param color
+     * @return
+     */
+    public StraightLine createStraightLineForGCanvas(Color color);
+    
+    /**
+     * Creates a logaritmic or exponential function layer for the graphic canvas
+     * @param color
+     * @return
+     */
+    public LogaritmicExponentialLine createLogaritmicExponentialLineForGCanvas(Color color, double point);
+    
+    /**
+     * Creates a square root or pow line function for the graphic canvas
+     * @param color
+     * @return
+     */
+    public SquareRootPowLine createSquareRootPowLineForGCanvas(Color color, double point);
+    
+    /**
+     * Creates a density slice function for the graphic canvas
+     * @param color
+     * @return
+     */
+    public DensitySlicingLine createDensitySliceForGCanvas(Color color, int levels);
+	
+	
+	public void addBorder(int x1, int y1, int x2, int y2);
+	
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addValueChangedListener(IGCanvasListener listener);
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeValueChangedListener(IGCanvasListener listener);
+	
+	/**
+	 * Invocar a los eventos asociados al componente
+	 */
+	public void callDataChanged(String key, Object value);
+	
+	/**
+	 * Invocar a los eventos asociados al componente
+	 */
+	public void callDataDragged(String key, Object value);
+	
+	/**
+	 * A�ade un elemento dibujable a la lista
+	 * @param element
+	 */
+	public void addDrawableElement(DrawableElement element);
+	
+	/**
+	 * Reemplaza un elemento dibujable si encuentra uno de su mismo tipo
+	 * @param element
+	 */
+	public void replaceDrawableElement(DrawableElement element);
+
+	/**
+	 * Obtiene todos los elementos dibujable que sean una instancia de c1
+	 * @param c1
+	 * @return ArrayList de DrawableElements
+	 */
+	public List<DrawableElement> getDrawableElements(Class<?> c1);
+	
+	/**
+	 * Reemplaza un elemento dibujable si encuentra uno del tipo especificado en el 
+	 * parametro c1
+	 * @param element
+	 * @param c1
+	 */
+	public void replaceDrawableElement(DrawableElement element, Class<?> cl);
+	
+	/**
+	 * Elimina un elemento dibujable
+	 * @param Class clase del elemento a eliminar
+	 */
+	public void removeDrawableElement(Class<?> cl);
+	
+	/**
+	 * Asigna una lista de elementos dibujables
+	 * @return
+	 */
+	public void setDrawableElements(List<DrawableElement>  list);
+		
+	/**
+	 * Inicializa el fondo y dibuja el gr�fico sobre el canvas.
+	 */
+	public void paint(Graphics g);
+	
+	/**
+	 * Ejecuta las acciones antes del primer dibujado de todos
+	 * los elementos dibujables
+	 */
+	public void execFirstDrawActions();
+	
+	/**
+	 * Obtiene la posici�n m�nima en X del canvas donde comenzar a dibujar
+	 * @return
+	 */
+	public int getCanvasMinX();
+	
+	/**
+	 * Obtiene la posici�n m�nima en Y del canvas donde comenzar a dibujar
+	 * @return
+	 */
+	public int getCanvasMinY();
+	
+	/**
+	 * Obtiene la posici�n m�xima en X del canvas donde terminar el dibujado
+	 * @return
+	 */
+	public int getCanvasMaxX();
+	
+	/**
+	 * Obtiene la posici�n m�xima en Y del canvas donde terminar el dibujado
+	 * @return
+	 */
+	public int getCanvasMaxY();
+	
+	/**
+	 * Obtiene el ancho del canvas sumando a partir de getCanvasX donde termina el �rea de dibujo
+	 * @return
+	 */
+	public int getCanvasWidth();
+	
+	/**
+	 * Obtiene el alto del canvas sumando a partir de getCanvasY donde termina el �rea de dibujo
+	 * @return
+	 */
+	public int getCanvasHeight();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/SquareRootPowLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/SquareRootPowLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/SquareRootPowLine.java	(revision 15423)
@@ -0,0 +1,29 @@
+/* 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.swing.gcanvas;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface SquareRootPowLine extends BaseFunction {
+
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvasEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvasEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GCanvasEvent.java	(revision 15423)
@@ -0,0 +1,56 @@
+/* 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.swing.gcanvas;
+
+import java.util.EventObject;
+/**
+ * Clase que contiene la informaci�n que se produce al dispararse un evento
+ * en el GCanvas
+ * 
+ * @version 28/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class GCanvasEvent extends EventObject {
+	private static final long serialVersionUID = 1654248992170060578L;
+	private String key;
+	private Object value;
+
+	public GCanvasEvent(Object source, String key, Object value) {
+		super(source);
+		this.key = key;
+		this.value = value;
+	}
+
+	/**
+	 * @return the key
+	 */
+	public String getKey() {
+		return key;
+	}
+
+	/**
+	 * @return the value
+	 */
+	public Object getValue() {
+		return value;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/MinMaxLines.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/MinMaxLines.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/MinMaxLines.java	(revision 15423)
@@ -0,0 +1,32 @@
+/* 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.swing.gcanvas;
+
+/**
+ * Graphic layer to paint a two lines with the maximum and the minumun
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class  MinMaxLines extends DrawableElement {
+	public abstract void setMinimum(double min);
+	
+	public abstract void setMaximum(double max);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/InfoLayer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/InfoLayer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/InfoLayer.java	(revision 15423)
@@ -0,0 +1,35 @@
+/* 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.swing.gcanvas;
+
+/**
+ * Graphic layer to paint a layer of information
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class  InfoLayer extends DrawableElement {
+	/**
+	 * Sets the maximum and minimum values for this layer
+	 * @param min
+	 * @param max
+	 */
+	public abstract void setLimits(double min, double max);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/LogaritmicExponentialLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/LogaritmicExponentialLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/LogaritmicExponentialLine.java	(revision 15423)
@@ -0,0 +1,39 @@
+/* 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.swing.gcanvas;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface LogaritmicExponentialLine extends BaseFunction {
+	/**
+	 * Devuelve si esta usando la funcion logaritmica
+	 * @return
+	 */
+	public boolean isLogaritmical();
+
+	/**
+	 * Devuelve si esta usando la funcion exponencial
+	 * @return
+	 */
+	public boolean isExponencial();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DrawableElement.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DrawableElement.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/DrawableElement.java	(revision 15423)
@@ -0,0 +1,168 @@
+/* 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.swing.gcanvas;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.event.MouseEvent;
+/**
+ * Clase base para los gr�ficos a dibujar sobre el canvas
+ *
+ * 14-oct-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class DrawableElement {
+	protected Color   color     = Color.BLACK;
+	private boolean   firstDraw = true;
+	private boolean   drawing   = true;
+
+	/**
+	 * Entorno donde se dibuja
+	 */
+	protected GCanvas canvas    = null;
+	
+	/**
+	 * Dibujado del elemento gr�fico desde el GCanvas. Llamar� antes de dibujar a
+	 * la funci�n firstDrawActions
+	 * @param g
+	 */
+	public void draw(Graphics g) {
+		if(!drawing)
+			return;
+		if (firstDraw) {
+			firstDrawActions();
+			firstDraw = false;
+		}
+		paint(g);
+	}
+	
+	/**
+	 * Asigna el flag de dibujado del elemento gr�fico
+	 * @param draw
+	 */
+	public void setDrawing(boolean drawing) {
+		this.drawing = drawing;
+	}
+	
+	/**
+	 * Obtiene el flag que informa si el elemento gr�fico est� dibujandose
+	 * o no.
+	 * @return
+	 */
+	public boolean isDrawing() {
+		return this.drawing;
+	}
+
+	/**
+	 * Dibujado del elemento gr�fico
+	 * @param g
+	 */
+	protected abstract void paint(Graphics g);
+	
+	/**
+	 * Acciones a ejecutar al asignar el canvas
+	 */
+	public abstract void firstActions();
+
+	/**
+	 * Acciones a ejecutar antes del primer dibujado
+	 */
+	public abstract void firstDrawActions();
+	
+	/**
+	 * Asigna el objeto JComponent donde se pintan los elementos.
+	 * @param canvas
+	 */
+	public void setCanvas(GCanvas canvas) {
+		this.canvas = canvas;
+	}
+	
+	/**
+	 * Asigna el color de la l�nea
+	 * @param c Color
+	 */
+	public void setColor(Color c) {
+		this.color = c;
+	}
+	
+	/**
+	 * Obtiene el color de la l�nea
+	 * @param c Color
+	 */
+	public Color getColor() {
+		return this.color;
+	}
+
+	/**
+	 * Metodo que se ejecuta cuando se suelta el raton en el canvas
+	 * @param e
+	 * @return Si no se desea propagar el evento a otros drawables, devolver false.
+	 */
+	public boolean mouseReleased(MouseEvent e) {
+		return true;
+	}
+
+	/**
+	 * Metodo que se ejecuta cuando se presiona el raton en el canvas
+	 * @param e
+	 * @return Si no se desea propagar el evento a otros drawables, devolver false.
+	 */
+	public boolean mousePressed(MouseEvent e) {
+		return true;
+	}
+	
+	/**
+	 * Metodo que se ejecuta cuando se esta dibujando con el raton en el canvas
+	 * @param e
+	 * @return Si no se desea propagar el evento a otros drawables, devolver false.
+	 */
+	public boolean mouseDragged(MouseEvent e) {
+		return true;
+	}
+	
+	/**
+	 * Metodo que se ejecuta cuando se esta moviendo el raton sobre el canvas
+	 * @param e
+	 * @return Si no se desea propagar el evento a otros drawables, devolver false.
+	 */
+	public boolean mouseMoved(MouseEvent e) {
+		return true;
+	}
+	
+	/**
+	 * Metodo que se ejecuta cuando entra el raton al canvas
+	 * @param e
+	 * @return
+	 */
+	public boolean mouseEntered(MouseEvent e) {
+		return true;
+	}
+
+	/**
+	 * Metodo que se ejecuta cuando sale el raton del canvas
+	 * @param e
+	 * @return
+	 */
+	public boolean mouseExited(MouseEvent e) {
+		return true;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GraphicHistogram.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GraphicHistogram.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/gcanvas/GraphicHistogram.java	(revision 15423)
@@ -0,0 +1,83 @@
+/* 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.swing.gcanvas;
+
+/**
+ * Graphic layer to paint a histogram
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public abstract class  GraphicHistogram extends DrawableElement {
+	public static final int TYPE_LINE            = 1;
+	public static final int TYPE_FILL            = 2;
+
+	public static final int VIEW_LINEAL          = 0;
+	public static final int VIEW_ACUMMULATED     = 1;
+	public static final int VIEW_LOGARITHMIC     = 2;
+	public static final int VIEW_ACUMMULATEDLOG  = 3;
+	
+	public static final int FUNCTION_NONE        = -1;
+	public static final int FUNCTION_LINEAL      = 0;
+	public static final int FUNCTION_GAUSS       = 1;
+	public static final int FUNCTION_EXPONENT    = 2;
+	public static final int FUNCTION_LOGARIT     = 3;
+	public static final int FUNCTION_SQUARE_ROOT = 4;
+	public static final int EQUALIZATION         = 5;
+	public static final int FUNCTION_DENSITY     = 6;
+	
+	/**
+	 * Asigna el tipo de gr�fica a mostrar. El tipo de gr�fica est� definida por las constantes TYPE 
+	 * definidas en esta clase. Por defecto siempre se muestra el tipo LINE
+	 * @param type
+	 */
+	public abstract void setType(int type);
+	
+	/**
+	 * Asigna el histograma a visualizar
+	 * @param histogramDrawed
+	 */
+	public abstract void setHistogramDrawed(double[] histogramDrawed);
+	
+	/**
+	 * Asigna el tipo de vista para el histograma a mostrar. No hace un repintado
+	 * @param type
+	 */
+	public abstract void setTypeViewed(int type);
+	
+	/**
+	 * Devuelve la forma en la que se dibujara el histograma. Posibilidades:<br>
+	 * TYPE_LINE<br>
+	 * TYPE_FILL
+	 * @return the type
+	 */
+	public abstract int getType();
+	
+	/**
+	 * Devuelve la forma que tendr� la grafica del histograma. Posibilidades:<br>
+	 * VIEW_LINEAL<br>
+	 * VIEW_ACUMMULATED<br>
+	 * VIEW_LOGARITHMIC<br>
+	 * VIEW_ACUMMULATEDLOG<br>
+	 * 
+	 * @return the typeViewed
+	 */
+	public abstract int getTypeViewed();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/RasterSwingManager.java	(revision 15423)
@@ -0,0 +1,218 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing;
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.swing.ImageIcon;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+import org.gvsig.raster.swing.buttonbar.ButtonBar;
+import org.gvsig.raster.swing.gcanvas.GCanvas;
+import org.gvsig.raster.swing.infobypoint.MainInfoByPointPanel;
+import org.gvsig.raster.swing.newlayer.CreateNewLayerPanel;
+import org.gvsig.raster.swing.newlayer.FileNameManagement;
+import org.gvsig.raster.swing.openfile.OpenFileContainer;
+import org.gvsig.raster.swing.pagedtable.ModelLoader;
+import org.gvsig.raster.swing.pagedtable.PagedTable;
+import org.gvsig.raster.swing.pagedtable.TableModel;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.raster.swing.preview.PreviewPanel;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+import org.gvsig.raster.swing.roi.ROIPanel;
+import org.gvsig.raster.swing.slider.SliderText;
+
+
+/**
+ * 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 RasterWindowManager
+ * @see JValidationServicePanel
+ * @author gvSIG team
+ * @version $Id$
+ */
+public interface RasterSwingManager {
+
+    /**
+     * 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 RasterWindowManager} to register in the
+     *            ScriptingUIManager.
+     * @see RasterWindowManager
+     */
+    public void registerWindowManager(RasterWindowManager manager);
+
+    /**
+     * Returns the {@link RasterWindowManager}.
+     * 
+     * @return {@link RasterWindowManager}
+     * @see {@link RasterWindowManager}
+     */
+    public RasterWindowManager getWindowManager();
+    
+    public BasePanel createGenericBasePanel();
+ 
+    /**
+     * Creates a canvas to draw graphic layers.
+     * @param backgroundColor
+     * @return
+     */
+    public GCanvas createGraphicCanvas(Color backgroundColor);
+    
+    /**
+     * Creates a preview panel using a data source, a render process and a list
+     * of panels
+     * @param buttons
+     * @param list
+     * @param generalPanel
+     * @param downPreviewPanel
+     * @param renderProcess
+     * @param dataSource
+     * @return
+     */
+	public PreviewPanel createPreviewPanel(int buttons, 
+    		ArrayList list,
+    		JPanel generalPanel,
+    		JPanel downPreviewPanel,
+    		PreviewRenderProcess renderProcess,
+    		DataSourcePreview dataSource);
+    
+    /**
+     * Creates a preview panel using a data source and a render process. After 
+     * the creation the function previewInitializeSizes in {@link PreviewPanel} 
+     * should be invoked.
+     * @param renderProcess {@link PreviewRenderProcess}
+     * @param dataSource {@link DataSourcePreview}
+     * @return {@link PreviewPanel} 
+     */
+	public PreviewPanel createSinglePreviewPanel( 
+    		PreviewRenderProcess renderProcess,
+    		DataSourcePreview dataSource);
+	
+    
+    /**
+     * Creates the information by point panel
+     * @param translations
+     * @param extended
+     * @return
+     */
+    public MainInfoByPointPanel createInfoByPointPanel(
+    		HashMap<String, String> translations, 
+    		HashMap<String, ImageIcon> icons, 
+    		JPanel extended);
+    
+    /**
+     * Creates a button bar component
+     * @return
+     */
+    public ButtonBar createButtonBar();
+
+    /**
+     * Creates a panel to build a new layer
+     * @param fileNameManagement
+     * @param extList
+     * 			List of file extensions to accept
+     * @return
+     * @deprecated Uses createNewLayerPanel without parameters. The FileNameManagement should be built internally
+     */
+    public CreateNewLayerPanel createNewLayerPanel(FileNameManagement fileNameManagement);
+    public CreateNewLayerPanel createNewLayerPanel();
+    
+    /**
+     * Creates a panel to build a new layer
+     * @param fileNameManagement
+     * @param extList
+     * 			List of file extensions to accept
+     * @param tittle
+     *          Tittle for the window
+     * @return
+     * @deprecated Uses createNewLayerPanel with the title as parameter. The FileNameManagement should be built internally
+     */
+    public CreateNewLayerPanel createNewLayerPanel(FileNameManagement fileNameManagement, String title);
+    public CreateNewLayerPanel createNewLayerPanel(String title);
+    
+    /**
+     * Creates a panel to open files
+     * @param showBorder
+     * @param fileFilter
+     * @return
+     */
+    public OpenFileContainer createOpenFileContainer(boolean showBorder, String[] fileFilter, String defaultPath);
+    
+    /**
+     * Creates a panel for manage ROIs of raster
+     * @return
+     */
+    public ROIPanel createROIPanel();
+    
+    /**
+     * Creates a paged table component
+     * @param modelLoader
+     * @return
+     */
+    public PagedTable createPagedTable(ModelLoader modelLoader);
+    
+    /**
+     * Creates a model loader for a paged table
+     * @return
+     */
+    public ModelLoader createModelLoader(TableModel tableModel);
+    
+    /**
+     * Creates a buttons panel
+     * @param parent
+     * @return
+     */
+    public IButtonsPanel createButtonsPanel(int buttons, JComponent parent);
+    
+    /**
+     * Creates a slider with a text box
+     * @return
+     */
+    public SliderText createSliderText(int min, int max, int defaultValue, boolean border);
+    
+    /**
+     * Shows the summary of a process
+     * @param fileName
+     * @param time
+     */
+    public void showSummaryProcessDialog(String fileName, long time);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/listener/PanelChangeEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/listener/PanelChangeEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/listener/PanelChangeEvent.java	(revision 15423)
@@ -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.swing.listener;
+
+import java.util.EventObject;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PanelChangeEvent extends EventObject {
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Constructs a ChangeEvent object.
+     *
+     * @param source  the Object that is the source of the event
+     *                (typically <code>this</code>)
+     */
+    public PanelChangeEvent(Object source) {
+        super(source);
+    }
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/listener/PanelChangeListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/listener/PanelChangeListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/listener/PanelChangeListener.java	(revision 15423)
@@ -0,0 +1,32 @@
+/* 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.swing.listener;
+
+import java.util.EventListener;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface PanelChangeListener extends EventListener {
+
+	public void panelHasChanged(PanelChangeEvent event);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/newlayer/FileNameManagement.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/newlayer/FileNameManagement.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/newlayer/FileNameManagement.java	(revision 15423)
@@ -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.swing.newlayer;
+
+import java.util.List;
+
+
+/**
+ * Interface to manage the name of a new layer.
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface FileNameManagement {
+
+	public String getUniqueLayerName();
+	
+	public void usesUniqueLayerName();
+	
+	public List<String> getPrefixSupported();
+	
+	public String getDefaultFilePath();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/newlayer/CreateNewLayerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/newlayer/CreateNewLayerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/newlayer/CreateNewLayerPanel.java	(revision 15423)
@@ -0,0 +1,44 @@
+/* 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.swing.newlayer;
+
+
+/**
+ * Panel to create a new layer. This panel gives the option to select a file
+ * or open in memory.
+ *
+ */
+public interface CreateNewLayerPanel {
+	/**
+	 * Gets the file name selected. If there is not selected a file it will
+	 * return a temporary file
+	 * @return
+	 */
+	public String getFileSelected();
+	
+	/**
+	 * Gets the directory. If there is not selected a directory it will
+	 * return a temporary directory
+	 * @return
+	 */
+	public String getDirectorySelected();
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/ModelLoader.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/ModelLoader.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/ModelLoader.java	(revision 15423)
@@ -0,0 +1,53 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.pagedtable;
+
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * Provides a model and renders for columns to a <code>PagedTable</code>
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface ModelLoader {
+
+	public TableModel getTableModel();
+	
+	public TableCellRenderer getRenderForColumn(int column);
+	
+	public void setRenderForColumn(int column, TableCellRenderer render);
+	
+	public TableCellEditor getCellEditorForColumn(int column);
+	
+	public void setCellEditorForColumn(int column, TableCellEditor editor);
+	
+	public String[] getColumnNames();
+	
+	public int[] getColumnWidths();
+	
+	public void setColumnNames(String[] columnNames);
+	
+	public void setColumnWidths(int[] columnWidths);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTable.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTable.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTable.java	(revision 15423)
@@ -0,0 +1,191 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.pagedtable;
+
+import javax.swing.JComponent;
+import javax.swing.JTable;
+
+import org.gvsig.gui.beans.table.exceptions.NotInitializeException;
+
+/**
+ * API for a <code>PagedTable</code>
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface PagedTable {
+	/**
+	 * Gets the value at the selected position
+	 * @param row
+	 * @param col
+	 * @return
+	 */
+	public Object getValueAt(int row, int col);
+	
+	/**
+	 * Sets a value in a cell
+	 * @param obj
+	 * @param row
+	 * @param column
+	 */
+	public void setValueAt(Object obj, int row, int column);
+	/**
+	 * Gets the number of columns
+	 * @return
+	 */
+	public int getColumnCount();
+	/**
+	 * Gets the number of rows
+	 * @return
+	 */
+	public int getRowCount();
+	/**
+	 * Adds a row to the table.
+	 * @param list List of strings
+	 */
+	public void addRow(Object[] list);
+	
+	/**
+	 * Deletes a row from the table.
+	 * @param Global position of the entry
+	 */
+	public void delRow(int i);
+	
+	/**
+	 * Removes all rows of this table. This call does not
+	 * show the confirmation message.
+	 */
+	public void removeAllRowsWithoutAsk();
+	
+	/**
+	 * Removes all rows of this table.
+	 */
+	public void removeAllRows();
+	
+	/**
+	 * Gets the selected rows
+	 * @return
+	 * @throws NotInitializeException
+	 */
+	public int[] getSelectedRows();
+	
+	/**
+	 * Swap two rows
+	 * @param i Row to delete
+	 */
+	public void swapRow(int i, int j);
+	
+	/**
+	 * Sets the rows selected
+	 * @param rows
+	 */
+	public void setSelectedRows(int[] rows);
+	
+	/**
+	 * Sets the row selected
+	 * @param rows
+	 */
+	public void setSelectedRow(int row);
+	
+	/**
+	 * Increase the selected row
+	 */
+	public void increaseSelectedRows();
+	
+	/**
+	 * Decrease the selected row
+	 */
+	public void decreaseSelectedRows();
+	
+	/**
+	 * Adds a new row selected without deselecting the old ones
+	 * @param row
+	 */
+	public void addSelectedRow(int row);
+	
+	/**
+	 * Shows or hides the controls to move rows
+	 * @param show
+	 */
+	public void showMoveRowsControls(boolean show);
+	
+	/**
+	 * Shows or hides the table controller
+	 * @param show
+	 */
+	public void showControllerTable(boolean show);
+	
+	/**
+	 * Selects the next page
+	 */
+	public void nextPage();
+	
+	/**
+	 * Selects the previous page
+	 */
+	public void prevPage();
+	
+	/**
+	 * Sets the page selected
+	 * @param pageNumber
+	 */
+	public void setSelectedPage(int pageNumber);
+	
+	/**
+	 * Gets the table data model
+	 * @return
+	 */
+	public TableModel getTableModel();
+	
+	/**
+	 * Gets the component
+	 * @return
+	 */
+	public JComponent getComponent();
+	
+	/**
+	 * Gets the internal JTable
+	 * @return
+	 */
+	public JTable getJTable();
+	
+	/**
+	 * Adds a listener
+	 * @param listener
+	 */
+	public void addListener(PagedTableListener listener);
+	
+	/**
+	 * Sets a message to ask for confirmation when all
+	 * entries are going to be deleted
+	 * @param message
+	 */
+	public void setConfirmationMessageDeleteAllEntries(String message);
+	
+	/**
+	 * Sets a message to ask for confirmation when one entry
+	 * are going to be deleted
+	 * @param message
+	 */
+	public void setConfirmationMessageDeleteOneEntry(String message);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/TableModel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/TableModel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/TableModel.java	(revision 15423)
@@ -0,0 +1,36 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.pagedtable;
+
+
+/**
+ * Interfaz que implementan los modelos de tabla
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ *
+ */
+public interface TableModel{
+    public Object[] getNewLine();
+    public void addNewLine();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTableEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTableEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTableEvent.java	(revision 15423)
@@ -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.swing.pagedtable;
+
+import java.util.EventObject;
+
+/**
+ * Evento lanzado por las herramientas de la vista
+ * 17/01/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class PagedTableEvent  extends EventObject {
+	private static final long        serialVersionUID = 1L;
+	
+	public static int                EVENT_SELECTED_ROWS           = 0;
+	public static int                EVENT_ADD_ENTRY               = 1; 
+	public static int                EVENT_REMOVE_ENTRY            = 2;
+	public static int                EVENT_REMOVE_ALL              = 3;
+	public static int                EVENT_SELECTED_PAGE           = 4;
+	public static int                EVENT_MODIFY_ENTRY            = 5;
+	public static int                EVENT_SWAP_ENTRIES            = 6;
+	
+	private int                      event                         = -1;
+	private int[]                    rows                          = null;
+	private Object                   rowDeleted                    = null;
+	
+	/**
+	 * Constructor
+	 * @param source
+	 */
+	public PagedTableEvent(Object source, int id, int[] rows) {
+		super(source);
+		this.event = id;
+		this.rows = rows;
+	}
+	
+	/**
+	 * Constructor
+	 * @param source
+	 */
+	public PagedTableEvent(Object source, int id, Object rowDeleted) {
+		super(source);
+		this.event = id;
+		this.rowDeleted = rowDeleted;
+	}
+	
+	public int getEvent() {
+		return event;
+	}
+	
+	public int[] getRows() {
+		return rows;
+	}
+	
+	public Object getRowDeleted() {
+		return rowDeleted;
+	}
+	
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTableListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTableListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/pagedtable/PagedTableListener.java	(revision 15423)
@@ -0,0 +1,9 @@
+package org.gvsig.raster.swing.pagedtable;
+
+/**
+ * Listener for paged tables
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface PagedTableListener {
+	public void tableChanged(PagedTableEvent event);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/roi/ROIPanelDataModel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/roi/ROIPanelDataModel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/roi/ROIPanelDataModel.java	(revision 15423)
@@ -0,0 +1,29 @@
+/* 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.swing.roi;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public interface ROIPanelDataModel {
+
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/roi/ROIPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/roi/ROIPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/roi/ROIPanel.java	(revision 15423)
@@ -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.swing.roi;
+
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelListener;
+
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.table.TableContainer;
+
+/**
+ * Panel for raster ROIs
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ * 
+ */
+public interface ROIPanel {
+	public static final int         BUTTON_ACCEPT             = 1;
+	public static final int         BUTTON_CANCEL             = 2;
+	public static final int         BUTTON_APPLY              = 3;
+	
+	public static final int         POLYGON_BUTTON            = 4;
+	public static final int         POINT_BUTTON              = 5;
+	public static final int         LINE_BUTTON               = 6;
+	public static final int         NEW_BUTTON                = 7;
+	public static final int         DELETE_BUTTON             = 8;
+	public static final int         EXPORT_BUTTON             = 9;
+	public static final int         IMPORT_BUTTON             = 10;
+	public static final int         ADDFLYR_BUTTON            = 11;
+	public static final int         FLYRS_COMBO               = 12;
+	public static final int         REMOVE_ROI_FILE_BUTTON    = 13;
+	
+	public JComponent getComponent();
+	
+	/**
+	 * Gets the table
+	 * @return
+	 */
+	public TableContainer getTable();
+	
+	/**
+	 * Gets a button. The buttons are defined as a constant in this interface
+	 * @param button
+	 * @return
+	 */
+	public AbstractButton getButton(int button);
+	
+	/**
+	 * Gets the list of layers
+	 * @param button
+	 * @return
+	 */
+	public JComboBox getLayerList(int button);
+	
+	/**
+	 * Adds a listener to the buttons
+	 * @param listener
+	 */
+	public void addButtonsListener(
+			ActionListener listener, 
+			ButtonsPanelListener mainButtonsListener);
+	
+	public void addTableListeners(
+			ListSelectionListener listSelectionlistener, 
+			TableModelListener tableModelListener);
+	
+	/**
+	 * Enables or disables the list of tools
+	 * @param b
+	 */
+	public void setToolsEnabled(boolean b);
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/AbstractButtonsPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/AbstractButtonsPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/AbstractButtonsPanel.java	(revision 15423)
@@ -0,0 +1,177 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.basepanel;
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.LayoutManager;
+import java.awt.Window;
+
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.RasterSwingLocator;
+
+
+/**
+ * <code>AbstractButtonsPanel</code> is a panel which inherits of <code>JPanel</code>.
+ * That reimplemented panel permits add generic buttons of apply, accept and cancel to
+ * a panel.
+ * @author BorSanZa - Borja Sanchez Zamorano 
+ */
+public abstract class AbstractButtonsPanel extends JPanel {
+	private static final long serialVersionUID = 1536590395737700551L;
+	IButtonsPanel             bp               = null;
+	JPanel                    content          = null;
+	private int               margin           = 4;
+	
+	/**
+	 * Crea el <code>DefaultButtonsPanel</code> con los botones por defecto.
+	 */
+	public AbstractButtonsPanel() {
+		super.setLayout(new java.awt.BorderLayout(0, 0));
+		getButtonsPanel().addAccept();
+		getButtonsPanel().addCancel();
+		getButtonsPanel().addApply();
+		super.add((JPanel)getButtonsPanel(), java.awt.BorderLayout.SOUTH);
+		super.add(getContent(), java.awt.BorderLayout.CENTER);
+		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(margin, margin, margin, margin));
+	}
+
+	/**
+	 * Crea el <code>DialogPanel</code> con los botones que definamos de la clase
+	 * <code>ButtonsPanel</code>
+	 *
+	 * @param buttons Constante para definir que botones se crear�n
+	 */
+	public AbstractButtonsPanel(int buttons) {
+		super.setLayout(new java.awt.BorderLayout(0, 0));
+		bp = RasterSwingLocator.getSwingManager().createButtonsPanel(buttons, this);
+		super.add((JPanel)getButtonsPanel(), java.awt.BorderLayout.SOUTH);
+		super.add(getContent(), java.awt.BorderLayout.CENTER);
+		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(margin, margin, margin, margin));
+	}
+
+	/**
+	 * Obtener el objeto <code>ButtonsPanel</code> del <code>DialogPanel</code>.
+	 * En caso de no estar creado, lo crear�.
+	 *
+	 * @return El componente bp
+	 */
+	public IButtonsPanel getButtonsPanel() {
+		if (bp == null)
+			bp = RasterSwingLocator.getSwingManager().createButtonsPanel(IButtonsPanel.BUTTONS_NONE, this);
+		return bp;
+	}
+
+	/**
+	 * Obtener el contenido del <code>DialogPanel</code>. En caso de no estar creado,
+	 * lo crear�.
+	 *
+	 * @return El componente content
+	 */
+	public JPanel getContent() {
+		if (content == null)
+			content = new JPanel();
+		return content;
+	}
+
+	public void addButtonPressedListener(ButtonsPanelListener listener) {
+		getButtonsPanel().addButtonPressedListener(listener);
+	}
+
+	public void removeButtonPressedListener(ButtonsPanelListener listener) {
+		getButtonsPanel().removeButtonPressedListener(listener);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#getLayout()
+	 */
+	public LayoutManager getLayout() {
+		return getContent().getLayout();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#setLayout(java.awt.LayoutManager)
+	 */
+	public void setLayout(LayoutManager mgr) {
+		getContent().setLayout(mgr);
+	}
+
+	/**
+	 * Devuelve el Window que contiene dicha ventana o null en caso de que no sea
+	 * asi
+	 * @return
+	 */
+	public Window getWindow() {
+		Container container = getParent();
+		while (container != null) {
+			if (container instanceof Window)
+				return (Window) container;
+			container = container.getParent();
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component)
+	 */
+	public Component add(Component comp) {
+		return getContent().add(comp);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component, int)
+	 */
+	public Component add(Component comp, int index) {
+		return getContent().add(comp, index);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component, java.lang.Object)
+	 */
+	public void add(Component comp, Object constraints) {
+		getContent().add(comp, constraints);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component, java.lang.Object, int)
+	 */
+	public void add(Component comp, Object constraints, int index) {
+		getContent().add(comp, constraints, index);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.lang.String, java.awt.Component)
+	 */
+	public Component add(String name, Component comp) {
+		return getContent().add(name, comp);
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelListener.java	(revision 15423)
@@ -0,0 +1,36 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.basepanel;
+
+import java.util.EventListener;
+
+/**
+ *
+ * @version 09/05/2008
+ *
+ * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface ButtonsPanelListener extends EventListener {
+  public void actionButtonPressed(ButtonsPanelEvent e);
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/IButtonsPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/IButtonsPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/IButtonsPanel.java	(revision 15423)
@@ -0,0 +1,186 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.basepanel;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+
+public interface IButtonsPanel {
+	public static final int BUTTON_ACCEPT             = 1;
+	public static final int BUTTON_CANCEL             = 2;
+	public static final int BUTTON_APPLY              = 3;
+	public static final int BUTTON_YES                = 4;
+	public static final int BUTTON_NO                 = 5;
+	public static final int BUTTON_CLOSE              = 6;
+	public static final int BUTTON_EXIT               = 7;
+	public static final int BUTTON_SEEDETAILS         = 8;
+	public static final int BUTTON_HIDEDETAILS        = 9;
+	public static final int BUTTON_PAUSE              = 10;
+	public static final int BUTTON_RESTART            = 11;
+	public static final int BUTTON_SAVE               = 12;
+	
+	public static final int BUTTON_USR1               = 100;
+	public static final int BUTTON_USR2               = 101;
+	public static final int BUTTON_USR3               = 102;
+	public static final int BUTTON_USR4               = 103;
+	public static final int BUTTON_USR5               = 104;
+	
+	/**
+	 * Sirve para cuando se crean botones nuevos, saber el �ltimo n�mero usado
+	 * internamente, as� '<code>new_id = BUTTON_LAST + 1;</code>' podr�a ser
+	 * el �ndice del nuevo bot�n.
+	 */
+	public static final int BUTTON_LAST               = 12;
+	public static final int BUTTONS_ACCEPT            = 1;
+	public static final int BUTTONS_ACCEPTCANCEL      = 2;
+	public static final int BUTTONS_ACCEPTCANCELAPPLY = 3;
+	public static final int BUTTONS_CANCEL            = 4;
+	public static final int BUTTONS_YESNO             = 5;
+	public static final int BUTTONS_CLOSE             = 6;
+	public static final int BUTTONS_EXIT              = 7;
+	public static final int BUTTONS_NONE              = 8;
+	public static final int BUTTONS_APPLYCLOSE        = 9;
+	
+	/**
+	 * A�adir el disparador de cuando se pulsa un bot�n.
+	 * @param listener
+	 */
+	public void addButtonPressedListener(ButtonsPanelListener listener);
+
+	/**
+	 * Devuelve el array de listeners del componente
+	 * @return
+	 */
+	public Object[] getButtonPressedListeners();
+
+	/**
+	 * Borrar el disparador de eventos de los botones.
+	 * @param listener
+	 */
+	public void removeButtonPressedListener(ButtonsPanelListener listener);
+	
+	/**
+	 * A�adir el boton Aceptar.
+	 */
+	public void addAccept();
+
+	/**
+	 * A�adir el boton Guardar.
+	 */
+	public void addSave();
+
+	/**
+	 * A�adir el boton Cancelar.
+	 */
+	public void addCancel();
+
+	/**
+	 * A�adir el boton S�.
+	 */
+	public void addYes();
+
+	/**
+	 * A�adir el boton No.
+	 */
+	public void addNo();
+
+	/**
+	 * A�adir el boton Aplicar.
+	 */
+	public void addApply();
+
+	/**
+	 * A�adir el boton Cerrar.
+	 */
+	public void addClose();
+
+	/**
+	 * A�adir el boton Salir.
+	 */
+	public void addExit();
+
+	/**
+	 * A�adir el boton Ver detalles.
+	 */
+	public void addSeeDetails();
+
+	/**
+	 * A�adir el boton Ocultar detalles.
+	 */
+	public void addHideDetails();
+
+	/**
+	 * A�adir el boton Pausar.
+	 */
+	public void addPause();
+
+	/**
+	 * A�adir el boton Reanudar.
+	 */
+	public void addRestart();
+
+	/**
+	 * A�adimos un bot�n definido por el usuario.
+	 *
+	 * @param text Texto que contendr� el bot�n
+	 * @param id Entero para identificar los eventos del bot�n
+	 */
+	public void addButton(String text, int id);
+
+	/**
+	 * Obtener un bot�n por su Entero
+	 * @param id N�mero del disparador del bot�n
+	 * @return El bot�n especificado o <code>null</code> si no se encontr� el bot�n.
+	 */
+	public JButton getButton(int id);
+
+	/**
+	 * <p>Removes the button identified by <code>id</code>.</p>
+	 * 
+	 * @param id identifier of the button
+	 * @return <code>true</code> if has removed the button; otherwise <code>false</code>
+	 */
+	public boolean removeButton(int id);
+	
+	/**
+	 * <p>Returns the text of the button identified by <code>id</code>.</p>
+	 * 
+	 * @param id identifier of the button
+	 * 
+	 * @return text of the identified button
+	 */
+	public String getButtonText(int id);
+	
+	/**
+	 * <p>Enables (or disables) the button identified by <code>id</code>.</p>
+	 * 
+	 * @param id identifier of the button
+	 * @param b <code>true</code> to enable the button, otherwise <code>false</code>
+	 * 
+	 * @return <code>true</code> if there was a button of that kind in this group, otherwise <code>false</code>
+	 */
+	public boolean setEnabled(int id, boolean b);
+	
+	public JComponent getComponent();
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/src/main/java/org/gvsig/raster/swing/basepanel/ButtonsPanelEvent.java	(revision 15423)
@@ -0,0 +1,47 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.basepanel;
+
+import java.util.EventObject;
+
+/**
+ *
+ * @version 09/05/2008
+ *
+ * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ButtonsPanelEvent extends EventObject {
+	private static final long serialVersionUID = 4275588038151358375L;
+
+	int button = 0;
+
+	public ButtonsPanelEvent(Object source, int button) {
+		super(source);
+		this.button = button;
+	}
+	
+	public int getButton() {
+		return button;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/pom.xml	(revision 15423)
@@ -0,0 +1,54 @@
+<?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.swing.api</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.swing</artifactId>
+		<version>2.2.171</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.i18n</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/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api/pom.xml
___________________________________________________________________
Added: svn:mime-type
   + text/plain


Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.api
___________________________________________________________________
Added: svn:ignore
   + target

.classpath

.project

.settings


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedBarPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedBarPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedBarPanel.java	(revision 15423)
@@ -0,0 +1,30 @@
+package org.gvsig.raster.swing.impl.pagedtable;
+
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JFrame;
+
+public class TestPagedBarPanel implements ActionListener {
+		private int                          w        = 50;
+		private int                          h        = 250;
+		private JFrame                       frame    = new JFrame();
+		private PaginationBarPanel           desc     = null;
+
+		public TestPagedBarPanel() {
+			desc = new PaginationBarPanel(null);
+			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 TestPagedBarPanel();
+		}
+
+		public void actionPerformed(ActionEvent e) {
+			
+		}
+	}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedBarPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedTablePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedTablePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedTablePanel.java	(revision 15423)
@@ -0,0 +1,98 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.pagedtable.ModelLoader;
+import org.gvsig.raster.swing.pagedtable.PagedTableEvent;
+import org.gvsig.raster.swing.pagedtable.PagedTableListener;
+
+public class TestPagedTablePanel implements ActionListener, PagedTableListener {
+	private int                          w        = 500;
+	private int                          h        = 350;
+	private JFrame                       frame    = new JFrame();
+	private PagedTableImpl               desc     = null;
+
+	public TestPagedTablePanel() {
+		String[] c = new String[]{"uno", "dos", "tres", "cuatro"};
+		int[] sizes = new int[]{40, 80, -1, 0};
+		GCPModel model = new GCPModel(c);
+		CheckBoxColumnRenderer r = new CheckBoxColumnRenderer(this);
+		CheckBoxColumnEditor e = new CheckBoxColumnEditor();
+		ModelLoader modelLoader = new ModelLoaderImpl(model);
+		modelLoader.setRenderForColumn(0, r);
+		modelLoader.setCellEditorForColumn(0, e);
+		modelLoader.setColumnNames(c);
+		modelLoader.setColumnWidths(sizes);
+		desc = new PagedTableImpl(modelLoader);
+		JPanel table = (JPanel)desc.getComponent();
+		table.setBorder(BorderFactory.createTitledBorder("My table"));
+		desc.setConfirmationMessageDeleteAllEntries("Would you like to remove all entries?");
+		desc.setConfirmationMessageDeleteOneEntry("Would you like to remove selected entry?");
+		
+		JPanel p = new JPanel();
+		p.setLayout(new BorderLayout());
+		p.add(table, BorderLayout.CENTER);
+		
+		JPanel p1 = new JPanel();
+		p1.setPreferredSize(new Dimension(80, 0));
+		p.add(p1, BorderLayout.EAST);
+		
+		JPanel p2 = new JPanel();
+		p2.setPreferredSize(new Dimension(0, 80));
+		p.add(p2, BorderLayout.NORTH);
+		
+		frame.getContentPane().add(p);
+		frame.setSize(w, h);
+		frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+		frame.setVisible(true);
+		
+		
+		//desc.showMoveRowsControls(false);
+		//desc.showControllerTable(false);
+	}
+
+	public static void main(String[] args) {
+		new TestPagedTablePanel();
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public void tableChanged(PagedTableEvent event) {
+		
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPagedTablePanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/GCPModel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/GCPModel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/GCPModel.java	(revision 15423)
@@ -0,0 +1,70 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import javax.swing.table.DefaultTableModel;
+
+import org.gvsig.raster.swing.pagedtable.TableModel;
+/**
+ * Modelo correspondiente a una tabla de puntos de control
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class GCPModel extends DefaultTableModel implements TableModel {
+	final private static long serialVersionUID = -3370601314380922368L;
+	private int               nColumns         = 0;
+
+	public GCPModel(String[] columnNames) {
+		super(new Object[0][columnNames.length], columnNames);
+		this.nColumns = columnNames.length;
+	}
+
+	@SuppressWarnings("unchecked")
+	public Class getColumnClass(int c) {
+		return String.class;
+	}
+
+	public void setValueAt(Object value, int row, int col) {
+		super.setValueAt(value, row, col);
+	}
+
+	public void addNewLine() {
+		addNew();
+	}
+	public void addNew() {
+		Object[] line = new Object[nColumns];
+		line[0] = new Boolean(true);
+		for (int i = 0; i < nColumns; i++)
+			line[i] = new String("");
+		super.addRow(line);
+	}
+
+	public Object[] getNewLine() {
+		Object[] o = new Object[nColumns];
+		o[0] = new Boolean(true);
+		for (int i = 1; i < nColumns; i++)
+			o[i] = "";
+		return o;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/GCPModel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnEditor.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnEditor.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnEditor.java	(revision 15423)
@@ -0,0 +1,72 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractCellEditor;
+import javax.swing.JCheckBox;
+import javax.swing.JTable;
+import javax.swing.SwingUtilities;
+import javax.swing.table.TableCellEditor;
+
+/**
+ * Componente tabla
+ * 
+ * @author Nacho Brodin (brodin_ign@gva.es)
+ *
+ */
+public class CheckBoxColumnEditor extends AbstractCellEditor
+implements TableCellEditor {
+    final private static long serialVersionUID = -3370601314380922368L;
+    public JCheckBox theCheckBox;
+
+    public CheckBoxColumnEditor() {
+        super();
+        theCheckBox = new JCheckBox();
+        theCheckBox.addActionListener(new ActionListener() {
+                public void actionPerformed(ActionEvent event) {
+                    fireEditingStopped() ;
+                    
+                }
+            });
+    }
+
+    public Component getTableCellEditorComponent(JTable table, Object obj,
+                                                 boolean isSelected,
+                                                 int row, int col) {
+    	theCheckBox.setHorizontalAlignment(SwingUtilities.CENTER);
+
+        Boolean lValueAsBoolean = (Boolean) obj;
+        theCheckBox.setSelected(lValueAsBoolean.booleanValue());
+
+        return theCheckBox;
+    }
+
+    public Object getCellEditorValue() {
+        return new Boolean(theCheckBox.isSelected());
+    }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnEditor.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnRenderer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnRenderer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnRenderer.java	(revision 15423)
@@ -0,0 +1,71 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.awt.Component;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JCheckBox;
+import javax.swing.JTable;
+import javax.swing.SwingConstants;
+import javax.swing.table.TableCellRenderer;
+
+/**
+ * Componente tabla
+ * 
+ * @author Nacho Brodin (brodin_ign@gva.es)
+ *
+ */
+public class CheckBoxColumnRenderer extends JCheckBox implements TableCellRenderer {
+    final private static long            serialVersionUID = -3370601314380922368L;
+    private ActionListener               listener = null;
+
+    public CheckBoxColumnRenderer() {}
+    
+    public CheckBoxColumnRenderer(ActionListener listener) {
+    	this.listener = listener;
+    }
+    
+    public Component getTableCellRendererComponent(JTable table,
+                                                   Object value,
+                                                   boolean isSelected,
+                                                   boolean hasFocus,
+                                                   int row, int column) {
+        if (value == null) {
+            this.setSelected(false);
+        }
+        if(isSelected)
+        	if(listener != null) 
+        		listener.actionPerformed(new ActionEvent(this, row, "SELECT_ROW"));
+        	
+        if(value instanceof Boolean){
+	        Boolean ValueAsBoolean = (Boolean) value;
+	        this.setSelected(ValueAsBoolean.booleanValue());
+	        this.setHorizontalAlignment(SwingConstants.CENTER);
+        }
+        	
+        return this;
+    }
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/CheckBoxColumnRenderer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPager.java	(revision 15423)
@@ -0,0 +1,63 @@
+package org.gvsig.raster.swing.impl.pagedtable;
+
+
+import java.awt.event.ActionEvent;
+import java.util.List;
+
+public class TestPager {
+
+		public TestPager() {
+			Pager p = new Pager(5, null);
+			for (int i = 0; i < 17; i++) {
+				p.addEntry("Element" + i);
+			}
+			showPage(p, 0);
+			showPage(p, 1);
+			showPage(p, 2);
+			showPage(p, 3);
+			
+			showSelectedPage(p);
+			p.increaseSelectedPage();
+			showSelectedPage(p);
+			p.increaseSelectedPage();
+			showSelectedPage(p);
+			p.increaseSelectedPage();
+			showSelectedPage(p);
+			p.increaseSelectedPage();
+			showSelectedPage(p);
+			p.decreaseSelectedPage();
+			showSelectedPage(p);
+			
+			p.swapRow(2, 4);
+			showPage(p, 0);
+			p.swapRow(4, 2);
+			showPage(p, 0);
+			p.swapRow(0, 16);
+			showPage(p, 0);
+			showPage(p, 3);
+		}
+		
+		private void showPage(Pager p, int n) {
+			List<Object> l = p.getPage(n);
+			for (int i = 0; i < l.size(); i++) {
+				System.out.println((String)l.get(i));
+			}
+			System.out.println("---------");
+		}
+		
+		private void showSelectedPage(Pager p) {
+			List<Object> l = p.getSelectedPage();
+			for (int i = 0; i < l.size(); i++) {
+				System.out.println((String)l.get(i));
+			}
+			System.out.println("---------");
+		}
+
+		public static void main(String[] args) {
+			new TestPager();
+		}
+
+		public void actionPerformed(ActionEvent e) {
+			
+		}
+	}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/org/gvsig/raster/swing/impl/pagedtable/TestPager.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestROIPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestROIPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestROIPanel.java	(revision 15423)
@@ -0,0 +1,36 @@
+
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.swing.impl.roi.DefaultROIPanel;
+import org.gvsig.raster.swing.roi.ROIPanel;
+import org.gvsig.raster.swing.roi.ROIPanelDataModel;
+
+public class TestROIPanel implements ActionListener {
+		private int                          w        = 550;
+		private int                          h        = 300;
+		private JFrame                       frame    = new JFrame();
+		private ROIPanel                     desc     = null;
+		private ROIPanelDataModel            model    = null;
+
+		public TestROIPanel() {
+			model = new ROIPanelDataModel() {
+			};
+			desc = new DefaultROIPanel();
+			frame.getContentPane().add(desc.getComponent());
+			frame.setSize(w, h);
+			frame.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
+			frame.setVisible(true);
+		}
+
+		public static void main(String[] args) {
+			new TestROIPanel();
+		}
+
+		public void actionPerformed(ActionEvent e) {
+			
+		}
+	}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestROIPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestCreateNewLayerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestCreateNewLayerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestCreateNewLayerPanel.java	(revision 15423)
@@ -0,0 +1,53 @@
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JFrame;
+
+import org.gvsig.raster.swing.impl.newlayer.CreateNewLayerPanelImpl;
+import org.gvsig.raster.swing.newlayer.FileNameManagement;
+
+public class TestCreateNewLayerPanel implements ActionListener {
+	private int                          w        = 550;
+	private int                          h        = 300;
+	private JFrame                       frame    = new JFrame();
+	private CreateNewLayerPanelImpl      desc     = null;
+	
+	public class FileNameManagementImpl implements FileNameManagement {
+		
+		public String getDefaultFilePath() {
+			return System.getProperty("user.home");
+		}
+
+		public List<String> getPrefixSupported() {
+			List<String> list = new ArrayList<String>();
+			list.add("tif");
+			return list;
+		}
+
+		public String getUniqueLayerName() {
+			return "Prueba";
+		}
+
+		public void usesUniqueLayerName() {
+		}
+
+	}
+
+	public TestCreateNewLayerPanel() {
+		desc = new CreateNewLayerPanelImpl(new FileNameManagementImpl());
+		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 TestCreateNewLayerPanel();
+	}
+
+	public void actionPerformed(ActionEvent e) {
+
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestCreateNewLayerPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestInfoByPointPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestInfoByPointPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestInfoByPointPanel.java	(revision 15423)
@@ -0,0 +1,67 @@
+
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JFrame;
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.impl.tool.infobypoint.DefaultInfoByPointDataModel;
+import org.gvsig.raster.swing.impl.tool.infobypoint.MainInfoByPointPanelImpl;
+
+public class TestInfoByPointPanel implements ActionListener {
+		private int                          w        = 270;
+		private int                          h        = 434;
+		private JFrame                       frame    = new JFrame();
+		private MainInfoByPointPanelImpl     desc     = null;
+
+		public TestInfoByPointPanel() {
+			desc = new MainInfoByPointPanelImpl(null, null, new JPanel());
+			DefaultInfoByPointDataModel model = (DefaultInfoByPointDataModel)desc.getInfoByPointDataModel();
+			model.addObserver(desc);
+			model.setARGB(255, 125, 110);
+			model.setCMYK(new double[]{54, 254, 121, 190});
+			model.setHSL(234.3, 125.5, 110.3);
+			model.setBandValues(new double[]{4.53, 2.24, 67.7, 67.87});
+			model.setNumberOfBands(4);
+			model.setPixelPoint(100, 105);
+			model.setViewPoint(305, 405);
+			model.setWorldPoint(20554523.32, 19362125.23);
+			List<String> list = new ArrayList<String>();
+			list.add("Esta_es_la_capa_numero_uno_de_la_lista_de_capas.jpg");
+			list.add("Esta_es_la_capa_segunda_de_la_lista_de_capas_del_info_by_point.jpg");
+			model.setLayerList(list);
+			model.notifyObservers();
+			
+			desc.addListenerExtendedButton(this);
+			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 TestInfoByPointPanel();
+		}
+
+		private boolean doubleSize = false;
+		public void actionPerformed(ActionEvent e) {
+			if(!doubleSize)
+				frame.setSize(w * 2, h);
+			else
+				frame.setSize(w, h);
+			doubleSize = !doubleSize;
+		}
+
+//		public void stateChanged(ChangeEvent e) {
+//			if(e.getSource() == desc.getTabs()) {
+//				if(desc.getTabs().getSelectedIndex() == 2) {
+//					frame.setSize(w, 600);
+//				} else {
+//					frame.setSize(w, h);
+//				}
+//			}
+//		}
+	}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/test/java/TestInfoByPointPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/META-INF/services/org.gvsig.tools.library.Library	(revision 15423)
@@ -0,0 +1 @@
+org.gvsig.raster.swing.impl.RasterSwingImplLibrary
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/delall.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/delall.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/last.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/last.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/newpoint.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/newpoint.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/backward-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/backward-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/delone.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/delone.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/up-16x16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/up-16x16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/prev.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/prev.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/line-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/line-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/polygon-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/polygon-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/next.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/next.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/point-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/point-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/icon-folder-open.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/icon-folder-open.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/tfwload-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/tfwload-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/first.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/first.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/down-16x16.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/down-16x16.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/forward-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/forward-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/layer-saveas.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/images/layer-saveas.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_eu.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_it.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text.properties	(revision 15423)
@@ -0,0 +1,2 @@
+delete_roi_file=Elimina todas las ROI de la capa. El fichero vectorial no es borrado, solo su relaci�n con la capa r�ster.
+cargar_rois=Cargar ROIs de un fichero shp
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_zh.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_en.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_en.properties	(revision 15423)
@@ -0,0 +1,2 @@
+delete_roi_file=Removes all ROI from the layer. The vectorial file is not deleted, just the relation with the raster layer.
+cargar_rois=Load ROIs from shp file
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_gl.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_ca.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_pt.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_cs.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_fr.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/resources/org/gvsig/raster/swing/impl/i18n/text_de.properties
===================================================================

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultGraphicHistogram.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultGraphicHistogram.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultGraphicHistogram.java	(revision 15423)
@@ -0,0 +1,284 @@
+/* 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.swing.impl.canvas.layer;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+
+import org.gvsig.raster.swing.gcanvas.GraphicHistogram;
+/**
+ * Gr�fica que representa un histograma con los valores pasados en el constructor 
+ *
+ * 14-oct-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultGraphicHistogram extends GraphicHistogram {
+	private int             border               = 2;
+
+	// Valores de la funci�n original
+	private double[]        histogramValues      = null;
+
+	// Valores que se pintan en la gr�fica
+	private double[]        valuesLineal         = null;
+	private double[]        valuesAcummulated    = null;
+	private double[]        valuesLogarithmic    = null;
+	private double[]        valuesAcummulatedLog = null;
+
+	private int             typeViewed           = 0;
+
+	private int             type                 = TYPE_LINE;
+	
+	/**
+	 * Constructor. Asigna el color
+	 * @param c
+	 */
+	public DefaultGraphicHistogram(Color c) {
+		setColor(c);
+	}
+
+	/**
+	 * Constructor. Asigna el color y los valores
+	 * @param c
+	 */
+	public DefaultGraphicHistogram(double[] values, Color c) {
+		setColor(c);
+		setHistogramDrawed(values);
+	}
+
+	private int valueToPixelY(double value) {
+		value = 1.0D - value;
+		return (int) Math.round(canvas.getCanvasMinY() + border + ((canvas.getCanvasMaxY() - canvas.getCanvasMinY() - (border * 2)) * value));
+	}
+
+	/**
+	 * Dibujado de la l�nea de incremento exponencial sobre el canvas.
+	 */
+	protected void paint(Graphics g) {
+		double[] valuesToDraw = recalcHistogram(typeViewed);
+		
+		if (valuesToDraw == null)
+			return;
+
+		g.setColor(color);
+
+		double width;
+		switch (type) {
+			case TYPE_FILL:
+				width = canvas.getCanvasMaxX() - canvas.getCanvasMinX();
+				for (int i = 0; i < valuesToDraw.length; i++) {
+					int x1 = (int) Math.round(((double) i - 0.5D) * (width / (valuesToDraw.length - 1.0D)));
+					int x2 = (int) Math.round(((double) i + 0.5D) * (width / (valuesToDraw.length - 1.0D)));
+					x1 += canvas.getCanvasMinX();
+					x2 += canvas.getCanvasMinX();
+					int y1 = valueToPixelY(valuesToDraw[i]);
+					if (x1 < (canvas.getCanvasMinX() + border))
+						x1 = canvas.getCanvasMinX() + border;
+					if (x2 > (canvas.getCanvasMaxX() - border))
+						x2 = canvas.getCanvasMaxX() - border;
+					g.setColor(color);
+					g.fillRect(x1, y1, x2 - x1, canvas.getCanvasMaxY() - border - y1);
+				}
+				break;
+			default:
+				width = canvas.getCanvasMaxX() - canvas.getCanvasMinX();
+				for (int i = 1; i < valuesToDraw.length; i++) {
+					int x1 = (int) Math.round(canvas.getCanvasMinX() + ((i - 1.0D) * (width / (valuesToDraw.length - 1.0D))));
+					int x2 = (int) Math.round(canvas.getCanvasMinX() + (i * (width / (valuesToDraw.length - 1.0D))));
+					g.drawLine(x1, valueToPixelY(valuesToDraw[i - 1]), x2, valueToPixelY(valuesToDraw[i]));
+				}
+				break;
+		}
+	}
+
+	/**
+	 * Asigna el tipo de gr�fica a mostrar. El tipo de gr�fica est� definida por las constantes TYPE 
+	 * definidas en esta clase. Por defecto siempre se muestra el tipo LINE
+	 * @param type
+	 */
+	public void setType(int type) {
+		this.type = type;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.gcanvas.GraphicHistogram#setTypeViewed(int)
+	 */
+	public void setTypeViewed(int type) {
+		this.typeViewed = type;
+	}
+	
+	/**
+	 * Convertimos los valores del histograma a visualizar a una escala de
+	 * porcentajes que es lo que representa visualmente el componente
+	 * @param values
+	 */
+	private void convertToPercent(double[] values) {
+		double max = Double.NEGATIVE_INFINITY;
+		for (int i = 0; i < values.length; i++)
+			if (values[i] > max)
+				max = values[i];
+		
+		for (int i = 0; i < values.length; i++)
+			values[i] = values[i] / max;
+	}
+	
+	/**
+	 * Calculamos el histograma a dibujar en cuestion. Los tipos son:<p>
+	 * 	VIEW_LINEAL<br>
+	 * 	VIEW_ACUMMULATED<br>
+	 * 	VIEW_LOGARITHMIC
+	 * 
+	 * @param type
+	 * @return
+	 */
+	private double[] recalcHistogram(int type) {
+		double min;
+		if (histogramValues == null)
+			histogramValues = new double[0];
+		switch (type) {
+			// Calcular la grafica acumulada
+			case VIEW_ACUMMULATED:
+				// Si ya estan calculados, no los vuelve a calcular
+				if (valuesAcummulated != null) return valuesAcummulated;
+
+				valuesAcummulated = new double[histogramValues.length];
+				if (valuesAcummulated.length >= 1) {
+					valuesAcummulated[0] = histogramValues[0];
+					for (int i = 1; i < histogramValues.length; i++)
+						valuesAcummulated[i] = histogramValues[i] + valuesAcummulated[i - 1];
+				}
+				
+				convertToPercent(valuesAcummulated);
+
+				return valuesAcummulated;
+
+			// Calcular la grafica logaritmica
+			case VIEW_LOGARITHMIC:
+				// Si ya estan calculados, no los vuelve a calcular
+				if (valuesLogarithmic != null) return valuesLogarithmic;
+				
+				min = Double.MAX_VALUE;
+				for (int i = 0; i < histogramValues.length; i++)
+					if (histogramValues[i] < min)
+						min = histogramValues[i];
+				
+				valuesLogarithmic = new double[histogramValues.length];
+				for (int i = 0; i < histogramValues.length; i++)
+					valuesLogarithmic[i] = java.lang.Math.log(histogramValues[i] - min + 1.0);
+				
+				convertToPercent(valuesLogarithmic);
+				
+				return valuesLogarithmic;
+				
+				
+				// Calcular la grafica acumulada
+			case VIEW_ACUMMULATEDLOG:
+				// Si ya estan calculados, no los vuelve a calcular
+				if (valuesAcummulatedLog != null) return valuesAcummulatedLog;
+
+				valuesAcummulatedLog = new double[histogramValues.length];
+				if (valuesAcummulatedLog.length >= 1) {
+					valuesAcummulatedLog[0] = histogramValues[0];
+					for (int i = 1; i < histogramValues.length; i++)
+						valuesAcummulatedLog[i] = histogramValues[i] + valuesAcummulatedLog[i - 1];
+				}
+				
+				min = Double.MAX_VALUE;
+				for (int i = 0; i < valuesAcummulatedLog.length; i++)
+					if (valuesAcummulatedLog[i] < min)
+						min = valuesAcummulatedLog[i];
+				
+				for (int i = 0; i < valuesAcummulatedLog.length; i++)
+					valuesAcummulatedLog[i] = java.lang.Math.log(valuesAcummulatedLog[i] - min + 1.0);
+				
+				convertToPercent(valuesAcummulatedLog);
+
+				return valuesAcummulatedLog;
+
+			// Si no es logaritmica ni acumulada, lo tratamos como si fuera lineal
+			default:
+				// Si ya estan calculados, no los vuelve a calcular
+				if (valuesLineal != null) return valuesLineal;
+
+				valuesLineal = new double[histogramValues.length];
+				for (int i = 0; i < histogramValues.length; i++)
+					valuesLineal[i] = histogramValues[i];
+
+				convertToPercent(valuesLineal);
+
+				return valuesLineal;
+		}
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.gcanvas.GraphicHistogram#setHistogramDrawed(double[])
+	 */
+	public void setHistogramDrawed(double[] histogramDrawed) {
+		histogramValues = histogramDrawed;
+
+		valuesLineal = null;
+		valuesAcummulated = null;
+		valuesLogarithmic = null;
+		valuesAcummulatedLog = null;
+		
+		if(histogramDrawed == null)
+			return;
+		
+		if (canvas != null)
+			((Component)canvas).repaint();
+	}
+
+	/**
+	 * Devuelve la forma en la que se dibujara el histograma. Posibilidades:<br>
+	 * TYPE_LINE<br>
+	 * TYPE_FILL
+	 * @return the type
+	 */
+	public int getType() {
+		return type;
+	}
+	
+	/**
+	 * Devuelve la forma que tendr� la grafica del histograma. Posibilidades:<br>
+	 * VIEW_LINEAL<br>
+	 * VIEW_ACUMMULATED<br>
+	 * VIEW_LOGARITHMIC<br>
+	 * VIEW_ACUMMULATEDLOG<br>
+	 * 
+	 * @return the typeViewed
+	 */
+	public int getTypeViewed() {
+		return typeViewed;
+	}
+	
+	/**
+	 * @return the histogramValues
+	 */
+	public double[] getHistogramValues() {
+		return histogramValues;
+	}
+	
+	public void firstActions() {}
+	public void firstDrawActions() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultGraphicHistogram.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultLogaritmicExponentialLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultLogaritmicExponentialLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultLogaritmicExponentialLine.java	(revision 15423)
@@ -0,0 +1,246 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.swing.impl.canvas.layer.function;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+import java.util.List;
+
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+import org.gvsig.raster.swing.gcanvas.LogaritmicExponentialLine;
+import org.gvsig.raster.swing.impl.DefaultRasterSwingManager;
+import org.gvsig.raster.swing.impl.canvas.layer.DefaultInfoLayer;
+/**
+ * Representa una funcion con posibilidad de arrastre para las funciones
+ * logaritmicas y exponenciales. Con el raton se puede pasar de una a otra
+ * directamente.
+ * 
+ * Las formas mas logicas de uso seria pasandole:
+ * 1.0: Para una funcion logaritmica
+ * -1.0: Para una funcion exponencial
+ * 0.0: Para una funcion lineal
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class DefaultLogaritmicExponentialLine extends DefaultStraightLine implements LogaritmicExponentialLine {
+	/**
+	 * Numero de puntos que contiene esta funci�n
+	 */
+	private double num = 40.0;
+	
+	/**
+	 * Base de la exponencial
+	 */
+	private double baseExp = 6.0;
+	
+	private double valueFunction = 1.0;
+	
+	/**
+	 * Constructor. Asigna el color y establece la posicion de la funcion.
+	 * Los valores normales son 1.0 para logaritmica y -1.0 para exponencial.
+	 * El rango va desde -2.0 hasta 2.0. Siendo 0.0 una funcion lineal.
+	 * @param c
+	 */
+	public DefaultLogaritmicExponentialLine(Color c, double point) {
+		super(c);
+		setShowSquares(false);
+
+		valueFunction = point;
+		recalcList();
+	}
+
+	/**
+	 * Actualiza la barra informativa para saber en que estado se encuentra el
+	 * componente.
+	 * Cuando el porcentaje es mayor a 0 siempre estamos en la Logaritmica
+	 * Cuando el porcentaje es menor a 0 siempre estamos en la exponencial
+	 * @param perc
+	 */
+	private void setInfoPoint(Double perc) {
+		if (canvas != null) {
+			List<DrawableElement> list = canvas.getDrawableElements(DefaultInfoLayer.class);
+			if (list.size() > 0) {
+				DefaultInfoLayer infoLayer = (DefaultInfoLayer) list.get(0);
+				
+				if (perc == null) {
+					infoLayer.setStatusLeft(null);
+					infoLayer.setStatusRight(null);
+					((Component)canvas).repaint();
+					return;
+				}
+
+				if (perc.doubleValue() > 0.0)
+					infoLayer.setStatusLeft(DefaultRasterSwingManager.getText(this, "logarithmical"));
+				else
+					infoLayer.setStatusLeft(DefaultRasterSwingManager.getText(this, "exponential"));
+
+				infoLayer.setStatusRight(clipDecimals(Math.abs(perc.doubleValue()*100.0), 2) + "%");
+			}
+		}
+	}
+	
+	public double clipDecimals(double num, int n) {
+		long m = (long) Math.pow(10, n);
+		long aux = Math.round(num * m);
+		return (double) aux / (double) m;
+	}
+	
+	/**
+	 * Recalcula todos los puntos de la funcion
+	 * ( 0.0 a  1.0) - Funcion logaritmica con aproximacion al centro
+	 * ( 1.0 a  2.0) - Funcion logaritmica con aproximacion al borde
+	 * ( 0.0 a -1.0) - Funcion exponencial con aproximacion al centro
+	 * (-1.0 a -2.0) - Funcion exponencial con aproximacion al borde
+	 */
+	private void recalcList() {
+		double x, y = 0.0;
+
+		setInfoPoint(new Double(valueFunction));
+
+		this.listSquare.clear();
+
+		for (int i = 0; i <= num; i++) {
+			x = ((double) i) / num;
+
+			// Aproximacion al centro de una funcion logaritmica
+			if (valueFunction >= 0.0 && valueFunction <= 1.0) {
+				y = logFunction(x);
+				y = x + ((y - x) * valueFunction);
+			}
+
+			// Aproximacion al borde de una funcion logaritmica
+			if (valueFunction > 1.0 && valueFunction <= 2.0) {
+				y = logFunction(x);
+				y = y + ((1.0 - y) * (valueFunction - 1.0));
+			}
+
+			// Aproximacion al centro de una funcion exponencial
+			if (valueFunction >= -1.0 && valueFunction < 0.0) {
+				y = expFunction(x);
+				y = x - ((x - y) * Math.abs(valueFunction));
+			}
+
+			// Aproximacion al borde de una funcion exponencial
+			if (valueFunction >= -2.0 && valueFunction < -1.0) {
+				y = expFunction(x);
+				y = y * (1.0 - (Math.abs(valueFunction) - 1.0));
+			}
+
+			if (y < 0.0)
+				y = 0.0;
+			if (y > 1.0)
+				y = 1.0;
+
+			this.listSquare.add(new Square(x, y));
+		}
+	}
+	
+	/**
+	 * Formula para calcular el valor en y de una funcion logaritmica en x
+	 * @param x
+	 * @return
+	 */
+	private double logFunction(double x) {
+		return Math.log10(1.0 + (x * 99.0)) / 2.0;
+	}
+	
+	/**
+	 * Formula para calcular el valor en y de una funcion exponencial en x
+	 * @param x
+	 * @return
+	 */
+	private double expFunction(double x) {
+		return (Math.exp(x * baseExp) - 1.0) / (Math.exp(baseExp) - 1.0);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mouseDragged(java.awt.event.MouseEvent)
+	 */
+	public boolean mouseDragged(MouseEvent e) {
+		if (((Component)canvas).getCursor().getType() != Cursor.DEFAULT_CURSOR)
+			return true;
+
+		double x = pixelToValueX(e.getX());
+		double y = pixelToValueY(e.getY());
+		
+		double y2 = 0.0;
+		
+		// Localizamos el punto del raton para pasar un porcentaje correcto y que 
+		// asi coincida la funcion con el raton
+		if (y >= x) {
+			y2 = logFunction(x);
+			if (y < y2)
+				valueFunction = (y - x) / (y2 - x);
+			else
+				valueFunction = ((y - y2) / (1.0 - y2)) + 1.0;
+		} else {
+			y2 = expFunction(x);
+			
+			if (y > y2)
+				valueFunction = -Math.abs((y - x) / (y2 - x));
+			else
+				valueFunction = -Math.abs((y2 - y) / y2)  - 1.0;
+		}
+		
+		if (valueFunction > 2.0)
+			valueFunction = 2.0;
+		if (valueFunction < -2.0)
+			valueFunction = -2.0;
+		
+		recalcList();
+		((Component)canvas).repaint();
+		canvas.callDataDragged("line", this);
+		return false;
+	}
+
+	public boolean mouseMoved(MouseEvent e) {
+		return true;
+	}
+
+	public boolean mousePressed(MouseEvent e) {
+		return mouseDragged(e);
+	}
+
+	public boolean mouseReleased(MouseEvent e) {
+		setInfoPoint(null);
+		return true;
+	}
+	
+	public boolean isLogaritmical() {
+		return (valueFunction > 0.0);
+	}
+
+	public boolean isExponencial() {
+		return (valueFunction < 0.0);
+	}
+	
+	public int getFunctionType() {
+		return 1;
+	}
+	
+	public double getValueFunction() {
+		return valueFunction;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultLogaritmicExponentialLine.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultStraightLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultStraightLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultStraightLine.java	(revision 15423)
@@ -0,0 +1,512 @@
+/* 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.swing.impl.canvas.layer.function;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Graphics;
+import java.awt.Image;
+import java.awt.Point;
+import java.awt.Toolkit;
+import java.awt.event.MouseEvent;
+import java.awt.image.MemoryImageSource;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+import org.gvsig.raster.swing.gcanvas.StraightLine;
+import org.gvsig.raster.swing.impl.canvas.DefaultGCanvas;
+import org.gvsig.raster.swing.impl.canvas.layer.DefaultInfoLayer;
+/**
+ * Representa una linea recta con puntos de arrastre para la ecualizaci�n de
+ * un histograma y realce lineales y dencity slicing.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultStraightLine extends DefaultBaseFunction implements StraightLine {
+
+	/**
+	 * Representa un punto seleccionado sobre el canvas. Este es
+	 * dibujado como un peque�o cuadrado.
+	 *
+	 * @author Nacho Brodin (nachobrodin@gmail.com)
+	 */
+	class Square {
+		private double x      = 0.0D;
+		private double y      = 0.0D;
+		private int    width  = 6;
+		private Color  color  = Color.WHITE;
+		
+		
+		/**
+		 * Constructor. Calcula las esquinas del cuadrado
+		 * @param p
+		 */
+		public Square(double x, double y) {
+			setPosition(x, y);
+		}
+
+		/**
+		 * Constructor. Calcula las esquinas del cuadrado
+		 * @param p
+		 */
+		public Square(int x, int y) {
+			setPosition(x, y);
+		}
+		
+		/**
+		 * Asigna una nueva posici�n al punto
+		 * @param x
+		 */
+		public void setPosition(double x, double y) {
+			this.x = x;
+			this.y = y;
+
+			if (this.x > 1.0D) this.x = 1.0D;
+			if (this.x < 0.0D) this.x = 0.0D;
+			if (this.y > 1.0D) this.y = 1.0D;
+			if (this.y < 0.0D) this.y = 0.0D;
+		}
+		
+		/**
+		 * Asigna una nueva posici�n al punto
+		 * @param x
+		 */
+		public void setPosition(int x, int y) {
+			setPosition(pixelToValueX(x), pixelToValueY(y));
+		}
+		
+		public int getPixelX() {
+			return valueToPixelX(x);
+		}
+
+		public int getPixelY() {
+			return valueToPixelY(y);
+		}
+		
+		public double getX() {
+			return x;
+		}
+		
+		public double getY() {
+			return y;
+		}
+		
+		/**
+		 * Dibuja el cuadrado
+		 * @param g
+		 */
+		protected void paint(Graphics g) {
+			g.setColor(color);
+			g.drawRect((int) valueToPixelX(x) - (width >> 1), (int) valueToPixelY(y) - (width >> 1), (int) width, (int)width);
+		}
+
+		/**
+		 * Dibuja el cursor del raton
+		 * @param g
+		 */
+		protected void paintCursor(Graphics g) {
+			g.setColor(Color.white);
+			g.drawLine(valueToPixelX(x) - 6, valueToPixelY(y), valueToPixelX(x) + 6, valueToPixelY(y));
+			g.drawLine(valueToPixelX(x), valueToPixelY(y) - 6, valueToPixelX(x), valueToPixelY(y) + 6);
+		}
+		
+		/**
+		 * Informa de si el punto pasado por par�metro cae dentro del cuadro o no
+		 * @param p Punto a comprobar
+		 * @return true si el punto est� dentro y false si no lo est�
+		 */
+		public boolean isInside(Point p) {
+			if (p.getX() < (valueToPixelX(x) - (width >> 1)))
+				return false;
+			if (p.getX() > (valueToPixelX(x) + (width >> 1)))
+				return false;
+			if (p.getY() < (valueToPixelY(y) - (width >> 1)))
+				return false;
+			if (p.getY() > (valueToPixelY(y) + (width >> 1)))
+				return false;
+			return true;
+		}
+		
+		/**
+		 * Asigna el color del cuadrado
+		 * @param c Color
+		 */
+		public void setColor(Color c) {
+			this.color = c;
+		}
+		
+		private int valueToPixelX(double value) {
+			value = minx + ((maxx - minx) * value);
+			return (int) Math.round(canvas.getCanvasMinX() + border + ((canvas.getCanvasMaxX() - canvas.getCanvasMinX() - (border * 2)) * value));
+		}
+
+		private int valueToPixelY(double value) {
+			value = 1.0D - value;
+			return (int) Math.round(canvas.getCanvasMinY() + border + ((canvas.getCanvasMaxY() - canvas.getCanvasMinY() - (border * 2)) * value));
+		}
+
+	}
+	
+	/**
+	 * Lista de cuadrados que intersectan con la recta
+	 */
+	protected List<Square> listSquare        = new ArrayList<Square>();
+	private int            pointDragged      = -1;
+	private Cursor         transparentCursor = null;
+	private boolean        showSquares       = true;
+	private int            border            = 2;
+	
+	/**
+	 * Constructor. Asigna el color
+	 * @param c
+	 */
+	public DefaultStraightLine(Color c) {
+		int[] pixels = new int[16 * 16];
+		Image image = Toolkit.getDefaultToolkit().createImage(new MemoryImageSource(16, 16, pixels, 0, 16));
+		transparentCursor = Toolkit.getDefaultToolkit().createCustomCursor(image, new Point(0, 0), "invisibleCursor");
+		
+		setColor(c);
+		clearSquares();
+		addSquare(0.0D, 0.0D);
+		addSquare(1.0D, 1.0D);
+	}
+
+	public void clearSquares() {
+		listSquare.clear();
+	}
+
+	public void addSquare(double x, double y) {
+		listSquare.add(new Square(x, y));
+	}
+	
+	/**
+	 * Dibujado de las l�neas y cuadros sobre el canvas
+	 */
+	protected void paint(Graphics g) {
+		super.paint(g);
+		g.setColor(color);
+
+		// Dibujamos una l�nea desde un punto hasta el siguiente
+		Square square = null;
+		Square lastSquare = null;
+
+		if (listSquare.size() > 0) {
+			square = ((Square) listSquare.get(0));
+			g.drawLine(canvas.getCanvasMinX(), square.getPixelY(), square.getPixelX(), square.getPixelY());
+		}
+		for (int i = 0; i < listSquare.size(); i++) {
+			lastSquare = square;
+			square = ((Square) listSquare.get(i));
+			if (lastSquare != null)
+				g.drawLine(lastSquare.getPixelX(), lastSquare.getPixelY(), square.getPixelX(), square.getPixelY());
+		}
+		if (listSquare.size() > 0) {
+			square = ((Square) listSquare.get(listSquare.size() - 1));
+			g.drawLine(square.getPixelX(), square.getPixelY(), canvas.getCanvasMaxX(), square.getPixelY());
+		}
+
+		// Dibujamos los cuadrados de los puntos
+		if (showSquares) {
+			for (int i = 0; i < listSquare.size(); i++) {
+				square = ((Square) listSquare.get(i));
+				square.setColor(color);
+				if (pointDragged != i)
+					square.paint(g);
+				else
+					square.paintCursor(g);
+			}
+		}
+
+		if (pointDragged != -1) {
+			setInfoPoint(pointDragged);
+		}
+	}
+	
+	/**
+	 * Visualiza la posicion de un punto en la barra de estado
+	 * @param square
+	 */
+	private void setInfoPoint(int point) {
+		List<DrawableElement> list = canvas.getDrawableElements(DefaultInfoLayer.class);
+		if (list.size() > 0) {
+			DefaultInfoLayer infoLayer = (DefaultInfoLayer) list.get(0);
+			if (point != -1) {
+				Square square = ((Square) listSquare.get(point));
+				
+				double value = minx + (square.getX() * (maxx - minx));
+				value = infoLayer.getMin() + (value * (infoLayer.getMax() - infoLayer.getMin()));
+				
+				infoLayer.setStatusLeft("In: " + clipDecimals(value, 1));
+				infoLayer.setStatusRight("Out: " + Math.round(square.getY() * 255.0D));
+			} else {
+				infoLayer.setStatusLeft(null);
+				infoLayer.setStatusRight(null);
+			}
+		}
+	}
+	
+	public double clipDecimals(double num, int n) {
+		long m = (long) Math.pow(10, n);
+		long aux = Math.round(num * m);
+		return (double) aux / (double) m;
+	}
+
+	/**
+	 * Asigna el objeto JComponent donde se pintan los elementos. Inicializa los puntos
+	 * de inicio y fin de l�nea y asigna los listener
+	 * @param canvas
+	 */
+	public void setCanvas(DefaultGCanvas canvas) {
+		super.setCanvas(canvas);
+	}
+	
+	/**
+	 * Inserta un elemento (cuadrado) en el array entre los dos cuadrados entre los que se
+	 * encuentre el valor de su X, as� siempre est�n ordenados en el array por valor de X. 
+	 * @param element
+	 * @return Devuelve la posici�n del elemento insertado, en caso de no poder insertarse
+	 *         devolver� -1
+	 */
+	private int insert(Square element) {
+		for (int i = 0; i < (listSquare.size() - 1); i++) {
+			double sqX = ((Square) listSquare.get(i)).getX();
+			double sqNextX = ((Square) listSquare.get(i + 1)).getX();
+			if (element.getX() >= sqX && element.getX() <= sqNextX) {
+				listSquare.add(i + 1, element);
+				return i + 1;
+			}
+		}
+		return -1;
+	}
+	
+	/**
+	 * Se captura el punto a arrastrar, en caso de que no coincida con un punto,
+	 * se inserta
+	 */
+	public boolean mousePressed(MouseEvent e) {
+		for (int i = 0; i < listSquare.size(); i++) {
+			if (((Square) listSquare.get(i)).isInside(e.getPoint())) {
+				if ((e.getModifiersEx() & MouseEvent.BUTTON3_DOWN_MASK) != 0) {
+					if ((i == 0) || ((i + 1) == listSquare.size()))
+						continue;
+					pointDragged = -1;
+					listSquare.remove(i);
+					((Component)canvas).repaint();
+					return false;
+				}
+				if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) != 0) {
+					pointDragged = i;
+					this.mouseDragged(e);
+					return false;
+				}
+			}
+		}
+
+		if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0)
+			return true;
+		// En caso de que nadie lo este tratando, osea, un cursor normal
+		if (((Component)canvas).getCursor().getType() == Cursor.DEFAULT_CURSOR) {
+			pointDragged = insert(new Square(e.getX(), e.getY()));
+			this.mouseDragged(e);
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Inicializamos el punto arrastrado a un valor fuera del array
+	 */
+	public boolean mouseReleased(MouseEvent e) {
+		pointDragged = -1;
+		setInfoPoint(-1);
+		((Component)canvas).repaint();
+		canvas.callDataChanged("line", this);
+		return true;
+	}
+
+	/**
+	 * Cuando se ha pinchado un punto y se arrastra se define aqu� su comportamiento.
+	 */
+	public boolean mouseDragged(MouseEvent e) {
+		if (pointDragged >= 0) {
+			((Component)canvas).setCursor(transparentCursor);
+			int minX = canvas.getCanvasMinX();
+			int minY = canvas.getCanvasMinY();
+			int maxX = canvas.getCanvasMaxX();
+			int maxY = canvas.getCanvasMaxY();
+
+			// Controlamos que no se salga de los l�mites
+			int x = Math.min(Math.max(e.getX(), minX), maxX);
+			int y = Math.min(Math.max(e.getY(), minY), maxY);
+			Square point = ((Square) listSquare.get(pointDragged));
+
+			try {
+				// El primer punto no se desplaza en X
+				if (pointDragged == 0) {
+					point.setPosition(minX, y);
+					return false;
+				}
+				// El �ltimo punto no se desplaza en X
+				if (pointDragged == (listSquare.size() - 1)) {
+					point.setPosition(maxX, y);
+					return false;
+				}
+
+				// Puntos centrales
+				point.setPosition(x, y);
+
+				// Arrastra a los de abajo si la X es menor que los inferiores
+				for (int i = 0; i < pointDragged; i++) {
+					Square lowPoint = ((Square) listSquare.get(i));
+					if (lowPoint.getPixelX() >= x) {
+						lowPoint.setPosition(x, lowPoint.getPixelY());
+						for (int j = i + 1; listSquare.get(j) != point;) {
+							listSquare.remove(j);
+							pointDragged--;
+						}
+						break;
+					}
+				}
+
+				// Arrastra a los de arriba si la X es mayor que los superiores
+				for (int i = listSquare.size() - 1; i > pointDragged; i--) {
+					Square upperPoint = ((Square) listSquare.get(i));
+					if (upperPoint.getPixelX() <= x) {
+						upperPoint.setPosition(x, upperPoint.getPixelY());
+						for (int j = i - 1; listSquare.get(j) != point;) {
+							listSquare.remove(j);
+							j--;
+						}
+						break;
+					}
+				}
+			} finally {
+				// Siempre repintamos
+				((Component)canvas).repaint();
+				canvas.callDataDragged("line", this);
+			}
+			return false;
+		}
+		return true;
+	}
+
+	/**
+	 * Variable para saber si se ha visualizado alguna informacion
+	 */
+	boolean last = false;
+
+	public boolean mouseMoved(MouseEvent e) {
+		for (int i = 0; i < listSquare.size(); i++) {
+			if (((Square)listSquare.get(i)).isInside(e.getPoint())) {
+				((Component)canvas).setCursor(new Cursor(Cursor.MOVE_CURSOR));
+				setInfoPoint(i);
+				((Component)canvas).repaint();
+				last = true;
+				return false;
+			}
+		}
+		if (last) {
+			setInfoPoint(-1);
+			((Component)canvas).repaint();
+			last = false;
+		}
+		return true;
+	}
+
+	public double[] getInValues(double min, double max) {
+		double[] in = getPercentInValues(); 
+		for (int i = 0; i < in.length; i++)
+			in[i] = min + (in[i] * (max - min));
+		return in;
+	}
+
+	public int[] getOutValues() {
+		double[] values = getPercentOutValues(); 
+		int[] out = new int[values.length];
+		for (int i = 0; i < values.length; i++)
+			out[i] = (int) Math.round(values[i] * 255.0D);
+		return out;
+	}
+
+	public double[] getPercentInValues() {
+		double[] in = new double[listSquare.size() + 2];
+		for (int i = 0; i < listSquare.size(); i++) {
+			Square square = ((Square) listSquare.get(i));
+			in[i + 1] = minx + ((maxx - minx) * square.getX());
+		}
+		in[0] = 0.0D;
+		in[in.length - 1] = 1.0D;
+		return in;
+	}
+
+	public double[] getPercentOutValues() {
+		double[] out = new double[listSquare.size() + 2];
+		for (int i = 0; i < listSquare.size(); i++) {
+			Square square = ((Square) listSquare.get(i));
+			out[i + 1] = square.getY();
+		}
+		out[0] = out[1];
+		out[out.length - 1] = out[out.length - 2];
+		return out;
+	}
+	
+	public void firstActions() {}
+	public void firstDrawActions() {}
+
+	/**
+	 * @param showSquares the showSquares to set
+	 */
+	public void setShowSquares(boolean showSquares) {
+		this.showSquares = showSquares;
+	}
+
+	protected double pixelToValueX(int pixel) {
+		double value = ((double) (pixel - canvas.getCanvasMinX() - border) / (double) (canvas.getCanvasMaxX() - canvas.getCanvasMinX() - (border * 2.0D)));
+		
+		value = (value - minx) / (maxx - minx);
+		
+		return value;
+	}
+
+	protected double pixelToValueY(int pixel) {
+		double div = (double) (canvas.getCanvasMaxY() - canvas.getCanvasMinY() - (border * 2.0D));
+		if (div == 0.0D)
+			return 0.0D;
+		
+		return (1.0D - ((double) (pixel - canvas.getCanvasMinY() - border) / div));
+	}
+	
+	public int getFunctionType() {
+		return 0;
+	}
+	
+	/**
+	 * En una funci�n lineal da igual lo que devuelva, pero es interesante para sus
+	 * clases derivadas
+	 * @return
+	 */
+	public double getValueFunction() {
+		return 0.0;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultStraightLine.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultBaseFunction.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultBaseFunction.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultBaseFunction.java	(revision 15423)
@@ -0,0 +1,65 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.swing.impl.canvas.layer.function;
+
+import java.awt.Graphics;
+import java.util.List;
+
+import org.gvsig.raster.swing.gcanvas.BaseFunction;
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+import org.gvsig.raster.swing.impl.canvas.layer.DefaultMinMaxLines;
+/**
+ * Todo algoritmo que queramos que implemente un realce, debe heredar de esta base
+ * para poder distinguir los drawables genericos de los algoritmos.
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public abstract class DefaultBaseFunction extends DrawableElement implements BaseFunction {
+	protected double      minx       = 0.0D;
+	protected double      maxx       = 1.0D;
+	
+
+	/**
+	 * Especifica el limite minimo del algoritmo en forma de porcentaje
+	 * @param minx
+	 */
+	public void setMinX(double minx) {
+		this.minx = minx;
+	}
+
+	/**
+	 * Especifica el limite maximo del algoritmo en forma de porcentaje
+	 * @param maxx
+	 */
+	public void setMaxX(double maxx) {
+		this.maxx = maxx;
+	}
+	
+	protected void paint(Graphics g) {
+		/*List<DrawableElement> elements = canvas.getDrawableElements(DefaultMinMaxLines.class);
+		if (elements.size() > 0) {
+			DefaultMinMaxLines minMaxLines = (DefaultMinMaxLines) elements.get(0);
+			setMinX(minMaxLines.getMinDistance());
+			setMaxX(minMaxLines.getMaxDistance());
+		}*/
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultBaseFunction.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultDensitySlicingLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultDensitySlicingLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultDensitySlicingLine.java	(revision 15423)
@@ -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.swing.impl.canvas.layer.function;
+
+import java.awt.Color;
+import java.awt.event.MouseEvent;
+
+import org.gvsig.raster.swing.gcanvas.DensitySlicingLine;
+/**
+ * Representa una l�nea escalonada para el realce de density slicing.
+ * Esta hereda de StraightLine porque es b�sicamente la misma pero con una
+ * forma determinada.
+ * 
+ * 11/03/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class DefaultDensitySlicingLine extends DefaultStraightLine implements DensitySlicingLine {
+	public static final int DEFAULT_LEVELS = 6;
+
+	private int             levels         = DEFAULT_LEVELS;
+	
+	/**
+	 * Constructor. Asigna el valor de color a la l�nea
+	 * @param c Color
+	 */
+	public DefaultDensitySlicingLine(Color c) {
+		this(c, DEFAULT_LEVELS);
+	}
+	
+	/**
+	 * Constructor. Asigna el valor de color a la l�nea
+	 * @param c Color
+	 */
+	public DefaultDensitySlicingLine(Color c, int levels) {
+		super(c);
+		if(levels < 0)
+			return;
+		setShowSquares(false);
+		setShape(levels);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.gcanvas.DensitySlicingLine#setShape(int)
+	 */
+	@SuppressWarnings("unchecked")
+	public void setShape(int levels) {
+		this.levels = levels;
+		listSquare.clear();
+
+		if (levels <= 1)
+			return;
+
+		int nSquares = (levels * 2);
+
+		double posX = 0.0D;
+		double posY = 0.0D;
+		double contX = 0.0D;
+		double contY = 0.0D;
+		for (int i = 0; i < nSquares; i++) {
+			posX = contX / (double) levels;
+			posY = contY / (double) (levels - 1.0D);
+			listSquare.add(new Square(posX, posY));
+			if ((i % 2) != 0)
+				contY++;
+			else
+				contX++;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.gcanvas.DensitySlicingLine#getLevels()
+	 */
+	public int getLevels() {
+		return levels;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#getFunctionType()
+	 */
+	public int getFunctionType() {
+		return 3;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#getValueFunction()
+	 */
+	public double getValueFunction() {
+		return levels;
+	}
+	
+	/* (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mouseDragged(java.awt.event.MouseEvent)
+	 */
+	public boolean mouseDragged(MouseEvent e) {
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mouseMoved(java.awt.event.MouseEvent)
+	 */
+	public boolean mouseMoved(MouseEvent e) {
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public boolean mousePressed(MouseEvent e) {
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mouseReleased(java.awt.event.MouseEvent)
+	 */
+	public boolean mouseReleased(MouseEvent e) {
+		return true;
+	}
+
+	public void firstDrawActions() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultDensitySlicingLine.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultSquareRootPowLine.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultSquareRootPowLine.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultSquareRootPowLine.java	(revision 15423)
@@ -0,0 +1,251 @@
+/* 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.swing.impl.canvas.layer.function;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.event.MouseEvent;
+import java.util.List;
+
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+import org.gvsig.raster.swing.gcanvas.SquareRootPowLine;
+import org.gvsig.raster.swing.impl.DefaultRasterSwingManager;
+import org.gvsig.raster.swing.impl.canvas.layer.DefaultInfoLayer;
+/**
+ * Representa una funcion con posibilidad de arrastre para las funciones
+ * raices cuadradas y cuadradas. Con el raton se puede pasar de una a otra
+ * directamente.
+ * 
+ * Las formas mas logicas de uso seria pasandole:
+ * 1.0: Para una funcion raiz cuadrada
+ * -1.0: Para una funcion cuadrada
+ * 0.0: Para una funcion lineal
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+@SuppressWarnings("unchecked")
+public class DefaultSquareRootPowLine extends DefaultStraightLine implements SquareRootPowLine {
+	/**
+	 * Numero de puntos que contiene esta funci�n
+	 */
+	private double num = 40.0;
+	
+	private double valueFunction = 1.0;
+	
+	/**
+	 * Constructor. Asigna el color y establece la posicion de la funcion.
+	 * Los valores normales son 1.0 para raiz cuadrada y -1.0 para cuadrada.
+	 * El rango va desde -2.0 hasta 2.0. Siendo 0.0 una funcion lineal.
+	 * @param c
+	 */
+	public DefaultSquareRootPowLine(Color c, double point) {
+		super(c);
+		setShowSquares(false);
+		valueFunction = point;
+		recalcList();
+	}
+
+	/**
+	 * Actualiza la barra informativa para saber en que estado se encuentra el
+	 * componente.
+	 * Cuando el porcentaje es mayor a 0 siempre estamos en la raiz cuadrada
+	 * Cuando el porcentaje es menor a 0 siempre estamos en la cuadrada
+	 * @param perc
+	 */
+	private void setInfoPoint(Double perc) {
+		if (canvas != null) {
+			List<DrawableElement> list = canvas.getDrawableElements(DefaultInfoLayer.class);
+			if (list.size() > 0) {
+				DefaultInfoLayer infoLayer = (DefaultInfoLayer) list.get(0);
+				
+				if (perc == null) {
+					infoLayer.setStatusLeft(null);
+					infoLayer.setStatusRight(null);
+					((Component)canvas).repaint();
+					return;
+				}
+
+				if (perc.doubleValue() > 0.0)
+					infoLayer.setStatusLeft(DefaultRasterSwingManager.getText(this, "square_root"));
+				else
+					infoLayer.setStatusLeft(DefaultRasterSwingManager.getText(this, "pow"));
+
+				infoLayer.setStatusRight(clipDecimals(Math.abs(perc.doubleValue() * 100.0), 2) + "%");
+			}
+		}
+	}
+	
+	/**
+	 * Recalcula todos los puntos de la funcion
+	 * Posibles rangos para perc:
+	 * ( 0.0 a  1.0) - Funcion raiz cuadrada con aproximacion al centro
+	 * ( 1.0 a  2.0) - Funcion raiz cuadrada con aproximacion al borde
+	 * ( 0.0 a -1.0) - Funcion cuadrada con aproximacion al centro
+	 * (-1.0 a -2.0) - Funcion cuadrada con aproximacion al borde
+	 * 
+	 * @param perc
+	 */
+	private void recalcList() {
+		double x, y = 0.0;
+
+		setInfoPoint(new Double(valueFunction));
+
+		this.listSquare.clear();
+
+		for (int i = 0; i <= num; i++) {
+			x = ((double) i) / num;
+
+			// Aproximacion al centro de una funcion raiz cuadrada
+			if (valueFunction >= 0.0 && valueFunction <= 1.0) {
+				y = squareFunction(x);
+				y = x + ((y - x) * valueFunction);
+			}
+
+			// Aproximacion al borde de una funcion raiz cuadrada
+			if (valueFunction > 1.0 && valueFunction <= 2.0) {
+				y = squareFunction(x);
+				y = y + ((1.0 - y) * (valueFunction - 1.0));
+			}
+
+			// Aproximacion al centro de una funcion cuadrada
+			if (valueFunction >= -1.0 && valueFunction < 0.0) {
+				y = powFunction(x);
+				y = x - ((x - y) * Math.abs(valueFunction));
+			}
+
+			// Aproximacion al borde de una funcion cuadrada
+			if (valueFunction >= -2.0 && valueFunction < -1.0) {
+				y = powFunction(x);
+				y = y * (1.0 - (Math.abs(valueFunction) - 1.0));
+			}
+
+			if (y < 0.0)
+				y = 0.0;
+			if (y > 1.0)
+				y = 1.0;
+
+			this.listSquare.add(new Square(x, y));
+		}
+	}
+	
+	/**
+	 * Formula para calcular el valor en y de una funcion raiz cuadrada en x
+	 * @param x
+	 * @return
+	 */
+	private double squareFunction(double x) {
+		return Math.sqrt(x);
+	}
+	
+	/**
+	 * Formula para calcular el valor en y de una funcion cuadrada en x
+	 * @param x
+	 * @return
+	 */
+	private double powFunction(double x) {
+		return Math.pow(x, 2);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mouseDragged(java.awt.event.MouseEvent)
+	 */
+	public boolean mouseDragged(MouseEvent e) {
+		if (((Component)canvas).getCursor().getType() != Cursor.DEFAULT_CURSOR)
+			return true;
+
+		double x = pixelToValueX(e.getX());
+		double y = pixelToValueY(e.getY());
+		
+		double y2 = 0.0;
+		
+		// Localizamos el punto del raton para pasar un porcentaje correcto y que 
+		// asi coincida la funcion con el raton
+		if (y >= x) {
+			y2 = squareFunction(x);
+			if (y < y2)
+				valueFunction = (y - x) / (y2 - x);
+			else
+				valueFunction = ((y - y2) / (1.0 - y2)) + 1.0;
+		} else {
+			y2 = powFunction(x);
+			
+			if (y > y2)
+				valueFunction = -Math.abs((y - x) / (y2 - x));
+			else
+				valueFunction = -Math.abs((y2 - y) / y2)  - 1.0;
+		}
+		
+		if (valueFunction < -2.0)
+			valueFunction = -2.0;
+
+		if (valueFunction > 2.0)
+			valueFunction = 2.0;
+
+		recalcList();
+		((Component)canvas).repaint();
+		canvas.callDataDragged("line", this);
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mouseMoved(java.awt.event.MouseEvent)
+	 */
+	public boolean mouseMoved(MouseEvent e) {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public boolean mousePressed(MouseEvent e) {
+		return mouseDragged(e);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#mouseReleased(java.awt.event.MouseEvent)
+	 */
+	public boolean mouseReleased(MouseEvent e) {
+		setInfoPoint(null);
+		return true;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#getFunctionType()
+	 */
+	public int getFunctionType() {
+		return 2;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.layers.functions.StraightLine#getValueFunction()
+	 */
+	public double getValueFunction() {
+		return valueFunction;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/function/DefaultSquareRootPowLine.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultMinMaxLines.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultMinMaxLines.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultMinMaxLines.java	(revision 15423)
@@ -0,0 +1,232 @@
+/* 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.swing.impl.canvas.layer;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Cursor;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Stroke;
+import java.awt.event.MouseEvent;
+import java.util.List;
+
+import javax.swing.SwingUtilities;
+
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+import org.gvsig.raster.swing.gcanvas.MinMaxLines;
+import org.gvsig.raster.swing.impl.canvas.DefaultGCanvas;
+import org.gvsig.raster.swing.impl.canvas.layer.function.DefaultBaseFunction;
+
+/**
+ * Representa dos l�neas rectas que se�alizan el m�ximo y el m�nimo.
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultMinMaxLines extends MinMaxLines {
+	/**
+	 * Representa el borde de separacion para los limites
+	 */
+	private int     border      = 2;
+
+	private double  minPos      = 0.0D;
+	private double  maxPos      = 1.0D;
+
+	private boolean minSelected = false;
+	private boolean maxSelected = false;
+	
+	/**
+	 * Constructor. Asigna el color
+	 * @param c
+	 */
+	public DefaultMinMaxLines(Color c) {
+		setColor(c);
+	}
+	
+	public void setMinimum(double min) {
+		this.minPos = min;
+	}
+	
+	public void setMaximum(double max) {
+		this.maxPos = max;
+	}
+	
+	private int valueToPixel(double value) {
+		return (int) Math.round(canvas.getCanvasMinX() + border + ((canvas.getCanvasMaxX() - canvas.getCanvasMinX() - (border * 2)) * value));
+	}
+
+	private double pixelToValue(int pixel) {
+		return ((double) (pixel - canvas.getCanvasMinX() - border) / (double) (canvas.getCanvasMaxX() - canvas.getCanvasMinX() - (border * 2)));
+	}
+	
+	/**
+	 * Dibujado de las l�neas y cuadros sobre el canvas
+	 */
+	public void paint(Graphics g) {
+		g.setColor(color);
+		int y = (int) canvas.getCanvasMinY();
+		int x1 = valueToPixel(minPos);
+		int x2 = valueToPixel(maxPos);
+		Graphics2D g2 = (Graphics2D) g;
+		float dash1[] = {10.0f};
+		BasicStroke stroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash1, 0.0f);
+		Stroke stroke2 = g2.getStroke();
+		g2.setStroke(stroke);
+
+		g2.drawLine(x1, y, x1, canvas.getCanvasMaxY());
+		g2.drawLine(x2, y, x2, canvas.getCanvasMaxY());
+
+		g2.setStroke(stroke2);
+	}
+
+	/**
+	 * Asigna el objeto JComponent donde se pintan los elementos. Inicializa los puntos
+	 * de inicio y fin de l�nea y asigna los listener
+	 * @param canvas
+	 */
+	public void setCanvas(DefaultGCanvas canvas) {
+		super.setCanvas(canvas);
+	}
+	
+	/**
+	 * Se captura el punto a arrastrar
+	 */
+	public boolean mousePressed(MouseEvent e) {
+		if ((e.getModifiersEx() & MouseEvent.BUTTON1_DOWN_MASK) == 0)
+			return true;
+
+		if (e.getY() > canvas.getCanvasMinY() && e.getY() < canvas.getCanvasMaxY()) {
+			if (e.getX() >= (valueToPixel(minPos) - 3) && e.getX() <= (valueToPixel(minPos) + 3)) {
+				minSelected = true;
+				return false;
+			}
+			if (e.getX() >= (valueToPixel(maxPos) - 3) && e.getX() <= (valueToPixel(maxPos) + 3)) {
+				maxSelected = true;
+				return false;
+			}
+		}
+		return true;
+	}
+
+	/**
+	 * Inicializamos el punto arrastrado a un valor fuera del array
+	 */
+	public boolean mouseReleased(MouseEvent e) {
+		if (canvas != null && (minSelected != false || maxSelected != false )) {
+			((Component)canvas).repaint();
+			canvas.callDataChanged("minmax", this);
+		}
+		minSelected = false;
+		maxSelected = false;
+		return true;
+	}
+
+	/**
+	 * Cuando se ha pinchado un punto y se arrastra se define aqu� su comportamiento.
+	 */
+	public boolean mouseDragged(MouseEvent e) {
+		if (canvas == null)
+			return true;
+
+		if (minSelected) {
+			minPos = pixelToValue(e.getX());
+			if (minPos < 0)
+				minPos = 0;
+			if (minPos > 1.0)
+				minPos = 1.0;
+			if (minPos > maxPos)
+				maxPos = minPos;
+			
+			updateDrawableElements();
+			return false;
+		}
+		if (maxSelected) {
+			maxPos = pixelToValue(e.getX());
+			if (maxPos < 0)
+				maxPos = 0;
+			if (maxPos > 1.0)
+				maxPos = 1.0;
+			if (maxPos < minPos)
+				minPos = maxPos;
+			
+			updateDrawableElements();
+			return false;
+		}
+		return true;
+	}
+	
+	private void updateDrawableElements() {
+		List<DrawableElement> elements = canvas.getDrawableElements(DefaultBaseFunction.class);
+		if (elements.size() > 0) {
+			DefaultBaseFunction baseFunction = (DefaultBaseFunction) elements.get(0);
+			baseFunction.setMinX(minPos);
+			baseFunction.setMaxX(maxPos);
+		}
+		
+		((Component)canvas).repaint();
+		SwingUtilities.invokeLater(new Runnable() {
+			public void run() {
+				canvas.callDataDragged("minmax", this);
+			}
+		});
+	}
+	
+	public boolean mouseMoved(MouseEvent e) {
+		if (e.getY() > canvas.getCanvasMinY() && e.getY() < canvas.getCanvasMaxY()) {
+			if (e.getX() >= (valueToPixel(minPos) - 3) &&
+					e.getX() <= (valueToPixel(minPos) + 3)) {
+				((Component)canvas).setCursor(new Cursor(Cursor.W_RESIZE_CURSOR));
+				return false;
+			}
+			if (e.getX() >= (valueToPixel(maxPos) - 3) &&
+					e.getX() <= (valueToPixel(maxPos) + 3)) {
+				((Component)canvas).setCursor(new Cursor(Cursor.E_RESIZE_CURSOR));
+				return false;
+			}
+		}
+		return true;
+	}
+	
+	/**
+	 * Obtiene la distancia de la l�nea del m�nimo al inicio del histograma. La 
+	 * distancia la devuelve en tanto por cien del tama�o del gr�fico
+	 * @return Porcentaje de distancia entre el punto inicial del gr�fico hasta la
+	 * l�nea del m�nimo.
+	 */
+	public double getMinDistance() {
+		return minPos;
+	}
+	
+	/**
+	 * Obtiene la distancia de la l�nea del m�ximo al inicio del histograma. La 
+	 * distancia la devuelve en tanto por cien del tama�o del gr�fico
+	 * @return Porcentaje de distancia entre el punto inicial del gr�fico hasta la
+	 * l�nea del m�ximo.
+	 */
+	public double getMaxDistance() {
+		return maxPos;
+	}
+	
+	public void firstActions() {}
+	public void firstDrawActions() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultMinMaxLines.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/Border.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/Border.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/Border.java	(revision 15423)
@@ -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.
+* 
+*/
+package org.gvsig.raster.swing.impl.canvas.layer;
+
+import java.awt.Color;
+import java.awt.Graphics;
+
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+/**
+ * Gr�fico que representa un borde para el canvas. Dibuja un cuadrado sin relleno en el perimetro m�ximo de
+ * dibujo del canvas. 
+ *
+ * 14-oct-2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class Border extends DrawableElement {
+	public static final int BORDER = 5;
+		
+	/**
+	 * Constructor. Asigna el color
+	 * @param c
+	 */
+	public Border(Color c) {
+		setColor(c);
+	}
+	
+	/**
+	 * Dibujado de la l�nea de incremento exponencial sobre el canvas.
+	 */
+	public void paint(Graphics g) {
+		g.setColor(color);
+		g.drawRect(canvas.getCanvasMinX(), canvas.getCanvasMinY(), canvas.getCanvasWidth(), canvas.getCanvasHeight());
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.DrawableElement#firstActions()
+	 */
+	public void firstActions() {
+		canvas.addBorder(BORDER, BORDER, BORDER, BORDER);
+	}
+
+	public void firstDrawActions() {}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/Border.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultInfoLayer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultInfoLayer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultInfoLayer.java	(revision 15423)
@@ -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.swing.impl.canvas.layer;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.RenderingHints;
+import java.awt.geom.Rectangle2D;
+import java.util.List;
+
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+import org.gvsig.raster.swing.gcanvas.InfoLayer;
+/**
+ * Capa para GCanvas que muestra el maximo y minimo de una banda
+ * 
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class DefaultInfoLayer extends InfoLayer {
+	private Color        color       = null;
+	private double       min         = 0.0;
+	private double       max         = 1.0;
+	private String       statusRight = null;
+	private String       statusLeft  = null;
+	
+	/**
+	 * Creacion de un InfoLayer especificando el color
+	 * @param c
+	 */
+	public DefaultInfoLayer(Color c) {
+		color = c;
+	}
+
+	/**
+	 * Definir el borde que va a tener el componente
+	 */
+	public void firstActions() {
+		canvas.addBorder(0, 15, 0, 15);
+	}
+	
+	/**
+	 * Establecer los valores maximo y minimo para dicha capa
+	 * @param min
+	 * @param max
+	 */
+	public void setLimits(double min, double max) {
+		this.min = min;
+		this.max = max;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.beans.canvas.DrawableElement#paint(java.awt.Graphics)
+	 */
+	protected void paint(Graphics g) {
+		
+		Graphics2D graphics2 = (Graphics2D) g;
+
+		RenderingHints hints = new RenderingHints(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
+		hints.add(new RenderingHints(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY));
+		graphics2.setRenderingHints(hints);
+
+		graphics2.setColor(color);
+		graphics2.setFont(new java.awt.Font("Times", 1, 12));
+		
+		String min2 = clipDecimals(min, 1) + "";
+		String max2 = clipDecimals(max, 1) + "";
+
+		Rectangle2D rectangle2D = graphics2.getFontMetrics().getStringBounds(max2, g);
+		
+		graphics2.drawString(min2, canvas.getCanvasMinX(), canvas.getCanvasMinX() + 12);
+		graphics2.drawString(max2, 
+				(int) (((Component)canvas).getWidth() - rectangle2D.getWidth() - canvas.getCanvasMinX()), 
+				canvas.getCanvasMinX() + 12);
+		
+		if (statusRight != null) {
+			rectangle2D = graphics2.getFontMetrics().getStringBounds(statusRight, g);
+			graphics2.drawString(statusRight, 
+					(int) (((Component)canvas).getWidth() - rectangle2D.getWidth() - canvas.getCanvasMinX()), 
+					(int) ((Component)canvas).getHeight() - canvas.getCanvasMinX());
+		}
+
+		if (statusLeft != null) {
+			graphics2.drawString(statusLeft, 
+					canvas.getCanvasMinX(), 
+					(int) ((Component)canvas).getHeight() - canvas.getCanvasMinX());
+		}
+		
+		List<DrawableElement> list = canvas.getDrawableElements(DefaultMinMaxLines.class);
+		if (list.size() > 0) {
+			DefaultMinMaxLines minMaxLines = (DefaultMinMaxLines) list.get(0);
+
+			double minP = min + (minMaxLines.getMinDistance() * (max - min));
+			double maxP = min + (minMaxLines.getMaxDistance() * (max - min));
+			min2 = clipDecimals(minP, 1) + "";
+			max2 = clipDecimals(maxP, 1) + "";
+
+			list = canvas.getDrawableElements(DefaultGraphicHistogram.class);
+			if (list.size() > 0) {
+				DefaultGraphicHistogram histogram = (DefaultGraphicHistogram) list.get(0);
+				double[] ds = histogram.getHistogramValues();
+				double total = 0.0D;
+				double totalmin = 0.0D;
+				double totalmax = 0.0D;
+				for (int i = 0; i < ds.length; i++) {
+					double value = min + (((double) (i * (max - min))) / (double) (ds.length - 1.0D));
+					total += ds[i];
+					if (minP > value)
+						totalmin += ds[i];
+					if (maxP < value)
+						totalmax += ds[i];
+				}
+
+				totalmin = (100.0D * totalmin) / total;
+				totalmax = (100.0D * totalmax) / total;
+
+				min2 = min2 + " (" + clipDecimals(totalmin, 2) + "%)";
+				max2 = max2 + " (" + clipDecimals(totalmax, 2) + "%)";
+			}
+
+			rectangle2D = graphics2.getFontMetrics().getStringBounds(max2, g);
+
+			if (statusLeft == null)
+				graphics2.drawString(min2, 
+						canvas.getCanvasMinX(), 
+						(int) ((Component)canvas).getHeight() - canvas.getCanvasMinX());
+
+			if (statusRight == null)
+				graphics2.drawString(max2, 
+						(int) (((Component)canvas).getWidth() - rectangle2D.getWidth() - canvas.getCanvasMinX()), 
+						(int) ((Component)canvas).getHeight() - canvas.getCanvasMinX());
+		}
+	}
+	
+	/**
+	 * @return the min
+	 */
+	public double getMin() {
+		return min;
+	}
+
+	/**
+	 * @return the max
+	 */
+	public double getMax() {
+		return max;
+	}
+	
+	/**
+	 * @param status the status to set
+	 */
+	public void setStatusRight(String statusRight) {
+		this.statusRight = statusRight;
+	}
+	
+	/**
+	 * @param statusLeft the statusLeft to set
+	 */
+	public void setStatusLeft(String statusLeft) {
+		this.statusLeft = statusLeft;
+	}
+	
+	public void firstDrawActions() {}
+	
+	public double clipDecimals(double num, int n) {
+		long m = (long) Math.pow(10, n);
+		long aux = Math.round(num * m);
+		return (double) aux / (double) m;
+	}
+}
\ No newline at end of file

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/layer/DefaultInfoLayer.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/DefaultGCanvas.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/DefaultGCanvas.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/canvas/DefaultGCanvas.java	(revision 15423)
@@ -0,0 +1,363 @@
+/* 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.swing.impl.canvas;
+
+import java.awt.Color;
+import java.awt.Cursor;
+import java.awt.Graphics;
+import java.awt.event.MouseEvent;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.gcanvas.DensitySlicingLine;
+import org.gvsig.raster.swing.gcanvas.DrawableElement;
+import org.gvsig.raster.swing.gcanvas.GCanvas;
+import org.gvsig.raster.swing.gcanvas.GCanvasEvent;
+import org.gvsig.raster.swing.gcanvas.GraphicHistogram;
+import org.gvsig.raster.swing.gcanvas.IGCanvasListener;
+import org.gvsig.raster.swing.gcanvas.InfoLayer;
+import org.gvsig.raster.swing.gcanvas.LogaritmicExponentialLine;
+import org.gvsig.raster.swing.gcanvas.MinMaxLines;
+import org.gvsig.raster.swing.gcanvas.SquareRootPowLine;
+import org.gvsig.raster.swing.gcanvas.StraightLine;
+import org.gvsig.raster.swing.impl.canvas.layer.Border;
+import org.gvsig.raster.swing.impl.canvas.layer.DefaultGraphicHistogram;
+import org.gvsig.raster.swing.impl.canvas.layer.DefaultInfoLayer;
+import org.gvsig.raster.swing.impl.canvas.layer.DefaultMinMaxLines;
+import org.gvsig.raster.swing.impl.canvas.layer.function.DefaultDensitySlicingLine;
+import org.gvsig.raster.swing.impl.canvas.layer.function.DefaultLogaritmicExponentialLine;
+import org.gvsig.raster.swing.impl.canvas.layer.function.DefaultSquareRootPowLine;
+import org.gvsig.raster.swing.impl.canvas.layer.function.DefaultStraightLine;
+/**
+ * Canvas donde se pintan objetos GLine
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class DefaultGCanvas  extends JPanel implements GCanvas {
+	private static final long   serialVersionUID       = 5431466034535083594L;
+	private Color               backgroundColor        = Color.WHITE;
+	private List<IGCanvasListener> 
+                                actionCommandListeners = new ArrayList<IGCanvasListener>();
+	public static final int     DEFAULT_CURSOR         = Cursor.DEFAULT_CURSOR;
+	
+	private boolean hasMouse = false;
+	
+	// Tama�o de los bordes para el canvas
+	private int               borderX1                 = 0;
+	private int               borderX2                 = 0;
+	private int               borderY1                 = 0;
+	private int               borderY2                 = 0;
+	
+	private List<DrawableElement>           
+	                          drawableElements         = new ArrayList<DrawableElement>();
+		
+	/**
+	 * Contructor.Inicializa el objeto asignando color de fondo. Considera que el objeto
+	 * GLine ya tiene su color asignado.
+	 * @param line Objeto l�nea
+	 * @param backgroundColor
+	 */
+	public DefaultGCanvas(Color backgroundColor) {
+		this.backgroundColor = backgroundColor;
+		addMouseListener(this);
+		addMouseMotionListener(this);
+	}
+	
+	public void addBorder(int x1, int y1, int x2, int y2) {
+		borderX1 += x1;
+		borderX2 += x2;
+		borderY1 += y1;
+		borderY2 += y2;
+	}
+	
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addValueChangedListener(IGCanvasListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeValueChangedListener(IGCanvasListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+	
+	/**
+	 * Invocar a los eventos asociados al componente
+	 */
+	public void callDataChanged(String key, Object value) {
+		Iterator<?> iterator = actionCommandListeners.iterator();
+		while (iterator.hasNext()) {
+			IGCanvasListener listener = (IGCanvasListener) iterator.next();
+			listener.actionDataChanged(new GCanvasEvent(this, key, value));
+		}
+	}
+	
+	/**
+	 * Invocar a los eventos asociados al componente
+	 */
+	public void callDataDragged(String key, Object value) {
+		Iterator<?> iterator = actionCommandListeners.iterator();
+		while (iterator.hasNext()) {
+			IGCanvasListener listener = (IGCanvasListener) iterator.next();
+			listener.actionDataDragged(new GCanvasEvent(this, key, value));
+		}
+	}
+	
+	/**
+	 * A�ade un elemento dibujable a la lista
+	 * @param element
+	 */
+	public void addDrawableElement(DrawableElement element) {
+		if (drawableElements.contains(element))
+			return;
+		element.setCanvas(this);
+		element.firstActions();
+		drawableElements.add(element);
+	}
+	
+	/**
+	 * Reemplaza un elemento dibujable si encuentra uno de su mismo tipo
+	 * @param element
+	 */
+	public void replaceDrawableElement(DrawableElement element) {
+		for (int i = 0; i < drawableElements.size(); i++) {
+			if (element.getClass().isAssignableFrom(drawableElements.get(i).getClass())) {
+				drawableElements.set(i, element);
+				element.setCanvas(this);
+				break;
+			}
+		}
+	}
+	
+	/**
+	 * Reemplaza un elemento dibujable si encuentra uno del tipo especificado en el 
+	 * parametro c1
+	 * @param element
+	 * @param c1
+	 */
+	public void replaceDrawableElement(DrawableElement element, Class<?> cl) {
+		for (int i = 0; i < drawableElements.size(); i++) {
+			if (cl.isInstance(drawableElements.get(i))) {
+				drawableElements.set(i, element);
+				element.setCanvas(this);
+				break;
+			}
+		}
+	}
+
+	/**
+	 * Obtiene todos los elementos dibujable que sean una instancia de c1
+	 * @param c1
+	 * @return ArrayList de DrawableElements
+	 */
+	public List<DrawableElement> getDrawableElements(Class<?> c1) {
+		ArrayList<DrawableElement> elements = new ArrayList<DrawableElement>();
+		for (int i = 0; i < drawableElements.size(); i++) {
+			if (c1.isInstance(drawableElements.get(i)))
+				elements.add(drawableElements.get(i));
+		}
+		return elements;
+	}
+	
+	/**
+	 * Elimina un elemento dibujable
+	 * @param Class clase del elemento a eliminar
+	 */
+	public void removeDrawableElement(Class<?> cl) {
+		for (int i = 0; i < drawableElements.size(); i++)
+			if (cl.isInstance(drawableElements.get(i)))
+				drawableElements.remove(i);
+	}
+	
+	/**
+	 * Asigna una lista de elementos dibujables
+	 * @return
+	 */
+	public void setDrawableElements(List<DrawableElement>  list) {
+		drawableElements.clear();
+		for (int i = 0; i < list.size(); i++)
+			if (list.get(i) instanceof DrawableElement)
+				drawableElements.add(list.get(i));
+		repaint();
+	}
+		
+	/**
+	 * Inicializa el fondo y dibuja el gr�fico sobre el canvas.
+	 */
+	public void paint(Graphics g) {
+		if (g == null) 
+			return;
+		g.setColor(backgroundColor);
+		g.fillRect(0, 0, getWidth(), getHeight());
+		for (int i = 0; i < drawableElements.size(); i++) 
+			((DrawableElement)drawableElements.get(i)).draw(g);
+	}
+	
+	/**
+	 * Ejecuta las acciones antes del primer dibujado de todos
+	 * los elementos dibujables
+	 */
+	public void execFirstDrawActions() {
+		for (int i = 0; i < drawableElements.size(); i++) 
+			((DrawableElement)drawableElements.get(i)).firstDrawActions();
+	}
+	
+	/**
+	 * Obtiene la posici�n m�nima en X del canvas donde comenzar a dibujar
+	 * @return
+	 */
+	public int getCanvasMinX() {
+		return borderX1;
+	}
+	
+	/**
+	 * Obtiene la posici�n m�nima en Y del canvas donde comenzar a dibujar
+	 * @return
+	 */
+	public int getCanvasMinY() {
+		return borderY1;
+	}
+	
+	/**
+	 * Obtiene la posici�n m�xima en X del canvas donde terminar el dibujado
+	 * @return
+	 */
+	public int getCanvasMaxX() {
+		return getWidth() - borderX2;
+	}
+	
+	/**
+	 * Obtiene la posici�n m�xima en Y del canvas donde terminar el dibujado
+	 * @return
+	 */
+	public int getCanvasMaxY() {
+		return getHeight() - borderY2;
+	}
+	
+	/**
+	 * Obtiene el ancho del canvas sumando a partir de getCanvasX donde termina el �rea de dibujo
+	 * @return
+	 */
+	public int getCanvasWidth() {
+		return getWidth() - (borderX1 + borderX2);
+	}
+	
+	/**
+	 * Obtiene el alto del canvas sumando a partir de getCanvasY donde termina el �rea de dibujo
+	 * @return
+	 */
+	public int getCanvasHeight() {
+		return getHeight() - (borderY1 + borderY2);
+	}
+
+	public void mousePressed(MouseEvent e) {
+		for (int i = drawableElements.size() - 1; i >= 0 ; i--)
+			if (!((DrawableElement) drawableElements.get(i)).mousePressed(e))
+				return;
+	}
+
+	public void mouseReleased(MouseEvent e) {
+		for (int i = drawableElements.size() - 1; i >= 0 ; i--)
+			if (!((DrawableElement) drawableElements.get(i)).mouseReleased(e))
+				return;
+		this.mouseMoved(e);
+	}
+
+	public void mouseDragged(MouseEvent e) {
+		for (int i = drawableElements.size() - 1; i >= 0 ; i--)
+			if (!((DrawableElement) drawableElements.get(i)).mouseDragged(e))
+				return;
+	}
+
+	public void mouseMoved(MouseEvent e) {
+		for (int i = drawableElements.size() - 1; i >= 0 ; i--)
+			if (!((DrawableElement) drawableElements.get(i)).mouseMoved(e))
+				return;
+		setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
+	}
+	
+	public void mouseEntered(MouseEvent e) {
+		hasMouse = true;
+		repaint();
+		for (int i = drawableElements.size() - 1; i >= 0 ; i--)
+			if (!((DrawableElement) drawableElements.get(i)).mouseEntered(e))
+				return;
+	}
+	
+	public void mouseExited(MouseEvent e) {
+		hasMouse = false;
+		repaint();
+		for (int i = drawableElements.size() - 1; i >= 0 ; i--)
+			if (!((DrawableElement) drawableElements.get(i)).mouseExited(e))
+				return;
+	}
+
+	/**
+	 * Devuelve si en ese momento el raton esta sobre el canvas
+	 * @return
+	 */
+	public boolean isMouse() {
+		return hasMouse;
+	}
+
+	public void mouseClicked(MouseEvent e) {}
+	
+	public DrawableElement createBorderLayerForGCanvas(Color color) {
+		return new Border(color);
+	}
+	
+	public InfoLayer createInfoLayerForGCanvas(Color colorLayer) {
+		return new DefaultInfoLayer(colorLayer);
+	}
+	
+	public GraphicHistogram createHistogramForGCanvas(double[] data, Color color) {
+		return new DefaultGraphicHistogram(data, color);
+	}
+	
+	public MinMaxLines createMinMaxLinesForGCanvas(Color color) {
+		return new DefaultMinMaxLines(color);
+	}
+	
+	public StraightLine createStraightLineForGCanvas(Color color) {
+		return new DefaultStraightLine(color);
+	}
+	
+    public LogaritmicExponentialLine createLogaritmicExponentialLineForGCanvas(Color color, double point) {
+    	return new DefaultLogaritmicExponentialLine(color, point);
+    }
+    
+    public SquareRootPowLine createSquareRootPowLineForGCanvas(Color color, double point) {
+    	return new DefaultSquareRootPowLine(color, point);
+    }
+    
+    public DensitySlicingLine createDensitySliceForGCanvas(Color color, int levels) {
+    	return new DefaultDensitySlicingLine(color, levels);
+    }
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/images/forward.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/images/forward.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/images/backward.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/images/backward.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/MainInfoByPointPanelImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/MainInfoByPointPanelImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/MainInfoByPointPanelImpl.java	(revision 15423)
@@ -0,0 +1,156 @@
+/* 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.swing.impl.tool.infobypoint;
+
+import java.awt.Component;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionListener;
+import java.util.HashMap;
+import java.util.Observable;
+
+import javax.swing.ImageIcon;
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
+import org.gvsig.raster.swing.infobypoint.MainInfoByPointPanel;
+import org.gvsig.raster.swing.pixelinspector.PixelInspector;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class MainInfoByPointPanelImpl extends JPanel implements MainInfoByPointPanel {
+	private static final long           serialVersionUID        = 1L;
+	private HashMap<String, String>     tr                      = null;
+	private HashMap<String, ImageIcon>  icons                   = null;
+	private DefaultInfoByPointDataModel dataModel               = null;
+	private PixelInspectorPanel         pixelInspectorPanel     = null;
+	private InfoByPointPanel            infoByPointPanel        = null;
+	private ButtonsPanel                buttonsPanel            = null;
+	private JPanel                      extended                = null;
+	
+	public MainInfoByPointPanelImpl(
+			HashMap<String, String> translations, 
+			HashMap<String, ImageIcon> icons,
+			JPanel extended) {
+		tr = translations;
+		if(tr == null || tr.get("layer_list") == null) {
+			tr = new HashMap<String, String>();
+			tr.put("layer_list", "layer_list");
+			tr.put("band_values", "band_values");
+			tr.put("pixel_point", "pixel_point");
+			tr.put("view_point", "view_point");
+			tr.put("world_point", "world_point");
+			tr.put("bands", "bands");
+			tr.put("colors", "colors");
+			tr.put("coords", "coords");
+			tr.put("lat", "lat");
+			tr.put("long", "long");
+		}
+		this.icons = icons;
+		if(this.icons == null) {
+			this.icons = new HashMap<String, ImageIcon>();
+			this.icons.put("forward-icon", new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/forward-icon.png", ""));
+			this.icons.put("backward-icon", new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/backward-icon.png", ""));
+		}
+		this.extended = extended;
+		init();
+	}
+	
+	private void init() {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+
+		if(extended == null) {
+			gbc.fill = GridBagConstraints.BOTH;
+			gbc.weightx = 1;
+			gbc.weighty = 1;
+		} else {
+			//gbc.anchor = GridBagConstraints.WEST;
+			gbc.fill = GridBagConstraints.VERTICAL;
+			gbc.weighty = 1;
+		}
+		gbc.insets = new java.awt.Insets(2, 2, 2, 2);
+		add((Component)getPixelInspectorPanel(), gbc);
+
+		if(extended == null) {
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			gbc.weightx = 1;
+			gbc.weighty = 0;
+		} else {
+			gbc.fill = GridBagConstraints.NONE;
+			gbc.weighty = 0;
+		}
+		
+		gbc.gridy = 1;
+		add(getinfoByPointPanel(), gbc);
+		
+		if(extended != null) {
+			gbc.insets = new java.awt.Insets(0, 6, 0, 6);
+			gbc.gridy = 2;
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			add(getButtonsPanel(), gbc);
+			
+			gbc.gridx = 1;
+			gbc.gridy = 0;
+			gbc.gridheight = 3;
+			gbc.insets = new java.awt.Insets(0, 0, 0, 0);
+			gbc.fill = GridBagConstraints.BOTH;
+			gbc.weightx = 1;
+			gbc.weighty = 1;
+			//extended.setBorder(BorderFactory.createLineBorder(Color.red));
+			add(extended, gbc);
+		}
+	}
+	
+	public InfoByPointDataModel getInfoByPointDataModel() {
+		if(dataModel == null)
+			dataModel = new DefaultInfoByPointDataModel();
+		return dataModel;
+	}
+	
+	public PixelInspector getPixelInspectorPanel() {
+		if(pixelInspectorPanel == null)
+			pixelInspectorPanel = new PixelInspectorPanel(tr);
+		return pixelInspectorPanel;
+	}
+	
+	public InfoByPointPanel getinfoByPointPanel() {
+		if(infoByPointPanel == null)
+			infoByPointPanel = new InfoByPointPanel(tr, getInfoByPointDataModel());
+		return infoByPointPanel;
+	}
+	
+	public ButtonsPanel getButtonsPanel() {
+		if(buttonsPanel == null)
+			buttonsPanel = new ButtonsPanel(icons);
+		return buttonsPanel;
+	}
+	
+	public void addListenerExtendedButton(ActionListener listener) {
+		getButtonsPanel().getExtendedButton().addActionListener(listener);
+	}
+	
+	public void update(Observable o, Object arg) {
+		getinfoByPointPanel().updateDataModel();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/MainInfoByPointPanelImpl.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelInspectorPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelInspectorPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelInspectorPanel.java	(revision 15423)
@@ -0,0 +1,343 @@
+/* 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.swing.impl.tool.infobypoint;
+
+import java.awt.Color;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.awt.geom.AffineTransform;
+import java.awt.image.BufferedImage;
+import java.util.HashMap;
+
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JMenuItem;
+import javax.swing.JPanel;
+import javax.swing.JPopupMenu;
+import javax.swing.event.PopupMenuEvent;
+import javax.swing.event.PopupMenuListener;
+
+import org.gvsig.raster.swing.pixelinspector.PixelInspector;
+
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PixelInspectorPanel extends JPanel implements MouseListener, PixelInspector {
+	final private static long      serialVersionUID = -3370601314380922368L;
+	private JPopupMenu             menu = null;
+	/**
+	 * Ancho y alto de la ventana
+	 */
+	private int                    w = 0;
+	private int                    h = 0;
+	/**
+	 * Posici�n de la ventana en X y en Y
+	 */
+	//private int                    posWindowX = 0;
+	//private int                    posWindowY = 0;
+	/**
+	 * Escala del zoom
+	 */
+	private int                    scale = 8;
+	/**
+	 * Vista asociada al inspector de pixels
+	 */
+	public BufferedImage            img = null;
+	/**
+	 * Posici�n en X e Y donde se comienza a dibujar dentro del inspector de pixeles
+	 */
+	private int						posX = 0;
+	private int						posY = 0;
+	/**
+	 * Posici�n del pixel en X e Y en relaci�n a las coordenadas del buffer de la vista
+	 */
+	public int                      pixX = 0;
+	public int                      pixY = 0;
+	/**
+	 * Valores RGB del pixel seleccionado
+	 */    
+	int                             red = 0, green = 0, blue = 0;
+	private boolean					clear = false;
+	private Color					color = Color.red;
+	private JCheckBoxMenuItem[] 	entry = new JCheckBoxMenuItem[6];
+	private HashMap<String, String>            
+                                    tr                      = null;
+	/**
+	 * Constructor de la ventana de dialogo para gvSIG.
+	 */
+	public PixelInspectorPanel(HashMap<String, String> translations) {
+		tr = translations;
+		if(tr == null || tr.get("layer_list") == null) {
+			tr = new HashMap<String, String>();
+			tr.put("green", "green");
+			tr.put("red", "red");
+			tr.put("blue", "blue");
+		}
+		
+		addMouseListener(this);
+
+		initMenu();
+	}
+
+	public void setViewCoordinates(int pixX, int pixY) {
+		this.pixX = pixX;
+		this.pixY = pixY;
+	}
+
+	/**
+	 * 
+	 * @param clear
+	 */
+	public void setClear(boolean clear) {
+		this.clear = clear;
+	}
+
+	/**
+	 * Inicializa el men� contextual con las opciones de selecci�n del 
+	 * zoom.
+	 */
+	private void initMenu() {
+		menu = new JPopupMenu();
+		PopupMenuListener lis = new PopupMenuListener() {
+			public void popupMenuCanceled( PopupMenuEvent evt ) {
+				clear = true;
+				repaint();
+			}
+
+			public void popupMenuWillBecomeInvisible(PopupMenuEvent e) {
+			}
+
+			public void popupMenuWillBecomeVisible(PopupMenuEvent e) {
+			}
+		};
+		menu.addPopupMenuListener(lis);
+
+		ActionListener al = new ActionListener() {
+			public void actionPerformed( ActionEvent evt ){
+				String txt = ((JMenuItem)evt.getSource()).getText();
+				if(txt.compareTo("X4") == 0) {
+					scale = 4;
+					for (int i = 1; i <= 3; i++) 
+						entry[i].setSelected(false);	
+					entry[0].setSelected(true);
+				}
+				if(txt.compareTo("X8") == 0) {
+					scale = 8;
+					entry[0].setSelected(false);
+					entry[1].setSelected(true);
+					entry[2].setSelected(false);
+					entry[3].setSelected(false);
+				}
+				if(txt.compareTo("X16") == 0) {
+					scale = 16;
+					entry[0].setSelected(false);
+					entry[1].setSelected(false);
+					entry[2].setSelected(true);
+					entry[3].setSelected(false);
+				}
+				if(txt.compareTo("X32") == 0) {
+					scale = 32;
+					for (int i = 0; i < 3; i++) 
+						entry[i].setSelected(false);	
+					entry[3].setSelected(true);
+				}
+				if(txt.compareTo(tr.get("green")) == 0) {
+					color = Color.GREEN;
+					entry[4].setSelected(false);
+					entry[5].setSelected(true);
+				}
+				if(txt.compareTo(tr.get("red")) == 0) {
+					color = Color.RED;
+					entry[4].setSelected(true);
+					entry[5].setSelected(false);
+				}
+			}
+		};
+
+		entry[0] = new JCheckBoxMenuItem( "X4" );
+		entry[0].addActionListener( al );
+		menu.add(entry[0]);
+		entry[1] = new JCheckBoxMenuItem( "X8" );
+		entry[1].setSelected(true);
+		entry[1].addActionListener( al );
+		menu.add(entry[1]);
+		entry[2] = new JCheckBoxMenuItem( "X16" );
+		entry[2].addActionListener( al );
+		menu.add(entry[2]);
+		entry[3] = new JCheckBoxMenuItem( "X32" );
+		entry[3].addActionListener( al );
+		menu.add(entry[3]);
+		entry[4] = new JCheckBoxMenuItem(tr.get("red") );
+		entry[4].addActionListener( al );
+		entry[4].setSelected(true);
+		menu.add(entry[4]);
+		entry[5] = new JCheckBoxMenuItem(tr.get("green") );
+		entry[5].addActionListener( al );
+		menu.add(entry[5]);
+	}
+
+	/**
+	 * Obtiene el buffer de la vista activa y lo dibuja sobre el panel
+	 * con los datos de escala y desplazamiento seleccionados.
+	 */
+	protected void paintComponent(Graphics g) {
+		w = getVisibleRect().width;
+		h = getVisibleRect().height;
+
+		if(clear) {
+			g.setColor(Color.BLACK);
+			g.fillRect(0, 0, w, h);
+			return;
+		}
+
+		if(img != null) {
+			int sizeCrux = 10;
+			
+			//Obtenemos valores RGB del Image
+			int value = 0;
+			try {
+				value = img.getRGB(pixX, pixY);
+			} catch (ArrayIndexOutOfBoundsException e) {
+
+			}
+			red = ((value & 0x00ff0000) >> 16);
+			green = ((value & 0x0000ff00) >> 8);
+			blue = (value & 0x000000ff);
+
+			//Dibujamos el graphics con el zoom
+			g.setColor(Color.BLACK);
+			g.fillRect(0, 0, w, h);
+			((Graphics2D)g).scale(scale, scale);
+			g.drawImage(img, posX, posY , this);
+			((Graphics2D)g).setTransform(new AffineTransform());
+
+			//Dibujamos la informaci�n RGB y la cruz
+			g.setXORMode(Color.WHITE);
+			g.setColor(color);
+			int middleW = w >> 1;
+			int middleH = h >> 1;
+			g.drawLine(middleW - sizeCrux, middleH, middleW + sizeCrux, middleH);
+			g.drawLine(middleW, middleH - sizeCrux, middleW , middleH + sizeCrux);
+			//g.drawString(red + "," + green + "," + blue, w - 85, h - 3);
+		}
+	}
+
+	/**
+	 * Asigna el zoom de la vista sobre el inspector de pixels
+	 * @param scale Escala
+	 */
+	public void setScale(int scale) {
+		this.scale = scale;
+	}
+
+	/**
+	 * Asigna la posici�n en X del control donde se empieza a dibujar
+	 * @param posX posici�n X del Graphics donde se empieza a dibujar
+	 */
+	public void setPosX(int posX) {
+		this.posX = posX;
+	}
+
+	/**
+	 * Asigna la posici�n en Y del control donde se empieza a dibujar
+	 * @param posY posici�n Y del Graphics donde se empieza a dibujar
+	 */
+	public void setPosY(int posY) {
+		this.posY = posY;
+	}
+
+	/**
+	 * Obtiene el factor de escala
+	 * @return 
+	 */
+	public int getScale() {
+		return scale;
+	}
+
+	/**
+	 * Obtiene la vista asociada al inspector de pixeles
+	 * @return IView
+	 */
+	public BufferedImage getDataBuffer() {
+		return img;
+	}
+
+	/**
+	 * Asigna la vista asociada al inspector de pixeles
+	 * @param IView
+	 */
+	public void setDataBuffer(BufferedImage img) {
+		this.img = img;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mouseClicked(java.awt.event.MouseEvent)
+	 */
+	public void mouseClicked(MouseEvent e) {
+		clear = true;
+		repaint();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mouseEntered(java.awt.event.MouseEvent)
+	 */
+	public void mouseEntered(MouseEvent e) {
+		clear = true;
+		repaint();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mouseExited(java.awt.event.MouseEvent)
+	 */
+	public void mouseExited(MouseEvent e) {
+		clear = true;
+		repaint();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public void mousePressed(MouseEvent e) {
+		if(e.getButton() == MouseEvent.BUTTON3) {
+			menu.show( e.getComponent(), e.getX(), e.getY() );
+			clear = true;
+			repaint();
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
+	 */
+	public void mouseReleased(MouseEvent e) {
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelInspectorPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelViewInfoPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelViewInfoPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelViewInfoPanel.java	(revision 15423)
@@ -0,0 +1,265 @@
+/* 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.swing.impl.tool.infobypoint;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.text.DecimalFormat;
+import java.util.HashMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListModel;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+
+public class PixelViewInfoPanel extends JPanel {
+	private static final long    serialVersionUID        = 1L;
+	private HashMap<String, String>            
+	                             tr                      = null;
+	private JList                jListBandValues         = null;
+	private JLabel               jLabelHSLPoint          = null;
+	private JLabel               jLabelCMKYPoint         = null;
+	private JLabel               jLabelRGBPoint          = null;
+	private JLabel               jLabelPixelPoint        = null;
+	private JLabel               jLabelViewPoint         = null;
+	private JLabel               jLabelLatitudePoint     = null;
+	private JLabel               jLabelLongitudPoint     = null;
+	private JLabel               jLabelNumberOfBands     = null;
+	
+	private JPanel               jPanelCoordinates       = null;
+	private JPanel               jPanelColors            = null;
+	private JPanel               jPanelBands             = null;
+	private DefaultInfoByPointDataModel dataModel              = null;
+	
+	public PixelViewInfoPanel(HashMap<String, String> translations, DefaultInfoByPointDataModel dataModel) {
+		tr = translations;
+		if(tr == null || tr.get("layer_list") == null) {
+			tr = new HashMap<String, String>();
+			tr.put("layer_list", "layer_list");
+			tr.put("band_values", "band_values");
+			tr.put("pixel_point", "pixel_point");
+			tr.put("view_point", "view_point");
+			tr.put("world_point", "world_point");
+			tr.put("bands", "bands");
+			tr.put("colors", "colors");
+			tr.put("coords", "coords");
+			tr.put("lat", "lat");
+			tr.put("long", "long");
+		}
+		this.dataModel = dataModel;
+		init();
+	}
+	
+	private void init() {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.anchor = GridBagConstraints.WEST;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1;
+		gbc.insets = new java.awt.Insets(1, 2, 1, 2);
+		add(getJPanelCoordinates(), gbc);
+		
+		gbc.gridy = 1;
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.weighty = 1;
+		add(getJPanelBands(), gbc);
+		
+		gbc.gridy = 2;
+		gbc.weighty = 0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		add(getJPanelColors(), gbc);
+	}
+	
+	public JPanel getJPanelBands() {
+		if(jPanelBands == null) {
+			jPanelBands = new JPanel();
+			jPanelBands.setBorder(BorderFactory.createTitledBorder(tr.get("bands")));
+			jPanelBands.setLayout(new GridBagLayout());
+			GridBagConstraints gbc = new GridBagConstraints();
+			gbc.gridx = 0;
+			gbc.gridy = 0;
+			gbc.anchor = GridBagConstraints.WEST;
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			gbc.weightx = 1;
+			gbc.insets = new java.awt.Insets(1, 2, 1, 2);
+			
+			jPanelBands.add(getJLabelNumberOfBands(), gbc);
+			gbc.gridy = 1;
+			gbc.gridheight = 2;
+			gbc.fill = GridBagConstraints.BOTH;
+			gbc.weighty = 1;
+			JScrollPane listScroller = new JScrollPane(getJListValues());
+			jPanelBands.add(listScroller, gbc);
+		}
+		return jPanelBands;
+	}
+
+	public JPanel getJPanelColors() {
+		if(jPanelColors == null) {
+			jPanelColors = new JPanel();
+			jPanelColors.setBorder(BorderFactory.createTitledBorder(tr.get("colors")));
+			jPanelColors.setLayout(new GridBagLayout());
+			GridBagConstraints gbc = new GridBagConstraints();
+			gbc.gridx = 0;
+			gbc.gridy = 0;
+			gbc.anchor = GridBagConstraints.WEST;
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			gbc.weightx = 1;
+			gbc.insets = new java.awt.Insets(1, 2, 2, 2);
+			
+			jPanelColors.add(getJLabelRGBPoint(), gbc);
+			gbc.gridy = 1;
+			jPanelColors.add(getJLabelCMKYPoint(), gbc);
+			gbc.gridy = 2;
+			jPanelColors.add(getJLabelHSLPoint(), gbc);
+		}
+		return jPanelColors;
+	}
+
+	public JPanel getJPanelCoordinates() {
+		if(jPanelCoordinates == null) {
+			jPanelCoordinates = new JPanel();
+			jPanelCoordinates.setLayout(new GridBagLayout());
+			jPanelCoordinates.setBorder(BorderFactory.createTitledBorder(tr.get("coords")));
+			GridBagConstraints gbc = new GridBagConstraints();
+			gbc.gridx = 0;
+			gbc.gridy = 0;
+			gbc.anchor = GridBagConstraints.WEST;
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			gbc.weightx = 1;
+			gbc.insets = new java.awt.Insets(1, 2, 2, 2);
+			
+			gbc.gridy = 1;
+			jPanelCoordinates.add(getJLabelLatitudePoint(), gbc);
+			gbc.gridy = 2;
+			jPanelCoordinates.add(getJLabelLongitudPoint(), gbc);
+			gbc.gridy = 3;
+			jPanelCoordinates.add(getJLabelViewPoint(), gbc);
+			gbc.gridy = 4;
+			jPanelCoordinates.add(getJLabelPixelPoint(), gbc);
+		}
+		return jPanelCoordinates;
+	}
+
+	private JList getJListValues() {
+		if(jListBandValues == null) {
+			jListBandValues = new JList();
+		}
+		return jListBandValues;
+	}
+
+	private JLabel getJLabelHSLPoint() {
+		if(jLabelHSLPoint == null)
+			jLabelHSLPoint = new JLabel("HSL: ");
+		return jLabelHSLPoint;
+	}
+
+	private JLabel getJLabelCMKYPoint() {
+		if(jLabelCMKYPoint == null)
+			jLabelCMKYPoint = new JLabel("CMYK: ");
+		return jLabelCMKYPoint;
+	}
+
+	private JLabel getJLabelRGBPoint() {
+		if(jLabelRGBPoint == null)
+			jLabelRGBPoint = new JLabel("RGB: " );
+		return jLabelRGBPoint;
+	}
+
+	private JLabel getJLabelPixelPoint() {
+		if(jLabelPixelPoint == null)
+			jLabelPixelPoint = new JLabel();
+		return jLabelPixelPoint;
+	}
+
+	private JLabel getJLabelViewPoint() {
+		if(jLabelViewPoint == null)
+			jLabelViewPoint = new JLabel();
+		return jLabelViewPoint;
+	}
+	
+	private JLabel getJLabelLatitudePoint() {
+		if(jLabelLatitudePoint == null)
+			jLabelLatitudePoint = new JLabel();
+		return jLabelLatitudePoint;
+	}
+	
+	private JLabel getJLabelLongitudPoint() {
+		if(jLabelLongitudPoint == null)
+			jLabelLongitudPoint = new JLabel();
+		return jLabelLongitudPoint;
+	}
+
+	private JLabel getJLabelNumberOfBands() {
+		if(jLabelNumberOfBands == null)
+			jLabelNumberOfBands = new JLabel();
+		return jLabelNumberOfBands;
+	}
+
+	public void updateDataModel() {
+		Double nanObj = new Double(Double.NaN);
+		DecimalFormat df2 = new DecimalFormat("#.##");
+		DecimalFormat df4 = new DecimalFormat("#.####");
+		getJLabelNumberOfBands().setText(tr.get("bands") + ": " + dataModel.bands);
+		
+		String y = (!new Double(dataModel.worldPoint.getY()).equals(nanObj)) ? df2.format(dataModel.worldPoint.getY()) : "NaN";
+		getJLabelLatitudePoint().setText(tr.get("lat") + ": " + y);
+		
+		String x = (!new Double(dataModel.worldPoint.getY()).equals(nanObj)) ? df2.format(dataModel.worldPoint.getX()) : "NaN";
+		getJLabelLongitudPoint().setText(tr.get("long") + ": " + x);
+		
+		y = (!new Double(dataModel.viewPoint.getY()).equals(nanObj)) ? df2.format(dataModel.viewPoint.getY()) : "NaN";
+		x = (!new Double(dataModel.viewPoint.getY()).equals(nanObj)) ? df2.format(dataModel.viewPoint.getX()) : "NaN";
+		getJLabelViewPoint().setText(tr.get("view_point") + ": (" + x + ", " + y + ")");
+		
+		y = (!new Double(dataModel.pixelPoint.getY()).equals(nanObj)) ? df2.format(dataModel.pixelPoint.getY()) : "NaN";
+		x = (!new Double(dataModel.pixelPoint.getY()).equals(nanObj)) ? df2.format(dataModel.pixelPoint.getX()) : "NaN";
+		getJLabelPixelPoint().setText(tr.get("pixel_point") + ": (" + x + ", " + y + ")");
+		
+		getJLabelRGBPoint().setText("RGB: " + dataModel.rgb[0] + ", " + 
+											dataModel.rgb[1] + ", " + 
+											dataModel.rgb[2]);
+		getJLabelHSLPoint().setText("HSL: " + df4.format(dataModel.hsl[0]) + ", " + 
+											df4.format(dataModel.hsl[1]) + ", " + 
+											df4.format(dataModel.hsl[2]));
+		getJLabelCMKYPoint().setText("CMYK: " + df4.format(dataModel.cmyk[0]) + ", " + 
+											df4.format(dataModel.cmyk[1]) + ", " + 
+											df4.format(dataModel.cmyk[2]) + ", " +
+											df4.format(dataModel.cmyk[3]));
+		
+		DefaultListModel listModel = null;
+		if(getJListValues().getModel() == null || !(getJListValues().getModel() instanceof DefaultListModel))
+			listModel = new DefaultListModel();
+		else
+			listModel = (DefaultListModel)getJListValues().getModel();
+		listModel.clear();
+		for (int i = 0; i < dataModel.bandsValues.size(); i++) {
+			listModel.addElement("B" + i + ": " + dataModel.bandsValues.get(i));	
+		}
+		if(getJListValues().getModel() == null || !(getJListValues().getModel() instanceof DefaultListModel))
+			getJListValues().setModel(listModel);
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/PixelViewInfoPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/ButtonsPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/ButtonsPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/ButtonsPanel.java	(revision 15423)
@@ -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.swing.impl.tool.infobypoint;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.HashMap;
+
+import javax.swing.Icon;
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ButtonsPanel extends JPanel implements ActionListener {
+	private static final long  serialVersionUID = 1L;
+	private static int         BUTTON_SIZE      = 26;
+	private JButton            extendedButton   = null;
+	private Icon               icon1            = null;
+	private Icon               icon2            = null;
+	
+	public ButtonsPanel(HashMap<String, ImageIcon> icons) {
+		try {
+			icon1 = icons.get("forward-icon");
+			icon2 = icons.get("backward-icon");
+		} catch (NullPointerException e) {
+		}
+		init();
+	}
+	
+	private void init() {
+		FlowLayout ly = new FlowLayout();
+		setLayout(ly);
+		ly.setHgap(0);
+		ly.setVgap(0);
+		ly.setAlignment(FlowLayout.RIGHT);
+		//setBorder(BorderFactory.createLineBorder(Color.blue));
+		add(getExtendedButton());
+	}
+	
+	public JButton getExtendedButton() {
+		if(extendedButton == null) {
+			extendedButton = new JButton(icon1);
+			extendedButton.setPreferredSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
+			extendedButton.addActionListener(this);
+		}
+		return extendedButton;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getExtendedButton()) {
+			if(getExtendedButton().getIcon() == icon1)
+				getExtendedButton().setIcon(icon2);
+			else
+				getExtendedButton().setIcon(icon1);
+		}
+		
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/ButtonsPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/DefaultInfoByPointDataModel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/DefaultInfoByPointDataModel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/DefaultInfoByPointDataModel.java	(revision 15423)
@@ -0,0 +1,115 @@
+/* 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.swing.impl.tool.infobypoint;
+
+import java.awt.geom.Point2D;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Observable;
+
+import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
+
+public class DefaultInfoByPointDataModel extends Observable implements InfoByPointDataModel {
+	private static final int   LONG_STRING             = 26;
+	public int                 bands                   = 0;
+	public List<Double>        bandsValues             = new ArrayList<Double>();
+	public Point2D             pixelPoint              = new Point2D.Double();
+	public Point2D             worldPoint              = new Point2D.Double();
+	public Point2D             viewPoint               = new Point2D.Double();
+	public int[]               rgb                     = new int[3];
+	public double[]            cmyk                    = new double[4];
+	public double[]            hsl                     = new double[3];
+	public List<String>        layers                  = null;
+	public boolean             projected               = true;
+	
+	public DefaultInfoByPointDataModel() {
+		setARGB(0, 0, 0);
+		setCMYK(new double[]{0, 0, 0, 0});
+		setHSL(0, 0, 0);
+		setBandValues(new double[]{Double.NaN});
+		setNumberOfBands(0);
+		setPixelPoint(-1, -1);
+		setViewPoint(Double.NaN, Double.NaN);
+		setWorldPoint(Double.NaN, Double.NaN);
+		List<String> list = new ArrayList<String>();
+		list.add("...");
+		setLayerList(list);
+	}
+	
+	public void setProjected(boolean projected) {
+		this.projected = projected;
+	}
+	
+	public void setBandValues(double[] list) {
+		bandsValues.clear();
+		for (int i = 0; i < list.length; i++) {
+			bandsValues.add(list[i]);
+		}
+	}
+	
+	public void setNumberOfBands(int n) {
+		this.bands = n;
+	}
+	
+	public void setLayerList(List<String> list) {
+		layers = list;
+	}
+	
+	public void setARGB(int r, int g, int b) {
+		rgb[0] = r;
+		rgb[1] = g;
+		rgb[2] = b;
+	}
+	
+	public void setCMYK(double[] cmyk) {
+		this.cmyk = cmyk;
+	}
+	
+	public void setHSL(double h, double s, double l) {
+		hsl[0] = h;
+		hsl[1] = s;
+		hsl[2] = l;
+	}
+	
+	public void setPixelPoint(double x, double y) {
+		pixelPoint.setLocation(x, y);
+	}
+	
+	public void setWorldPoint(double x, double y) {
+		worldPoint.setLocation(x, y);
+	}
+	
+	public void setViewPoint(double x, double y) {
+		viewPoint.setLocation(x, y);
+	}
+	
+	public String getFormatedLayerName(int i) {
+		if(LONG_STRING < layers.get(i).length())
+			return "..." + layers.get(i).substring(layers.get(i).length() - LONG_STRING, layers.get(i).length());
+		return layers.get(i);
+	}
+	
+	public void notifyObservers() {
+		setChanged();
+		super.notifyObservers();
+	}
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/DefaultInfoByPointDataModel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/InfoByPointPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/InfoByPointPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/InfoByPointPanel.java	(revision 15423)
@@ -0,0 +1,306 @@
+/* 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.swing.impl.tool.infobypoint;
+
+import java.awt.BorderLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.text.DecimalFormat;
+import java.text.DecimalFormatSymbols;
+import java.util.HashMap;
+
+import javax.swing.BorderFactory;
+import javax.swing.DefaultListModel;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JList;
+import javax.swing.JPanel;
+import javax.swing.JScrollPane;
+import javax.swing.JTextField;
+
+import org.gvsig.raster.swing.infobypoint.InfoByPointDataModel;
+
+public class InfoByPointPanel extends JPanel implements ActionListener {
+	private static final long    serialVersionUID        = 1L;
+	private HashMap<String, String>
+	                             tr                      = null;
+	private JList                jListBandValues         = null;
+	private JLabel               jLabelHSLPoint          = null;
+	private JLabel               jLabelCMKYPoint         = null;
+	private JLabel               jLabelRGBPoint          = null;
+	private JLabel               jLabelPixelPoint        = null;
+	private JLabel               jLabelViewPoint         = null;
+	private JLabel               jLabelLatitudePoint     = null;
+	private JLabel               jLabelLongitudPoint     = null;
+	private JLabel               jLabelNumberOfBands     = null;
+	private JTextField           jTextBoxLayerSelected   = null;
+	private JComboBox            jComboListLayer         = null;
+
+	private JPanel               jPanelLayerNames        = null;
+	private JPanel               jPanelCoordinates       = null;
+	private JPanel               jPanelColors            = null;
+	private JPanel               jPanelBands             = null;
+	private DefaultInfoByPointDataModel
+	                             dataModel              = null;
+
+	public InfoByPointPanel(HashMap<String, String> translations, InfoByPointDataModel dataModel) {
+		tr = translations;
+		if(tr == null || tr.get("layer_list") == null) {
+			tr = new HashMap<String, String>();
+			tr.put("layer_list", "layer_list");
+			tr.put("band_values", "band_values");
+			tr.put("pixel_point", "pixel_point");
+			tr.put("view_point", "view_point");
+			tr.put("world_point", "world_point");
+			tr.put("bands", "bands");
+			tr.put("colors", "colors");
+			tr.put("coords", "coords");
+			tr.put("lat", "lat");
+			tr.put("long", "long");
+		}
+		this.dataModel = (DefaultInfoByPointDataModel)dataModel;
+		init();
+	}
+
+	private void init() {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1;
+		gbc.insets = new java.awt.Insets(1, 2, 1, 2);
+		add(getJPanelLayerNames(), gbc);
+
+		gbc.gridy = 1;
+		add(getJPanelCoordinates(), gbc);
+
+		gbc.gridy = 2;
+		add(getJPanelBands(), gbc);
+
+		gbc.gridy = 3;
+		add(getJPanelColors(), gbc);
+	}
+
+	public JPanel getJPanelLayerNames() {
+		if(jPanelLayerNames == null) {
+			jPanelLayerNames = new JPanel();
+			jPanelLayerNames.setBorder(BorderFactory.createTitledBorder(tr.get("layer_list")));
+			jPanelLayerNames.setLayout(new BorderLayout());
+
+			jPanelLayerNames.add(getJComboListLayer(), BorderLayout.CENTER);
+		}
+		return jPanelLayerNames;
+	}
+
+	public JPanel getJPanelBands() {
+		if(jPanelBands == null) {
+			jPanelBands = new JPanel();
+			jPanelBands.setBorder(BorderFactory.createTitledBorder(tr.get("bands")));
+			jPanelBands.setLayout(new BorderLayout());
+			jPanelBands.add(getJLabelNumberOfBands(), BorderLayout.NORTH);
+			JScrollPane listScroller = new JScrollPane(getJListValues());
+			//listScroller.setMinimumSize(new Dimension(0, 35));
+			//listScroller.setMaximumSize(new Dimension(0, 35));
+			//listScroller.setPreferredSize(new Dimension(0, 35));
+			jPanelBands.add(listScroller, BorderLayout.CENTER);
+		}
+		return jPanelBands;
+	}
+
+	public JPanel getJPanelColors() {
+		if(jPanelColors == null) {
+			jPanelColors = new JPanel();
+			jPanelColors.setBorder(BorderFactory.createTitledBorder(tr.get("colors")));
+			jPanelColors.setLayout(new GridBagLayout());
+			GridBagConstraints gbc = new GridBagConstraints();
+			gbc.gridx = 0;
+			gbc.gridy = 0;
+			gbc.anchor = GridBagConstraints.WEST;
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			gbc.weightx = 1;
+			gbc.insets = new java.awt.Insets(1, 2, 2, 2);
+
+			jPanelColors.add(getJLabelRGBPoint(), gbc);
+			gbc.gridy = 1;
+			jPanelColors.add(getJLabelCMKYPoint(), gbc);
+			gbc.gridy = 2;
+			jPanelColors.add(getJLabelHSLPoint(), gbc);
+		}
+		return jPanelColors;
+	}
+
+	public JPanel getJPanelCoordinates() {
+		if(jPanelCoordinates == null) {
+			jPanelCoordinates = new JPanel();
+			jPanelCoordinates.setLayout(new GridBagLayout());
+			jPanelCoordinates.setBorder(BorderFactory.createTitledBorder(tr.get("coords")));
+			GridBagConstraints gbc = new GridBagConstraints();
+			gbc.gridx = 0;
+			gbc.gridy = 0;
+			gbc.anchor = GridBagConstraints.WEST;
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			gbc.weightx = 1;
+			gbc.insets = new java.awt.Insets(1, 2, 2, 2);
+
+			gbc.gridy = 1;
+			jPanelCoordinates.add(getJLabelLatitudePoint(), gbc);
+			gbc.gridy = 2;
+			jPanelCoordinates.add(getJLabelLongitudPoint(), gbc);
+			gbc.gridy = 3;
+			jPanelCoordinates.add(getJLabelViewPoint(), gbc);
+			gbc.gridy = 4;
+			jPanelCoordinates.add(getJLabelPixelPoint(), gbc);
+		}
+		return jPanelCoordinates;
+	}
+
+	private JList getJListValues() {
+		if(jListBandValues == null) {
+			jListBandValues = new JList();
+			//jListBandValues.setPreferredSize(new Dimension(0, 35));
+		}
+		return jListBandValues;
+	}
+
+	private JLabel getJLabelHSLPoint() {
+		if(jLabelHSLPoint == null)
+			jLabelHSLPoint = new JLabel("HSL: ");
+		return jLabelHSLPoint;
+	}
+
+	private JLabel getJLabelCMKYPoint() {
+		if(jLabelCMKYPoint == null)
+			jLabelCMKYPoint = new JLabel("CMYK: ");
+		return jLabelCMKYPoint;
+	}
+
+	private JLabel getJLabelRGBPoint() {
+		if(jLabelRGBPoint == null)
+			jLabelRGBPoint = new JLabel("RGB: " );
+		return jLabelRGBPoint;
+	}
+
+	private JLabel getJLabelPixelPoint() {
+		if(jLabelPixelPoint == null)
+			jLabelPixelPoint = new JLabel();
+		return jLabelPixelPoint;
+	}
+
+	private JLabel getJLabelViewPoint() {
+		if(jLabelViewPoint == null)
+			jLabelViewPoint = new JLabel();
+		return jLabelViewPoint;
+	}
+
+	private JLabel getJLabelLatitudePoint() {
+		if(jLabelLatitudePoint == null)
+			jLabelLatitudePoint = new JLabel();
+		return jLabelLatitudePoint;
+	}
+
+	private JLabel getJLabelLongitudPoint() {
+		if(jLabelLongitudPoint == null)
+			jLabelLongitudPoint = new JLabel();
+		return jLabelLongitudPoint;
+	}
+
+	private JLabel getJLabelNumberOfBands() {
+		if(jLabelNumberOfBands == null)
+			jLabelNumberOfBands = new JLabel();
+		return jLabelNumberOfBands;
+	}
+
+	@SuppressWarnings("unused")
+	private JTextField getJTextBoxLayerSelected() {
+		if(jTextBoxLayerSelected == null)
+			jTextBoxLayerSelected = new JTextField();
+		return jTextBoxLayerSelected;
+	}
+
+	private JComboBox getJComboListLayer() {
+		if(jComboListLayer == null) {
+			jComboListLayer = new JComboBox();
+			jComboListLayer.addActionListener(this);
+		}
+		return jComboListLayer;
+	}
+
+	public void updateDataModel() {
+        String sep = " ";
+
+		Double nanObj = new Double(Double.NaN);
+		DecimalFormat df2 = new DecimalFormat("#.##");
+		DecimalFormat df4 = new DecimalFormat("#.####");
+		getJLabelNumberOfBands().setText(tr.get("bands") + ": " + dataModel.bands);
+
+		String y = (!new Double(dataModel.worldPoint.getY()).equals(nanObj)) ? df2.format(dataModel.worldPoint.getY()) : "NaN";
+		getJLabelLatitudePoint().setText(tr.get("lat") + "/Y: " + y);
+
+		String x = (!new Double(dataModel.worldPoint.getY()).equals(nanObj)) ? df2.format(dataModel.worldPoint.getX()) : "NaN";
+		getJLabelLongitudPoint().setText(tr.get("long") + "/X: " + x);
+
+		y = (!new Double(dataModel.viewPoint.getY()).equals(nanObj)) ? df2.format(dataModel.viewPoint.getY()) : "NaN";
+		x = (!new Double(dataModel.viewPoint.getY()).equals(nanObj)) ? df2.format(dataModel.viewPoint.getX()) : "NaN";
+		getJLabelViewPoint().setText(tr.get("view_point") + ": (" + x + sep + y + ")");
+
+		y = (!new Double(dataModel.pixelPoint.getY()).equals(nanObj)) ? df2.format(dataModel.pixelPoint.getY()) : "NaN";
+		x = (!new Double(dataModel.pixelPoint.getY()).equals(nanObj)) ? df2.format(dataModel.pixelPoint.getX()) : "NaN";
+		getJLabelPixelPoint().setText(tr.get("pixel_point") + ": (" + x + sep + y + ")");
+
+		getJLabelRGBPoint().setText("RGB: " + dataModel.rgb[0] + sep +
+											dataModel.rgb[1] + sep +
+											dataModel.rgb[2]);
+		getJLabelHSLPoint().setText("HSL: " + df4.format(dataModel.hsl[0]) + sep +
+											df4.format(dataModel.hsl[1]) + sep +
+											df4.format(dataModel.hsl[2]));
+		getJLabelCMKYPoint().setText("CMYK: " + df4.format(dataModel.cmyk[0]) + sep +
+											df4.format(dataModel.cmyk[1]) + sep +
+											df4.format(dataModel.cmyk[2]) + sep +
+											df4.format(dataModel.cmyk[3]));
+
+		getJComboListLayer().removeAllItems();
+		for (int i = 0; i < dataModel.layers.size(); i++) {
+			getJComboListLayer().addItem(dataModel.getFormatedLayerName(i));
+		}
+
+		DefaultListModel listModel = null;
+		if(getJListValues().getModel() == null || !(getJListValues().getModel() instanceof DefaultListModel))
+			listModel = new DefaultListModel();
+		else
+			listModel = (DefaultListModel)getJListValues().getModel();
+		listModel.clear();
+		for (int i = 0; i < dataModel.bandsValues.size(); i++) {
+			listModel.addElement("B" + i + ": " + dataModel.bandsValues.get(i));
+		}
+		if(getJListValues().getModel() == null || !(getJListValues().getModel() instanceof DefaultListModel))
+			getJListValues().setModel(listModel);
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		/*if(e.getSource() == getJComboListLayer()) {
+			if(getJComboListLayer().getSelectedIndex() != -1)
+				getJTextBoxLayerSelected().setText(dataModel.layers.get(getJComboListLayer().getSelectedIndex()));
+		}*/
+	}
+
+}

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/tool/infobypoint/InfoByPointPanel.java
___________________________________________________________________
Added: svn:mime-type
   + text/plain

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/sumaryprocess/SummaryProcessDialog.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/sumaryprocess/SummaryProcessDialog.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/sumaryprocess/SummaryProcessDialog.java	(revision 15423)
@@ -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.swing.impl.sumaryprocess;
+
+import java.io.File;
+
+import javax.swing.JFrame;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelEvent;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelListener;
+import org.gvsig.raster.swing.impl.basepanel.ButtonsPanel;
+
+/**
+ * Panel principal del dialogo de finalizaci�n del salvado a raster. En el se
+ * muestra la informaci�n de nombre de fichero, tama�o de este, tiempo de la
+ * operaci�n, etc...
+ * 
+ * Para mostrar un fichero solo hay que usar el metodo estatico show.
+ *
+ * @version 19/06/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class SummaryProcessDialog implements ButtonsPanelListener {
+	private JFrame                      frame         = null;
+	private SummaryProcessPanel         infoPanel     = null;
+	static private SummaryProcessDialog endInfoDialog = null;
+
+	/**
+	 * Obtiene el panel con la informaci�n de finalizaci�n
+	 * @return EndInfoPanel
+	 */
+	private SummaryProcessPanel getInfoPanel() {
+		if (infoPanel == null) {
+			infoPanel = new SummaryProcessPanel();
+			getFrame().add(infoPanel);
+			infoPanel.addButtonPressedListener(this);
+		}
+		return infoPanel;
+	}
+
+	private JFrame getFrame() {
+		if (frame == null) {
+			frame = new JFrame(Messages.getText("stats"));
+			frame.setResizable(false);
+			frame.setAlwaysOnTop(true);
+		}
+		return frame;
+	}
+	
+	static public void show(String fileName, long time) {
+		if (fileName == null || !new File(fileName).exists())
+			return;
+		
+		if ((endInfoDialog == null) || (!endInfoDialog.getFrame().isVisible()))
+			endInfoDialog = new SummaryProcessDialog();
+		endInfoDialog.getInfoPanel().addFile(fileName, time);
+		endInfoDialog.getFrame().setContentPane(endInfoDialog.getInfoPanel());
+		endInfoDialog.getFrame().pack();
+		endInfoDialog.getFrame().setVisible(true);
+	}
+
+	public void actionButtonPressed(ButtonsPanelEvent e) {
+		if (e.getButton() == ButtonsPanel.BUTTON_ACCEPT) {
+			getFrame().setVisible(false);
+			endInfoDialog = null;
+		}
+	}
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/sumaryprocess/SummaryProcessPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/sumaryprocess/SummaryProcessPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/sumaryprocess/SummaryProcessPanel.java	(revision 15423)
@@ -0,0 +1,323 @@
+/* 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.swing.impl.sumaryprocess;
+
+import java.awt.BorderLayout;
+import java.awt.CardLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.BorderFactory;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+import javax.swing.border.TitledBorder;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.basepanel.AbstractButtonsPanel;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+import org.gvsig.utils.swing.JComboBox;
+
+/**
+ * Panel principal del dialogo de finalizaci�n del salvado a raster. En el se
+ * muestra la informaci�n de nombre de fichero, tama�o de este, tiempo de la
+ * operaci�n, etc...
+ *
+ * @version 18/04/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SummaryProcessPanel extends AbstractButtonsPanel implements ActionListener {
+	private static final long	serialVersionUID	= -2280318605043767336L;
+	private JPanel contentPane = null;
+	private JComboBox comboBox = null;
+
+	private String labelFilename = "File:";
+	private String labelPath = "Path:";
+	private String labelTime = "Time:";
+	private String labelSize = "Size:";
+	private String labelCompression = "Compression:";
+
+	/**
+	 * This is the default constructor
+	 */
+	protected SummaryProcessPanel() {
+		super(IButtonsPanel.BUTTONS_ACCEPT);
+		setBorder(BorderFactory.createEmptyBorder(5, 5, 5, 5));
+		initialize();
+		setTranslation();
+	}
+
+	/**
+	 * Asigna los textos a los paneles en el idioma seleccionado
+	 */
+	private void setTranslation() {
+		setLabelFilename(Messages.getText("file") + ":");
+		setLabelPath(Messages.getText("path") + ":");
+		setLabelSize(Messages.getText("size") + ":");
+		setLabelTime(Messages.getText("time") + ":");
+		setLabelCompression(Messages.getText("compress") + ":");
+	}
+
+	protected void addFile(String fileName, long time) {
+		File f = new File(fileName);
+		String size = RasterLocator.getManager().getFileUtils().formatFileSize(f.length());
+
+		String compression;
+		if (fileName.endsWith("ecw") || fileName.endsWith("jp2") ||
+				fileName.endsWith("jpg") || fileName.endsWith("jpeg")) {
+			compression = "Yes";
+		} else {
+			compression = "No";
+		}
+		
+		JPanel pContent = new JPanel();
+		pContent.setLayout(new GridBagLayout());
+
+		GridBagConstraints gridBagConstraints;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(5, 5, 2, 5);
+		pContent.add(newPanelFile(fileName), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 5);
+		pContent.add(newPanelTimeSize(RasterLocator.getManager().getRasterUtils().formatTime(time), size), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.insets = new Insets(2, 5, 5, 5);
+		pContent.add(newPanelCompression(compression), gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 4;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.weighty = 1.0;
+		JPanel emptyPanel = new JPanel();
+		emptyPanel.setPreferredSize(new Dimension(0, 0));
+		pContent.add(emptyPanel, gridBagConstraints);
+
+		pContent.setBorder(BorderFactory.createTitledBorder(BorderFactory.createLineBorder(Color.gray, 1), "Estadisticas",
+				TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+
+		File file = new File(fileName);
+		
+		contentPane.add(pContent, file.getName());
+		if (comboBox.getItemCount() == 0)
+			comboBox.setVisible(false);
+		else
+			comboBox.setVisible(true);
+		comboBox.addItem(file.getName());
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	private void initialize() {
+		setLayout(new BorderLayout(5, 5));
+
+		contentPane = new JPanel();
+		contentPane.setLayout(new CardLayout());
+		
+		comboBox = new JComboBox();
+		comboBox.setVisible(false);
+		comboBox.addActionListener(this);
+		
+		this.add(contentPane, BorderLayout.CENTER);
+		this.add(comboBox, BorderLayout.SOUTH);
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel newPanelFile(String file) {
+		JPanel pFile = new JPanel();
+
+		JLabel lFileNameTag = new JLabel(labelFilename);
+		JLabel lPathTag = new JLabel(labelPath);
+
+		File fileorig = new File(file);
+
+		JTextField tFile = new JTextField(fileorig.getName());
+		tFile.setBackground(pFile.getBackground());
+		tFile.setEditable(false);
+		tFile.setHorizontalAlignment(JTextField.LEFT);
+		tFile.setBorder(null);
+		
+		JTextField pathFile = new JTextField(fileorig.getParent() + File.separator);
+		pathFile.setBackground(pFile.getBackground());
+		pathFile.setEditable(false);
+		pathFile.setHorizontalAlignment(JTextField.LEFT);
+		pathFile.setBorder(null);
+		
+		pFile.setLayout(new GridBagLayout());
+		
+		GridBagConstraints gridBagConstraints;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(5, 5, 5, 5);
+		pFile.add(lFileNameTag, gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 5, 5, 5);
+		pFile.add(tFile, gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(5, 5, 5, 5);
+		pFile.add(lPathTag, gridBagConstraints);
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 1;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.fill = GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(5, 5, 5, 5);
+		pFile.add(pathFile, gridBagConstraints);
+
+		
+		return pFile;
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel newPanelTimeSize(String time, String size) {
+		JPanel pTime = new JPanel();
+		pTime.setLayout(new GridBagLayout());
+
+		JLabel lTimeTag = new JLabel(labelTime);
+		GridBagConstraints gridBagConstraints;
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 5, 2, 2);
+		pTime.add(lTimeTag, gridBagConstraints);
+
+		JLabel lTime = new JLabel(time);
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 11);
+		pTime.add(lTime, gridBagConstraints);
+
+		JLabel lSizeTag = new JLabel(labelSize);
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.anchor = GridBagConstraints.EAST;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 11);
+		pTime.add(lSizeTag, gridBagConstraints);
+
+		JLabel lSize = new JLabel(size);
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 5);
+		pTime.add(lSize, gridBagConstraints);
+
+		return pTime;
+	}
+
+	/**
+	 * This method initializes jPanel
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel newPanelCompression(String compression) {
+		JPanel pCompression = new JPanel();
+
+		JLabel lCompressTag = new JLabel(labelCompression);
+		JLabel lCompress = new JLabel(compression);
+
+		pCompression.setLayout(new FlowLayout(FlowLayout.LEFT));
+		pCompression.add(lCompressTag);
+		pCompression.add(lCompress);
+
+		return pCompression;
+	}
+
+	/**
+	 * @param labelFilename the labelFilename to set
+	 */
+	private void setLabelFilename(String labelFilename) {
+		this.labelFilename = labelFilename;
+	}
+
+	/**
+	 * @param labelFilename the labelFilename to set
+	 */
+	private void setLabelPath(String labelPath) {
+		this.labelPath = labelPath;
+	}
+
+	/**
+	 * @param labelTime the labelTime to set
+	 */
+	private void setLabelTime(String labelTime) {
+		this.labelTime = labelTime;
+	}
+
+	/**
+	 * @param labelSize the labelSize to set
+	 */
+	private void setLabelSize(String labelSize) {
+		this.labelSize = labelSize;
+	}
+
+	/**
+	 * @param labelCompression the labelCompression to set
+	 */
+	private void setLabelCompression(String labelCompression) {
+		this.labelCompression = labelCompression;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == comboBox)
+			((CardLayout) contentPane.getLayout()).show(contentPane, (String) comboBox.getSelectedItem());
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/FileNameManagementImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/FileNameManagementImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/FileNameManagementImpl.java	(revision 15423)
@@ -0,0 +1,55 @@
+/* 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.swing.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.raster.swing.newlayer.FileNameManagement;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class FileNameManagementImpl implements FileNameManagement {
+	private FileUtils fileUtils = RasterLocator.getManager().getFileUtils();
+	
+	public String getDefaultFilePath() {
+		return System.getProperty("java.io.tmpdir");//System.getProperty("user.home");
+	}
+
+	public List<String> getPrefixSupported() {
+		List<String> list = new ArrayList<String>();
+		list.add("tif");
+		return list;
+	}
+
+	public String getUniqueLayerName() {
+		return fileUtils.getOnlyLayerName();
+	}
+
+	public void usesUniqueLayerName() {
+		fileUtils.usesOnlyLayerName();
+	}
+
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/SinglePreviewPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/SinglePreviewPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/SinglePreviewPanel.java	(revision 15423)
@@ -0,0 +1,213 @@
+/* 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.swing.impl.preview;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.geom.Rectangle2D;
+
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import javax.swing.JTabbedPane;
+import javax.swing.border.TitledBorder;
+
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.imagenavigator.IClientImageNavigator;
+import org.gvsig.gui.beans.imagenavigator.ImageNavigator;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.raster.swing.preview.PreviewPanel;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+/**
+ * Single preview with fixed size to insert in a major panel.
+ * 
+ * 19/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SinglePreviewPanel extends JPanel implements PreviewPanel {
+	private static final long serialVersionUID = 6028780107787443656L;
+	private ImageNavigator        imageNavigator        = null;
+	private DataSourcePreview     fLayer                = null;
+	private PreviewRenderProcess  renderProcess         = null;
+	private JPanel                jPanelPreview         = null;
+	private PreviewRequestManager previewRequestManager =  null;
+
+	/**
+	 * Construir un nuevo PreviewBasePanel
+	 * @param renderProcess. Clase para procesar el raster antes del dibujado
+	 * @param lyr. Capa raster a mostrar en la previsualizaci�n
+	 */
+	public SinglePreviewPanel( 
+			PreviewRenderProcess renderProcess,
+			DataSourcePreview lyr) {
+		this.renderProcess = renderProcess;
+		setLayer(lyr);
+		initialize();
+	}
+	
+	/**
+	 * Construir un nuevo PreviewBasePanel
+	 * @param renderProcess. Clase para procesar el raster antes del dibujado
+	 * @param lyr. Capa raster a mostrar en la previsualizaci�n
+	 */
+	public SinglePreviewPanel( 
+			PreviewRenderProcess renderProcess) {
+		this.renderProcess = renderProcess;
+		initialize();
+	}
+
+	/**
+	 * Inicializa los componentes gr�ficos
+	 */
+	private void initialize() {
+		setLayout(new BorderLayout(8, 8));
+		add(getPanelPreview(), BorderLayout.CENTER);
+	}
+	
+	/**
+	 * Cierra la capa abierta para previsualizaci�n
+	 */
+	public void closePreviewLayer() {
+		previewRequestManager.closePreviewLayer();
+	}
+	
+	/**
+	 * Obtiene el objeto IClientImageNavigator
+	 * @return
+	 */
+	public IClientImageNavigator getPreviewManager() {
+		return previewRequestManager;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#getImageNavigator()
+	 */
+	public ImageNavigator getImageNavigator() {
+		if (imageNavigator == null) {
+			imageNavigator = new ImageNavigator(getPreviewManager());
+			imageNavigator.setFocusable(true);
+			imageNavigator.setBorder(BorderFactory.createLineBorder(Color.gray, 1));
+		}
+		return imageNavigator;
+	}
+
+	/**
+	 * Obtiene el panel con el componente con la vista previa
+	 * @return JPanel
+	 */
+	public JPanel getPanelPreview() {
+		if (jPanelPreview == null) {
+			jPanelPreview = new JPanel();
+			JPanel jsubpanel2 = new JPanel();
+			jPanelPreview.setBorder(BorderFactory.createTitledBorder(null, Messages.getText("vista_previa"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+			jPanelPreview.setLayout(new BorderLayout());
+			jsubpanel2.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
+			jsubpanel2.setLayout(new BorderLayout());
+
+			jsubpanel2.add(getImageNavigator(), BorderLayout.CENTER);
+			jPanelPreview.add(jsubpanel2, BorderLayout.CENTER);
+
+			jPanelPreview.setPreferredSize(new Dimension(237, 237));
+			jPanelPreview.setMinimumSize(new Dimension(237, 237));
+			jPanelPreview.setMaximumSize(new Dimension(237, 237));
+		}
+		return jPanelPreview;
+	}
+
+	
+	/**
+	 * Especificar la capa para la previsualizaci�n
+	 * @param layer
+	 */
+	public void setLayer(DataSourcePreview fLayer) {
+		this.fLayer = fLayer;
+		previewRequestManager = new PreviewRequestManager(renderProcess, fLayer);
+
+		previewInitializeSizes();
+	}
+	
+	public void previewInitializeSizes() {
+		// Util para ejecutar el test sin una capa de prueba
+		if (fLayer == null)
+			return;
+
+		// Especificar las dimensiones de la capa en la vista previa
+		Rectangle2D extent2 = fLayer.getBBoxRectangle();
+		getImageNavigator().setViewDimensions(extent2.getMinX(), extent2.getMaxY(), extent2.getMaxX(), extent2.getMinY());
+		getImageNavigator().setZoom(1.0/ fLayer.getCellSize());
+		getImageNavigator().setAutoAdjusted();
+	}
+
+	/**
+	 * Especificar el layer para el recorte
+	 * @param layer
+	 */
+	public DataSourcePreview getLayer() {
+		return fLayer;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#setPreviewSize(java.awt.Dimension)
+	 */
+	public void setPreviewSize(Dimension dimension) {
+		getPanelPreview().setPreferredSize(dimension);
+		getPanelPreview().setMinimumSize(dimension);
+		getPanelPreview().setMaximumSize(dimension);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#refreshPreview()
+	 */
+	public void refreshPreview() {
+		if (fLayer == null)
+			return;
+		getImageNavigator().updateBuffer();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#getDataSourcePreview()
+	 */
+	public DataSourcePreview getDataSourcePreview() {
+		return fLayer;
+	}
+
+	public void addButtonPressedListener(ButtonsPanelListener listener) {
+		// TODO Auto-generated method stub
+		
+	}
+
+	public ButtonsPanel getButtonsPanel() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public JTabbedPane getTabbedPane() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/PreviewRequestManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/PreviewRequestManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/PreviewRequestManager.java	(revision 15423)
@@ -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.swing.impl.preview;
+
+import java.awt.Component;
+import java.awt.Graphics2D;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.gui.beans.imagenavigator.IClientImageNavigator;
+import org.gvsig.gui.beans.imagenavigator.ImageUnavailableException;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Gestor de visualizaci�n de preview. Se encarga del repintado de la imagen
+ * de la previsualizaci�n
+ *
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class PreviewRequestManager implements IClientImageNavigator {
+	private static final Logger     logger            = LoggerFactory.getLogger(PreviewRequestManager.class);
+	private DataSourcePreview       previewLayer      = null;
+	private PreviewRenderProcess    renderProcess     = null;
+
+	/**
+	 * Construye un ColorTableListener
+	 * @param
+	 */
+	public PreviewRequestManager(	PreviewRenderProcess renderProcess,
+									DataSourcePreview layer) {
+		this.renderProcess = renderProcess;
+		setLayer(layer);
+	}
+
+	/**
+	 * Asigna la capa raster de la vista
+	 * @param fLayer
+	 */
+	private void setLayer(DataSourcePreview fLayer) {
+		//if (fLayer instanceof IRasterLayerActions) {
+			//IRasterLayerActions ly = (IRasterLayerActions) fLayer;
+			//try {
+				//Este c�digo no va bien pq la preview siempre tiene el extent global y el �ltimo fichero
+				//puede ser de un zoom
+				/*if(ly.isActionEnabled(IRasterLayerActions.REMOTE_ACTIONS))
+					previewLayer = (FLyrRaster)fLayer.getFileLayer();
+				else*/
+					previewLayer = fLayer.cloneDataSourcePreview();					
+			//} catch (Exception e) {
+				//messageBoxError("preview_not_available", previewBasePanel, e);
+			//}
+		//}
+	}
+
+	/**
+	 * Cierra la capa abierta para previsualizaci�n
+	 */
+	public void closePreviewLayer() {
+		previewLayer.closePreviewLayer();
+	}
+
+	public void drawImage(Graphics2D g, double x1, double y1, double x2, double y2, double zoom, int width, int height)
+		throws ImageUnavailableException {
+		if (previewLayer == null)
+			throw new ImageUnavailableException(Messages.getText("error_dont_exists_layer"));
+
+		previewLayer.pushStatus();
+		try {
+			if(renderProcess != null)
+				renderProcess.process(previewLayer);
+		} catch (ImageUnavailableException e2) {
+			throw new ImageUnavailableException(Messages.getText("error_adding_filters"));
+		} catch (Exception e2) {
+			logger.debug("error_adding_filters", this, e2);
+			throw new ImageUnavailableException(Messages.getText("error_adding_filters"));
+		}
+
+		try {
+			double[] coords = new double[]{x1, y1, x2, y2};
+			previewLayer.draw(null, g, coords, width, height, null, 1.0);
+		} catch (ImageUnavailableException e) {
+			logger.debug("error_preview_render", this, e);
+			throw new ImageUnavailableException(Messages.getText("error_preview_render"));
+		} catch (Exception e2) {
+			logger.debug("error_preview_render", this, e2);
+			throw new ImageUnavailableException(Messages.getText("error_preview_render"));
+		}
+		previewLayer.popStatus();
+	}
+	
+	/**
+	 * Shows a error dialog with a text and a accept button 
+	 * @param msg Message to show in the dialog
+	 * @param parentWindow Parent window
+	 */
+	public void messageBoxError(String msg, Object parentWindow, Exception exception) {
+		logger.debug(msg, parentWindow, exception);
+		String string = Messages.getText("accept");
+		Object[] options = {string};
+		JOptionPane.showOptionDialog((Component)parentWindow,
+					"<html>" + Messages.getText(msg).replaceAll("\n", "<br>") + "</html>",
+					Messages.getText("confirmacion"),
+					JOptionPane.OK_OPTION,
+					JOptionPane.ERROR_MESSAGE,
+					null,
+					options,
+					string);
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/PreviewBasePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/PreviewBasePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/preview/PreviewBasePanel.java	(revision 15423)
@@ -0,0 +1,374 @@
+/* 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.swing.impl.preview;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.geom.Rectangle2D;
+import java.util.ArrayList;
+
+import javax.swing.BorderFactory;
+import javax.swing.JPanel;
+import javax.swing.JSplitPane;
+import javax.swing.JTabbedPane;
+import javax.swing.border.Border;
+import javax.swing.border.TitledBorder;
+import javax.swing.plaf.basic.BasicSplitPaneDivider;
+import javax.swing.plaf.basic.BasicSplitPaneUI;
+
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanel;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+import org.gvsig.gui.beans.imagenavigator.IClientImageNavigator;
+import org.gvsig.gui.beans.imagenavigator.ImageNavigator;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.raster.swing.preview.PreviewBasePanelTab;
+import org.gvsig.raster.swing.preview.PreviewPanel;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+/**
+ * Panel base para componentes con previsualizaci�n.
+ * 
+ * 19/02/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class PreviewBasePanel extends DefaultButtonsPanel implements PreviewPanel {
+	private static final long serialVersionUID = 6028780107787443656L;
+
+	private ImageNavigator        imageNavigator        = null;
+	private DataSourcePreview     fLayer                = null;
+
+	/**
+	 * Lista de paneles de usuario que son a�adidos a los tabs
+	 */
+	private ArrayList<PreviewBasePanelTab>             
+	                              userPanel             = new ArrayList<PreviewBasePanelTab>();
+	/**
+	 * Panel de la base del cuadro con opciones comunes para todos los tabs
+	 */
+	private JPanel                generalPanel          = null;
+	/**
+	 * Panel de debajo de la vista previa
+	 */
+	private JPanel                downPreviewPanel      = null;
+	private PreviewRenderProcess  renderProcess         = null;
+
+	/**
+	 * Panel central para el caso de que sea m�s de uno (con pesta�as)
+	 */
+	private JTabbedPane           tabbedPane            = null;
+	/**
+	 * Panel central para el caso de que sea solo uno (sin pesta�as)
+	 */
+	private JPanel                mainPanel             = null;
+
+	private JSplitPane            jPanelRight           = null;
+	private JPanel                jPanelPreview         = null;
+
+	private PreviewRequestManager previewRequestManager =  null;
+	
+	/**
+	 * Construir un nuevo PreviewBasePanel
+	 * @param userPanel. Lista de paneles de usuario para los tabs
+	 * @param generalPanel. Panel inferior global para todos los tabs
+	 * @param downPreviewPanel. Panel inferior al de la previsualizaci�n
+	 * @param renderProcess. Clase para procesar el raster antes del dibujado
+	 * @param lyr. Capa raster a mostrar en la previsualizaci�n
+	 */
+	public PreviewBasePanel(ArrayList<PreviewBasePanelTab> userPanel, 
+							JPanel generalPanel, 
+							JPanel downPreviewPanel, 
+							PreviewRenderProcess renderProcess,
+							DataSourcePreview lyr) {
+		this(ButtonsPanel.BUTTONS_ACCEPTCANCELAPPLY, userPanel, generalPanel, downPreviewPanel, renderProcess, lyr);
+	}
+
+	/**
+	 * Construir un nuevo PreviewBasePanel
+	 * @param buttons
+	 * @param userPanel
+	 * @param generalPanel
+	 * @param downPreviewPanel
+	 * @param renderProcess
+	 * @param lyr
+	 */
+	public PreviewBasePanel(int buttons,
+			ArrayList<PreviewBasePanelTab> userPanel, 
+			JPanel generalPanel, 
+			JPanel downPreviewPanel, 
+			PreviewRenderProcess renderProcess,
+			DataSourcePreview lyr) {
+		super(buttons);
+		this.userPanel = userPanel;
+		this.generalPanel = generalPanel;
+		this.downPreviewPanel = downPreviewPanel;
+		this.renderProcess = renderProcess;
+		setLayer(lyr);
+		initialize();
+	}
+
+	/**
+	 * Inicializa los componentes gr�ficos
+	 */
+	private void initialize() {
+		setLayout(new BorderLayout(8, 8));
+
+		JPanel panelLeft = new JPanel();
+		panelLeft.setPreferredSize(new Dimension(390, 0));
+		panelLeft.setLayout(new BorderLayout(8, 8));
+		if(userPanel != null) {
+			if(userPanel.size() == 1)
+				panelLeft.add(getPanelWithoutTabs(), BorderLayout.CENTER);
+			else if(userPanel.size() > 1)
+				panelLeft.add(getTabbedPane(), BorderLayout.CENTER);
+		}
+		if(generalPanel != null)
+			panelLeft.add(getGeneralPanel(), BorderLayout.SOUTH);
+
+		JSplitPane jSplitPane1 = new JSplitPane();
+		jSplitPane1.setLeftComponent(panelLeft);
+		jSplitPane1.setRightComponent(getPanelRight());
+		jSplitPane1.setResizeWeight(1.0);
+		jSplitPane1.setContinuousLayout(true);
+		jSplitPane1.setUI(new BasicSplitPaneUI() {
+			public BasicSplitPaneDivider createDefaultDivider() {
+				return new BasicSplitPaneDivider(this) {
+					private static final long serialVersionUID = 1L;
+
+					public void setBorder(Border b) {
+					}
+				};
+			}
+		});
+		jSplitPane1.setBorder(null);
+
+		add(jSplitPane1, BorderLayout.CENTER);
+	}
+	
+	/**
+	 * Cierra la capa abierta para previsualizaci�n
+	 */
+	public void closePreviewLayer() {
+		previewRequestManager.closePreviewLayer();
+	}
+	
+	/**
+	 * Asigna el panel de la posici�n 0 del array. Este panel es el que se utiliza
+	 * cuando no hay un JTabbedPane
+	 * @param panel
+	 */
+	public void setUniquePanel(PreviewBasePanelTab panel) {
+		userPanel.clear();
+		userPanel.add(panel);
+		mainPanel = (JPanel)panel;
+		((JSplitPane)getContent().getComponent(0)).setLeftComponent(mainPanel);
+		getContent().updateUI();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#getTabbedPane()
+	 */
+	public JTabbedPane getTabbedPane() {
+		if (tabbedPane == null) {
+			tabbedPane = new JTabbedPane();
+			for (int i = 0; i < userPanel.size(); i++) 
+				tabbedPane.addTab(((PreviewBasePanelTab)userPanel.get(i)).getTitle(), ((PreviewBasePanelTab)userPanel.get(i)).getPanel());
+		}
+		return tabbedPane;
+	}
+	
+	/**
+	 * Obtiene el panel central sin tabs. Esto ocurre cuando el usuario solo quiere un
+	 * panel. En este caso no hacen falta pesta�as por lo que se incorpora solo un JPanel
+	 * @return JTabbedPane
+	 */
+	public JPanel getPanelWithoutTabs() {
+		if (mainPanel == null) {
+			if(((PreviewBasePanelTab)userPanel.get(0)) instanceof JPanel) {
+				mainPanel = ((PreviewBasePanelTab)userPanel.get(0)).getPanel();
+			} else
+				mainPanel = new JPanel();
+		}
+		return mainPanel;
+	}
+	
+	/**
+	 * Obtiene el panel con opciones comunes a todas las pesta�as.
+	 * @return JPanel
+	 */
+	public JPanel getGeneralPanel() {
+		return generalPanel;
+	}
+	
+	/**
+	 * Obtiene el panel de debajo de la vista previa
+	 * @return JPanel
+	 */
+	public JPanel getDownPreviewPanel() {
+		return downPreviewPanel;
+	}
+
+	/**
+	 * Obtiene la lista de paneles de usuario
+	 * @return ArrayList de IUserPanelInterface
+	 */
+	public ArrayList<PreviewBasePanelTab> getUserPanels() {
+		return userPanel;
+	}
+	
+	/**
+	 * Obtiene el objeto IClientImageNavigator
+	 * @return
+	 */
+	public IClientImageNavigator getPreviewManager() {
+		return previewRequestManager;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#getImageNavigator()
+	 */
+	public ImageNavigator getImageNavigator() {
+		if (imageNavigator == null) {
+			imageNavigator = new ImageNavigator(getPreviewManager());
+			imageNavigator.setFocusable(true);
+			imageNavigator.setBorder(BorderFactory.createLineBorder(Color.gray, 1));
+		}
+		return imageNavigator;
+	}
+
+	/**
+	 * Obtiene el panel con el componente con la vista previa
+	 * @return JPanel
+	 */
+	public JPanel getPanelPreview() {
+		if (jPanelPreview == null) {
+			jPanelPreview = new JPanel();
+			JPanel jsubpanel2 = new JPanel();
+			jPanelPreview.setBorder(BorderFactory.createTitledBorder(null, Messages.getText("vista_previa"), TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+			jPanelPreview.setLayout(new BorderLayout());
+			jsubpanel2.setBorder(BorderFactory.createEmptyBorder(8, 8, 8, 8));
+			jsubpanel2.setLayout(new BorderLayout());
+
+			jsubpanel2.add(getImageNavigator(), BorderLayout.CENTER);
+			jPanelPreview.add(jsubpanel2, BorderLayout.CENTER);
+
+			jPanelPreview.setPreferredSize(new Dimension(237, 237));
+			jPanelPreview.setMinimumSize(new Dimension(237, 237));
+			jPanelPreview.setMaximumSize(new Dimension(237, 237));
+		}
+		return jPanelPreview;
+	}
+
+	/**
+	 * Devuelve el panel donde estar� el widget de preview
+	 * @return
+	 */
+	private JSplitPane getPanelRight() {
+		if (jPanelRight == null) {
+			jPanelRight = new JSplitPane();
+			jPanelRight.setOrientation(JSplitPane.VERTICAL_SPLIT);
+			jPanelRight.setContinuousLayout(true);
+			jPanelRight.setResizeWeight(0.0);
+			jPanelRight.setPreferredSize(new Dimension(220, 0));
+			jPanelRight.setMinimumSize(new Dimension(220, 0));
+
+			if(getPanelPreview() != null)
+				jPanelRight.setTopComponent(getPanelPreview());
+			else
+				jPanelRight.setTopComponent(new JPanel());
+			if(getDownPreviewPanel() != null)
+				jPanelRight.setBottomComponent(getDownPreviewPanel());
+			else
+				jPanelRight.setBottomComponent(new JPanel());
+			jPanelRight.setUI(new BasicSplitPaneUI() {
+				public BasicSplitPaneDivider createDefaultDivider() {
+					return new BasicSplitPaneDivider(this) {
+						private static final long serialVersionUID = 1L;
+
+						public void setBorder(Border b) {
+						}
+					};
+				}
+			});
+			jPanelRight.setBorder(null);
+		}
+		return jPanelRight;
+	}
+
+	public void setLayer(DataSourcePreview fLayer) {
+		this.fLayer = fLayer;
+		previewRequestManager = new PreviewRequestManager(renderProcess, fLayer);
+
+		previewInitializeSizes();
+	}
+	
+	public void previewInitializeSizes() {
+		// Util para ejecutar el test sin una capa de prueba
+		if (fLayer == null)
+			return;
+
+		// Especificar las dimensiones de la capa en la vista previa
+		Rectangle2D extent2 = fLayer.getBBoxRectangle();
+		getImageNavigator().setViewDimensions(extent2.getMinX(), extent2.getMaxY(), extent2.getMaxX(), extent2.getMinY());
+		getImageNavigator().setZoom(1.0/ fLayer.getCellSize());
+		getImageNavigator().setAutoAdjusted();
+	}
+
+
+	/**
+	 * Especificar el layer para el recorte
+	 * @param layer
+	 */
+	public DataSourcePreview getLayer() {
+		return fLayer;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#setPreviewSize(java.awt.Dimension)
+	 */
+	public void setPreviewSize(Dimension dimension) {
+		getPanelPreview().setPreferredSize(dimension);
+		getPanelPreview().setMinimumSize(dimension);
+		getPanelPreview().setMaximumSize(dimension);
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#refreshPreview()
+	 */
+	public void refreshPreview() {
+		if (fLayer == null)
+			return;
+		getImageNavigator().updateBuffer();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.preview.PreviewPanel#getDataSourcePreview()
+	 */
+	public DataSourcePreview getDataSourcePreview() {
+		return fLayer;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/slider/ColorSliderTextContainer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/slider/ColorSliderTextContainer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/slider/ColorSliderTextContainer.java	(revision 15423)
@@ -0,0 +1,314 @@
+package org.gvsig.raster.swing.impl.slider;
+
+import java.awt.BorderLayout;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.swing.JPanel;
+import javax.swing.JSpinner;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.gvsig.gui.beans.doubleslider.DoubleSlider;
+import org.gvsig.gui.beans.doubleslider.DoubleSliderEvent;
+import org.gvsig.gui.beans.doubleslider.DoubleSliderListener;
+/**
+ * Barra de deslizamiento con una ventana de texto que tiene el valor de la
+ * posici�n de la barra. En este control podr� controlarse mediante la entrada
+ * de datos por la caja de texto la posibilidad de introducir valores decimales.
+ *
+ * @version 15/06/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ColorSliderTextContainer extends JPanel implements ChangeListener, DoubleSliderListener {
+	private static final long serialVersionUID = 1876415954410511634L;
+	private ArrayList<DoubleSliderListener> actionCommandListeners = new ArrayList<DoubleSliderListener>();
+
+	private JPanel       pText            = null;
+	private DoubleSlider slider           = null;
+	private JSpinner     jSpinner         = null;
+	private int          min              = 0;
+	private int          max              = 255;
+	private int          defaultPos       = 0;
+
+	/**
+	 * Contructor
+	 * @param min Valor m�nimo de la barra
+	 * @param max Valor m�ximo de la barra
+	 * @param defaultPos Posici�n por defecto
+	 */
+	public ColorSliderTextContainer(int min, int max, int defaultPos) {
+		super();
+		this.min = min;
+		this.max = max;
+		this.defaultPos = defaultPos;
+
+		initialize();
+		slider.setTwoSliders(false);
+	}
+
+	/**
+	 * Constructor vacio
+	 */
+	public ColorSliderTextContainer() {
+		this(0, 100, 0);
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 */
+	private void initialize() {
+		this.setLayout(new BorderLayout(5, 5));
+		this.add(getSlider(), BorderLayout.CENTER);
+		this.add(getPText(), BorderLayout.EAST);
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPText() {
+		if (pText == null) {
+			pText = new JPanel();
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.insets = new java.awt.Insets(0, 10, 8, 0);
+			pText.setLayout(new GridBagLayout());
+			pText.add(getJSpinner(), gridBagConstraints1);
+		}
+		return pText;
+	}
+
+	/**
+	 * This method initializes jSlider
+	 *
+	 * @return javax.swing.JSlider
+	 */
+	public DoubleSlider getSlider() {
+		if (slider == null) {
+			slider = new DoubleSlider();
+			slider.setMinimum(min);
+			slider.setMaximum(max);
+			slider.setValue(defaultPos);
+			slider.addValueChangedListener(this);
+		}
+		return slider;
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JSpinner getJSpinner() {
+		if (jSpinner == null) {
+			jSpinner = new JSpinner();
+			jSpinner.setValue(new Integer(defaultPos));
+			jSpinner.setPreferredSize(new Dimension(50, 26));
+			jSpinner.setMinimumSize(new Dimension(50, 26));
+			jSpinner.addChangeListener(this);
+		}
+		return jSpinner;
+	}
+
+	public void setComponentSize(int w, int h){
+	}
+
+	/**
+	 * Obtiene el valor del control.
+	 * @return Valor del control en formato double.
+	 */
+	public int getValue() {
+		return new Integer(getJSpinner().getValue() + "").intValue();
+	}
+
+	/**
+	 * Asigna el valor del control.
+	 * @return Valor del control en formato double.
+	 */
+	public void setValue(int value) {
+		getJSpinner().setValue(new Integer(value));
+		getSlider().setValue(value);
+	}
+
+	/**
+	 * Activa o desactiva el control del panel
+	 * @param active
+	 */
+	public void setControlEnabled(boolean active){
+		getSlider().setEnabled(active);
+		getJSpinner().setEnabled(active);
+	}
+
+	/**
+	 * Obtiene el valor m�ximo del slider
+	 * @return Entero con el valor m�ximo
+	 */
+	public int getMax() {
+		return max;
+	}
+
+	/**
+	 * Asigna el valor m�ximo del slider
+	 * @param Entero con el valor m�ximo
+	 * @deprecated Usar setMaximum en su lugar
+	 */
+	public void setMax(int max) {
+		this.setMaximum(max);
+	}
+
+	/**
+	 * Asigna el valor m�ximo del slider
+	 * @param Entero con el valor m�ximo
+	 */
+	public void setMaximum(int max) {
+		this.max = max;
+		updateInterval();
+	}
+
+	/**
+	 * Obtiene el valor m�nimo del slider
+	 * @return Entero con el valor m�nimo
+	 */
+	public int getMin() {
+		return min;
+	}
+
+	/**
+	 * Asigna el valor m�nimo del slider
+	 * @param Entero con el valor m�nimo
+	 * @deprecated Usar setMinimum
+	 */
+	public void setMin(int min) {
+		this.setMinimum(min);
+	}
+
+	/**
+	 * Asigna el valor m�nimo del slider
+	 * @param Entero con el valor m�nimo
+	 */
+	public void setMinimum(int min) {
+		this.min = min;
+		updateInterval();
+	}
+
+	private void updateInterval() {
+		int aux = this.getValue();
+		getSlider().setMinimum(min);
+		getSlider().setMaximum(max);
+		setValue(aux);
+	}
+
+	/**
+	 * Especificar el color izquierdo del control
+	 * @param color
+	 */
+	public void setColor1(Color color, boolean refresh) {
+		slider.setColor1(color, refresh);
+	}
+
+	/**
+	 * Especificar el color derecho del control
+	 * @param color
+	 */
+	public void setColor2(Color color, boolean refresh) {
+		slider.setColor2(color, refresh);
+	}
+
+	/**
+	 * Controla cuando cambia el spinner
+	 */
+	public void stateChanged(ChangeEvent e) {
+		int value = new Integer(getJSpinner().getValue().toString()).intValue();
+		if (value != getSlider().getValue())
+			getSlider().setValue(value);
+		if (new Integer(getJSpinner().getValue().toString()).intValue() != getSlider().getValue())
+			getJSpinner().setValue(new Integer(getSlider().getValue()));
+
+		if (spinnerEvent)
+			callChangeValue();
+	}
+
+	/**
+	 * Dispara el evento del cambio del control
+	 */
+	protected void callChangeValue() {
+		Iterator<DoubleSliderListener> iterator = actionCommandListeners.iterator();
+		while (iterator.hasNext()) {
+			DoubleSliderListener listener = iterator.next();
+			listener.actionValueChanged(new DoubleSliderEvent(this));
+		}
+	}
+
+	/**
+	 * Dispara el evento del cambio del control
+	 */
+	protected void callDraggedValue() {
+		Iterator<DoubleSliderListener> iterator = actionCommandListeners.iterator();
+		while (iterator.hasNext()) {
+			DoubleSliderListener listener = iterator.next();
+			listener.actionValueDragged(new DoubleSliderEvent(this));
+		}
+	}
+
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addValueChangedListener(DoubleSliderListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeValueChangedListener(DoubleSliderListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.swing.JComponent#setEnabled(boolean)
+	 */
+	public void setEnabled(boolean enabled) {
+		super.setEnabled(enabled);
+		jSpinner.setEnabled(enabled);
+		slider.setEnabled(enabled);
+	}
+
+	/**
+	 * Controla cuando cambia el slider
+	 */
+	public void actionValueChanged(DoubleSliderEvent e) {
+		int value = getSlider().getValue();
+		getJSpinner().setValue(new Integer(value));
+
+		if (isEnabled())
+			callChangeValue();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.gui.beans.doubleslider.DoubleSliderListener#actionValueDragged(java.util.EventObject)
+	 */
+	boolean spinnerEvent = true;
+	int lastDragged = -1;
+	public void actionValueDragged(DoubleSliderEvent e) {
+		int value = getSlider().getValue();
+		if (lastDragged != value) {
+			lastDragged = value;
+			spinnerEvent = false;
+			getJSpinner().setValue(new Integer(value));
+			spinnerEvent = true;
+
+			if (isEnabled())
+				callDraggedValue();
+		}
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/slider/SliderTextContainer.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/slider/SliderTextContainer.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/slider/SliderTextContainer.java	(revision 15423)
@@ -0,0 +1,440 @@
+package org.gvsig.raster.swing.impl.slider;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.awt.event.KeyEvent;
+import java.awt.event.KeyListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.swing.BorderFactory;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.JSlider;
+import javax.swing.JTextField;
+import javax.swing.border.TitledBorder;
+import javax.swing.event.ChangeEvent;
+import javax.swing.event.ChangeListener;
+
+import org.gvsig.gui.beans.slidertext.listeners.SliderEvent;
+import org.gvsig.gui.beans.slidertext.listeners.SliderListener;
+import org.gvsig.raster.swing.slider.SliderText;
+/**
+ * Barra de deslizamiento con una ventana de texto que tiene el valor de la
+ * posici�n de la barra. En este control podr� controlarse mediante la entrada
+ * de datos por la caja de texto la posibilidad de introducir valores decimales.
+ *
+ * Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class SliderTextContainer extends JPanel implements SliderText, ChangeListener, FocusListener, KeyListener, MouseListener {
+	private static final long serialVersionUID = 1876415954410511634L;
+	private ArrayList<SliderListener> actionCommandListeners = new ArrayList<SliderListener>();
+	private JPanel     pText           = null;
+	private JSlider    slider          = null;
+	private JTextField text            = null;
+	private int        min             = 0;
+	private int        max             = 255;
+	private double     interval        = 1.0;
+	private int        defaultPos      = 0;
+	private boolean    decimal         = false;
+	private boolean    disconnectEvent = false;
+	private boolean    dragged         = false;
+	private boolean    showBorder      = false;
+
+	/**
+	 * Contructor
+	 * @param min Valor m�nimo de la barra
+	 * @param max Valor m�ximo de la barra
+	 * @param defaultPos Posici�n por defecto
+	 * @deprecated Es recomendable el uso del constructor con el par�metro border. Tiene la misma funcionalidad 
+	 * si se pone ese par�metro a true. Se mantiene este constructor por compatibilidad con versiones 
+	 * anteriores.
+	 */
+	public SliderTextContainer(int min, int max, int defaultPos) {
+		this(min, max, defaultPos, false);
+	}
+	
+	/**
+	 * Contructor
+	 * @param min Valor m�nimo de la barra
+	 * @param max Valor m�ximo de la barra
+	 * @param defaultPos Posici�n por defecto
+	 * @param border Flag que obliga a mostrar u ocultar el borde
+	 */
+	public SliderTextContainer(int min, int max, int defaultPos, boolean border) {
+		super();
+		this.min = min;
+		this.max = max;
+		this.defaultPos = defaultPos;
+		this.showBorder = border;
+		initialize();
+	}
+
+
+	/**
+	 * Constructor vacio
+	 */
+	public SliderTextContainer() {
+		this(0, 100, 0);
+	}
+
+	/**
+	 * Dispara el evento del cambio del control
+	 */
+	protected void callChangeValue(boolean forceEvent) {
+		if (!getSlider().isEnabled() && !forceEvent)
+			return;
+		Iterator<SliderListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			SliderListener listener = (SliderListener) acIterator.next();
+			listener.actionValueChanged(new SliderEvent(this));
+		}
+	}
+
+	/**
+	 * Dispara el evento del cambio del control
+	 */
+	protected void callDraggedValue() {
+		Iterator<SliderListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			SliderListener listener = (SliderListener) acIterator.next();
+			listener.actionValueDragged(new SliderEvent(this));
+		}
+	}
+
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	public void addValueChangedListener(SliderListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	public void removeValueChangedListener(SliderListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Asigna un borde al componente con el texto pasado como
+	 * par�metro
+	 * @param name
+	 */
+	public void setBorder(String name){
+		setBorder(BorderFactory.createTitledBorder(null, name, TitledBorder.DEFAULT_JUSTIFICATION, TitledBorder.DEFAULT_POSITION, null, null));
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 */
+	private void initialize() {
+		this.setLayout(new BorderLayout());
+		this.add(getSlider(), BorderLayout.CENTER);
+		this.add(getPText(), BorderLayout.EAST);
+		if(showBorder)
+			this.setBorder(BorderFactory.createLineBorder(java.awt.Color.gray,1));
+	}
+
+	/**
+	 * This method initializes jPanel1
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	private JPanel getPText() {
+		if (pText == null) {
+			pText = new JPanel();
+			GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+			gridBagConstraints1.insets = new java.awt.Insets(0, 10, 8, 0);
+			pText.setLayout(new GridBagLayout());
+			pText.add(getTextField(), gridBagConstraints1);
+		}
+		return pText;
+	}
+
+	/**
+	 * This method initializes jSlider
+	 *
+	 * @return javax.swing.JSlider
+	 */
+	public JSlider getSlider() {
+		if (slider == null) {
+			slider = new JSlider();
+			slider.setMinimum(0);
+			slider.setMaximum((int) ((max - min) / interval));
+			slider.setValue((int) ((defaultPos - min) / interval));
+			updateTicks();
+			slider.addChangeListener(this);
+			slider.addMouseListener(this);
+		}
+		return slider;
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JTextField getTextField() {
+		if (text == null) {
+			text = new JTextField();
+			text.setText(defaultPos + "");
+			text.setPreferredSize(new Dimension(40, 26));
+			text.setMinimumSize(new Dimension(40, 26));
+			text.addFocusListener(this);
+			text.addKeyListener(this);
+		}
+		return text;
+	}
+
+	public void setComponentSize(int w, int h){
+	}
+
+	/**
+	 * Obtiene el valor del control.
+	 * @return Valor del control en formato double.
+	 */
+	public double getValue() {
+		return new Double(getTextField().getText()).doubleValue();
+	}
+
+	/**
+	 * Asigna el valor del control.
+	 * @return Valor del control en formato double.
+	 */
+	public void setValue(double value){
+		if(decimal)
+			getTextField().setText(String.valueOf(value));
+		else
+			getTextField().setText(String.valueOf((int)value));
+		getSlider().setValue((int) ((value - min) / interval));
+	}
+
+	/**
+	 * Activa o desactiva el control del panel
+	 * @param active
+	 */
+	public void setControlEnabled(boolean active){
+		getSlider().setEnabled(active);
+		getTextField().setEnabled(active);
+		if (active == false) {
+			getTextField().setBackground(pText.getBackground());
+		} else {
+			getTextField().setBackground(java.awt.Color.white);
+		}
+	}
+
+	/**
+	 * Asigna el flag que dice si el valor del campo de texto ser�
+	 * decimal o entero
+	 * @param dec true si se admiten valores decimales y false si no se admiten
+	 */
+	public void setDecimal (boolean dec){
+		decimal = dec;
+		String s = getTextField().getText();
+		if(dec)
+			getTextField().setText((s +".0"));
+		else{
+			int index = s.lastIndexOf(".");
+			if(index == -1 || index == 0)
+				index = s.length() - 1;
+			getTextField().setText(s.substring(0, index + 1));
+		}
+	}
+
+	/**
+	 * Obtiene el flag que dice si el valor del campo de texto es
+	 * decimal o entero
+	 * @return true si se admiten valores decimales y false si no se admiten
+	 */
+	public boolean getDecimal (){
+		return decimal;
+	}
+
+	/**
+	 * Obtiene el valor m�ximo del slider
+	 * @return Entero con el valor m�ximo
+	 */
+	public int getMax() {
+		return max;
+	}
+
+	/**
+	 * Asigna el valor m�ximo del slider
+	 * @param Entero con el valor m�ximo
+	 * @deprecated Usar setMaximum en su lugar
+	 */
+	public void setMax(int max) {
+		this.setMaximum(max);
+	}
+
+	/**
+	 * Asigna el valor m�ximo del slider
+	 * @param Entero con el valor m�ximo
+	 */
+	public void setMaximum(int max) {
+		this.max = max;
+		updateInterval();
+	}
+
+	/**
+	 * Obtiene el valor m�nimo del slider
+	 * @return Entero con el valor m�nimo
+	 */
+	public int getMin() {
+		return min;
+	}
+
+	/**
+	 * Asigna el valor m�nimo del slider
+	 * @param Entero con el valor m�nimo
+	 * @deprecated Usar setMinimum
+	 */
+	public void setMin(int min) {
+		this.setMinimum(min);
+	}
+
+	/**
+	 * Asigna el valor m�nimo del slider
+	 * @param Entero con el valor m�nimo
+	 */
+	public void setMinimum(int min) {
+		this.min = min;
+		updateInterval();
+	}
+
+	/**
+	 * Actualizar la separacion entre los Ticks
+	 */
+	private void updateTicks() {
+		int ticks = (int) ((max-min)/interval) / 40;
+		getSlider().setMajorTickSpacing(ticks * 4);
+		slider.setPaintTicks(true);
+		getSlider().setMinorTickSpacing(ticks);
+	}
+
+	private void updateInterval() {
+		double aux = this.getValue();
+		getSlider().setMinimum(0);
+		getSlider().setMaximum((int) ((max - min) / interval));
+		setValue(aux);
+		updateTicks();
+	}
+	/**
+	 * Definir un intervalo para el slider
+	 * @param value
+	 */
+	public void setInterval(double value) {
+		interval = value;
+		updateInterval();
+	}
+
+	/**
+	 * Obtener el intervalo definido para el slider
+	 * @return
+	 */
+	public double getInterval() {
+		return interval;
+	}
+
+	/**
+	 * Controla que si el formato introducido en el textfield es numerico. Si lo
+	 * es se actualiza la posici�n del slider
+	 */
+	private void checkDecimalTextAndUpdateSlider() {
+		String text = getTextField().getText();
+		double value = 0;
+		disconnectEvent = true;
+
+		try {
+			if (!text.equals("")) {
+				value = (Double.parseDouble(text) * 100) / (double) (getMax() - getMin());
+				value = Double.valueOf(text).doubleValue();
+				if (value < getMin())
+					value = getMin();
+				if (value > getMax())
+					value = getMax();
+			}
+			setValue(value);
+			callChangeValue(true);
+		} catch (NumberFormatException exc) {
+			setValue(getSlider().getValue()*interval + min);
+		}
+	}
+
+	/**
+	 * Control del evento de cambio en la posici�n del slider. Este cambio
+	 * actualiza el valor de la caja de texto y ejecuta el m�todo stateChanged de
+	 * los listener registrados.
+	 */
+	public void stateChanged(ChangeEvent e) {
+		//Modificamos la caja de texto con el valor de la posici�n del slider
+		if (!disconnectEvent) {
+			double value = (getSlider().getValue() * getInterval()) + getMin();
+			if (!getDecimal())
+				getTextField().setText(((int) value) + "");
+			else
+				getTextField().setText(((int) (value * 10)) / 10.0 + "");
+			if (dragged)
+				callDraggedValue();
+			else
+				callChangeValue(true);
+		}
+		disconnectEvent = false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.FocusListener#focusLost(java.awt.event.FocusEvent)
+	 */
+	public void focusLost(FocusEvent e) {
+		checkDecimalTextAndUpdateSlider();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.KeyListener#keyReleased(java.awt.event.KeyEvent)
+	 */
+	public void keyReleased(KeyEvent e) {
+		if (e.getKeyCode() == 10)
+			checkDecimalTextAndUpdateSlider();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
+	 */
+	public void mousePressed(MouseEvent e) {
+		dragged = true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.event.MouseListener#mouseReleased(java.awt.event.MouseEvent)
+	 */
+	public void mouseReleased(MouseEvent e) {
+		dragged = false;
+		callChangeValue(false);
+	}
+	
+	public JComponent getComponent() {
+		return this;
+	}
+
+	public void focusGained(FocusEvent e) {}
+	public void keyPressed(KeyEvent e) {}
+	public void keyTyped(KeyEvent e) {}
+	public void mouseClicked(MouseEvent e) {}
+	public void mouseEntered(MouseEvent e) {}
+	public void mouseExited(MouseEvent e) {}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/ExtendedFileFilter.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/ExtendedFileFilter.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/ExtendedFileFilter.java	(revision 15423)
@@ -0,0 +1,195 @@
+/* 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.swing.impl;
+
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.filechooser.FileFilter;
+
+
+/**
+ * ExtendedFileFilter es una clase para usarla junto a los JFileChooser.
+ * Ofrece una funcionalidad simple para poder agregar extensiones de manera
+ * comoda y rapida. Las descripciones ya las pone con un formato, asi que esto
+ * es opcional poner una descripci�n especifica.
+ * 
+ * Un ejemplo t�pico de como se usaria:
+ * <pre>
+ * // Usamos el JFileChooser de libUIComponents
+ * JFileChooser chooser = new JFileChooser(this.getClass().toString(), (File) null);
+ * // Desactivamos el modo de ver todos los ficheros
+ * chooser.setAcceptAllFileFilterUsed(false);
+ * // Activamos la multiseleccion
+ * chooser.setMultiSelectionEnabled(true);
+ * // Nos guardamos cada tipo de fichero en uno que contenga todos
+ * ExtendedFileFilter allFilters = new ExtendedFileFilter();
+ * for (int i = 0; i < formats.length; i++) {
+ *   ExtendedFileFilter fileFilter = new ExtendedFileFilter();
+ *   fileFilter.addExtension(formats[i]);
+ *   // Agregamos el filefilter al JFileChooser
+ *   chooser.addChoosableFileFilter(fileFilter);
+ *   // Agregamos el mismo filtro a un ExtendedFileFilter global 
+ *   allFilters.addExtension(formats[i]);
+ * }
+ * // Poner una descripcion (OPCIONAL) para todos los ficheros.
+ * allFilters.setDescription(PluginServices.getText(this, "todos_soportados"));
+ * // Lo a�adimos
+ * chooser.addChoosableFileFilter(allFilters);
+ * // Y lo dejamos seleccionado por defecto
+ * chooser.setFileFilter(allFilters);
+ * </pre>
+ * 
+ * @version 21/11/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ExtendedFileFilter extends FileFilter {
+	String description = null;
+
+	ArrayList<String> extensions = new ArrayList<String>();
+
+	/**
+	 * Constructor de un ExtendedFileFilter
+	 */
+	public ExtendedFileFilter() {
+	}
+
+	/**
+	 * Construye un ExtendedFileFilter con una extensi�n ya agregada
+	 * @param extension
+	 */
+	public ExtendedFileFilter(String extension) {
+		addExtension(extension);
+	}
+
+	/**
+	 * A�ade una extensi�n a la lista de extensiones soportadas
+	 * @param extension
+	 */
+	public void addExtension(String extension) {
+		if (extension == null)
+			return;
+
+		extensions.add(extension);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.filechooser.FileFilter#accept(java.io.File)
+	 */
+	public boolean accept(File f) {
+		if (f.isDirectory())
+			return true;
+
+		String s = f.getName();
+		int i = s.lastIndexOf('.');
+
+		if (i > 0 && i < s.length() - 1) {
+			String extension = s.substring(i + 1).toLowerCase();
+			for (int j = 0; j < extensions.size(); j++) {
+				if (extensions.get(j).toString().toLowerCase().equals(extension))
+					return true;
+			}
+		}
+
+		return false;
+	}
+
+	/**
+	 * Normaliza el nombre de un fichero, a�adiendo la extension si fuera
+	 * necesario
+	 * @param file
+	 * @return
+	 */
+	public String getNormalizedFilename(File file) {
+		String s = file.getName();
+		int i = s.lastIndexOf('.');
+
+		if (i > 0 && i < s.length() - 1) {
+			String extension = s.substring(i + 1).toLowerCase();
+			for (int j = 0; j < extensions.size(); j++) {
+				if (extensions.get(j).toString().toLowerCase().equals(extension))
+					return file.toString();
+			}
+		}
+
+		return file.toString() + "." + extensions.get(0).toString().toLowerCase();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.filechooser.FileFilter#getDescription()
+	 */
+	public String getDescription() {
+		String format1 = "";
+		String format2 = "";
+		for (int j = 0; j < extensions.size(); j++) {
+			if (format1.length() != 0) {
+				format1 = format1 + ", ";
+				format2 = format2 + "; ";
+			}
+			// Files JPG, GIF, ... (*.jpg; *.gif ...)
+			if (j >= 4) {
+				format1 = "...";
+				format2 = "...";
+				break;
+			}
+			format1 = format1 + extensions.get(j).toString().toUpperCase();
+			format2 = format2 + "*." + extensions.get(j).toString().toLowerCase();
+		}
+		if (description == null)
+			return "files" + " " + format1 + " (" + format2 + ")";
+
+		return description + " (" + format2 + ")";
+	}
+
+	/**
+	 * Especifica la descripcion del item
+	 * @param description the description to set
+	 */
+	public void setDescription(String description) {
+		this.description = description;
+	}
+
+	/**
+	 * Borra una extension de la lista de extensiones
+	 * @param extension
+	 */
+	public void removeExtension(String extension) {
+		extensions.remove(extension);
+ }
+
+	/**
+	 * Borra todas las extensiones existentes
+	 */
+	public void clearExtensions() {
+		extensions.clear();
+	}
+
+	/**
+	 * Devuelve una lista con las extensiones disponibles
+	 * @return
+	 */
+	public ArrayList<String> getExtensions() {
+		return extensions;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/newlayer/CreateNewLayerPanelImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/newlayer/CreateNewLayerPanelImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/newlayer/CreateNewLayerPanelImpl.java	(revision 15423)
@@ -0,0 +1,266 @@
+/* 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.swing.impl.newlayer;
+
+import java.awt.BorderLayout;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.io.File;
+import java.util.List;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JComponent;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.impl.openfile.OpenFileContainerImpl;
+import org.gvsig.raster.swing.newlayer.CreateNewLayerPanel;
+import org.gvsig.raster.swing.newlayer.FileNameManagement;
+import org.gvsig.raster.swing.openfile.OpenFileContainer;
+
+/**
+ * Panel to create a new layer. This panel gives the option to select a file
+ * or open in memory.
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class CreateNewLayerPanelImpl extends JPanel implements CreateNewLayerPanel {
+	private static final long    serialVersionUID     = -8569485642371687008L;
+	private JRadioButton         jRBFileGenerate      = null;
+	private JRadioButton         jRBOpenMemory        = null;
+	private JTextField           filenameTextField    = null;
+	private JLabel               labelFilename        = null;
+	private JPanel               panelNameFile        = null;
+	private List<String>         extList              = null;
+	private FileNameManagement   fileNameManagement   = null;
+	private OpenFileContainer    openFileContainer    = null;
+	
+	public CreateNewLayerPanelImpl(FileNameManagement fileNameManagement, String tittle) {
+		this.fileNameManagement = fileNameManagement;
+		this.extList = fileNameManagement.getPrefixSupported();
+		initialize(tittle);
+		translate();
+		
+		getFileSelectorPanel().setPath(fileNameManagement.getDefaultFilePath());
+		updateNewLayerText();
+	}
+	
+	public CreateNewLayerPanelImpl(FileNameManagement fileNameManagement) {
+		this(fileNameManagement, "");
+	}
+
+
+	private void initialize(String tittle) {
+		ButtonGroup buttonGroup2;
+		buttonGroup2 = new ButtonGroup();
+		buttonGroup2.add(getRadioFileGenerate());
+		buttonGroup2.add(getRadioOpenMemory());
+		
+		setLayout(new GridBagLayout());
+		setBorder(BorderFactory.createTitledBorder(tittle));
+		
+		GridBagConstraints gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.fill = GridBagConstraints.BOTH;
+		gridBagConstraints.weightx = 1.0D;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 5, 2);
+		
+		add(getRadioFileGenerate(), gridBagConstraints);
+		
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.insets = new Insets(2, 25, 5, 2);
+		add((JComponent)getFileSelectorPanel(), gridBagConstraints);
+
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(2, 2, 2, 2);
+		add(getRadioOpenMemory(), gridBagConstraints);
+		
+		gridBagConstraints.gridy = 3;
+		gridBagConstraints.insets = new Insets(2, 25, 2, 2);
+		add(getFileNamePanel(), gridBagConstraints);
+	}
+
+	/**
+	 * Seccion donde ir�n todas las traducciones invariables del componente
+	 */
+	private void translate() {
+		getRadioFileGenerate().setText(Messages.getText( "generar_fichero"));
+		getRadioOpenMemory().setText(Messages.getText( "abrir_memoria"));
+		getLabelFilename().setText(Messages.getText( "nombre_capa") + ":");
+	}
+
+	/**
+	 * Devuelve el JRadioButton de generar fichero
+	 * @return
+	 */
+	public JRadioButton getRadioFileGenerate() {
+		if (jRBFileGenerate == null) {
+			jRBFileGenerate = new JRadioButton();
+			jRBFileGenerate.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBFileGenerate.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return jRBFileGenerate;
+	}
+
+	/**
+	 * Devuelve el JRadioButton de Abrir en memoria
+	 * @return
+	 */
+	public JRadioButton getRadioOpenMemory() {
+		if (jRBOpenMemory == null) {
+			jRBOpenMemory = new JRadioButton();
+			jRBOpenMemory.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBOpenMemory.setMargin(new Insets(0, 0, 0, 0));
+
+			jRBOpenMemory.addItemListener(new ItemListener() {
+				public void itemStateChanged(ItemEvent evt) {
+					jRBOpenMemoryStateChanged(evt);
+				}
+			});
+			jRBOpenMemory.setSelected(true);
+		}
+		return jRBOpenMemory;
+	}
+
+	/**
+	 * This method initializes filenameTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getFilenameTextField() {
+		if (filenameTextField == null) {
+			filenameTextField = new JTextField();
+			filenameTextField.setPreferredSize(new Dimension(0, filenameTextField.getPreferredSize().height));
+		}
+		return filenameTextField;
+	}
+
+	public OpenFileContainer getFileSelectorPanel() {
+		if (openFileContainer == null) {
+			openFileContainer = new OpenFileContainerImpl(
+					false, 
+					extList, 
+					fileNameManagement.getDefaultFilePath());
+		}
+		return openFileContainer;
+	}
+
+	
+	public JPanel getFileNamePanel() {
+		if (panelNameFile == null) {
+			panelNameFile = new JPanel();
+			panelNameFile.setLayout(new BorderLayout());
+			panelNameFile.add(getLabelFilename(), BorderLayout.WEST);
+			panelNameFile.add(getFilenameTextField(), BorderLayout.CENTER);
+		}
+		return panelNameFile;
+	}
+
+	private JLabel getLabelFilename() {
+		if (labelFilename == null) {
+			labelFilename = new JLabel();
+		}
+		return labelFilename;
+	}
+
+	/**
+	 * Establece si esta habilitado o no el cuadro de texto de entrada de nombre de
+	 * fichero
+	 * @param value
+	 */
+	public void setFilenameEnabled(boolean value) {
+		getFilenameTextField().setEnabled(value);
+		getLabelFilename().setEnabled(value);
+	}
+
+	/**
+	 * Poner los estados de los RadioButton en caso de que cambien de valor
+	 * @param evt
+	 */
+	protected void jRBOpenMemoryStateChanged(ItemEvent evt) {
+		if (getRadioOpenMemory().getSelectedObjects() != null) {
+			getFileSelectorPanel().setEnabled(false);
+			setFilenameEnabled(true);
+		} else {
+			getFileSelectorPanel().setEnabled(true);
+			setFilenameEnabled(false);
+		}
+	}
+
+	/**
+	 * Establece el texto de la etiqueta del nombre de fichero
+	 * @param text
+	 */
+	public void setLabelFilename(String text) {
+		getLabelFilename().setText(text);
+	}
+
+	public String getFileSelected() {
+		boolean isDir = false;
+		if (getRadioFileGenerate().isSelected()) {
+			String path = getFileSelectorPanel().getFile().getAbsolutePath();
+			if(new File(path).isDirectory()) {
+				isDir = true;
+			} else {
+				return path.substring(path.lastIndexOf(File.separator) + 1, path.length());
+			}
+		} 
+		
+		if (!getRadioFileGenerate().isSelected() || isDir) {
+			String file = getFilenameTextField().getText();
+			if (file.compareTo(fileNameManagement.getUniqueLayerName()) == 0)
+				fileNameManagement.usesUniqueLayerName();
+			updateNewLayerText();
+			return file;
+		}
+		return null;
+	}
+	
+	public String getDirectorySelected() {
+		if (getRadioFileGenerate().isSelected()) {
+			String path = getFileSelectorPanel().getFile().getAbsolutePath();
+			if(new File(path).isDirectory()) {
+				return path;
+			} else {
+				return new File(path).getParent();
+			}
+		}
+		return fileNameManagement.getDefaultFilePath();
+	}
+	
+	/**
+	 * Especificar el nombre de la nueva capa para el recuadro de texto asignando
+	 * en cada llamada un nombre consecutivo.
+	 */
+	public void updateNewLayerText() {
+		getFilenameTextField().setText(fileNameManagement.getUniqueLayerName());
+	}
+
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/DefaultRasterSwingManager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/DefaultRasterSwingManager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/DefaultRasterSwingManager.java	(revision 15423)
@@ -0,0 +1,216 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl;
+
+import java.awt.Color;
+import java.util.ArrayList;
+import java.util.HashMap;
+
+import javax.swing.ImageIcon;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.table.DefaultTableModel;
+
+import org.gvsig.raster.swing.BasePanel;
+import org.gvsig.raster.swing.RasterSwingManager;
+import org.gvsig.raster.swing.RasterWindowManager;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+import org.gvsig.raster.swing.buttonbar.ButtonBar;
+import org.gvsig.raster.swing.gcanvas.GCanvas;
+import org.gvsig.raster.swing.impl.basepanel.ButtonsPanel;
+import org.gvsig.raster.swing.impl.buttonbar.ButtonBarContainerImpl;
+import org.gvsig.raster.swing.impl.canvas.DefaultGCanvas;
+import org.gvsig.raster.swing.impl.newlayer.CreateNewLayerPanelImpl;
+import org.gvsig.raster.swing.impl.openfile.OpenFileContainerImpl;
+import org.gvsig.raster.swing.impl.pagedtable.ModelLoaderImpl;
+import org.gvsig.raster.swing.impl.pagedtable.PagedTableImpl;
+import org.gvsig.raster.swing.impl.preview.PreviewBasePanel;
+import org.gvsig.raster.swing.impl.preview.SinglePreviewPanel;
+import org.gvsig.raster.swing.impl.roi.DefaultROIPanel;
+import org.gvsig.raster.swing.impl.slider.SliderTextContainer;
+import org.gvsig.raster.swing.impl.sumaryprocess.SummaryProcessDialog;
+import org.gvsig.raster.swing.impl.tool.infobypoint.MainInfoByPointPanelImpl;
+import org.gvsig.raster.swing.infobypoint.MainInfoByPointPanel;
+import org.gvsig.raster.swing.newlayer.CreateNewLayerPanel;
+import org.gvsig.raster.swing.newlayer.FileNameManagement;
+import org.gvsig.raster.swing.openfile.OpenFileContainer;
+import org.gvsig.raster.swing.pagedtable.ModelLoader;
+import org.gvsig.raster.swing.pagedtable.PagedTable;
+import org.gvsig.raster.swing.pagedtable.TableModel;
+import org.gvsig.raster.swing.preview.DataSourcePreview;
+import org.gvsig.raster.swing.preview.PreviewPanel;
+import org.gvsig.raster.swing.preview.PreviewRenderProcess;
+import org.gvsig.raster.swing.roi.ROIPanel;
+import org.gvsig.raster.swing.slider.SliderText;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.i18n.I18nManager;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Default implementation of the {@link CartociudadSwingManager}.
+ * 
+ * @author gvSIG Team
+ * @version $Id$
+ */
+public class DefaultRasterSwingManager implements RasterSwingManager {
+	private static final Logger  logger = LoggerFactory.getLogger(DefaultRasterSwingManager.class);
+    private RasterWindowManager rasterWindowManager;
+    private I18nManager i18nmanager = null;
+
+    public DefaultRasterSwingManager() {
+        this.i18nmanager = ToolsLocator.getI18nManager();       
+    }
+
+    public String getTranslation(String key) {
+        return this.i18nmanager.getTranslation(key);
+    }
+
+    public RasterWindowManager getWindowManager() {
+        return rasterWindowManager;
+    }
+
+    public void registerWindowManager(RasterWindowManager windowManager) {
+        this.rasterWindowManager = windowManager;        
+    }
+    
+	/**
+	 * Obtiene la traducci�n de la cadena de texto
+	 * @param parent Ventana padre
+	 * @param text Cadena a traducir
+	 * @return Cadena de texto traducida
+	 */
+	public static String getText(Object parent, String key) {
+		 if (key == null)
+	            return null;
+	        String translation = org.gvsig.i18n.Messages.getText(key, false);
+	        if (translation != null)
+	            return translation;
+	        else {
+	            logger.debug("Can't find translation for ''{1}''.", key);
+	            return key;
+	        }
+	}
+
+	public BasePanel createGenericBasePanel() {
+		return new GenericBasePanel();
+	}
+
+	public GCanvas createGraphicCanvas(Color backgroundColor) {
+		return new DefaultGCanvas(backgroundColor);
+	}
+	
+	@SuppressWarnings({ "rawtypes", "unchecked" })
+	public PreviewPanel createPreviewPanel(int buttons, 
+    		ArrayList list,
+    		JPanel generalPanel,
+    		JPanel downPreviewPanel,
+    		PreviewRenderProcess renderProcess,
+    		DataSourcePreview dataSource) {
+    	return new PreviewBasePanel(
+    			buttons, 
+    			list, 
+    			generalPanel, 
+    			downPreviewPanel, 
+    			renderProcess, 
+    			dataSource);
+    }
+    
+	public PreviewPanel createSinglePreviewPanel(
+			PreviewRenderProcess renderProcess, DataSourcePreview dataSource) {
+		return new SinglePreviewPanel(
+    			renderProcess, 
+    			dataSource);
+	}
+	
+	public PreviewPanel createSinglePreviewPanel( 
+    		PreviewRenderProcess renderProcess) {
+		return new SinglePreviewPanel(
+    			renderProcess);
+	}
+    
+    public MainInfoByPointPanel createInfoByPointPanel(
+    		HashMap<String, String> translations, 
+    		HashMap<String, ImageIcon> icons,
+    		JPanel extended) {
+    	return new MainInfoByPointPanelImpl(translations, icons, extended);
+    }
+    
+	public ButtonBar createButtonBar() {
+		return new ButtonBarContainerImpl();
+	}
+	
+    public CreateNewLayerPanel createNewLayerPanel(
+    		FileNameManagement fileNameManagement,
+    		String tittle) {
+    	return new CreateNewLayerPanelImpl(fileNameManagement, tittle);
+    }
+    
+    public CreateNewLayerPanel createNewLayerPanel(
+    		FileNameManagement fileNameManagement) {
+    	return new CreateNewLayerPanelImpl(fileNameManagement);
+    }
+    
+    public CreateNewLayerPanel createNewLayerPanel(String tittle) {
+    	FileNameManagement fileNameManagement = new FileNameManagementImpl();
+    	return new CreateNewLayerPanelImpl(fileNameManagement, tittle);
+    }
+    
+    public CreateNewLayerPanel createNewLayerPanel() {
+    	FileNameManagement fileNameManagement = new FileNameManagementImpl();
+    	return new CreateNewLayerPanelImpl(fileNameManagement);
+    }
+    
+    public OpenFileContainer createOpenFileContainer(boolean showBorder, String[] fileFilter, String defaultPath) {
+    	return new OpenFileContainerImpl(showBorder, fileFilter, defaultPath);
+    }
+    
+    public ROIPanel createROIPanel() {
+    	return new DefaultROIPanel();
+    }
+
+	public PagedTable createPagedTable(ModelLoader modelLoader) {
+		return new PagedTableImpl(modelLoader);
+	}
+	
+	public ModelLoader createModelLoader(TableModel tableModel) {
+		return new ModelLoaderImpl((DefaultTableModel)tableModel);
+	}
+	
+	public IButtonsPanel createButtonsPanel(int buttons, JComponent parent) {
+		return new ButtonsPanel(buttons, parent);
+	}
+
+	public SliderText createSliderText(int min, int max, int defaultValue, boolean border) {
+		return new SliderTextContainer(min, max, defaultValue, border);
+	}
+	
+	public FileNameManagement createFileNameManagement() {
+		return new FileNameManagementImpl();
+	}
+	
+    public void showSummaryProcessDialog(String fileName, long time) {
+    	SummaryProcessDialog.show(fileName, time);
+	}
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PagedTablePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PagedTablePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PagedTablePanel.java	(revision 15423)
@@ -0,0 +1,324 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.awt.BorderLayout;
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.List;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.JPanel;
+import javax.swing.JTable;
+import javax.swing.event.TableModelEvent;
+import javax.swing.event.TableModelListener;
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.JTableHeader;
+import javax.swing.table.TableColumn;
+
+import org.gvsig.raster.swing.pagedtable.ModelLoader;
+import org.gvsig.raster.swing.pagedtable.PagedTableEvent;
+
+
+/**
+ * Paged table
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PagedTablePanel extends JPanel implements MouseListener, Observer, TableModelListener {
+	private static final long          serialVersionUID       = 1L;
+	private PagedJTable                jTable                 = null;
+	private ModelLoader                modelLoader            = null;
+	private DefaultTableModel          model                  = null;
+	private Pager                      pager                  = null;
+	private int                        heightLine             = 16;
+	
+	public class PagedJTable extends JTable {
+		private static final long serialVersionUID = 1L;
+
+		public PagedJTable(DefaultTableModel model, String[] columnNames) {
+			super(null, columnNames);
+			this.setModel(model);
+		}
+		
+		/**
+		 * Reimplemented to calculate the number of pages when the component gets
+		 * a resize event
+		 */
+		public void setBounds(int x, int y, int width, int height) {
+	        super.setBounds(x, y, width, height);
+	        int entriesPerPage = (int)(getHeight() / (double)heightLine);
+			getPager(entriesPerPage);
+	    }
+	}
+	
+	public PagedTablePanel(ModelLoader modelLoader,
+			Pager pager, 
+			PaginationBarPanel paginationBar,
+			MoveRowsPanel moveRowsPanel, 
+			TableEntryControllerPanel tableEntryControllerPanel) {
+		this.modelLoader = modelLoader;
+		this.pager = pager;
+		this.model = (DefaultTableModel)modelLoader.getTableModel();
+		initGUI(paginationBar, moveRowsPanel, tableEntryControllerPanel);
+		
+	}
+	
+	private void initGUI(
+			PaginationBarPanel paginationBar, 
+			MoveRowsPanel moveRowsPanel, 
+			TableEntryControllerPanel tableEntryControllerPanel) {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.BOTH;
+		gbc.weightx = 1;
+		gbc.weighty = 1;
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		
+		add(getJTableWithHeader(), gbc);
+		
+		gbc.fill = GridBagConstraints.VERTICAL;
+		gbc.weightx = 0;
+		gbc.weighty = 1;
+		gbc.gridx = 1;
+		gbc.gridy = 0;
+		
+		add(paginationBar, gbc);
+		
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1;
+		gbc.weighty = 0;
+		gbc.gridx = 0;
+		gbc.gridy = 1;
+		gbc.gridwidth = 2;
+		
+		JPanel panel = new JPanel();
+		panel.setLayout(new FlowLayout(FlowLayout.CENTER, 0, 0));
+		panel.add(tableEntryControllerPanel);
+		panel.add(moveRowsPanel);
+		add(panel, gbc);
+	}
+	
+	public Pager getPager(int nEntriesPerPage) {
+		pager.setEntriesPerPage(nEntriesPerPage);
+		return pager;
+	}
+	
+	/**
+	 * Gets a panel with the JTable and its header
+	 * @return
+	 */
+	public JPanel getJTableWithHeader() {
+		JPanel p = new JPanel(new BorderLayout());
+		JTableHeader header = getJTable().getTableHeader();
+		p.add(header, BorderLayout.NORTH);
+		p.add(getJTable(), BorderLayout.CENTER);
+		return p;
+	}
+	
+	/**
+	 * Gets the JTable
+	 * @return Tabla de bandas de la imagen
+	 */
+	public JTable getJTable() {
+		if (jTable == null) {
+			jTable = new PagedJTable(model, modelLoader.getColumnNames());
+			jTable.addMouseListener(this);
+			jTable.setAutoResizeMode(JTable.AUTO_RESIZE_ALL_COLUMNS);
+			model.addTableModelListener(this);
+			
+			TableColumn column = null;
+
+			int widthPerColumn = (int) (this.getWidth() / modelLoader.getColumnNames().length);
+			for (int i = 0; i < modelLoader.getColumnNames().length; i++) {
+				column = jTable.getColumnModel().getColumn(i);
+				column.setResizable(true);
+				if (modelLoader.getColumnWidths() == null)
+					column.setPreferredWidth(widthPerColumn);
+				else {
+					if(i < modelLoader.getColumnWidths().length && 
+					   modelLoader.getColumnWidths()[i] > 0) {
+						column.setMaxWidth(modelLoader.getColumnWidths()[i]);
+					} else {
+						if(modelLoader.getColumnWidths()[i] == 0) {
+							column.setMinWidth(0);
+							column.setMaxWidth(0);
+						} else
+							column.setPreferredWidth(widthPerColumn);
+					}
+				}
+				if(modelLoader.getCellEditorForColumn(i) != null)
+					column.setCellEditor(modelLoader.getCellEditorForColumn(i));
+				if(modelLoader.getRenderForColumn(i) != null)
+					column.setCellRenderer(modelLoader.getRenderForColumn(i));
+			}
+		}
+
+		return jTable;
+	} 
+	
+
+	public void tableChanged(TableModelEvent e) {
+		if(e.getType() == TableModelEvent.UPDATE) {
+			int column = e.getColumn();
+			if(column != TableModelEvent.ALL_COLUMNS) {
+				Object[] entry = pager.getEntry(pager.getRowFromPageRow(e.getFirstRow()));
+				if(entry != null && column >= 0 && column < entry.length)
+					entry[column] = model.getValueAt(e.getFirstRow(), column);
+				pager.throwEvent(PagedTableEvent.EVENT_MODIFY_ENTRY, new int[]{e.getFirstRow()});
+			}
+		}
+	}
+	
+	public void setLineHeight(int height) {
+		this.heightLine = height;
+	}
+	
+	/**
+	 * Gets the number of rows in this table
+	 * @return N�mero de filas de la tabla
+	 */
+	public int getRowTableCount() {
+		return model.getRowCount();
+	}
+	
+	/**
+	 * Gets the selected point
+	 * @return position of the selected point
+	 */
+	public int getSelectedTableRow() {
+		return getJTable().getSelectedRow();
+	}
+	
+	/**
+	 * Reloads the selected page in the visual table
+	 */
+	private int reloadPage() {
+		model.setNumRows(0);
+		List<Object> lines = pager.getSelectedPage();
+		if(lines == null)
+			return pager.getSelectedPageNumber();
+		for (int i = 0; i < lines.size(); i++) {
+			model.addRow((Object[])lines.get(i));
+		}
+		return pager.getSelectedPageNumber();
+	}
+
+	public void mouseClicked(MouseEvent e) {
+		if(e.getSource() == jTable) {
+			//When the user clicks on table, it selects the entry in the table control
+			int selVisualRow = getSelectedTableRow();
+			if(selVisualRow >= 0) {
+				int selRow = pager.getSelectedPageNumber() * pager.getEntriesPerPage() + selVisualRow;
+				pager.setSelectedRows(new int[]{selRow});
+			}
+		}
+	}
+
+	public void mouseEntered(MouseEvent e) {
+		
+	}
+
+	public void mouseExited(MouseEvent e) {
+		
+	}
+
+	public void mousePressed(MouseEvent e) {
+		
+	}
+
+	public void mouseReleased(MouseEvent e) {
+		
+	}
+
+	
+	public void update(Observable o, Object arg) {
+		if(o instanceof Pager && arg instanceof Integer) {
+			int option = ((Integer)arg).intValue();
+			if(option == PagedTableEvent.EVENT_SELECTED_ROWS ) {
+				Pager pager = (Pager)o;
+				int[] selectedRows = pager.getSelectedRows();
+				if(selectedRows != null && selectedRows.length > 0) {
+					if(!pager.isInCurrentPage(selectedRows[0])) {
+						pager.setSelectedPage(pager.getPageFromRow(selectedRows[0]));
+						reloadPage();
+					}
+					if(pager.getEntriesPerPage() > 0) {
+						int r = selectedRows[0] % pager.getEntriesPerPage();
+						if(r >= 0 && r < model.getRowCount())
+							getJTable().setRowSelectionInterval(r, r);
+					}
+				}
+			}
+			
+			if(option == PagedTableEvent.EVENT_ADD_ENTRY ) {
+				model.addRow(pager.getLastEntry());
+				int lastTableRow = model.getRowCount() - 1;
+				getJTable().setRowSelectionInterval(lastTableRow, lastTableRow);
+			}
+			
+			if(option == PagedTableEvent.EVENT_REMOVE_ENTRY ) {
+				int[] selectedRows = pager.getSelectedRows();
+				reloadPage();
+				if(selectedRows != null && pager.getEntriesPerPage() > 0) {
+					int r = selectedRows[0] % pager.getEntriesPerPage();
+					if(r >= 0 && r < model.getRowCount()) {
+						getJTable().setRowSelectionInterval(r, r);
+					}
+				}
+			}
+			
+			if(option == PagedTableEvent.EVENT_REMOVE_ALL ) {
+				model.setNumRows(0);
+			}
+			
+			if(option == PagedTableEvent.EVENT_SELECTED_PAGE || option == PagedTableEvent.EVENT_MODIFY_ENTRY) {
+				reloadPage();
+				int[] selectedRows = pager.getSelectedRows();
+				if(selectedRows != null && pager.getEntriesPerPage() > 0) {
+					int nPage = pager.getSelectedPageNumber();
+					int initEntry = nPage * pager.getEntriesPerPage();
+					int endEntry = Math.min(initEntry + pager.getEntriesPerPage(), pager.getEntriesCount());
+					int selectedRow = selectedRows[0];
+					getJTable().clearSelection();
+					if(selectedRow >= initEntry && selectedRow < endEntry) {
+						int r = selectedRows[0] % pager.getEntriesPerPage();
+						getJTable().setRowSelectionInterval(r, r);
+					}
+				}
+			}
+			
+			if(option == PagedTableEvent.EVENT_SWAP_ENTRIES) {
+				reloadPage();
+			}
+			
+		}
+	}
+
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/ModelLoaderImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/ModelLoaderImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/ModelLoaderImpl.java	(revision 15423)
@@ -0,0 +1,91 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.table.DefaultTableModel;
+import javax.swing.table.TableCellEditor;
+import javax.swing.table.TableCellRenderer;
+
+import org.gvsig.raster.swing.pagedtable.ModelLoader;
+import org.gvsig.raster.swing.pagedtable.TableModel;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class ModelLoaderImpl implements ModelLoader {
+	private DefaultTableModel         tableModel   = null;
+	private List<TableCellEditor>     editorList   = null;
+	private List<TableCellRenderer>   renderList   = null;
+	private String[]                  columnNames  = null;
+	private int[]                     columnWidths = null;
+	
+	public ModelLoaderImpl(DefaultTableModel tableModel) {
+		this.tableModel = tableModel;
+		editorList = new ArrayList<TableCellEditor>(tableModel.getColumnCount());
+		renderList = new ArrayList<TableCellRenderer>(tableModel.getColumnCount());
+	}
+	
+	public TableCellEditor getCellEditorForColumn(int column) {
+		if(editorList.size() > column)
+			return editorList.get(column);
+		return null;
+	}
+
+	public TableCellRenderer getRenderForColumn(int column) {
+		if(renderList.size() > column)
+			return renderList.get(column);
+		return null;
+	}
+
+	public TableModel getTableModel() {
+		return (TableModel)tableModel;
+	}
+
+	public void setCellEditorForColumn(int column, TableCellEditor editor) {
+		editorList.add(column, editor);
+	}
+
+	public void setRenderForColumn(int column, TableCellRenderer render) {
+		renderList.add(column, render);
+	}
+	
+	public String[] getColumnNames() {
+		return columnNames;
+	}
+	
+	public int[] getColumnWidths() {
+		return columnWidths;
+	}
+	
+	public void setColumnNames(String[] columnNames) {
+		this.columnNames = columnNames;
+	}
+	
+	public void setColumnWidths(int[] columnWidths) {
+		this.columnWidths = columnWidths;
+	}
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PagedTableImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PagedTableImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PagedTableImpl.java	(revision 15423)
@@ -0,0 +1,212 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import javax.swing.JComponent;
+import javax.swing.JTable;
+
+import org.gvsig.raster.swing.pagedtable.ModelLoader;
+import org.gvsig.raster.swing.pagedtable.PagedTable;
+import org.gvsig.raster.swing.pagedtable.PagedTableEvent;
+import org.gvsig.raster.swing.pagedtable.PagedTableListener;
+import org.gvsig.raster.swing.pagedtable.TableModel;
+
+
+/**
+ * Paged table
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class PagedTableImpl implements PagedTable {
+	private static final long          serialVersionUID       = 1L;
+	private ModelLoader                modelLoader            = null;
+	private PagedTablePanel            panel                  = null;
+	private PaginationBarPanel         paginationBar          = null;
+	private TableEntryControllerPanel  tableEntryController   = null;
+	private TableControllerListener    tableListener          = null;
+	private MoveRowsPanel              moveRowsPanel          = null;
+	private Pager                      pager                  = null;
+	
+	public PagedTableImpl(ModelLoader modelLoader) {
+		this.modelLoader = modelLoader;
+		tableListener = new TableControllerListener(this);
+		getPager().addObserver(getTableEntryController());
+		getPager().addObserver(getPaginationBar());
+		getPager().addObserver(getMoveRowsPanel());
+		getPager().addObserver(getPagedTablePanel());
+	}
+	
+	public Pager getPager() {
+		if(pager == null) {
+			pager = new Pager(0, this);
+		}
+		return pager;
+	}
+	
+	public TableEntryControllerPanel getTableEntryController() {
+		if(tableEntryController == null) {
+			tableEntryController = new TableEntryControllerPanel(tableListener);
+		}
+		return tableEntryController;
+	}
+	
+	public PagedTablePanel getPagedTablePanel() {
+		if(panel == null) {
+			panel = new PagedTablePanel(modelLoader, 
+					getPager(), 
+					getPaginationBar(), 
+					getMoveRowsPanel(),
+					getTableEntryController());
+		}
+		return panel;
+	}
+	
+	public Object getValueAt(int row, int column) {
+		Object[] entry = pager.getEntry(row);
+		if(entry != null && column >= 0 && column < entry.length)
+			return entry[column];
+		return null;
+	}
+	
+	public void setValueAt(Object obj, int row, int column) {
+		Object[] entry = pager.getEntry(row);
+		if(entry != null && column >= 0 && column < entry.length)
+			entry[column] = obj;
+		pager.throwEvent(PagedTableEvent.EVENT_MODIFY_ENTRY, new int[]{row});
+	}
+	
+	public int getColumnCount() {
+		return panel.getJTable().getModel().getColumnCount();
+	}
+	
+	public int getRowCount() {
+		return pager.getEntriesCount();
+	}
+	
+	public MoveRowsPanel getMoveRowsPanel() {
+		if (moveRowsPanel == null) {
+			moveRowsPanel = new MoveRowsPanel(tableListener);
+		}
+		return moveRowsPanel;
+	}
+	
+	public PaginationBarPanel getPaginationBar() {
+		if(paginationBar == null) {
+			paginationBar = new PaginationBarPanel(tableListener);
+		}
+		return paginationBar;
+	}
+	
+	public void addRow(Object[] list) {
+		pager.addEntry(list);
+	}
+	
+	public void delRow(int i) {
+		pager.removeEntry(i);
+	}
+	
+	public void removeAllRows() {
+		pager.removeAllEntries();
+	}
+	
+	public void removeAllRowsWithoutAsk() {
+		pager.removeAllEntriesWithoutAsk();
+	}
+	
+	public int[] getSelectedRows() {
+		return pager.getSelectedRows();
+	}
+	
+	public void swapRow(int i, int j) {
+		pager.swapRow(i, j);
+	}
+	
+	public void setSelectedRows(int[] rows) {
+		pager.setSelectedRows(rows);
+	}
+	
+	public void setSelectedRow(int row) {
+		if(row == -1) {
+			pager.setSelectedRows(new int[]{pager.getEntriesCount() - 1});
+		} else {
+			pager.setSelectedRows(new int[]{row});
+		}
+	}
+	
+	public void addSelectedRow(int row) {
+		pager.addSelectedRow(row);
+	}
+	
+	public void increaseSelectedRows() {
+		pager.increaseSelectedRows();
+	}
+	
+	public void decreaseSelectedRows() {
+		pager.decreaseSelectedRows();
+	}
+	
+	public void nextPage() {
+		pager.increaseSelectedPage();
+	}
+	
+	public void prevPage() {
+		pager.decreaseSelectedPage();
+	}
+	
+	public void setSelectedPage(int pageNumber) {
+		pager.setSelectedPage(pageNumber);
+	}
+	
+	public TableModel getTableModel() {
+		return modelLoader.getTableModel();
+	}
+	
+	public JComponent getComponent() {
+		return panel;
+	}
+	
+	public JTable getJTable() {
+		return panel.getJTable();
+	}
+	
+	public void showMoveRowsControls(boolean show) {
+		getMoveRowsPanel().setVisible(false);
+	}
+	
+	public void showControllerTable(boolean show) {
+		getTableEntryController().setVisible(false);
+	}
+	
+	public void addListener(PagedTableListener listener) {
+		pager.addListener(listener);
+	}
+	
+	public void setConfirmationMessageDeleteAllEntries(String message) {
+		pager.setConfirmationMessageDeleteAllEntries(message);
+	}
+	
+	public void setConfirmationMessageDeleteOneEntry(String message) {
+		pager.setConfirmationMessageDeleteOneEntry(message);
+	}
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/TableEntryControllerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/TableEntryControllerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/TableEntryControllerPanel.java	(revision 15423)
@@ -0,0 +1,462 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.awt.Dimension;
+import java.awt.FlowLayout;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.gui.util.StatusComponent;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.pagedtable.PagedTableEvent;
+
+/**
+ * Control para el manejo de tablas. No contiene eventos, estos deben ser
+ * manejados desde la clase que lo llame.
+ * @author Nacho Brodin (brodin_ign@gva.es)
+ */
+public class TableEntryControllerPanel extends JPanel implements Observer {
+	private static final long serialVersionUID    = -6442685244347917638L;
+	private int               HEIGHT_BUTTONS      = 19;                   // 16
+																																			// estaria
+																																			// bien
+	// **********************Vars**********************************
+	private JButton           bPrev               = null;
+	private JComboBox         cPoint              = null;
+	private JButton           bNext               = null;
+	private JButton           bFirst              = null;
+	private JButton           bLast               = null;
+	private JLabel            lPoints             = null;
+	private JLabel            lNumberOfPoints     = null;
+	private JButton           bNew                = null;
+	private JButton           bDelPoint           = null;
+	private JButton           bClear              = null;
+
+	private String            pathToImagesForTest = "/src/main/resources/images/";
+
+	/**
+	 * Objeto para controlar el estado de los componentes visuales
+	 */
+	private StatusComponent   statusComponent  = null;
+
+	// **********************End Vars******************************
+
+	// **********************Methods*******************************
+	/**
+	 * This is the default constructor
+	 */
+	public TableEntryControllerPanel(TableControllerListener tableListener) {
+		tableListener.setControlPanel(this);
+		initialize(tableListener);
+	}
+
+	/**
+	 * This method initializes this
+	 * @return void
+	 */
+	private void initialize(TableControllerListener tableListener) {
+		statusComponent = new StatusComponent(this);
+
+		this.setLayout(new FlowLayout(FlowLayout.CENTER, 1, 0));
+		this.setAlignmentX(0);
+
+		lPoints = new JLabel();
+		lPoints.setText(Messages.getText("registro") + " ");
+		this.add(lPoints);
+
+		this.add(getBFirst());
+		this.add(getBPrev());
+		this.add(getCPoint());
+		this.add(getBNext());
+		this.add(getBLast());
+		this.add(getBNew());
+		this.add(getLNumberOfPoints());
+		this.add(getBDelPoint());
+		this.add(getBClear());
+
+		getBFirst().addActionListener(tableListener);
+		getBPrev().addActionListener(tableListener);
+		getCPoint().addActionListener(tableListener);
+		getBNext().addActionListener(tableListener);
+		getBLast().addActionListener(tableListener);
+		getBNew().addActionListener(tableListener);
+		getBDelPoint().addActionListener(tableListener);
+		getBClear().addActionListener(tableListener);
+	}
+
+	/**
+	 * Esta funci�n deshabilita todos los controles y guarda sus valores de
+	 * habilitado o deshabilitado para que cuando se ejecute restoreControlsValue
+	 * se vuelvan a quedar como estaba
+	 */
+	public void disableAllControls() {
+		statusComponent.setEnabled(false);
+	}
+
+	/**
+	 * Esta funci�n deja los controles como estaban al ejecutar la funci�n
+	 * disableAllControls
+	 */
+	public void restoreControlsValue() {
+		statusComponent.setEnabled(true);
+	}
+	
+	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;
+	}
+
+	// **********************Methods*******************************
+	/**
+	 * This method initializes jButton
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBFirst() {
+		if (bFirst == null) {
+			bFirst = new JButton();
+			bFirst.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bFirst.setEnabled(false);
+			bFirst.setIcon(loadIcon("first"));
+			bFirst.setToolTipText(Messages.getText("primero"));
+		}
+		return bFirst;
+	}
+
+	/**
+	 * This method initializes jButton
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBLast() {
+		if (bLast == null) {
+			bLast = new JButton();
+			bLast.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bLast.setEnabled(false);
+			bLast.setIcon(loadIcon("last"));
+			bLast.setToolTipText(Messages.getText("ultimo"));
+		}
+		return bLast;
+	}
+
+	/**
+	 * This method initializes bBefore
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBPrev() {
+		if (bPrev == null) {
+			bPrev = new JButton();
+			bPrev.setText("");
+			bPrev.setEnabled(false);
+			bPrev.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bPrev.setIcon(loadIcon("prev"));
+			bPrev.setActionCommand("");
+			bPrev.setToolTipText(Messages.getText("anterior"));
+		}
+		return bPrev;
+	}
+
+	/**
+	 * This method initializes bNext
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBNext() {
+		if (bNext == null) {
+			bNext = new JButton("");
+			bNext.setEnabled(false);
+			bNext.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bNext.setIcon(loadIcon("next"));
+			bNext.setActionCommand("");
+			bNext.setToolTipText(Messages.getText("siguiente"));
+		}
+		return bNext;
+	}
+
+	/**
+	 * Este m�todo inicializa el combo que contiene el n�mero de puntos.
+	 * @return javax.swing.JComboBox
+	 */
+	public JComboBox getCPoint() {
+		if (cPoint == null) {
+			cPoint = new JComboBox();
+			cPoint.setPreferredSize(new Dimension(64, HEIGHT_BUTTONS));
+		}
+		return cPoint;
+	}
+
+	/**
+	 * @return Returns the lNumberOfPoints.
+	 */
+	public JLabel getLNumberOfPoints() {
+		if (lNumberOfPoints == null) {
+			lNumberOfPoints = new JLabel();
+			lNumberOfPoints.setText(Messages.getText("de") + " 0");
+			// lNumberOfPoints.setPreferredSize(new java.awt.Dimension(35,15));
+		}
+		return lNumberOfPoints;
+	}
+
+	/**
+	 * This method initializes jButton
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBNew() {
+		if (bNew == null) {
+			bNew = new JButton();
+			bNew.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bNew.setIcon(loadIcon("newpoint"));
+			bNew.setToolTipText(Messages.getText("nuevo"));
+		}
+		return bNew;
+	}
+
+	/**
+	 * Este m�todo inicializa el bot�n del eliminar punto que har� que se elimine
+	 * el punto seleccionado.
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBDelPoint() {
+		if (bDelPoint == null) {
+			bDelPoint = new JButton();
+			bDelPoint.setText("");
+			bDelPoint.setEnabled(false);
+			bDelPoint.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bDelPoint.setIcon(loadIcon("delone"));
+			bDelPoint.setToolTipText(Messages.getText("borrar_uno"));
+		}
+		return bDelPoint;
+	}
+
+	/**
+	 * Este m�todo inicializa el bot�n del clear que har� que se eliminen todos
+	 * los puntos seleccionados.
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBClear() {
+		if (bClear == null) {
+			bClear = new JButton();
+			bClear.setText("");
+			bClear.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bClear.setEnabled(false);
+			bClear.setIcon(loadIcon("delall"));
+			bClear.setActionCommand("");
+			bClear.setToolTipText(Messages.getText("borrar_todos"));
+		}
+		return bClear;
+	}
+
+	/**
+	 * Resetea el control al estado inicial. Limpia el combo, pone el n�mero de
+	 * elementos a 0 y desactiva las flechas.
+	 */
+	public void resetControls() {
+		getCPoint().removeAllItems();
+		getLNumberOfPoints().setText(Messages.getText("de 0"));
+		checkArrows();
+	}
+
+	/**
+	 * Elimina del control un elemento de una posici�n.
+	 * <UL>
+	 * <LI>Actualiza el combo</LI>
+	 * <LI>Actualiza el texto que dice el n�mero de elementos</LI>
+	 * <LI>Actualiza las flechas</LI>
+	 * </UL>
+	 * @param pos Posici�n del elemento a eliminar.
+	 */
+	public void setNItems(int n) {
+		// if(n < 1)
+		// return;
+		getCPoint().removeAllItems();
+		for (int i = 1; i <= n; i++) {
+			try {
+				getCPoint().addItem(String.valueOf(i));
+			} catch (ArrayIndexOutOfBoundsException ex) {
+				// No a�adimos nada
+			}
+		}
+		getLNumberOfPoints().setText(Messages.getText("de") + " " + n);
+		checkArrows();
+	}
+
+	/**
+	 * Selecciona un elemento del control
+	 * @param index
+	 */
+	public void setSelectedIndex(int index) {
+		try {
+			getCPoint().setSelectedIndex(index);
+		} catch (IllegalArgumentException ex) {
+
+		}
+		checkArrows();
+	}
+
+	/**
+	 * Devuelve el punto seleccionado
+	 * @return Punto seleccionado.
+	 */
+	public int getSelectedIndex() {
+		return getCPoint().getSelectedIndex();
+	}
+
+	/**
+	 * Obtiene el n�mero de elementos en la lista.
+	 * @return N�mero de elementos
+	 */
+	public int getItemCount() {
+		return getCPoint().getItemCount();
+	}
+
+	/**
+	 * Obtiene el Objeto seleccionado como cadena de texto.
+	 * @return N�mero seleccionado
+	 */
+	public String getSelectedItem() {
+		return getCPoint().getSelectedItem().toString();
+	}
+
+	/**
+	 * Comprueba la posici�n del combo para ver si tiene que habilitar o
+	 * deshabilitar las flechas de delante y detr�s.
+	 */
+	public void checkArrows() {
+		if (!statusComponent.isEnabled())
+			return;
+
+		if (getCPoint().getItemCount() <= 0) {
+			getBClear().setEnabled(false);
+			getBDelPoint().setEnabled(false);
+		} else {
+			getBClear().setEnabled(true);
+			getBDelPoint().setEnabled(true);
+		}
+
+		if (getCPoint().getSelectedIndex() == -1) {
+			getBPrev().setEnabled(false);
+			getBNext().setEnabled(false);
+			getBLast().setEnabled(false);
+			getBFirst().setEnabled(false);
+
+			return;
+		}
+		if (getCPoint().getSelectedIndex() == 0) {
+			getBPrev().setEnabled(false);
+			getBFirst().setEnabled(false);
+		} else {
+			getBPrev().setEnabled(true);
+			getBFirst().setEnabled(true);
+		}
+
+		if (getCPoint().getSelectedIndex() == (getCPoint().getItemCount() - 1)) {
+			getBNext().setEnabled(false);
+			getBLast().setEnabled(false);
+		} else {
+			getBNext().setEnabled(true);
+			getBLast().setEnabled(true);
+		}
+	}
+
+	/**
+	 * A�ade un punto al combo y checkea los controles colocandolos en los valores
+	 * correctos.
+	 * @param countPoints N�mero de punto a a�adir al final del combo
+	 */
+	public void addPointToTable(int countPoints) {
+		getCPoint().addItem("" + countPoints);
+		getLNumberOfPoints().setText(Messages.getText("de") + " " + countPoints);
+		setSelectedIndex(getItemCount() - 1);
+		checkArrows();
+	}
+
+	/**
+	 * Asigna la ruta donde est�n las imagenes
+	 * @param pathToImages
+	 */
+	public void setPathToImages(String pathToImages) {
+		this.pathToImagesForTest = pathToImages;
+	}
+
+	/**
+	 * Activa o desactiva este panel y todos los que lo componen
+	 * @param enabled variable booleana para la activaci�n y/o desactivaci�n
+	 */
+	public void setEnabled(boolean enabled) {
+		this.getBDelPoint().setEnabled(enabled);
+		this.getBClear().setEnabled(enabled);
+	}
+
+	/**
+	 * Dice si los controles est�n deshabilitados o no
+	 * @return true si est� habilitado y false si no lo est�
+	 */
+	public boolean isDisableAllControls() {
+		return !statusComponent.isEnabled();
+	}
+
+	/**
+	 * Receives the event when the rows selected are updated
+	 */
+	public void update(Observable o, Object arg) {
+		Pager pager = (Pager)o;
+		if(o instanceof Pager && arg instanceof Integer) {
+			int option = ((Integer)arg).intValue();
+			if(option == PagedTableEvent.EVENT_SELECTED_ROWS ) {
+				int[] selectedRows = pager.getSelectedRows();
+				if(selectedRows != null && selectedRows.length > 0)
+					setSelectedIndex(selectedRows[0]);
+			}
+			
+			if(option == PagedTableEvent.EVENT_ADD_ENTRY ) {
+				addPointToTable(pager.getEntriesCount());
+			}
+			
+			if(option == PagedTableEvent.EVENT_REMOVE_ENTRY ) {
+				setNItems(pager.getEntriesCount());
+				int[] selectedRows = pager.getSelectedRows();
+				if(selectedRows != null && selectedRows.length >= 1) {
+					setSelectedIndex(selectedRows[0] % pager.getEntriesPerPage());
+				}
+			}
+			
+			if(option == PagedTableEvent.EVENT_REMOVE_ALL ) {
+				setNItems(0);
+			}
+		}
+		
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/Pager.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/Pager.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/Pager.java	(revision 15423)
@@ -0,0 +1,375 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Observable;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.pagedtable.PagedTable;
+import org.gvsig.raster.swing.pagedtable.PagedTableEvent;
+import org.gvsig.raster.swing.pagedtable.PagedTableListener;
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class Pager extends Observable {
+	private List<Object>             entries                  = null;
+	private int                      entriesPerPage           = 0;
+	private int                      selectedPage             = 0;
+	private int[]                    selectedRows             = null;
+	private List<PagedTableListener> listeners                = null;
+	private PagedTable               table                    = null;
+	private String                   deleteOneEntryMessage    = null;
+	private String                   deleteAllEntriesMessage  = null;
+	
+	public Pager(int entriesPerPage, PagedTable table) {
+		this.entriesPerPage = entriesPerPage;
+		entries = new ArrayList<Object>();
+		listeners = new ArrayList<PagedTableListener>();
+		this.table = table;
+	}
+	
+	public void throwEvent(int event, int[] rows) {
+		setChanged();
+		notifyObservers(event);
+		for (int i = 0; i < listeners.size(); i++) {
+			listeners.get(i).tableChanged(new PagedTableEvent(table, event, rows));
+		}
+	}
+	
+	public void setConfirmationMessageDeleteAllEntries(String message) {
+		deleteAllEntriesMessage = message;
+	}
+	
+	public void setConfirmationMessageDeleteOneEntry(String message) {
+		deleteOneEntryMessage = message;
+	}
+	
+	//*************ROWS**********************
+	
+	public void setSelectedRows(int[] rows) {
+		selectedRows = rows;
+		throwEvent(PagedTableEvent.EVENT_SELECTED_ROWS, rows);
+	}
+	
+	public void increaseSelectedRows() {
+		boolean change = false;
+		for (int i = 0; i < selectedRows.length; i++) {
+			if(selectedRows[i] < getEntriesCount()) {
+				selectedRows[i] ++;
+				change = true;
+			}
+		}
+		if(change) {
+			throwEvent(PagedTableEvent.EVENT_SELECTED_ROWS, selectedRows);
+		}
+	}
+	
+	public void decreaseSelectedRows() {
+		boolean change = false;
+		for (int i = 0; i < selectedRows.length; i++) {
+			if(selectedRows[i] > 0) {
+				selectedRows[i] --;
+				change = true;
+			}
+		}
+		if(change) {
+			throwEvent(PagedTableEvent.EVENT_SELECTED_ROWS, selectedRows);
+		}
+	}
+	
+	public void addSelectedRow(int row) {
+		int[] newSelected = new int[selectedRows.length + 1];
+		for (int i = 0; i < selectedRows.length; i++) {
+			newSelected[i] = selectedRows[i];
+		}
+		newSelected[newSelected.length - 1] = row;
+		selectedRows = newSelected;
+		throwEvent(PagedTableEvent.EVENT_SELECTED_ROWS, selectedRows);
+	}
+	
+	public int[] getSelectedRows() {
+		return selectedRows;
+	}
+	
+	/**
+	 * Adds a new entry. In the first place, if it is necessary 
+	 * changes the selected page and throws the event to actualize the
+	 * table and controls. Next it will notify the "add entry" event 
+	 * 
+	 * @param entry
+	 */
+	public void addEntry(Object entry) {
+		int newSelectedRow = entries.size();
+		
+		if(!isInCurrentPage(newSelectedRow)) {
+			setSelectedPage(getPageFromRow(newSelectedRow));
+			throwEvent(PagedTableEvent.EVENT_SELECTED_PAGE, new int[]{newSelectedRow});
+		}
+		
+		entries.add(entry);
+		throwEvent(PagedTableEvent.EVENT_ADD_ENTRY, new int[]{newSelectedRow});
+	    setSelectedRows(new int[]{newSelectedRow});
+	}
+	
+	public Object[] getEntry(int row) {
+		if(row >= 0 && row < entries.size())
+			return (Object[])entries.get(row);
+		return null;
+	}
+	
+	public void removeEntry(int pos) {
+		if(deleteOneEntryMessage != null) {
+			if (!messageBoxYesOrNot(deleteOneEntryMessage, null))
+				return;
+		}
+		
+		if(pos >= 0 && pos < entries.size()) {
+			int oldSelectedPageInRow = getPageFromRow(pos);
+			int oldSelectedPage = getSelectedPageNumber();
+			
+			Object removedEntry = entries.get(pos);
+			entries.remove(pos);
+			
+			if(isSelectedRow(pos)) {
+				//La p�gina donde est� la entrada a borrar est� en la p�gina seleccionada
+				if(oldSelectedPageInRow == oldSelectedPage) { 
+					int newRowSelected = selectAlternativeRow(pos);
+					int newPageSelected = getPageFromRow(newRowSelected);
+					if(newPageSelected != oldSelectedPage) {
+						setSelectedPage(newPageSelected);
+						throwEvent(PagedTableEvent.EVENT_SELECTED_PAGE, new int[]{pos});
+					    return;
+					}
+				}
+			} 
+			setChanged();
+			notifyObservers(PagedTableEvent.EVENT_REMOVE_ENTRY);
+			for (int i = 0; i < listeners.size(); i++) {
+				listeners.get(i).tableChanged(new PagedTableEvent(table, PagedTableEvent.EVENT_REMOVE_ENTRY, removedEntry));
+			}
+		}
+	}
+	
+	private int selectAlternativeRow(int row) {
+		for (int i = 0; i < selectedRows.length; i++) {
+			if(selectedRows[i] == row && selectedRows[i] != 0) {
+				selectedRows[i] --;
+				return selectedRows[i];
+			}
+		}
+		return row;
+	}
+	
+	public void swapRow(int i, int j) {
+		if(i == j)
+			return;
+		if(j < i) {
+			int aux = i;
+			i = j;
+			j = aux;
+		}
+			
+		Object a = entries.get(i);
+		Object b = entries.get(j);
+		entries.add(i, b);
+		entries.remove(i + 1);
+		entries.add(j, a);
+		entries.remove(j + 1);
+		
+		if(!isSelectedRow(j) || !isSelectedRow(i)) { //Si hay solo una seleccionada se intercambia la selecci�n
+			for (int k = 0; k < selectedRows.length; k++) {
+				if(selectedRows[k] == j) {
+					selectedRows[k] = i;
+					throwEvent(PagedTableEvent.EVENT_SELECTED_ROWS, new int[]{i, j});
+				    break;
+				}
+				if(selectedRows[k] == i) {
+					selectedRows[k] = j;
+					throwEvent(PagedTableEvent.EVENT_SELECTED_ROWS, new int[]{i, j});
+				    break;
+				}
+			}			
+		}
+		throwEvent(PagedTableEvent.EVENT_SWAP_ENTRIES, new int[]{i, j});
+	}
+	
+	public boolean isSelectedRow(int row) {
+		if(selectedRows == null)
+			return false;
+		for (int i = 0; i < selectedRows.length; i++) {
+			if(selectedRows[i] == row)
+				return true;
+		}
+		return false;
+	}
+	
+	/**
+	 * Gets the number of entries in this pager
+	 * @return
+	 */
+	public int getEntriesCount() {
+		return entries.size();
+	}
+	
+	/**
+	 * Gets the number of row from the row in the current page
+	 * @param pageRow
+	 * @return
+	 */
+	public int getRowFromPageRow(int pageRow) {
+		return getSelectedPageNumber() * getEntriesPerPage() + pageRow;
+	}
+	
+	public Object[] getLastEntry() {
+		return (Object[])entries.get(entries.size() - 1);
+	}
+	
+	public void removeAllEntries() {
+		if(deleteAllEntriesMessage != null) {
+			if (!messageBoxYesOrNot(deleteAllEntriesMessage, null))
+				return;
+		}
+		entries.clear();
+		throwEvent(PagedTableEvent.EVENT_REMOVE_ALL, null);
+	}
+	
+	public void removeAllEntriesWithoutAsk() {
+		entries.clear();
+		throwEvent(PagedTableEvent.EVENT_REMOVE_ALL, null);
+	}
+	
+	//*************PAGE**********************
+	
+	public void setEntriesPerPage(int n) {
+		this.entriesPerPage = n;
+		setChanged();
+	    notifyObservers(PagedTableEvent.EVENT_SELECTED_PAGE);
+	}
+	
+	public void increaseSelectedPage() {
+		if(selectedPage < getPageCount() - 1) {
+			selectedPage ++;
+			throwEvent(PagedTableEvent.EVENT_SELECTED_PAGE, null);
+		}
+	}
+	
+	public void decreaseSelectedPage() {
+		if (selectedPage > 0) {
+			selectedPage --;
+			throwEvent(PagedTableEvent.EVENT_SELECTED_PAGE, null);
+		}
+	}
+	
+	public void setSelectedPage(int page) {
+		if(page >= 0 && page < getPageCount()) {
+			selectedPage = page;
+			throwEvent(PagedTableEvent.EVENT_SELECTED_PAGE, null);
+		}
+	}
+	
+	public int getPageFromRow(int row) {
+		if(getEntriesPerPage() > 0)
+			return (int)(row / getEntriesPerPage());
+		return 0;
+	}
+	
+	public List<Object> getSelectedPage() {
+		return getPage(getSelectedPageNumber());
+	}
+	
+	public void removePage(int page) {
+		if(page >= 0 && page < getPageCount()) {
+			int init = entriesPerPage * page;
+			int end = init + entriesPerPage;
+			for (int i = end - 1; i >= init; i--) {
+				entries.remove(i);
+			}
+		}
+	}
+	
+	public int getPageCount() {
+		return (int)Math.ceil(entries.size() / (double)entriesPerPage);
+	}
+	
+	public boolean isInCurrentPage(int row) {
+		int init = selectedPage * getEntriesPerPage();
+		int end = init + getEntriesPerPage() - 1;
+		if(row >= init && row <= end)
+			return true;
+		return false;
+	}
+	
+	public List<Object> getPage(int page) {
+		if(page >= 0 && page < getPageCount()) {
+			int init = entriesPerPage * page;
+			int end = init + entriesPerPage;
+			end = end >= entries.size() ? entries.size() : end;
+			return entries.subList(init, end);
+		}
+		return null;
+	}
+	
+	public int getEntriesPerPage() {
+		return entriesPerPage;
+	}
+	
+	public int getSelectedPageNumber() {
+		if(selectedPage >= getPageCount()) {
+			selectedPage = getPageCount() - 1;
+			if(selectedPage < 0)
+				selectedPage = 0;
+		}
+		return selectedPage;
+	}
+	
+	public void addListener(PagedTableListener listener) {
+		this.listeners.add(listener);
+	}
+	
+	public boolean messageBoxYesOrNot(String msg, Object parentWindow){
+		String string1 = Messages.getText("yes");
+		String string2 = Messages.getText( "no");
+		Object[] options = {string1, string2};
+		int n = JOptionPane.showOptionDialog(table.getJTable(),
+					"<html>" + msg.replaceAll("\n", "<br>") + "</html>",
+					PluginServices.getText(parentWindow, "confirmacion"),
+					JOptionPane.YES_NO_OPTION,
+					JOptionPane.QUESTION_MESSAGE,
+					null,
+					options,
+					string1);
+		if (n == JOptionPane.YES_OPTION)
+			return true;
+		else
+			return false;
+	}
+	
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PaginationBarPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PaginationBarPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/PaginationBarPanel.java	(revision 15423)
@@ -0,0 +1,179 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.i18n.Messages;
+
+public class PaginationBarPanel extends JPanel implements Observer {
+	private static final long     serialVersionUID    = 1L;
+	private JButton               up                  = null;
+	private JButton               down                = null;
+	private JLabel                selectedPag         = null;
+	private JLabel                nPages              = null;
+	private String                pathToImagesForTest = "/src/main/resources/images/";
+	
+	public PaginationBarPanel(TableControllerListener tableListener) {
+		if(tableListener != null)
+			tableListener.setPaginationBarPanel(this);
+		initialize(tableListener);
+	}
+	
+	private void initialize(TableControllerListener tableListener) {
+		this.setLayout(new GridBagLayout());
+		
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.VERTICAL;
+		gbc.anchor = GridBagConstraints.NORTH;
+		
+		add(getButtonUp(), gbc);
+		
+		gbc.anchor = GridBagConstraints.CENTER;
+		gbc.gridy = 1;
+		gbc.weighty = 1;
+		
+		JPanel p = new JPanel(new GridBagLayout());
+		GridBagConstraints gbc1 = new GridBagConstraints();
+		gbc1.fill = GridBagConstraints.NONE;
+		gbc1.gridx = 0;
+		gbc1.gridy = 0;
+		p.add(getSelectedPage(), gbc1);		
+		gbc1.gridy = 1;
+		p.add(getNPages(), gbc1);
+		add(p, gbc);
+		
+		gbc.weighty = 0;
+		gbc.anchor = GridBagConstraints.SOUTH;
+		gbc.gridy = 2;
+		
+		add(getButtonDown(), gbc);
+		
+		getButtonUp().addActionListener(tableListener);
+		getButtonDown().addActionListener(tableListener);
+	}
+	
+	public JLabel getSelectedPage() {
+		if(selectedPag == null)
+			selectedPag = new JLabel("-");
+		return selectedPag;
+	}
+	
+	public JLabel getNPages() {
+		if(nPages == null)
+			nPages = new JLabel("-");
+		return nPages;
+	}
+	
+	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;
+	}
+	
+	public JButton getButtonUp() {
+		if (up == null) {
+			up = new JButton("");
+			up.setEnabled(false);
+			up.setPreferredSize(new Dimension(22, 22));
+			up.setIcon(loadIcon("up-16x16"));
+			up.setActionCommand("");
+			up.setToolTipText(Messages.getText("prev_pag"));
+		}
+		return up;
+	}
+	
+	public JButton getButtonDown() {
+		if (down == null) {
+			down = new JButton("");
+			down.setEnabled(false);
+			down.setPreferredSize(new Dimension(22, 22));
+			down.setIcon(loadIcon("down-16x16"));
+			down.setActionCommand("");
+			down.setToolTipText(Messages.getText("next_pag"));
+		}
+		return down;
+	}
+
+	public void update(Observable o, Object arg) {
+		Pager pager = (Pager)o;
+		if(o instanceof Pager && arg instanceof Integer) {
+			setPageNumberText(pager);
+			checkArrows(pager);	
+		}
+	}
+	
+	/**
+	 * Sets the text of page number selected and number of pages
+	 * @param pager
+	 */
+	private void setPageNumberText(Pager pager) {
+		if(pager.getPageCount() == 0) {
+			getNPages().setText("-");
+			getSelectedPage().setText("-");
+		} else {
+			getNPages().setText(pager.getPageCount() + "");
+			getSelectedPage().setText(pager.getSelectedPageNumber() + 1 + "");
+		}	
+	}
+	
+	/**
+	 * Checks whether the buttons are enabled o disabled
+	 * @param pager
+	 */
+	private void checkArrows(Pager pager) {
+		if(pager.getPageCount() == 0) {
+			getButtonDown().setEnabled(false);
+			getButtonUp().setEnabled(false);
+			return;
+		}
+		if(pager.getSelectedPageNumber() < pager.getPageCount() - 1) {
+			getButtonDown().setEnabled(true);
+		} else {
+			getButtonDown().setEnabled(false);
+		}
+		
+		if(pager.getSelectedPageNumber() <= 0) {
+			getButtonUp().setEnabled(false);
+		} else {
+			getButtonUp().setEnabled(true);
+		}
+	}
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/MoveRowsPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/MoveRowsPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/MoveRowsPanel.java	(revision 15423)
@@ -0,0 +1,164 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.awt.Dimension;
+import java.util.Observable;
+import java.util.Observer;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.gui.util.StatusComponent;
+import org.gvsig.i18n.Messages;
+
+public class MoveRowsPanel extends JPanel implements Observer {
+  private static final long serialVersionUID = -4496318143555472677L;
+
+	private int             HEIGHT_BUTTONS      = 19;       // 16 estaria bien
+	private JButton         bUp                 = null;
+	private JButton         bDown               = null;
+	private String          pathToImagesForTest = "/src/main/resources/images/";
+
+	/**
+	 * Objeto para controlar el estado de los componentes visuales 
+	 */
+	private StatusComponent statusComponent = null;
+	
+	/**
+	 * This is the default constructor
+	 */
+	public MoveRowsPanel(TableControllerListener tableListener) {
+		tableListener.setMoveRowsPanel(this);
+		initialize(tableListener);
+	}
+	
+	private void initialize(TableControllerListener tableListener) {
+		statusComponent = new StatusComponent(this);
+
+		setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.CENTER, 0, 0));
+		add(getBUp());
+		add(getBDown());
+
+		getBUp().addActionListener(tableListener);
+		getBDown().addActionListener(tableListener);
+	}
+	
+	/**
+	 * This method initializes bUp
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBUp() {
+		if (bUp == null) {
+			bUp = new JButton("");
+			bUp.setEnabled(true);
+			bUp.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bUp.setIcon(loadIcon("up-16x16"));
+			bUp.setActionCommand("");
+			bUp.setToolTipText(Messages.getText("subir"));
+		}
+		return bUp;
+	}
+
+	/**
+	 * This method initializes bDown
+	 * @return javax.swing.JButton
+	 */
+	public JButton getBDown() {
+		if (bDown == null) {
+			bDown = new JButton("");
+			bDown.setEnabled(true);
+			bDown.setPreferredSize(new Dimension(22, HEIGHT_BUTTONS));
+			bDown.setIcon(loadIcon("down-16x16"));
+			bDown.setActionCommand("");
+			bDown.setToolTipText(Messages.getText("bajar"));
+		}
+		return bDown;
+	}
+	
+	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;
+	}
+	
+	/**
+	 * Esta funci�n deshabilita todos los controles y guarda sus valores
+	 * de habilitado o deshabilitado para que cuando se ejecute restoreControlsValue
+	 * se vuelvan a quedar como estaba
+	 */
+	public void disableAllControls(){
+		statusComponent.setEnabled(false);
+	}
+
+	/**
+	 * Esta funci�n deja los controles como estaban al ejecutar la funci�n
+	 * disableAllControls
+	 */
+	public void restoreControlsValue(){
+		statusComponent.setEnabled(true);
+	}
+	
+	/**
+	 * Comprueba la posici�n del combo para ver si tiene que
+	 * habilitar o deshabilitar las flechas de delante y detr�s.
+	 */
+	private void checkArrows(Pager pager) {
+		if (!statusComponent.isEnabled())
+			return;
+
+		int[] selectedRows = pager.getSelectedRows();
+		if(selectedRows != null && pager.getEntriesCount() > 1) {
+			if(selectedRows[0] == 0) {
+				getBUp().setEnabled(false);
+				getBDown().setEnabled(true);
+			} else if(selectedRows[0] == pager.getEntriesCount() - 1) {
+				getBUp().setEnabled(true);
+				getBDown().setEnabled(false);
+			} else {
+				getBUp().setEnabled(true);
+				getBDown().setEnabled(true);
+			}
+		} else {
+			getBUp().setEnabled(false);
+			getBDown().setEnabled(false);
+		}
+	}	
+
+	public void update(Observable o, Object arg) {
+		if(o instanceof Pager && arg instanceof Integer) {
+			Pager pager = (Pager)o;
+			checkArrows(pager);
+		}
+	}	
+	
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/NotInitializeException.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/NotInitializeException.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/NotInitializeException.java	(revision 15423)
@@ -0,0 +1,64 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+/**
+ * Excepci�n que indica que una tabla no ha sido inicializada.
+ *
+ * @author Nacho Brodin (brodin_ign@gva.es)
+ */
+public class NotInitializeException extends Exception {
+	private static final long serialVersionUID = -6411813224550536884L;
+
+	public NotInitializeException() {
+		super();
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param message
+	 */
+	public NotInitializeException(String message) {
+		super(message);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param message
+	 * @param cause
+	 */
+	public NotInitializeException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	 * DOCUMENT ME!
+	 *
+	 * @param cause
+	 */
+	public NotInitializeException(Throwable cause) {
+		super(cause);
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/TableControllerListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/TableControllerListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/pagedtable/TableControllerListener.java	(revision 15423)
@@ -0,0 +1,158 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.pagedtable;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+
+import javax.swing.event.ListSelectionEvent;
+import javax.swing.event.ListSelectionListener;
+
+import org.gvsig.raster.swing.pagedtable.PagedTable;
+import org.gvsig.raster.swing.pagedtable.TableModel;
+
+
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class TableControllerListener implements ActionListener, ListSelectionListener {
+	public static boolean             comboEventEnable      = true;
+	private PagedTable                pagedTable            = null;
+	private TableEntryControllerPanel controlPanel          = null;
+	private MoveRowsPanel             moveRowsPanel         = null;
+	private PaginationBarPanel        paginationBarPanel    = null;         
+	public boolean                    enableNewLineListener = true;
+
+	/**
+	 * Constructor
+	 * @param tableContainer
+	 */
+	public TableControllerListener(PagedTable tableContainer){
+		this.pagedTable = tableContainer;
+	}
+
+	public void setControlPanel(TableEntryControllerPanel control) {
+		this.controlPanel = control;
+	}
+	
+	public void setMoveRowsPanel(MoveRowsPanel moveRowsPanel) {
+		this.moveRowsPanel = moveRowsPanel;
+	}
+	
+	public void setPaginationBarPanel(PaginationBarPanel paginationBarPanel) {
+		this.paginationBarPanel = paginationBarPanel;
+	}
+
+	/**
+	 * Captura y gestiona los eventos del control de la tabla para a�adir filas,
+	 * eliminar filas y moverse por la tabla.
+	 */
+	public void actionPerformed(ActionEvent e) {		
+		if(!comboEventEnable)
+			return;
+		
+		comboEventEnable = false;
+		
+		/**
+		 * Nueva entrada
+		 */
+		if (enableNewLineListener && e.getSource() == controlPanel.getBNew()) {
+			if (pagedTable.getTableModel() instanceof TableModel)
+				pagedTable.addRow(((TableModel) pagedTable.getTableModel()).getNewLine());
+		}
+
+		/**
+		 * Eliminar todas las filas
+		 */
+		if (enableNewLineListener && e.getSource() == controlPanel.getBClear()) {
+			pagedTable.removeAllRows();
+		}
+
+		/**
+		 * Elimina una entrada concreta de la tabla
+		 */
+		if (enableNewLineListener && e.getSource() == controlPanel.getBDelPoint()) {
+			int[] listSelection = pagedTable.getSelectedRows();
+			for (int i = listSelection.length - 1; i >= 0; i--)
+				pagedTable.delRow(listSelection[i]);
+		}
+
+		if (e.getSource() == controlPanel.getBFirst()) {
+			pagedTable.setSelectedRow(0);
+		}
+
+		if (e.getSource() == controlPanel.getBLast()) {
+			pagedTable.setSelectedRow(-1); //With -1 selects the last
+		}
+
+		if (e.getSource() == controlPanel.getBNext()) {
+			pagedTable.increaseSelectedRows();
+		}
+
+		if (e.getSource() == controlPanel.getBPrev()) {
+			pagedTable.decreaseSelectedRows();
+		}
+
+		if (e.getSource() == controlPanel.getCPoint()) {
+			pagedTable.setSelectedRow(controlPanel.getCPoint().getSelectedIndex());
+		}
+		
+		if (e.getSource() == paginationBarPanel.getButtonUp()) {
+			pagedTable.prevPage();
+		}
+		
+		if (e.getSource() == paginationBarPanel.getButtonDown()) {
+			pagedTable.nextPage();
+		}
+		
+		if (e.getSource() == moveRowsPanel.getBUp()) {
+			if(pagedTable.getSelectedRows() != null) {
+				for (int i = 0; i < pagedTable.getSelectedRows().length; i++) {
+					int row = pagedTable.getSelectedRows()[i];
+					pagedTable.swapRow(row, row - 1);
+				}
+			}
+		}
+		
+		if (e.getSource() == moveRowsPanel.getBDown()) {
+			if(pagedTable.getSelectedRows() != null) {
+				for (int i = 0; i < pagedTable.getSelectedRows().length; i++) {
+					int row = pagedTable.getSelectedRows()[i];
+					pagedTable.swapRow(row, row + 1);
+				}
+			}
+		}
+
+		comboEventEnable = true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see javax.swing.event.ListSelectionListener#valueChanged(javax.swing.event.ListSelectionEvent)
+	 */
+	public void valueChanged(ListSelectionEvent e) {
+	    //pagedTable.setSelectedIndex(pagedTable.getSelectedTableRow());
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/DefaultROIPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/DefaultROIPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/DefaultROIPanel.java	(revision 15423)
@@ -0,0 +1,175 @@
+/* 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.swing.impl.roi;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionListener;
+
+import javax.swing.AbstractButton;
+import javax.swing.JComboBox;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelListener;
+
+import org.gvsig.gui.beans.buttonspanel.ButtonsPanelListener;
+import org.gvsig.gui.beans.defaultbuttonspanel.DefaultButtonsPanel;
+import org.gvsig.gui.beans.table.TableContainer;
+import org.gvsig.raster.swing.roi.ROIPanel;
+
+
+/**
+ * Main panel for the ROI manager
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class DefaultROIPanel extends DefaultButtonsPanel implements ROIPanel {
+	private static final long           serialVersionUID            = 1L;
+	private ROIsTablePanel				tablePanel					= null;
+	private ROIButtonsPanel				buttonsPanel                = null;
+	private ROILayerPanel				layerPanel                  = null;
+	private JPanel                      controlPanel                = null;
+	
+	public DefaultROIPanel() {
+		super();
+		initialize();
+	}
+
+	private void initialize() {
+		setLayout(new GridBagLayout());
+
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.gridx = 0;
+		gbc.gridy = 0;
+		gbc.weightx = 1;
+		gbc.weighty = 1;
+		gbc.fill = GridBagConstraints.BOTH;
+		add(getROITablePanel(), gbc);
+
+		gbc.gridy = 1;
+		gbc.weighty = 0;
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.insets = new Insets(0, 0, 8, 0);
+		add(getTableButtonsPanel(), gbc);
+	}
+	
+	public JPanel getTableButtonsPanel() {
+		if (controlPanel == null) {
+			controlPanel = new JPanel();
+			controlPanel.setLayout(new GridBagLayout());
+			//controlPanel.setBorder(BorderFactory.createLineBorder(Color.gray));
+
+			GridBagConstraints gbc = new GridBagConstraints();
+			gbc.gridx = 0;
+			gbc.gridy = 0;
+			gbc.weightx = 1;
+			gbc.fill = GridBagConstraints.HORIZONTAL;
+			controlPanel.add(getROIButtonsPanel(), gbc);
+
+			gbc.gridy = 1;
+			controlPanel.add(getROILayerPanel(), gbc);
+		}
+		return controlPanel;
+	}
+	
+	public ROIsTablePanel getROITablePanel() {
+		if (tablePanel == null)
+			tablePanel = new ROIsTablePanel();
+		return tablePanel;
+	}
+	
+	public ROIButtonsPanel getROIButtonsPanel() {
+		if (buttonsPanel == null)
+			buttonsPanel = new ROIButtonsPanel();
+		return buttonsPanel;
+	}
+	
+	public ROILayerPanel getROILayerPanel() {
+		if (layerPanel == null)
+			layerPanel = new ROILayerPanel();
+		return layerPanel;
+	}
+
+	public JComponent getComponent() {
+		return this;
+	}
+	
+	public TableContainer getTable() {
+		return getROITablePanel().getTable();
+	}
+	
+	public void setToolsEnabled(boolean b) {
+		getROIButtonsPanel().setToolsEnabled(b);
+	}
+	
+	public void addButtonsListener(
+			ActionListener listener, 
+			ButtonsPanelListener mainButtonsListener) {
+		getROIButtonsPanel().getPolygonToolButton().addActionListener(listener);
+		getROIButtonsPanel().getPointToolButton().addActionListener(listener);
+		getROIButtonsPanel().getLineToolButton().addActionListener(listener);
+		getROIButtonsPanel().getDeleteButton().addActionListener(listener);
+		getROIButtonsPanel().getExportButton().addActionListener(listener);
+		getROIButtonsPanel().getImportButton().addActionListener(listener);
+		getROIButtonsPanel().getRemoveFileButton().addActionListener(listener);
+		getROIButtonsPanel().getNewButton().addActionListener(listener);
+		getROILayerPanel().getComboListOfLayers().addActionListener(listener);
+		getROILayerPanel().getButtonAddLayer().addActionListener(listener);
+		addButtonPressedListener(mainButtonsListener);
+	}
+	
+	public void addTableListeners(
+			ListSelectionListener listSelectionlistener, 
+			TableModelListener tableModelListener) {
+		getROITablePanel().addListenerToTable(tableModelListener, listSelectionlistener);
+	}
+
+	public AbstractButton getButton(int button) {
+		if(button == POLYGON_BUTTON)
+			return getROIButtonsPanel().getPolygonToolButton();
+		if(button == POINT_BUTTON)
+			return getROIButtonsPanel().getPointToolButton();
+		if(button == LINE_BUTTON)
+			return getROIButtonsPanel().getLineToolButton();
+		if(button == DELETE_BUTTON)
+			return getROIButtonsPanel().getDeleteButton();
+		if(button == EXPORT_BUTTON)
+			return getROIButtonsPanel().getExportButton();
+		if(button == IMPORT_BUTTON)
+			return getROIButtonsPanel().getImportButton();
+		if(button == NEW_BUTTON)
+			return getROIButtonsPanel().getNewButton();
+		if(button == ADDFLYR_BUTTON)
+			return getROILayerPanel().getButtonAddLayer();
+		if(button == REMOVE_ROI_FILE_BUTTON)
+			return getROIButtonsPanel().getRemoveFileButton();
+		return null;
+	}
+	
+	public JComboBox getLayerList(int button) {
+		if(button == FLYRS_COMBO)
+			return getROILayerPanel().getComboListOfLayers();
+		return null;
+	}
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROIsTablePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROIsTablePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROIsTablePanel.java	(revision 15423)
@@ -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.swing.impl.roi;
+
+import java.awt.BorderLayout;
+
+import javax.swing.JPanel;
+import javax.swing.border.EmptyBorder;
+import javax.swing.event.ListSelectionListener;
+import javax.swing.event.TableModelListener;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.table.TableContainer;
+
+/**
+ * Panel for the table with the list of ROIs
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ * 
+ */
+public class ROIsTablePanel extends JPanel {
+	private static final long           serialVersionUID   = 1L;
+	private TableContainer              tableContainer     = null;
+
+	public ROIsTablePanel() {
+		super();
+		initialize();
+	}
+
+	private void initialize() {
+		setLayout(new BorderLayout());
+		add(getTable(), BorderLayout.CENTER);
+	}
+	
+	public void addListenerToTable(
+			TableModelListener tableModelListener, 
+			ListSelectionListener listSelectionListener) {
+		getTable().getTable().getJTable().getSelectionModel()
+			.addListSelectionListener(listSelectionListener);
+		getTable().getTable().getJTable().getModel()
+			.addTableModelListener(tableModelListener);
+	}
+
+	public TableContainer getTable() {
+		if (tableContainer == null) {
+			String[] columnNames = { PluginServices.getText(this, "nombre"),
+					PluginServices.getText(this, "poligonos"),
+					PluginServices.getText(this, "lineas"),
+					PluginServices.getText(this, "puntos"),
+					PluginServices.getText(this, "color")};
+			int[] columnWidths = { 70, 15, 15, 15, 20 };
+			tableContainer = new TableContainer(columnNames, columnWidths);
+			tableContainer.setModel("ROIsTableModel");
+			tableContainer.initialize();
+			tableContainer.setControlVisible(false);
+			tableContainer.setBorder(new EmptyBorder(5, 5, 0, 5));
+		}
+		return tableContainer;
+	}
+
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROILayerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROILayerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROILayerPanel.java	(revision 15423)
@@ -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.swing.impl.roi;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.JButton;
+import javax.swing.JComboBox;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+
+/**
+ * Panel for the list of layers
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ * 
+ */
+public class ROILayerPanel extends JPanel {
+	private static final long           serialVersionUID   = 1L;
+	private JComboBox                   layerList          = null;
+	private JButton                     buttonAddLayer     = null;
+
+	public ROILayerPanel() {
+		super();
+		initialize();
+	}
+
+	private void initialize() {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new Insets(4, 2, 4, 2);
+		
+		add(getComboListOfLayers(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.weightx = 0;
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.NONE;
+		add(getButtonAddLayer(), gridBagConstraints1);
+	}
+	
+	public JComboBox getComboListOfLayers() {
+		if (layerList == null) {
+			layerList = new JComboBox();
+		}
+		return layerList;
+	}
+	
+	public JButton getButtonAddLayer() {
+		if (buttonAddLayer == null) {
+			buttonAddLayer = new JButton(Messages.getText("add"));
+		}
+		return buttonAddLayer;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROIButtonsPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROIButtonsPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/roi/ROIButtonsPanel.java	(revision 15423)
@@ -0,0 +1,222 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+ *
+ * Copyright (C) 2007-2008 Infrastructures and Transports Department
+ * of the Valencian Government (CIT)
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ */
+package org.gvsig.raster.swing.impl.roi;
+
+import java.awt.FlowLayout;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JToggleButton;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.i18n.Messages;
+
+/**
+ * List of buttons to control the list of ROIs
+ * 
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class ROIButtonsPanel extends JPanel {
+	private static final long           serialVersionUID   = 1L;
+	//private int                         sizeButton         = 25;
+	private JPanel                      toolsPanel         = null;
+	private JPanel                      tableButtonsPanel  = null;
+	private JButton                     newButton          = null;
+	private JButton                     deleteButton       = null;
+	private JButton                     exportButton       = null;
+	private JButton                     importButton       = null;
+	private JButton                     removeFileButton   = null;
+	private JToggleButton               pointToolButton    = null;
+	private JToggleButton               lineToolButton     = null;
+	private JToggleButton               polygonToolButton  = null;
+
+	public ROIButtonsPanel() {
+		initialize();
+	}
+
+	private void initialize() {
+		setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1;
+		gbc.insets = new Insets(0, 0, 4, 0);
+		
+		add(getTableButtonsPanel(), gbc);
+		add(getToolsPanel(), gbc);
+		getPolygonToolButton().setSelected(true);
+		setToolsEnabled(false);
+	}
+	
+	public JPanel getToolsPanel() {
+		if (toolsPanel == null) {
+			toolsPanel = new JPanel();
+			FlowLayout fl = new FlowLayout(FlowLayout.RIGHT);
+			fl.setHgap(2);
+			fl.setVgap(0);
+			toolsPanel.setLayout(fl);
+			toolsPanel.add(getPointToolButton());
+			toolsPanel.add(getLineToolButton());
+			toolsPanel.add(getPolygonToolButton());
+			toolsPanel.add(getRemoveFileButton());
+			toolsPanel.add(getExportButton());
+			toolsPanel.add(getImportButton());
+		}
+		return toolsPanel;
+	}
+	
+	public JPanel getTableButtonsPanel() {
+		if (tableButtonsPanel == null) {
+			tableButtonsPanel = new JPanel();
+			FlowLayout fl = new FlowLayout(FlowLayout.LEFT);
+			fl.setHgap(2);
+			fl.setVgap(0);
+			tableButtonsPanel.setLayout(fl);
+			tableButtonsPanel.add(getNewButton());
+			tableButtonsPanel.add(getDeleteButton());
+		}
+		return tableButtonsPanel;
+	}
+	
+	public void setToolsEnabled(boolean b) {
+		getPointToolButton().setEnabled(b);
+		getLineToolButton().setEnabled(b);
+		getPolygonToolButton().setEnabled(b);
+	}
+
+	public JButton getDeleteButton() {
+		if (deleteButton == null) {
+			deleteButton = new JButton(Messages.getText("borrar"));
+		}
+		return deleteButton;
+	}
+
+	public JButton getNewButton() {
+		if (newButton == null) {
+			newButton = new JButton(Messages.getText("nuevo"));
+		}
+		return newButton;
+	}
+
+	public JToggleButton getPointToolButton() {
+		if (pointToolButton == null) {
+			pointToolButton = new JToggleButton();
+			//pointToolButton.setPreferredSize(new Dimension(sizeButton, sizeButton));
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("point-icon");
+			} catch (Exception e) {
+			}
+			if(icon == null) 
+				icon = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/point-icon.png", "");
+			pointToolButton.setIcon(icon);
+		}
+		return pointToolButton;
+	}
+
+	public JToggleButton getLineToolButton() {
+		if (lineToolButton == null) {
+			lineToolButton = new JToggleButton();
+			//lineToolButton.setPreferredSize(new Dimension(sizeButton, sizeButton));
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("line-icon");
+			} catch (Exception e) {
+			}
+			if(icon == null) 
+				icon = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/line-icon.png", "");
+			lineToolButton.setIcon(icon);
+		}
+		return lineToolButton;
+	}
+
+	public JToggleButton getPolygonToolButton() {
+		if (polygonToolButton == null) {
+			polygonToolButton = new JToggleButton();
+			//polygonToolButton.setPreferredSize(new Dimension(sizeButton, sizeButton));
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("polygon-icon");
+			} catch (Exception e) {
+			}
+			if(icon == null) 
+				icon = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/polygon-icon.png", "");
+			polygonToolButton.setIcon(icon);
+		}
+		return polygonToolButton;
+	}
+	
+	public JButton getRemoveFileButton() {
+		if (removeFileButton == null) {
+			removeFileButton = new JButton();
+			//importButton.setPreferredSize(new Dimension(sizeButton, sizeButton));
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("delall");
+			} catch (Exception e) {
+			}
+			if(icon == null) 
+				icon = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/delall.png", "");
+			removeFileButton.setIcon(icon);
+			removeFileButton.setToolTipText(Messages.getText("delete_roi_file"));
+		}
+		return removeFileButton;
+	}
+
+
+	public JButton getImportButton() {
+		if (importButton == null) {
+			importButton = new JButton();
+			//importButton.setPreferredSize(new Dimension(sizeButton, sizeButton));
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("tfwload-icon");
+			} catch (Exception e) {
+			}
+			if(icon == null) 
+				icon = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/tfwload-icon.png", "");
+			importButton.setIcon(icon);
+			importButton.setToolTipText(Messages.getText("cargar_rois"));
+		}
+		return importButton;
+	}
+
+	public JButton getExportButton() {
+		if (exportButton == null) {
+			exportButton = new JButton();
+			//exportButton.setPreferredSize(new Dimension(sizeButton, sizeButton));
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("layer-saveas");
+			} catch (Exception e) {
+			}
+			if(icon == null) 
+				icon = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/layer-saveas.png", "");
+			exportButton.setIcon(icon);
+			exportButton.setToolTipText(Messages.getText("salvar_rois"));
+		}
+		return exportButton;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/basepanel/DefaultButtonsPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/basepanel/DefaultButtonsPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/basepanel/DefaultButtonsPanel.java	(revision 15423)
@@ -0,0 +1,179 @@
+package org.gvsig.raster.swing.impl.basepanel;
+
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2013 gvSIG Association.
+ *
+ * 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 3
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+
+import java.awt.Component;
+import java.awt.Container;
+import java.awt.LayoutManager;
+import java.awt.Window;
+
+import javax.swing.JPanel;
+
+import org.gvsig.raster.swing.basepanel.ButtonsPanelListener;
+
+/**
+ * <code>DefaultButtonsPanel</code> es un Panel que hereda de <code>JPanel</code> con
+ * el a�adido de poder definir una botonera por defecto.
+ *
+ * @version 20/08/2008
+ *
+ * @author BorSanZa - Borja Sanchez Zamorano (borja.sanchez@iver.es)
+ */
+public class DefaultButtonsPanel extends JPanel {
+	private static final long serialVersionUID = 1536590395737700551L;
+	ButtonsPanel              bp               = null;
+	JPanel                    content          = null;
+	private int               margin           = 4;
+	
+	/**
+	 * Crea el <code>DefaultButtonsPanel</code> con los botones por defecto.
+	 */
+	public DefaultButtonsPanel() {
+		super.setLayout(new java.awt.BorderLayout(0, 0));
+		getButtonsPanel().addAccept();
+		getButtonsPanel().addCancel();
+		getButtonsPanel().addApply();
+		super.add(getButtonsPanel(), java.awt.BorderLayout.SOUTH);
+		super.add(getContent(), java.awt.BorderLayout.CENTER);
+		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(margin, margin, margin, margin));
+	}
+
+	/**
+	 * Crea el <code>DialogPanel</code> con los botones que definamos de la clase
+	 * <code>ButtonsPanel</code>
+	 *
+	 * @param buttons Constante para definir que botones se crear�n
+	 */
+	public DefaultButtonsPanel(int buttons) {
+		super.setLayout(new java.awt.BorderLayout(0, 0));
+		bp = new ButtonsPanel(buttons);
+		super.add(getButtonsPanel(), java.awt.BorderLayout.SOUTH);
+		super.add(getContent(), java.awt.BorderLayout.CENTER);
+		this.setBorder(javax.swing.BorderFactory.createEmptyBorder(margin, margin, margin, margin));
+	}
+
+	/**
+	 * Obtener el objeto <code>ButtonsPanel</code> del <code>DialogPanel</code>.
+	 * En caso de no estar creado, lo crear�.
+	 *
+	 * @return El componente bp
+	 */
+	public ButtonsPanel getButtonsPanel() {
+		if (bp == null)
+			bp = new ButtonsPanel();
+		return bp;
+	}
+
+	/**
+	 * Obtener el contenido del <code>DialogPanel</code>. En caso de no estar creado,
+	 * lo crear�.
+	 *
+	 * @return El componente content
+	 */
+	public JPanel getContent() {
+		if (content == null)
+			content = new JPanel();
+		return content;
+	}
+
+	public void addButtonPressedListener(ButtonsPanelListener listener) {
+		getButtonsPanel().addButtonPressedListener(listener);
+	}
+
+	public void removeButtonPressedListener(ButtonsPanelListener listener) {
+		getButtonsPanel().removeButtonPressedListener(listener);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#getLayout()
+	 */
+	public LayoutManager getLayout() {
+		return getContent().getLayout();
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#setLayout(java.awt.LayoutManager)
+	 */
+	public void setLayout(LayoutManager mgr) {
+		getContent().setLayout(mgr);
+	}
+
+	/**
+	 * Devuelve el Window que contiene dicha ventana o null en caso de que no sea
+	 * asi
+	 * @return
+	 */
+	public Window getWindow() {
+		Container container = getParent();
+		while (container != null) {
+			if (container instanceof Window)
+				return (Window) container;
+			container = container.getParent();
+		}
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component)
+	 */
+	public Component add(Component comp) {
+		return getContent().add(comp);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component, int)
+	 */
+	public Component add(Component comp, int index) {
+		return getContent().add(comp, index);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component, java.lang.Object)
+	 */
+	public void add(Component comp, Object constraints) {
+		getContent().add(comp, constraints);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.awt.Component, java.lang.Object, int)
+	 */
+	public void add(Component comp, Object constraints, int index) {
+		getContent().add(comp, constraints, index);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see java.awt.Container#add(java.lang.String, java.awt.Component)
+	 */
+	public Component add(String name, Component comp) {
+		return getContent().add(name, comp);
+	}
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/basepanel/ButtonsPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/basepanel/ButtonsPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/basepanel/ButtonsPanel.java	(revision 15423)
@@ -0,0 +1,358 @@
+/**
+ * gvSIG. Desktop Geographic Information System.
+ *
+ * Copyright (C) 2007-2012 gvSIG Association.
+ *
+ * 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.
+ *
+ * For any additional information, do not hesitate to contact us
+ * at info AT gvsig.com, or visit our website www.gvsig.com.
+ */
+package org.gvsig.raster.swing.impl.basepanel;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.swing.JButton;
+import javax.swing.JComponent;
+import javax.swing.JPanel;
+
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelEvent;
+import org.gvsig.raster.swing.basepanel.ButtonsPanelListener;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+
+/**
+ * <code>ButtonsPanel</code> ofrece un widget con un conjunto de botones
+ * preestablecidos, aunque tambi�n se pueden a�adir botones con el m�todo
+ * {@link #addButton(String, int)}
+ *
+ * @version 09/05/2008
+ *
+ * @author BorSanZa - Borja Sanchez Zamorano 
+ */
+public class ButtonsPanel extends JPanel implements IButtonsPanel {
+	private static final long serialVersionUID = -1660559792086305063L;
+
+	private ArrayList<ButtonsPanelListener> actionCommandListeners = new ArrayList<ButtonsPanelListener>();
+	private ArrayList<JButton> buttonsList = new ArrayList<JButton>();
+
+	private JComponent      parent                    = null;
+
+	public ButtonsPanel() {
+		initialize();
+	}
+	
+	/**
+	 * Crea un ButtonsPanel con un Layout por defecto.
+	 */
+	public ButtonsPanel(JComponent parent) {
+		this.parent = parent;
+		initialize();
+	}
+
+	private void initialize() {
+		setLayout(new java.awt.FlowLayout(java.awt.FlowLayout.RIGHT, 2, 0));
+		setBorder(javax.swing.BorderFactory.createEmptyBorder(4, 0, 0, 0));
+	}
+	
+	public ButtonsPanel(int items, JComponent parent) {
+		this(items);
+		this.parent = parent;
+	}
+	
+	/**
+	 * Crea un ButtonsPanel con un Layout por defecto.
+	 * @param items Que botones vamos a usar en la creaci�n.
+	 */
+	public ButtonsPanel(int items) {
+		initialize();
+		switch (items) {
+			case BUTTONS_ACCEPT:
+				addAccept();
+				break;
+			case BUTTONS_ACCEPTCANCEL:
+				addAccept();
+				addCancel();
+				break;
+			case BUTTONS_ACCEPTCANCELAPPLY:
+				addApply();
+				addAccept();
+				addCancel();
+				break;
+			case BUTTONS_APPLYCLOSE:
+				addApply();
+				addClose();
+				break;
+			case BUTTONS_CANCEL:
+				addCancel();
+				break;
+			case BUTTONS_YESNO:
+				addYes();
+				addNo();
+				break;
+			case BUTTONS_CLOSE:
+				addClose();
+				break;
+			case BUTTONS_EXIT:
+				addExit();
+				break;
+			case BUTTONS_NONE:
+				break;
+		}
+	}
+
+	/**
+	 * A�adir el disparador de cuando se pulsa un bot�n.
+	 * @param listener
+	 */
+	public void addButtonPressedListener(ButtonsPanelListener listener) {
+		if (!actionCommandListeners.contains(listener))
+			actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Devuelve el array de listeners del componente
+	 * @return
+	 */
+	public Object[] getButtonPressedListeners() {
+		return actionCommandListeners.toArray();
+	}
+
+	/**
+	 * Borrar el disparador de eventos de los botones.
+	 * @param listener
+	 */
+	public void removeButtonPressedListener(ButtonsPanelListener listener) {
+		actionCommandListeners.remove(listener);
+	}
+
+	private void callActionCommandListeners(int buttonID) {
+		Iterator<ButtonsPanelListener> acIterator = actionCommandListeners.iterator();
+		while (acIterator.hasNext()) {
+			ButtonsPanelListener listener = (ButtonsPanelListener) acIterator.next();
+			listener.actionButtonPressed(new ButtonsPanelEvent(parent, buttonID));
+		}
+	}
+
+	/**
+	 * A�adir el boton Aceptar.
+	 */
+	public void addAccept() {
+		addButton(Messages.getText("aceptar"), BUTTON_ACCEPT);
+	}
+
+	/**
+	 * A�adir el boton Guardar.
+	 */
+	public void addSave() {
+		addButton(Messages.getText("guardar"), BUTTON_SAVE);
+	}
+
+	/**
+	 * A�adir el boton Cancelar.
+	 */
+	public void addCancel() {
+		addButton(Messages.getText("cancelar"), BUTTON_CANCEL);
+	}
+
+	/**
+	 * A�adir el boton S�.
+	 */
+	public void addYes() {
+		addButton(Messages.getText("si"), BUTTON_YES);
+	}
+
+	/**
+	 * A�adir el boton No.
+	 */
+	public void addNo() {
+		addButton(Messages.getText("no"), BUTTON_NO);
+	}
+
+	/**
+	 * A�adir el boton Aplicar.
+	 */
+	public void addApply() {
+		addButton(Messages.getText("aplicar"), BUTTON_APPLY);
+	}
+
+	/**
+	 * A�adir el boton Cerrar.
+	 */
+	public void addClose() {
+		addButton(Messages.getText("cerrar"), BUTTON_CLOSE);
+	}
+
+	/**
+	 * A�adir el boton Salir.
+	 */
+	public void addExit() {
+		addButton(Messages.getText("salir"), BUTTON_EXIT);
+	}
+
+	/**
+	 * A�adir el boton Ver detalles.
+	 */
+	public void addSeeDetails() {
+		addButton(Messages.getText("verdetalles"), BUTTON_SEEDETAILS);
+	}
+
+	/**
+	 * A�adir el boton Ocultar detalles.
+	 */
+	public void addHideDetails() {
+		addButton(Messages.getText("ocultardetalles"), BUTTON_HIDEDETAILS);
+	}
+
+	/**
+	 * A�adir el boton Pausar.
+	 */
+	public void addPause() {
+		addButton(Messages.getText("pausar"), BUTTON_PAUSE);
+	}
+
+	/**
+	 * A�adir el boton Reanudar.
+	 */
+	public void addRestart() {
+		addButton(Messages.getText("reanudar"), BUTTON_RESTART);
+	}
+
+	/**
+	 * A�adimos un bot�n definido por el usuario.
+	 *
+	 * @param text Texto que contendr� el bot�n
+	 * @param id Entero para identificar los eventos del bot�n
+	 */
+	public void addButton(String text, int id) {
+		JButton button = new JButton();
+		button.setText(text);
+
+		buttonsList.add(button);
+		button.setActionCommand(id + "");
+		button.addActionListener(new ActionListener() {
+			public void actionPerformed(ActionEvent e) {
+				callActionCommandListeners(Integer.parseInt(e.getActionCommand()));
+			}
+		});
+
+		add(button);
+	}
+
+	/**
+	 * Obtener un bot�n por su Entero
+	 * @param id N�mero del disparador del bot�n
+	 * @return El bot�n especificado o <code>null</code> si no se encontr� el bot�n.
+	 */
+	public JButton getButton(int id) {
+		Iterator<JButton> acIterator = buttonsList.iterator();
+		while (acIterator.hasNext()) {
+			JButton button = (JButton) acIterator.next();
+			if (Integer.parseInt(button.getActionCommand()) == id)
+				return button;
+		}
+		return null;
+	}
+
+	/**
+	 * <p>Removes the button identified by <code>id</code>.</p>
+	 * 
+	 * @param id identifier of the button
+	 * @return <code>true</code> if has removed the button; otherwise <code>false</code>
+	 */
+	public boolean removeButton(int id) {
+		String b_text = getButtonText(id);
+		
+		Iterator<JButton> acIterator = buttonsList.iterator();
+		while (acIterator.hasNext()) {
+			JButton button = (JButton) acIterator.next();
+			if (button.getText().compareTo(b_text) == 0) {
+				buttonsList.remove(button);
+				return true;
+			}
+		}
+		
+		return false;
+	}
+	
+	/**
+	 * <p>Returns the text of the button identified by <code>id</code>.</p>
+	 * 
+	 * @param id identifier of the button
+	 * 
+	 * @return text of the identified button
+	 */
+	public String getButtonText(int id) {
+		switch (id) {
+			case BUTTON_ACCEPT:
+				return Messages.getText("aceptar");
+			case BUTTON_CANCEL:
+				return Messages.getText("cancelar");
+			case BUTTON_APPLY:
+				return Messages.getText("aplicar");
+			case BUTTON_YES:
+				return Messages.getText("si");
+			case BUTTON_NO:
+				return Messages.getText("no");
+			case BUTTON_CLOSE:
+				return Messages.getText("cerrar");
+			case BUTTON_EXIT:
+				return Messages.getText("salir");
+			case BUTTON_SEEDETAILS:
+				return Messages.getText("verdetalles");
+			case BUTTON_HIDEDETAILS:
+				return Messages.getText("ocultardetalles");
+			case BUTTON_PAUSE:
+				return Messages.getText("pausar");
+			case BUTTON_RESTART:
+				return Messages.getText("reanudar");
+			case BUTTON_SAVE:
+				return Messages.getText("guardar");
+		}
+
+		return null;
+	}
+
+	/**
+	 * <p>Enables (or disables) the button identified by <code>id</code>.</p>
+	 * 
+	 * @param id identifier of the button
+	 * @param b <code>true</code> to enable the button, otherwise <code>false</code>
+	 * 
+	 * @return <code>true</code> if there was a button of that kind in this group, otherwise <code>false</code>
+	 */
+	public boolean setEnabled(int id, boolean b) {
+		String b_text = getButtonText(id);
+		
+		Iterator<JButton> acIterator = buttonsList.iterator();
+		while (acIterator.hasNext()) {
+			JButton button = (JButton) acIterator.next();
+			if (button.getText().compareTo(b_text) == 0) {
+				button.setEnabled(b);
+				return true;
+			}
+		}
+		
+		return false;
+	}
+
+	public JComponent getComponent() {
+		return this;
+	}
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/RasterSwingImplLibrary.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/RasterSwingImplLibrary.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/RasterSwingImplLibrary.java	(revision 15423)
@@ -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.swing.impl;
+
+import java.util.Locale;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.swing.RasterSwingLocator;
+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 RasterSwingImplLibrary extends AbstractLibrary {
+
+	public RasterSwingImplLibrary() {
+		super();
+	}
+	
+	@Override
+	public void doRegistration() {
+	    this.registerAs(RasterSwingLibrary.class, Library.TYPE.IMPL);
+	}
+	
+    @Override
+    protected void doInitialize() throws LibraryException {
+    	RasterSwingLocator
+            .registerSwingManager(DefaultRasterSwingManager.class);
+        
+        
+        if (!Messages.hasLocales()) {
+            Messages.addLocale(Locale.getDefault());
+        }
+        
+        Messages.addResourceFamily("org.gvsig.raster.swing.impl.i18n.text",
+            RasterSwingImplLibrary.class.getClassLoader(),
+            RasterSwingImplLibrary.class.getClass().getName()); 
+        
+        registerIcons();
+    }
+
+    @Override
+    protected void doPostInitialize() throws LibraryException {
+    }
+    
+    private void registerIcons() {
+		IconThemeHelper.registerIcon(null, "icon-folder-open", this);
+		IconThemeHelper.registerIcon(null, "backward-icon", this);
+		IconThemeHelper.registerIcon(null, "delall", this);
+		IconThemeHelper.registerIcon(null, "delone", this);
+		IconThemeHelper.registerIcon(null, "down-16x16", this);
+		IconThemeHelper.registerIcon(null, "first", this);
+		IconThemeHelper.registerIcon(null, "forward-icon", this);
+		IconThemeHelper.registerIcon(null, "icon-folder-open", this);
+		IconThemeHelper.registerIcon(null, "last", this);
+		IconThemeHelper.registerIcon(null, "layer-saveas", this);
+		IconThemeHelper.registerIcon(null, "line-icon", this);
+		IconThemeHelper.registerIcon(null, "newpoint", this);
+		IconThemeHelper.registerIcon(null, "next", this);
+		IconThemeHelper.registerIcon(null, "point-icon", this);
+		IconThemeHelper.registerIcon(null, "polygon-icon", this);
+		IconThemeHelper.registerIcon(null, "prev", this);
+		IconThemeHelper.registerIcon(null, "tfwload-icon", this);
+		IconThemeHelper.registerIcon(null, "up-16x16", this);
+    }
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/buttonbar/ButtonBarContainerImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/buttonbar/ButtonBarContainerImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/buttonbar/ButtonBarContainerImpl.java	(revision 15423)
@@ -0,0 +1,184 @@
+/* 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.swing.impl.buttonbar;
+
+import java.awt.FlowLayout;
+import java.util.ArrayList;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.raster.swing.buttonbar.ButtonBar;
+
+public class ButtonBarContainerImpl extends JPanel implements ButtonBar {
+	private static final long serialVersionUID = -2556987128553063939L;
+
+	private ArrayList<JButton> buttons = new ArrayList<JButton>();
+
+	private int       wComp              = 400;
+	private int       hComp              = 26;
+	private boolean   disableAllControls = false;
+	private boolean[] buttonsState       = null;
+
+
+	/**
+	 * This is the default constructor
+	 */
+	public ButtonBarContainerImpl() {
+		super();
+		initialize();
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 * @return void
+	 */
+	private void initialize() {
+		FlowLayout flowLayout = new FlowLayout();
+		flowLayout.setHgap(0);
+		flowLayout.setVgap(0);
+		this.setLayout(flowLayout);
+		this.setSize(wComp, hComp);
+		}
+
+
+	/**
+	 * A�ade un boton al ArrayList de los botones.
+	 *
+	 * @param iconName: nombre del icono asignado al boton. La imagen tendr�a que
+	 * 					estar dentro de la carpeta "images/"
+	 * @param tip: tip del boton;
+	 * @param order: orden que ocupar� el boton dentro del control
+	 */
+	public void addButton(String iconName, String tip, int order) {
+		JButton bt = new JButton();
+
+		bt.setPreferredSize(new java.awt.Dimension(22, 22));
+		try{
+			if (iconName != null)
+				bt.setIcon(IconThemeHelper.getImageIcon(iconName));
+		}catch(NullPointerException exc){
+			//El icono no existe -> No se a�ade ninguno
+		}
+
+		if(tip != null)
+			bt.setToolTipText(tip);
+
+		buttons.add(order, bt);
+		addList();
+
+	}
+
+	/**
+	 * Elimina el bot�n correspondiente al indice que le pasamos.
+	 * @param index
+	 */
+	public void delButton(int index){
+		buttons.remove(index);
+		this.removeAll();
+		addList();
+	}
+
+	/**
+	 * A�ade en el panel los botones que tenemos en el ArrayList.
+	 *
+	 */
+	public void addList(){
+		for(int i = 0 ; i < buttons.size() ; i++){
+			this.add((JButton)buttons.get(i));
+		}
+	}
+
+
+	/**
+	 * Esta funci�n deshabilita todos los controles y guarda sus valores
+	 * de habilitado o deshabilitado para que cuando se ejecute restoreControlsValue
+	 * se vuelvan a quedar como estaba
+	 */
+	public void disableAllControls(){
+		if(!disableAllControls){
+			disableAllControls = true;
+
+			buttonsState = new boolean[buttons.size()];
+
+
+
+			for (int i = 0 ; i < buttons.size() ; i++){
+
+				//Salvamos los estados
+				buttonsState[i] = ((JButton)buttons.get(i)).isEnabled();
+				//Desactivamos controles
+				((JButton)buttons.get(i)).setEnabled(false);
+			}
+		}
+	}
+
+	/**
+	 * Esta funci�n deja los controles como estaban al ejecutar la funci�n
+	 * disableAllControls
+	 */
+	public void restoreControlsValue(){
+		if(disableAllControls){
+			disableAllControls = false;
+
+			for(int i = 0 ; i < buttons.size() ; i++){
+				((JButton)buttons.get(i)).setEnabled(buttonsState[i]);
+			}
+		}
+	}
+
+	/**
+	 * M�todo para acceder a los botones del control;
+	 * @param index
+	 * @return
+	 */
+	public JButton getButton(int index){
+		return (JButton)buttons.get(index);
+	}
+
+	/**
+	 * M�todo para establecer la posici�n de los botones dentro del control.
+	 * @param align: "left" o "right"
+	 */
+	public void setButtonAlignment(String align){
+		FlowLayout layout = new FlowLayout();
+		layout.setHgap(2);
+		layout.setVgap(0);
+
+		if (align.equals("right"))
+			layout.setAlignment(FlowLayout.RIGHT);
+		else
+			layout.setAlignment(FlowLayout.LEFT);
+
+		this.setLayout(layout);
+	}
+
+	public void setComponentBorder(boolean br){
+		if(br)
+			this.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		if(!br)
+			this.setBorder(javax.swing.BorderFactory.createEmptyBorder());
+	}
+
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/OpenFileContainerImpl.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/OpenFileContainerImpl.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/OpenFileContainerImpl.java	(revision 15423)
@@ -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.swing.impl.openfile;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.io.File;
+import java.util.List;
+
+import javax.swing.ImageIcon;
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.gui.beans.Messages;
+import org.gvsig.raster.swing.openfile.OpenFileContainer;
+
+/**
+ * Implementation of a open file panel
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class OpenFileContainerImpl extends JPanel implements OpenFileContainer {
+	private static final long       serialVersionUID = 5823371652872582451L;
+
+	private JButton                 jButton          = null;
+	private JTextField              tOpen            = null;
+	private OpenFileListener        listener         = null;
+	private boolean                 showBorder       = true;
+	
+	private boolean isButtonVisible = true;
+	
+	public OpenFileContainerImpl(boolean showBorder, String[] fileFilter, String defaultPath) {
+		this.showBorder = showBorder;
+		listener = new OpenFileListener(this, fileFilter, defaultPath);
+		initialize();
+		listener.setButton(this.getJButton());
+	}
+	
+	public OpenFileContainerImpl(boolean showBorder, List<String> fileFilter, String defaultPath) {
+		this(showBorder, (String[])fileFilter.toArray(new String[0]), defaultPath);
+		listener.setButton(this.getJButton());
+	}
+
+	/**
+	 * This method initializes this
+	 *
+	 */
+	private void initialize() {
+		this.setLayout(new GridBagLayout());
+		if(showBorder)
+			this.setBorder(javax.swing.BorderFactory.createTitledBorder(null, Messages.getText("open_file"), javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, null, null));
+		
+		GridBagConstraints gridBagConstraints1 = new GridBagConstraints();
+		gridBagConstraints1.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints1.weightx = 1;
+		gridBagConstraints1.insets = new java.awt.Insets(0, 2, 0, 0);
+		
+		this.add(getTOpen(), gridBagConstraints1);
+		
+		gridBagConstraints1.gridx = 1;
+		gridBagConstraints1.weightx = 0;
+		
+		this.add(getJButton(), gridBagConstraints1);
+
+	}
+
+	/**
+	 * This method initializes jButton
+	 *
+	 * @return javax.swing.JButton
+	 */
+	private JButton getJButton() {
+		if (jButton == null) {
+			ImageIcon icon = null;
+			try {
+				icon = IconThemeHelper.getImageIcon("icon-folder-open");
+			} catch (Exception e) {
+			}
+			if(icon == null || icon.getIconWidth() <= 0 || icon.getIconHeight() <= 0) 
+				icon = new ImageIcon(System.getProperty("user.dir") + "/src/main/resources/images/icon-folder-open.gif", "");
+
+			jButton = new JButton(icon);
+			jButton.setPreferredSize(new Dimension(22, 22));
+			jButton.addActionListener(listener);
+			jButton.setVisible(isButtonVisible);
+			getTOpen().setEnabled(isButtonVisible);
+		}
+		return jButton;
+	}
+
+	/**
+	 * This method initializes jTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	public JTextField getTOpen() {
+		if (tOpen == null) {
+			tOpen = new JTextField();
+			tOpen.setPreferredSize(new Dimension(0, 22));
+		}
+		return tOpen;
+	}
+	
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.swing.openfile.OpenFileContainer#setPath(java.lang.String)
+	 */
+	public void setPath(String path) {
+		getTOpen().setText(path);
+	}
+
+
+	/**
+	 * Devuelve el file cuya ruta corresponde con el campo de texto.
+	 * @return
+	 */
+	public File getFile() {
+		File fil = null;
+		if(this.getTOpen().getText() != "") {
+			try {
+				fil = new File(this.getTOpen().getText());
+			} catch(Exception exc) {
+				System.err.println("Ruta o archivo no v�lido");
+			}
+		}
+		return fil;
+	}
+	
+	public void setEnabled(boolean enabled) {
+		getTOpen().setEnabled(enabled);
+		getJButton().setEnabled(enabled);
+	}
+
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/OpenFileListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/OpenFileListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/OpenFileListener.java	(revision 15423)
@@ -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.swing.impl.openfile;
+
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JFileChooser;
+
+/**
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class OpenFileListener implements ActionListener {
+	private JButton               button        = null;
+	private String                fName         = null;
+	private OpenFileContainerImpl controlPanel  = null;
+	private String[]              fileFilter    = null;
+	private String                lastDirectory = null;
+	
+	public OpenFileListener(OpenFileContainerImpl panel, String[] fileFilter, String lastDirectory) {
+		this.controlPanel = panel;
+		this.fileFilter = fileFilter;
+		this.lastDirectory = lastDirectory;
+	}
+	
+	public void setButton(JButton but) {
+		this.button = but;
+	}
+	
+	
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == this.button) {
+			JFileChooser file = new JFileChooser();
+			//file.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+			file.setDialogTitle("Select File");
+			if(lastDirectory != null) {
+				File lastDir = new File(lastDirectory);	
+				if(lastDir.isDirectory() && lastDir.exists()) {
+					file.setCurrentDirectory(lastDir);
+				}
+				if(!lastDir.isDirectory()) {
+					lastDir = new File(lastDir.getParent());
+					if(lastDir.exists())
+						file.setCurrentDirectory(lastDir);
+				}
+			}
+			
+			if(fileFilter != null) {
+				for (int i = 0; i < fileFilter.length; i++) {
+					file.addChoosableFileFilter(new ReadFilter(file, fileFilter[i]));					
+				}
+				int returnVal = file.showOpenDialog(controlPanel);
+				if(returnVal == JFileChooser.APPROVE_OPTION) {
+					lastDirectory = file.getSelectedFile().getAbsolutePath();
+					fName = file.getSelectedFile().toString();
+					controlPanel.getTOpen().setText(fName);
+				}
+			}
+		}
+
+	}
+
+	public String getFileName(){
+		return fName;
+	}
+}
+
+class ReadFilter extends javax.swing.filechooser.FileFilter{
+
+	JFileChooser chooser = null;
+	String filter = null;
+	
+	public ReadFilter(JFileChooser cho,String fil){
+		this.chooser = cho;
+		this.filter = fil;
+	}
+	
+	public boolean accept(File f) {
+		 return f.isDirectory() || f.getName().toLowerCase().endsWith("."+filter);
+	}
+
+	public String getDescription() {
+		return "."+filter;
+	}
+	
+}
\ No newline at end of file

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/FileTextField.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/FileTextField.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/openfile/FileTextField.java	(revision 15423)
@@ -0,0 +1,232 @@
+/* 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.swing.impl.openfile;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.FocusEvent;
+import java.awt.event.FocusListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.gui.beans.Messages;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.raster.swing.openfile.FileFilter;
+
+public class FileTextField extends JPanel {
+	private static final long serialVersionUID = 1L;
+	private JTextField tf_fileName = null;
+	private JButton bt_chooseFile = null;
+	private File selectedFile = null;
+	private JFileChooser jfc;
+	/**
+	 * Used to create file choosers with 'memory'
+	 */
+	private String JFC_ID = null;
+
+	public static final int ACTION_EVENT_FIELD_DISABLED = 0;
+	public static final int ACTION_EVENT_FIELD_ENABLED = 1;
+	public static final int ACTION_EVENT_VALUE_CHANGED = 1;
+
+	public FileTextField() {
+		super();
+		JFC_ID = this.getClass().getName();
+		initializeUI();
+	}
+
+	public FileTextField(String id) {
+		super();
+		JFC_ID = id;
+		initializeUI();
+	}
+
+	private void initializeUI() {
+		 jfc = new JFileChooser(JFC_ID, (String) null);
+		setLayout(new GridBagLayout());
+
+		GridBagConstraints constraints = new GridBagConstraints();
+		constraints.gridx = 0;
+		constraints.gridy = 0;
+		constraints.gridwidth = 1;
+		constraints.gridheight = 1;
+		constraints.fill = GridBagConstraints.BOTH;
+		constraints.anchor = GridBagConstraints.WEST;
+		constraints.weightx = 1.0;
+		constraints.weighty = 1.0;
+		constraints.insets = new Insets(0,0,0,4);
+		this.add(getNameField(), constraints);
+
+		getChooseFileButton().addActionListener(new ActionListener() {
+
+			public void actionPerformed(ActionEvent e) {
+				if (e.getSource()==getChooseFileButton()) {
+					int action = jfc.showDialog(FileTextField.this, Messages.getText("Open"));
+					if (action == JFileChooser.APPROVE_OPTION) {
+						setSelectedFile(jfc.getSelectedFile());
+						setEnabled(true);	
+					}
+				}
+			}
+		});
+		constraints.gridx = 1;
+		constraints.gridy = 0;
+		constraints.gridwidth = 1;
+		constraints.gridheight = 1;
+		constraints.fill = GridBagConstraints.BOTH;
+		constraints.anchor = GridBagConstraints.WEST;
+		constraints.weightx = 0.0;
+		constraints.weighty = 1.0;
+		constraints.insets = new Insets(0,0,0,0);
+		this.add(getChooseFileButton(), constraints);
+	}
+
+	private JTextField getNameField() {
+		if (tf_fileName==null) {
+			tf_fileName = new JTextField();
+			tf_fileName.addFocusListener(new FocusListener() {
+				public void focusGained(FocusEvent e) {}
+
+				public void focusLost(FocusEvent e) {
+					updateSelectedFile();
+				}
+			});
+		}
+		return tf_fileName;
+	}
+	
+	private JButton getChooseFileButton() {
+		if (bt_chooseFile==null) {
+			bt_chooseFile = new JButton("...");
+		}
+		return bt_chooseFile;
+	}
+
+
+	public void setSelectedFile(File file) {
+		File oldFile = selectedFile;
+		selectedFile = normalizeExtension(file);
+		getNameField().setText(selectedFile.toString());
+		if (file.isDirectory()) {
+			jfc.setLastPath(file);
+		}
+		else {
+		    jfc.setSelectedFile(file);
+            jfc.setLastPath(file.getParentFile());
+		}
+		fireValueChanged(oldFile, file);
+	}
+
+	public File getSelectedFile() {
+		return updateSelectedFile();
+	}
+	
+	private File normalizeExtension(File file) {
+		javax.swing.filechooser.FileFilter filter = (javax.swing.filechooser.FileFilter) jfc.getFileFilter();
+		if (!filter.accept(file)) {
+			String path = file.getPath();
+			if (filter instanceof FileFilter)  {
+				FileFilter ourFilter = (FileFilter) filter;
+			if (path.endsWith(".")) {
+				path = path+ourFilter.getDefaultExtension();
+			}
+			else {
+				path = path+"."+ourFilter.getDefaultExtension();
+			}
+			file = new File(path);
+			}
+		}
+		return file;	
+	}
+	
+	private File updateSelectedFile() {
+		File oldFile = selectedFile;
+		String text = getNameField().getText();
+		if ( (oldFile!=null && !oldFile.getPath().equals(text))
+				|| ((oldFile==null) && !text.equals(""))){
+			File newFile = normalizeExtension(new File(getNameField().getText()));
+			selectedFile = newFile;
+			fireValueChanged(oldFile, newFile);
+		}
+		return selectedFile;
+	}
+
+	protected void fireValueChanged(File oldValue, File newValue) {
+		firePropertyChange("selectedFileChanged", oldValue, newValue);
+	}
+
+	protected void fireEnabledChanged(boolean oldValue, boolean newValue) {
+		firePropertyChange("enabled", oldValue, newValue);
+	}
+
+	public void setEnabled(boolean enabled) {
+		boolean oldValue = isEnabled();
+		super.setEnabled(enabled);
+		getNameField().setEnabled(enabled);
+        getChooseFileButton().setEnabled(enabled);
+		fireEnabledChanged(oldValue, enabled);
+	}
+
+	public javax.swing.filechooser.FileFilter getFileFilter() {
+		return jfc.getFileFilter();
+	}
+
+	public int getFileSelectionMode() {
+		return jfc.getFileSelectionMode();
+	}
+
+	public boolean removeChoosableFileFilter(FileFilter f) {
+		return jfc.removeChoosableFileFilter(f);
+	}
+
+	public void setFileFilter(FileFilter filter) {
+
+		jfc.setFileFilter(filter);
+		
+	}
+
+	public void addChoosableFileFilter(FileFilter filter) {
+		jfc.addChoosableFileFilter(filter);
+	}
+
+	public FileFilter getAcceptAllFileFilter() {
+		return (FileFilter) jfc.getAcceptAllFileFilter();
+	}
+
+	public boolean isAcceptAllFileFilterUsed() {
+		return jfc.isAcceptAllFileFilterUsed();
+	}
+
+	public void resetChoosableFileFilters() {
+		jfc.resetChoosableFileFilters();
+	}
+
+	public void setAcceptAllFileFilterUsed(boolean b) {
+		jfc.setAcceptAllFileFilterUsed(b);
+	}
+	
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/GenericBasePanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/GenericBasePanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/src/main/java/org/gvsig/raster/swing/impl/GenericBasePanel.java	(revision 15423)
@@ -0,0 +1,47 @@
+/* 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.swing.impl;
+
+import org.gvsig.raster.swing.BasePanel;
+
+/**
+ * Clase no abstracta para instanciar un BasePanel generico
+ * 18/08/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class GenericBasePanel extends BasePanel {
+	private static final long serialVersionUID = 1L;
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#init()
+	 */
+	protected void init() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.raster.util.BasePanel#translate()
+	 */
+	protected void translate() {
+	}	
+}

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/org.gvsig.raster.swing.impl/pom.xml	(revision 15423)
@@ -0,0 +1,43 @@
+<?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.swing.impl</artifactId>
+	<packaging>jar</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.swing</artifactId>
+		<version>2.2.171</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.swing.api</artifactId>
+		</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.tools.swing.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+	</dependencies>
+</project>
\ No newline at end of file

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


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

.settings

.classpath

.project


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.swing/pom.xml	(revision 15423)
@@ -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.swing</artifactId>
+	<packaging>pom</packaging>
+	<name>${project.artifactId} (old)</name>
+	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster</artifactId>
+		<version>2.2.171</version>
+	</parent>
+	<dependencies>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.andami</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.raster.lib.api</artifactId>
+			<scope>compile</scope>
+		</dependency>
+		<dependency>
+			<groupId>org.gvsig</groupId>
+			<artifactId>org.gvsig.raster.lib.impl</artifactId>
+			<scope>runtime</scope>
+		</dependency>
+	</dependencies>
+	<modules>
+		<module>org.gvsig.raster.swing.api</module>
+		<module>org.gvsig.raster.swing.impl</module>
+	</modules>
+</project>
+

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/pom.xml	(revision 15423)
@@ -0,0 +1,157 @@
+<?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/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.raster</artifactId>
+    <packaging>pom</packaging>
+    <version>2.2.171</version>
+    <name>${project.artifactId} (old)</name>
+    <description>Raster support library</description>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.desktop</artifactId>
+        <version>2.0.341</version>
+    </parent>
+
+    <properties>
+        <potrace.version>2.0.0</potrace.version>
+        <org.gvsig.raster.cache.version>2.2.73</org.gvsig.raster.cache.version>
+    </properties>
+
+    <scm>
+        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster/tags/org.gvsig.raster-2.2.171</connection>
+        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster/tags/org.gvsig.raster-2.2.171</developerConnection>
+        <url>https://devel.gvsig.org/redmine/projects/gvsig-raster/repository/show/org.gvsig.raster/tags/org.gvsig.raster-2.2.171</url>
+    </scm>
+
+    <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>
+
+    <developers>
+        <developer>
+            <id>nbrodin</id>
+            <name>Nacho Brodin</name>
+            <email>nachobrodin@gmail.com</email>
+            <roles>
+                <role>Architect</role>
+                <role>Developer</role>
+            </roles>
+        </developer>
+    </developers>
+    <dependencyManagement>
+        <dependencies>
+
+            <!--
+            Versions of other gvSIG projects
+            -->
+	    <dependency>
+		    <groupId>org.gvsig</groupId>
+		    <artifactId>org.gvsig.raster.cache</artifactId>
+		    <version>${org.gvsig.raster.cache.version}</version>
+		    <type>pom</type>
+		    <scope>import</scope>
+	    </dependency>
+
+
+	    <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.jpotrace</artifactId>
+                <version>${potrace.version}</version>
+            </dependency>
+
+            <!--
+            Versions of child projects
+            -->
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.lib.api</artifactId>
+                <version>2.2.171</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.lib.impl</artifactId>
+                <version>2.2.171</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.swing.api</artifactId>
+                <version>2.2.171</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.swing.impl</artifactId>
+                <version>2.2.171</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.fmap</artifactId>
+                <version>2.2.171</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.algorithm</artifactId>
+                <version>2.2.171</version>
+            </dependency>
+            <dependency>
+                <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.raster.app.common</artifactId>
+                <version>2.2.171</version>
+            </dependency>
+
+        </dependencies>
+    </dependencyManagement>
+
+    <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/tags/</tagBase>
+                    <goals>deploy</goals>
+                </configuration>
+            </plugin>
+
+            <plugin>
+                <!-- Skip test execution -->
+                <!--
+                  Ahora mismo bastantes test de raster muestran interface de usuario,
+                  hasta que eso sea corregido desactivo la ejecucion por defecto de los
+                  test.
+                -->
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <skipTests>true</skipTests>
+                </configuration>
+            </plugin>
+
+        </plugins>
+    </build>
+
+    <modules>
+        <module>org.gvsig.raster.lib</module>
+        <module>org.gvsig.raster.swing</module>
+        <module>org.gvsig.raster.app</module>
+        <module>org.gvsig.raster.algorithm</module>
+        <module>org.gvsig.raster.fmap</module>
+    </modules>
+
+</project>
+

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

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/src/main/assembly/gvsig-plugin-package.xml	(revision 15423)
@@ -0,0 +1,70 @@
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    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 3
+    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.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>target/org.gvsig.raster.app.common</directory>
+      <outputDirectory>.</outputDirectory>
+      <excludes>
+      	<exclude>package.info</exclude>
+      </excludes>
+    </fileSet>
+    <fileSet>
+      <directory>target/native/lib</directory>
+      <outputDirectory>native</outputDirectory>
+    </fileSet>
+    <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.jpotrace:jar</include>
+		</includes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/src/main/resources-plugin/autorun.sh
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/src/main/resources-plugin/autorun.sh	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/src/main/resources-plugin/autorun.sh	(revision 15423)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# gvSIG. Desktop Geographic Information System.
+#
+# Copyright (C) 2007-2013 gvSIG Association.
+#
+# 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 3
+# 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.
+#
+# For any additional information, do not hesitate to contact us
+# at info AT gvsig.com, or visit our website www.gvsig.com.
+#
+
+
+#
+# Plugin autorun
+# 
+
+PLUGIN_NAME=$(basename "$PLUGIN_FOLDER")
+
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PLUGIN_FOLDER/native"
+GVSIG_NATIVE_LIBS="$GVSIG_NATIVE_LIBS:$PLUGIN_FOLDER/native"
+
+
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/pom.xml	(revision 15423)
@@ -0,0 +1,132 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.gvsig.raster.app.lin.x86_64</artifactId>
+  <packaging>jar</packaging>
+   
+ 	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.app</artifactId>
+    <version>2.2.22-SNAPSHOT</version>
+	</parent>
+
+  <properties>
+    <gvsig.package.info.operatingSystem>lin</gvsig.package.info.operatingSystem>
+    <gvsig.package.info.architecture>x86_64</gvsig.package.info.architecture>
+        
+    <jpotrace.classifier>linux-all-gcc4-X86_64-dynamic</jpotrace.classifier>
+    <jpotrace.version>2.0.0</jpotrace.version>
+  </properties>
+
+  <dependencyManagement>
+      <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+        </dependency> 
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.raster.app.common</artifactId>
+          <type>zip</type>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <scope>compile</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+          <scope>runtime</scope>
+        </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+          	<id>unpack</id>
+	        <phase>process-sources</phase>
+	        <goals>
+	          <goal>unpack</goal>
+	        </goals>
+	        <configuration>
+	          <artifactItems>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+		            <artifactId>org.gvsig.raster.app.common</artifactId>
+		            <type>zip</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target</outputDirectory>
+	            </artifactItem>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.jpotrace</artifactId>
+                <classifier>${jpotrace.classifier}</classifier>
+                <version>${jpotrace.version}</version>
+		            <type>tar.gz</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target/native</outputDirectory>
+	            </artifactItem>
+	          </artifactItems>
+	        </configuration>
+          </execution>
+        </executions>
+	  </plugin>
+  
+  
+    </plugins>
+  </build>
+
+  <!-- 
+  The profiles only configure the automatic deploy of gvSIG plugin in the gvSIG
+  configured in HOME/.gvsig-devel.properties
+  -->
+  <profiles>
+  
+    <profile>
+      <id>gvsig-plugin-install-raster-linux-x86_64</id>
+      <activation>
+         <os>
+             <family>unix</family>
+             <name>linux</name>
+             <arch>x86_64</arch>
+         </os>
+      </activation>
+	    <properties>
+	      <gvsig.install.plugin>true</gvsig.install.plugin>
+	    </properties>
+    </profile>
+
+    <profile>
+      <id>gvsig-plugin-install-raster-linux-amd64</id>
+      <activation>
+         <os>
+             <family>unix</family>
+             <name>linux</name>
+             <arch>amd64</arch>
+         </os>
+      </activation>
+      <properties>
+         <gvsig.install.plugin>true</gvsig.install.plugin>
+      </properties>
+    </profile>
+
+  </profiles>
+  
+</project>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Thu Oct 08 22:02:21 CEST 2015
+buildNumber=26

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86_64
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Thu Oct 08 22:02:21 CEST 2015
+buildNumber=26
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/src/main/assembly/gvsig-plugin-package.xml	(revision 15423)
@@ -0,0 +1,70 @@
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    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 3
+    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.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+        <source>target/package.info</source>
+    </file>
+    <file>
+    		<source>target/native/bin/jpotrace001.dll</source>
+        <outputDirectory>install/files</outputDirectory>
+    </file>    
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>target/org.gvsig.raster.app.common</directory>
+      <outputDirectory>.</outputDirectory>
+      <excludes>
+      	<exclude>package.info</exclude>
+      </excludes>
+    </fileSet>
+    <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.jpotrace:jar</include>
+		</includes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86/pom.xml	(revision 15423)
@@ -0,0 +1,116 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.gvsig.raster.app.win.x86</artifactId>
+  <packaging>jar</packaging>
+   
+ 	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.app</artifactId>
+    <version>2.2.22-SNAPSHOT</version>
+	</parent>
+
+  <properties>
+    <gvsig.package.info.operatingSystem>win</gvsig.package.info.operatingSystem>
+    <gvsig.package.info.architecture>x86</gvsig.package.info.architecture>
+    
+    <jpotrace.classifier>win-nt-vs8-i386-dynamic</jpotrace.classifier>
+    <jpotrace.version>2.0.0</jpotrace.version>
+  </properties>
+
+  <dependencyManagement>
+      <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+        </dependency> 
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.raster.app.common</artifactId>
+          <type>zip</type>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <scope>compile</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+          <scope>runtime</scope>
+        </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+          	<id>unpack</id>
+	        <phase>process-sources</phase>
+	        <goals>
+	          <goal>unpack</goal>
+	        </goals>
+	        <configuration>
+	          <artifactItems>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+		            <artifactId>org.gvsig.raster.app.common</artifactId>
+		            <type>zip</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target</outputDirectory>
+	            </artifactItem>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.jpotrace</artifactId>
+                <classifier>${jpotrace.classifier}</classifier>
+                <version>${jpotrace.version}</version>
+		            <type>tar.gz</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target/native</outputDirectory>
+	            </artifactItem>
+	          </artifactItems>
+	        </configuration>
+          </execution>
+        </executions>
+	  </plugin>
+  
+  
+    </plugins>
+  </build>
+
+  <profiles>
+  
+    <profile>
+      <id>gvsig-plugin-install-raster-windows-x86</id>
+      <activation>
+         <os>
+             <family>windows</family>
+             <!-- Uncomment this when have support for amd64 -->
+             <!-- 
+             <arch>x86</arch>
+             -->
+         </os>
+      </activation>
+	  <properties>
+	    <gvsig.install.plugin>true</gvsig.install.plugin>
+	  </properties>
+    </profile>
+    
+  </profiles>
+  
+</project>
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.win.x86
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Fri Mar 28 13:59:39 CET 2014
+buildNumber=12
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/src/main/assembly/gvsig-plugin-package.xml	(revision 15423)
@@ -0,0 +1,70 @@
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    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 3
+    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.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>target/org.gvsig.raster.app.common</directory>
+      <outputDirectory>.</outputDirectory>
+      <excludes>
+      	<exclude>package.info</exclude>
+      </excludes>
+    </fileSet>
+    <fileSet>
+      <directory>target/native/lib</directory>
+      <outputDirectory>native</outputDirectory>
+    </fileSet>
+    <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.jpotrace:jar</include>
+		</includes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/src/main/resources-plugin/autorun.sh
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/src/main/resources-plugin/autorun.sh	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/src/main/resources-plugin/autorun.sh	(revision 15423)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# gvSIG. Desktop Geographic Information System.
+#
+# Copyright (C) 2007-2013 gvSIG Association.
+#
+# 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 3
+# 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.
+#
+# For any additional information, do not hesitate to contact us
+# at info AT gvsig.com, or visit our website www.gvsig.com.
+#
+
+
+#
+# Plugin autorun
+# 
+
+PLUGIN_NAME=$(basename "$PLUGIN_FOLDER")
+
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PLUGIN_FOLDER/native"
+GVSIG_NATIVE_LIBS="$GVSIG_NATIVE_LIBS:$PLUGIN_FOLDER/native"
+
+
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mac_10.5/pom.xml	(revision 15423)
@@ -0,0 +1,97 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.gvsig.raster.app.mac_10.5</artifactId>
+  <packaging>jar</packaging>
+   
+ 	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.app</artifactId>
+    <version>2.2.4-SNAPSHOT</version>
+	</parent>
+
+  <properties>
+    <gvsig.package.info.operatingSystem>mac_10.5</gvsig.package.info.operatingSystem>
+    <gvsig.package.info.architecture>x86_64</gvsig.package.info.architecture>
+    
+    <jpotrace.classifier>mac-10.5-gcc4-universal-dynamic</jpotrace.classifier>
+    <jpotrace.version>2.0.0</jpotrace.version>
+  </properties>
+
+  <dependencyManagement>
+      <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+        </dependency> 
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.raster.app.common</artifactId>
+          <type>zip</type>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <scope>compile</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+          <scope>runtime</scope>
+        </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+          	<id>unpack</id>
+	        <phase>process-sources</phase>
+	        <goals>
+	          <goal>unpack</goal>
+	        </goals>
+	        <configuration>
+	          <artifactItems>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+		            <artifactId>org.gvsig.raster.app.common</artifactId>
+		            <type>zip</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target</outputDirectory>
+	            </artifactItem>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.jpotrace</artifactId>
+                <classifier>${jpotrace.classifier}</classifier>
+                <version>${jpotrace.version}</version>
+		            <type>tar.gz</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target/native</outputDirectory>
+	            </artifactItem>
+	          </artifactItems>
+	        </configuration>
+          </execution>
+        </executions>
+	  </plugin>
+  
+  
+    </plugins>
+  </build>
+
+  
+</project>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Mon Nov 15 21:09:02 CET 2021
+buildNumber=180
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/src/main/assembly/gvsig-plugin-package.xml	(revision 15423)
@@ -0,0 +1,65 @@
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    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 3
+    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.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>target/org.gvsig.raster.app.common</directory>
+      <outputDirectory>.</outputDirectory>
+      <excludes>
+      	<exclude>package.info</exclude>
+      </excludes>
+    </fileSet>
+    <fileSet>
+      <directory>src/main/resources-plugin</directory>
+      <outputDirectory>.</outputDirectory>
+    </fileSet>
+  </fileSets>
+
+<!--
+  <dependencySets>
+    <dependencySet>
+      <useProjectArtifact>false</useProjectArtifact>
+      <useTransitiveDependencies>false</useTransitiveDependencies>
+      <outputDirectory>lib</outputDirectory>
+		<includes>
+		</includes>
+    </dependencySet>
+  </dependencySets>
+-->
+</assembly>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin/pom.xml	(revision 15423)
@@ -0,0 +1,61 @@
+<?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/maven-v4_0_0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+    <artifactId>org.gvsig.raster.app.mainplugin</artifactId>
+    <packaging>jar</packaging>
+  	<name>${project.artifactId} (old)</name>
+
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.raster.app</artifactId>
+        <version>2.2.171</version>
+    </parent>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.app.common</artifactId>
+            <type>zip</type>
+        </dependency>
+
+    </dependencies>
+
+    <build>
+        <plugins>
+
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-dependency-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>unpack</id>
+                        <phase>process-sources</phase>
+                        <goals>
+                            <goal>unpack</goal>
+                        </goals>
+                        <configuration>
+                            <artifactItems>
+                                <artifactItem>
+                                    <groupId>org.gvsig</groupId>
+                                    <artifactId>org.gvsig.raster.app.common</artifactId>
+                                    <type>zip</type>
+                                    <overWrite>true</overWrite>
+                                    <outputDirectory>target</outputDirectory>
+                                </artifactItem>
+                            </artifactItems>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+
+
+        </plugins>
+    </build>
+
+    <properties>
+        <gvsig.install.plugin>true</gvsig.install.plugin>
+        <gvsig.package.info.name>Raster base support</gvsig.package.info.name>    
+    </properties>
+
+</project>
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.mainplugin
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Fri Mar 28 13:59:39 CET 2014
+buildNumber=12
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/src/main/resources-plugin/autorun.sh
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/src/main/resources-plugin/autorun.sh	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/src/main/resources-plugin/autorun.sh	(revision 15423)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# gvSIG. Desktop Geographic Information System.
+#
+# Copyright (C) 2007-2013 gvSIG Association.
+#
+# 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 3
+# 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.
+#
+# For any additional information, do not hesitate to contact us
+# at info AT gvsig.com, or visit our website www.gvsig.com.
+#
+
+
+#
+# Plugin autorun
+# 
+
+PLUGIN_NAME=$(basename "$PLUGIN_FOLDER")
+
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PLUGIN_FOLDER/native"
+GVSIG_NATIVE_LIBS="$GVSIG_NATIVE_LIBS:$PLUGIN_FOLDER/native"
+
+
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/src/main/assembly/gvsig-plugin-package.xml	(revision 15423)
@@ -0,0 +1,70 @@
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    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 3
+    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.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>target/org.gvsig.raster.app.common</directory>
+      <outputDirectory>.</outputDirectory>
+      <excludes>
+      	<exclude>package.info</exclude>
+      </excludes>
+    </fileSet>
+    <fileSet>
+      <directory>target/native/lib</directory>
+      <outputDirectory>native</outputDirectory>
+    </fileSet>
+    <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.jpotrace:jar</include>
+		</includes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.fedora.x86/pom.xml	(revision 15423)
@@ -0,0 +1,94 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.gvsig.raster.app.fedora.x86</artifactId>
+  <packaging>jar</packaging>
+   
+ 	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.app</artifactId>
+    <version>2.2.4-SNAPSHOT</version>
+	</parent>
+
+  <properties>
+    <gvsig.package.info.operatingSystem>fedora</gvsig.package.info.operatingSystem>
+    <gvsig.package.info.architecture>x86</gvsig.package.info.architecture>
+    
+    <native.classifier>fedora11-i586-dynamic</native.classifier>
+  </properties>
+
+  <dependencyManagement>
+      <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${native.classifier}</classifier>
+          <type>tar.gz</type>
+          <version>2.0.0-SNAPSHOT</version>
+        </dependency> 
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.raster.app.common</artifactId>
+          <type>zip</type>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <scope>compile</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${native.classifier}</classifier>
+          <type>tar.gz</type>
+          <scope>runtime</scope>
+        </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+          	<id>unpack</id>
+	        <phase>process-sources</phase>
+	        <goals>
+	          <goal>unpack</goal>
+	        </goals>
+	        <configuration>
+	          <artifactItems>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+		            <artifactId>org.gvsig.raster.app.common</artifactId>
+		            <type>zip</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target</outputDirectory>
+	            </artifactItem>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.jpotrace</artifactId>
+		            <classifier>${native.classifier}</classifier>
+		            <type>tar.gz</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target/native</outputDirectory>
+	            </artifactItem>
+	          </artifactItems>
+	        </configuration>
+          </execution>
+        </executions>
+	  </plugin>
+  
+  
+    </plugins>
+  </build>
+
+  
+</project>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Thu Oct 08 22:02:19 CEST 2015
+buildNumber=26
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/src/main/resources-plugin/autorun.sh
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/src/main/resources-plugin/autorun.sh	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/src/main/resources-plugin/autorun.sh	(revision 15423)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# gvSIG. Desktop Geographic Information System.
+#
+# Copyright (C) 2007-2013 gvSIG Association.
+#
+# 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 3
+# 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.
+#
+# For any additional information, do not hesitate to contact us
+# at info AT gvsig.com, or visit our website www.gvsig.com.
+#
+
+
+#
+# Plugin autorun
+# 
+
+PLUGIN_NAME=$(basename "$PLUGIN_FOLDER")
+
+LD_LIBRARY_PATH="$LD_LIBRARY_PATH:$PLUGIN_FOLDER/native"
+GVSIG_NATIVE_LIBS="$GVSIG_NATIVE_LIBS:$PLUGIN_FOLDER/native"
+
+
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/src/main/assembly/gvsig-plugin-package.xml	(revision 15423)
@@ -0,0 +1,70 @@
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    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 3
+    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.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<assembly>
+  <id>gvsig-plugin-package</id>
+  <formats>
+    <format>zip</format>
+  </formats>
+  <baseDirectory>${gvsig.package.info.code}</baseDirectory>
+  <includeBaseDirectory>true</includeBaseDirectory>
+  <files>
+    <file>
+      <source>target/package.info</source>
+    </file>
+  </files>
+
+  <fileSets>
+    <fileSet>
+      <directory>target/org.gvsig.raster.app.common</directory>
+      <outputDirectory>.</outputDirectory>
+      <excludes>
+      	<exclude>package.info</exclude>
+      </excludes>
+    </fileSet>
+    <fileSet>
+      <directory>target/native/lib</directory>
+      <outputDirectory>native</outputDirectory>
+    </fileSet>
+    <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.jpotrace:jar</include>
+		</includes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86/pom.xml	(revision 15423)
@@ -0,0 +1,132 @@
+<?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/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <artifactId>org.gvsig.raster.app.lin.x86</artifactId>
+  <packaging>jar</packaging>
+   
+ 	<parent>
+		<groupId>org.gvsig</groupId>
+		<artifactId>org.gvsig.raster.app</artifactId>
+    <version>2.2.22-SNAPSHOT</version>
+	</parent>
+
+  <properties>
+    <gvsig.package.info.operatingSystem>lin</gvsig.package.info.operatingSystem>
+    <gvsig.package.info.architecture>x86</gvsig.package.info.architecture>
+    
+    <jpotrace.classifier>linux-all-gcc4-i386-dynamic</jpotrace.classifier>
+    <jpotrace.version>2.0.0</jpotrace.version>
+  </properties>
+
+  <dependencyManagement>
+      <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+        </dependency> 
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.raster.app.common</artifactId>
+          <type>zip</type>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <scope>compile</scope>
+        </dependency>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.jpotrace</artifactId>
+          <classifier>${jpotrace.classifier}</classifier>
+          <version>${jpotrace.version}</version>
+          <type>tar.gz</type>
+          <scope>runtime</scope>
+        </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+  
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <executions>
+          <execution>
+          	<id>unpack</id>
+	        <phase>process-sources</phase>
+	        <goals>
+	          <goal>unpack</goal>
+	        </goals>
+	        <configuration>
+	          <artifactItems>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+		            <artifactId>org.gvsig.raster.app.common</artifactId>
+		            <type>zip</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target</outputDirectory>
+	            </artifactItem>
+	            <artifactItem>
+		            <groupId>org.gvsig</groupId>
+                <artifactId>org.gvsig.jpotrace</artifactId>
+                <classifier>${jpotrace.classifier}</classifier>
+                <version>${jpotrace.version}</version>
+		            <type>tar.gz</type>
+					      <overWrite>true</overWrite>
+					      <outputDirectory>target/native</outputDirectory>
+	            </artifactItem>
+	          </artifactItems>
+	        </configuration>
+          </execution>
+        </executions>
+	  </plugin>
+  
+  
+    </plugins>
+  </build>
+
+  <!-- 
+  The profiles only configure the automatic deploy of gvSIG plugin in the gvSIG
+  configured in HOME/.gvsig-devel.properties
+  -->
+  <profiles>
+  
+    <profile>
+      <id>gvsig-plugin-install-raster-linux-x86</id>
+      <activation>
+         <os>
+             <family>unix</family>
+             <name>linux</name>
+             <arch>x86</arch>
+         </os>
+      </activation>
+	    <properties>
+	      <gvsig.install.plugin>true</gvsig.install.plugin>
+	    </properties>
+    </profile>
+
+    <profile>
+      <id>gvsig-plugin-install-raster-linux-i386</id>
+      <activation>
+         <os>
+             <family>unix</family>
+             <name>linux</name>
+             <arch>i386</arch>
+         </os>
+      </activation>
+      <properties>
+         <gvsig.install.plugin>true</gvsig.install.plugin>
+      </properties>
+    </profile>
+
+  </profiles>
+  
+</project>
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.lin.x86
___________________________________________________________________
Added: svn:ignore
   + target


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/pom.xml	(revision 15423)
@@ -0,0 +1,161 @@
+<?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.app.common</artifactId>
+    <packaging>jar</packaging>
+  	<name>${project.artifactId} (old)</name>
+    <description>Basic libraries for raster support</description>
+    <parent>
+        <groupId>org.gvsig</groupId>
+        <artifactId>org.gvsig.raster.app</artifactId>
+        <version>2.2.171</version>
+    </parent>
+    
+    <dependencies>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.about.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.cache.lib.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.cache.lib.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.andami</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.i18n</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.tools.lib</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.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.lib.impl</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.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.metadata.lib.basic.api</artifactId>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.timesupport.lib.api</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.timesupport.lib.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>joda-time</groupId>
+            <artifactId>joda-time</artifactId>
+            <scope>runtime</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.swing.impl</artifactId>
+            <scope>runtime</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.gvsig</groupId>
+            <artifactId>org.gvsig.raster.algorithm</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.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.jpotrace</artifactId>
+            <scope>compile</scope>
+        </dependency>
+
+    </dependencies>
+  
+    <properties>
+        <!-- Control the deploy of the plugin in gvsig.product.folder.path/gvSIG/extensiones -->
+        <gvsig.install.plugin>false</gvsig.install.plugin>
+        <!--  Control the deploy of the plugin package in gvsig.product.folder.path/install -->
+        <gvsig.install.plugin.package>false</gvsig.install.plugin.package>
+    </properties>
+</project>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/buildNumber.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/buildNumber.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/buildNumber.properties	(revision 15423)
@@ -0,0 +1,2 @@
+#Mon Nov 15 21:09:02 CET 2021
+buildNumber=181
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/assembly/gvsig-plugin-package.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/assembly/gvsig-plugin-package.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/assembly/gvsig-plugin-package.xml	(revision 15423)
@@ -0,0 +1,74 @@
+<!--
+
+    gvSIG. Desktop Geographic Information System.
+
+    Copyright (C) 2007-2013 gvSIG Association.
+
+    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 3
+    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.
+
+    For any additional information, do not hesitate to contact us
+    at info AT gvsig.com, or visit our website www.gvsig.com.
+
+-->
+<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.swing.api:jar</include>
+		    <include>org.gvsig:org.gvsig.raster.swing.impl:jar</include>
+		    <include>org.gvsig:org.gvsig.raster.cache.lib.api:jar</include>
+		    <include>org.gvsig:org.gvsig.raster.cache.lib.impl:jar</include>
+		    <include>org.gvsig:org.gvsig.raster.lib.api:jar</include>
+		    <include>org.gvsig:org.gvsig.raster.lib.impl:jar</include>
+		    <include>org.gvsig:org.gvsig.raster.algorithm:jar</include>
+		    <include>org.gvsig:org.gvsig.raster.fmap:jar</include>
+		    <!-- <include>org.gvsig:org.gvsig.timesupport.lib.api:jar</include>
+		    <include>org.gvsig:org.gvsig.timesupport.lib.impl:jar</include>-->
+		    <include>org.joda:joda-time:jar</include>		
+		  </includes>
+    </dependencySet>
+  </dependencySets>
+
+</assembly>
+
+
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginUtils.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginUtils.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginUtils.java	(revision 15423)
@@ -0,0 +1,412 @@
+/* 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.mainplugin;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.Point;
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.JOptionPane;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.app.project.Project;
+import org.gvsig.app.project.ProjectManager;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.dal.DALLocator;
+import org.gvsig.fmap.dal.DataManager;
+import org.gvsig.fmap.dal.DataStore;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.datastruct.Param;
+import org.gvsig.fmap.dal.coverage.datastruct.Params;
+import org.gvsig.fmap.dal.coverage.store.parameter.RasterDataParameters;
+import org.gvsig.fmap.dal.coverage.util.ProviderServices;
+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.MapContextLocator;
+import org.gvsig.fmap.mapcontext.MapContextManager;
+import org.gvsig.fmap.mapcontext.exceptions.LoadLayerException;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.gui.beans.propertiespanel.PropertiesComponent;
+import org.gvsig.gui.beans.propertiespanel.PropertyStruct;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.DefaultFLyrRaster;
+import org.gvsig.raster.util.RasterNotLoadException;
+
+/**
+ * Herramientas de uso general y que son dependientes de gvSIG, FMap o de
+ * libUIComponents. En caso de no serlo existe una clase independiente de
+ * cualquier proyecto dentro de libRaster para este tipo de funciones.
+ *
+ * @version 31/05/2007
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterMainPluginUtils {
+
+	/**
+	 * Obtiene la lista de capas del TOC y devuelve las raster. Si hay capas agrupadas lo tiene en cuenta y mira
+	 * dentro de la agrupaci�n.
+	 * @param srcLyrs FLayers de la vista
+	 * @param destLyrs Lista de capas 
+	 * @return ArrayList con la lista de capas raster agrupadas o no. El orden en que aparecen
+	 * en la lista es de abajo a arriba las que aparecen en el TOC.
+	 */
+	public static ArrayList<FLayer> getRasterLayerList(FLayers srcLyrs, ArrayList<FLayer> destLyrs) {
+		if(destLyrs == null)
+			destLyrs = new ArrayList<FLayer>();
+		for (int i = 0; i < srcLyrs.getLayersCount(); i++) {
+			if(srcLyrs.getLayer(i) instanceof DefaultFLyrRaster)
+				destLyrs.add(srcLyrs.getLayer(i));
+			if(srcLyrs.getLayer(i) instanceof FLayers)
+				destLyrs = getLayerList((FLayers)srcLyrs.getLayer(i), destLyrs);
+		}
+		return destLyrs;
+	}
+	
+	/**
+	 * Obtiene la lista de capas del TOC y devuelve las raster. Si hay capas agrupadas lo tiene en cuenta y mira
+	 * dentro de la agrupaci�n.
+	 * @param srcLyrs FLayers de la vista
+	 * @param destLyrs Lista de capas 
+	 * @return ArrayList con la lista de capas raster agrupadas o no. El orden en que aparecen
+	 * en la lista es de abajo a arriba las que aparecen en el TOC.
+	 */
+	public static ArrayList<FLayer> getLayerList(FLayers srcLyrs, ArrayList<FLayer> destLyrs) {
+		if(srcLyrs == null)
+			return null;
+		if(destLyrs == null)
+			destLyrs = new ArrayList<FLayer>();
+		for (int i = 0; i < srcLyrs.getLayersCount(); i++) {
+			if(srcLyrs.getLayer(i) instanceof FLayers)
+				destLyrs = getLayerList((FLayers)srcLyrs.getLayer(i), destLyrs);
+			else 
+				destLyrs.add(srcLyrs.getLayer(i));
+		}
+		return destLyrs;
+	}
+	
+	/**
+	 * Obtiene el nombre de la vista donde est� cargada la capa que se pasa por par�metro
+	 * @param layer Capa cargada en una vista
+	 * @return Nombre de la vista donde est� cargada la capa.
+	 */
+	public static String getView(FLayer layer) {
+//		Project p = ((ProjectExtension) PluginServices.getExtension(ProjectExtension.class)).getProject();
+		Project p = ProjectManager.getInstance().getCurrentProject();
+		return p.getViewName(layer);	
+	}
+	
+	/**
+	 * A�ade una ventana al gestor de ventanas
+	 * @param window
+	 */
+	public static void addWindow(IWindow window) {
+		PluginServices.getMDIManager().addWindow(window);
+	}
+	
+	/**
+	 * Elimina una ventana al gestor de ventanas
+	 * @param window
+	 */
+	public static void closeWindow(IWindow window) {
+		PluginServices.getMDIManager().closeWindow(window);
+	}
+	
+	/**
+	 * Selecciona los controles del panel de propiedades a partir de los par�mtros
+	 * obtenidos del driver. Este m�todo realiza una transformaci�n entre Params
+	 * obtenido del driver de escritura y los par�metros del panel de propiedades.
+	 * @param panel Panel de propiedades
+	 * @param params Par�metros del driver
+	 * @param notTakeIntoAccount Nombre de par�metros que no hay que tener en cuenta. Si es null se tienen en cuenta todos.
+	 */
+	public static void loadPropertiesFromWriterParams(PropertiesComponent pComp, Params params, String[] notTakeIntoAccount) {
+		for (int i = 0; i < params.getNumParams(); i++) {
+			Param p = params.getParam(i);
+			String name = Messages.getText(p.getId());
+			String key = p.getId();
+
+			//Miramos si el par�metro coincide con  alguno en la lista de parametros que no hay que
+			//tener en cuenta. Si es as� no lo a�adimos
+			if(notTakeIntoAccount != null && notTakeIntoAccount.length > 0) {
+				boolean jump = false;
+				for (int j = 0; j < notTakeIntoAccount.length; j++) {
+					if (key.equals(notTakeIntoAccount[j]))
+						jump = true;
+				}
+				if(jump)
+					continue;
+			}
+
+			Object[] types = null;
+			int selectedValue = 0;
+
+			switch (p.getType()) {
+				case Params.CHECK:
+					pComp.addValue(name, key, p.getDefaultValue(), types);
+					break;
+				case Params.CHOICE:
+					ArrayList<String> list = new ArrayList<String>();
+					for (int j = 0; j < p.getList().length; j++) {
+						list.add(p.getList()[j]);
+						if (p.getDefaultValue() instanceof Integer)
+							if (((Integer) p.getDefaultValue()).intValue() == j)
+								selectedValue = j;
+					}
+					types = new Object[] { new Integer(PropertiesComponent.TYPE_COMBO), list };
+					pComp.addValue(name, key, new Integer(selectedValue), types);
+					break;
+				case Params.SLIDER:
+					types = new Object[] { new Integer(PropertiesComponent.TYPE_SLIDER), new Integer(p.getList()[0]), new Integer(p.getList()[1]) };
+					pComp.addValue(name, key, p.getDefaultValue(), types);
+					break;
+				default:
+					pComp.addValue(Messages.getText(((Param)params.getParam(i)).getId()), params.getParam(i).getId(), params.getParam(i).getDefaultValue(), null);
+					break;
+			}
+		}
+	}
+
+	/**
+	 * Carga los par�metros del escritor WriterParams con los valores obtenidos
+	 * de la ventana de propiedades.
+	 */
+	@SuppressWarnings("unchecked")
+	public static void loadWriterParamsFromPropertiesPanel(PropertiesComponent pComp, Params params) {
+		ArrayList<PropertyStruct> values = pComp.getValues();
+		for (int iParam = 0; iParam < params.getNumParams(); iParam++) {
+			Param p = params.getParam(iParam);
+			for (int iValue = 0; iValue < values.size(); iValue++) {
+				PropertyStruct prop = values.get(iValue);
+				if (p.getId().compareTo(prop.getKey()) == 0) {
+					switch (p.getType()) {
+						case Params.CHECK:
+							p.setDefaultValue((Boolean) prop.getNewValue());
+							break;
+						case Params.CHOICE:
+							p.setDefaultValue(((Integer) prop.getNewValue()));//p.list[((Integer) prop.getNewValue()).intValue()];
+							break;
+						case Params.SLIDER:
+							try {
+								p.setDefaultValue((Integer)prop.getNewValue());
+							} catch (NumberFormatException e) {}
+					}
+					break;
+				}
+			}
+		}
+	}
+
+	/**
+	 * Funci�n que devuelve true si se tiene permiso de escritura en la ruta
+	 * indicada en el par�metro path y false si no los tiene.
+	 * @param path Ruta a comprobar los permisosv
+	 * @param pluginObject si es distinto de null se obtiene un mensaje de
+	 *          advertencia y sirve como par�metro para getText de la traducci�n.
+	 *          Si es null no se mostrar� ventana de advertencia
+	 * @return true si se tiene permiso de escritura en la ruta indicada en el
+	 *         par�metro path y false si no los tiene.
+	 */
+	public static boolean canWrite(String path, Object pluginObject) {
+		File f = new File(path);
+		if(f.exists() && f.canWrite())
+			return true;
+		else {
+			if(pluginObject != null)
+				JOptionPane.showMessageDialog((Component)PluginServices.getMainFrame(),
+						PluginServices.getText(pluginObject, "error_escritura"));
+			return false;
+		}
+	}
+
+	/**
+	 * Carga una capa raster en una vista de gvSIG.
+	 * @param viewName Nombre de la vista donde ha de cargarse. Si vale null se cargar� en la
+	 * primera vista que encuentre que est� activa. Si no hay ninguna saltar� una excepci�n.
+	 * @param fileName Nombre del fichero a cargar. No debe ser nulo nunca.
+	 * @param layerName Nombre de la capa. Si es null se asignar� el nombre del
+	 * fichero sin extensi�n.
+	 * @throws RasterNotLoadException Excepci�n que se lanza cuando no se ha podido cargar la capa
+	 * por alg�n motivo.
+	 */
+	@SuppressWarnings("deprecation")
+	public static FLayer loadLayer(String viewName, String fileName, String layerName) throws RasterNotLoadException {
+		if(fileName ==  null)
+			return null;
+
+		//Seleccionamos la vista de gvSIG
+		AbstractViewPanel theView = null;
+		try {
+			IWindow[] allViews = PluginServices.getMDIManager().getAllWindows();
+			if(viewName != null) {
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel
+						&& (((AbstractViewPanel) allViews[i]).getDocument().getName().equals(viewName) ||
+							PluginServices.getMDIManager().getWindowInfo((AbstractViewPanel) allViews[i]).getTitle().equals(viewName)))
+						theView = (AbstractViewPanel) allViews[i];
+				}
+			} else {
+				IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel && ((AbstractViewPanel)allViews[i]) == activeWindow) //En la primera vista activa
+						theView = (AbstractViewPanel) allViews[i];
+				}
+				if(theView == null) {
+					for (int i = 0; i < allViews.length; i++) {
+						if (allViews[i] instanceof AbstractViewPanel) //En la primera vista
+							theView = (AbstractViewPanel) allViews[i];
+					}
+				}
+			}
+
+			if (theView == null)
+				throw new RasterNotLoadException("Imposible cargar la capa.");
+		} catch (ClassCastException ex) {
+			throw new RasterNotLoadException("No se puede hacer un casting de esa IWindow a View.");
+		}
+
+		theView.getMapControl().getMapContext().beginAtomicEvent();
+
+		DefaultFLyrRaster lyr = null;
+		try {
+			ProviderServices provServ = RasterLocator.getManager().getProviderServices();
+			RasterDataParameters storeParameters = provServ.createNotTiledParameters(fileName);
+			storeParameters.setSRS(theView.getProjection());
+			
+			MapContextManager mcm = MapContextLocator.getMapContextManager();
+			DataManager dataManager = DALLocator.getDataManager();
+			DataStore dataStore = null;
+			try {
+				dataStore = dataManager.createStore(storeParameters);
+			} catch (ValidateDataParametersException e) {
+				throw new RasterNotLoadException("Error al cargar la capa.");
+			} catch (InitializeException e) {
+				throw new RasterNotLoadException("Error al cargar la capa.");
+			} catch (ProviderNotRegisteredException e) {
+				throw new RasterNotLoadException("Error al cargar la capa.");
+			}
+			
+			lyr = new DefaultFLyrRaster();
+			
+			if(layerName == null) {
+				int endIndex = fileName.lastIndexOf(".");
+				if (endIndex < 0)
+					endIndex = fileName.length();
+				
+				layerName = fileName.substring(fileName.lastIndexOf(File.separator) + 1, endIndex);
+			}
+			
+			lyr = (DefaultFLyrRaster) mcm.createLayer(layerName, dataStore);
+
+		} catch (LoadLayerException e) {
+			throw new RasterNotLoadException("Error al cargar la capa.");
+		} catch (InitializeException e) {
+			throw new RasterNotLoadException("Error creating parameters.");
+		} catch (ProviderNotRegisteredException e) {
+			throw new RasterNotLoadException("Error creating parameters.");
+		}
+		theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
+		theView.getMapControl().getMapContext().invalidate();
+		theView.getMapControl().getMapContext().endAtomicEvent();
+		return lyr;
+	}
+	
+	/**
+	 * Carga una capa raster en una vista de gvSIG.
+	 * @param viewName Nombre de la vista donde ha de cargarse. Si vale null se cargar� en la
+	 * primera vista que encuentre que est� activa. Si no hay ninguna saltar� una excepci�n.
+	 * @param fileName Nombre del fichero a cargar. No debe ser nulo nunca.
+	 * @param layerName Nombre de la capa. Si es null se asignar� el nombre del
+	 * fichero sin extensi�n.
+	 * @throws RasterNotLoadException Excepci�n que se lanza cuando no se ha podido cargar la capa
+	 * por alg�n motivo.
+	 */
+	public static FLayer loadLayer(String viewName, FLayer lyr) throws RasterNotLoadException {
+		if(lyr ==  null)
+			return null;
+
+		//Seleccionamos la vista de gvSIG
+		AbstractViewPanel theView = null;
+		try {
+			IWindow[] allViews = PluginServices.getMDIManager().getAllWindows();
+			if(viewName != null) {
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel
+						&& PluginServices.getMDIManager().getWindowInfo((AbstractViewPanel) allViews[i]).getTitle().equals(viewName))
+						theView = (AbstractViewPanel) allViews[i];
+				}
+			} else {
+				IWindow activeWindow = PluginServices.getMDIManager().getActiveWindow();
+				for (int i = 0; i < allViews.length; i++) {
+					if (allViews[i] instanceof AbstractViewPanel && ((AbstractViewPanel)allViews[i]) == activeWindow) //En la primera vista activa
+						theView = (AbstractViewPanel) allViews[i];
+				}
+				if(theView == null) {
+					for (int i = 0; i < allViews.length; i++) {
+						if (allViews[i] instanceof AbstractViewPanel) //En la primera vista
+							theView = (AbstractViewPanel) allViews[i];
+					}
+				}
+			}
+
+			if (theView == null)
+				throw new RasterNotLoadException("Imposible cargar la capa.");
+		} catch (ClassCastException ex) {
+			throw new RasterNotLoadException("No se puede hacer un casting de esa IWindow a View.");
+		}
+
+		theView.getMapControl().getMapContext().beginAtomicEvent();
+		theView.getMapControl().getMapContext().getLayers().addLayer(lyr);
+		theView.getMapControl().getMapContext().invalidate();
+		theView.getMapControl().getMapContext().endAtomicEvent();
+		return lyr;
+	}
+	
+	/**
+	 * Calculo de las coordenadas de una ventana IWindow para que quede centrada sobre el 
+	 * MainFrame. Estas coordenadas solo valen para un IWindow ya que andami mete las ventanas
+	 * con coordenadas relativas a su ventanta principal.
+	 * @param widthWindow Ancho de la ventana a a�adir
+	 * @param heightWindow Alto de la ventana a a�adir
+	 * @return Array con el ancho y el alto 
+	 */
+	public static Point iwindowPosition(int widthWindow, int heightWindow) {
+		int posWindowX = 0;
+		int posWindowY = 0;
+		Dimension dim = null;
+		Point pos = null;
+		if(PluginServices.getMainFrame() instanceof Component) {
+			dim = ((Component)PluginServices.getMainFrame()).getSize();
+			pos = ((Component)PluginServices.getMainFrame()).getLocation();
+			if(dim != null && pos != null) {
+				posWindowX = ((dim.width >> 1) - (widthWindow >> 1));
+				posWindowY = ((dim.height >> 1) - (heightWindow >> 1) - 70);
+				return new Point(posWindowX, posWindowY);
+			}
+		}
+		return null;
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationListener.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationListener.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationListener.java	(revision 15423)
@@ -0,0 +1,32 @@
+/* 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.mainplugin.config;
+
+import java.util.EventListener;
+
+public interface ConfigurationListener extends EventListener {
+	/**
+	 * Evento que se dispara cuando cambia un valor de configuracion.
+	 * @param e
+	 */
+	public void actionConfigurationChanged(ConfigurationEvent e);
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/Configuration.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/Configuration.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/Configuration.java	(revision 15423)
@@ -0,0 +1,343 @@
+/* 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.mainplugin.config;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.fmap.layers.IConfiguration;
+import org.gvsig.utils.XMLEntity;
+
+/**
+ * La clase <code>Configuration</code> sirve para poder leer y escribir valores en el entorno
+ * de raster a nivel de configuraci�n. Para leer o escribir hay que usar los
+ * metodos getValue y setValue, estos metodos lanzan eventos en el caso de
+ * cambiar el valor que habia establecido. Forma de uso:<p>
+ *
+ * En la lectura es recomendable pasar un valor por defecto en el get, para que
+ * si no existe o si existe pero no corresponde el tipo de datos devolvera el
+ * valor por defecto<p>
+ *
+ * <code>Boolean valor = Configuration.getValue("valorBooleano", Boolean.valueOf(true));</code><p>
+ *
+ * <code>Configuration.setValue("valorBooleano", Boolean.valueOf(false));</code><p>
+ *
+ * Solo se pueden usar los siguientes tipos de datos:<br>
+ *  - <b>Boolean</b>, <b>Double</b>, <b>Float</b>, <b>Integer</b>, <b>Long</b>
+ *  y <b>String</b>.<p>
+ *
+ * Otra funcionalidad que tiene, es que puedes agregar un manejador de eventos
+ * para controlar los cambios de las variables y actuar en consecuencia si cambia
+ * la que deseas.
+ *
+ * @version 07/12/2007
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class Configuration implements IConfiguration {
+	static private Configuration singleton              = new Configuration();
+	private ArrayList<ConfigurationListener>            
+	                             actionCommandListeners = new ArrayList<ConfigurationListener>();
+	private XMLEntity            xml                    = null;
+	private HashMap<String, Object>
+	                             hashMap                = new HashMap<String, Object>();
+
+	/**
+	 * Constructor privado. Nos aseguramos de que nadie pueda crear una instancia
+	 * desde fuera, la configuraci�n es �nica para todos.
+	 */
+	private Configuration() {
+		try {
+			PluginServices ps = PluginServices.getPluginServices("org.gvsig.raster.mainplugin");
+			xml = ps.getPersistentXML();
+		} catch (NullPointerException e) {
+			//No est� inicializado Configuration
+			xml = new XMLEntity();
+		}
+	}
+
+	/**
+	 * Devuelve un valor Boolean para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Boolean getValue(String key, Boolean defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Boolean.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		try {
+			getXMLEntity().putProperty(key, defaultValue.booleanValue());
+		} catch(NullPointerException e) {
+			//No est� inicializada la configuraci�n. Devuelve el default
+		}
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Double para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Double getValue(String key, Double defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Double.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.doubleValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Float para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Float getValue(String key, Float defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Float.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.floatValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Integer para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Integer getValue(String key, Integer defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Integer.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.intValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor Long para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public Long getValue(String key, Long defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return Long.valueOf(getXMLEntity().getStringProperty(key));
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue.longValue());
+		return defaultValue;
+	}
+
+	/**
+	 * Devuelve un valor String para el key especificado
+	 * @param key
+	 * @param defaultValue
+	 * @return
+	 */
+	static public String getValue(String key, String defaultValue) {
+		singleton.saveDefaultValue(key, defaultValue);
+		try {
+			return getXMLEntity().getStringProperty(key);
+		} catch (Exception e) {
+		}
+		getXMLEntity().putProperty(key, defaultValue);
+		return defaultValue;
+	}
+
+	/**
+	 * Guarda el valor por defecto en caso de que no exista
+	 * @param key
+	 * @param defaultValue
+	 */
+	private void saveDefaultValue(String key, Object defaultValue) {
+		if (hashMap.get(key) == null)
+			hashMap.put(key, defaultValue);
+	}
+
+	/**
+	 * Devuelve el valor por defecto de un key
+	 * @param key
+	 * @return
+	 */
+	static public Object getDefaultValue(String key) {
+		return singleton.hashMap.get(key);
+	}
+
+	/**
+	 * Guarda en la configuracion el Objeto pasado por parametro asociado a dicho
+	 * key
+	 * @param key
+	 * @param value
+	 */
+	private void putProperty(String key, Object value) {
+		if (Integer.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Integer) value).intValue());
+			return;
+		}
+		if (Double.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Double) value).doubleValue());
+			return;
+		}
+		if (Float.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Float) value).floatValue());
+			return;
+		}
+		if (Boolean.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Boolean) value).booleanValue());
+			return;
+		}
+		if (Long.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, ((Long) value).longValue());
+			return;
+		}
+		if (String.class.isInstance(value)) {
+			getXMLEntity().putProperty(key, (String) value);
+			return;
+		}
+		getXMLEntity().putProperty(key, value);
+	}
+
+	/**
+	 * Establece un valor en la configuracion
+	 * @param uri
+	 * @param value
+	 */
+	static public void setValue(String key, Object value) {
+		if (value == null) {
+			getXMLEntity().remove(key);
+			singleton.callConfigurationChanged(key, value);
+			return;
+		}
+
+		String oldValue = getValue(key, value.toString());
+
+		singleton.putProperty(key, value);
+
+		if (!oldValue.equals(value.toString()))
+			singleton.callConfigurationChanged(key, value);
+	}
+
+	/**
+	 * A�adir un listener a la lista de eventos
+	 * @param listener
+	 */
+	static public void addValueChangedListener(ConfigurationListener listener) {
+		if (!singleton.actionCommandListeners.contains(listener))
+			singleton.actionCommandListeners.add(listener);
+	}
+
+	/**
+	 * Borrar un listener de la lista de eventos
+	 * @param listener
+	 */
+	static public void removeValueChangedListener(ConfigurationListener listener) {
+		singleton.actionCommandListeners.remove(listener);
+	}
+
+	/**
+	 * Invocar a los eventos asociados al componente
+	 */
+	private void callConfigurationChanged(String key, Object value) {
+		Iterator<ConfigurationListener> iterator = actionCommandListeners.iterator();
+		while (iterator.hasNext()) {
+			ConfigurationListener listener = iterator.next();
+			listener.actionConfigurationChanged(new ConfigurationEvent(this, key, value));
+		}
+	}
+
+	/**
+	 * Devuelve una instancia unica al XMLEntity de Configuration
+	 * @return
+	 */
+	static private XMLEntity getXMLEntity() {
+		return singleton.xml;
+	}
+	
+	/**
+	 * Devuelve una instancia al unico objeto de configuraci�n que puede existir.
+	 * @return
+	 */
+	static public Configuration getSingleton() {
+		return singleton;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueBoolean(java.lang.String, java.lang.Boolean)
+	 */
+	public Boolean getValueBoolean(String name, Boolean defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueString(java.lang.String, java.lang.String)
+	 */
+	public String getValueString(String name, String defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueDouble(java.lang.String, java.lang.Double)
+	 */
+	public Double getValueDouble(String name, Double defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueFloat(java.lang.String, java.lang.Float)
+	 */
+	public Float getValueFloat(String name, Float defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueInteger(java.lang.String, java.lang.Integer)
+	 */
+	public Integer getValueInteger(String name, Integer defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.gvsig.fmap.raster.conf.IConfiguration#getValueLong(java.lang.String, java.lang.Long)
+	 */
+	public Long getValueLong(String name, Long defaultValue) {
+		return Configuration.getValue(name, defaultValue);
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationEvent.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationEvent.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/config/ConfigurationEvent.java	(revision 15423)
@@ -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.mainplugin.config;
+
+import java.util.EventObject;
+/**
+ * Estado del evento de configuraci�n para las preferencias de Raster.
+ * 
+ * @version 26/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ConfigurationEvent extends EventObject {
+	private static final long serialVersionUID = 7016236098872059L;
+	private String key;
+	private Object value;
+
+	/**
+	 * Constructor de un ConfigurationEvent
+	 * @param source
+	 * @param key
+	 * @param value
+	 */
+	public ConfigurationEvent(Object source, String key, Object value) {
+		super(source);
+		this.key = key;
+		this.value = value;
+	}
+
+	/**
+	 * @return the key
+	 */
+	public String getKey() {
+		return key;
+	}
+
+	/**
+	 * @return the value
+	 */
+	public Object getValue() {
+		return value;
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/WritableFolderPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/WritableFolderPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/WritableFolderPanel.java	(revision 15423)
@@ -0,0 +1,146 @@
+package org.gvsig.raster.mainplugin.beans.createlayer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Point;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JCheckBox;
+import javax.swing.JLabel;
+
+import org.cresques.Messages;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.raster.mainplugin.RasterMainPluginUtils;
+import org.gvsig.raster.mainplugin.beans.createlayer.SelectDirectoryPanel;
+import org.gvsig.raster.swing.basepanel.AbstractButtonsPanel;
+import org.gvsig.raster.swing.basepanel.IButtonsPanel;
+
+/**
+ * Panel to select a writable folder
+ * 
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class WritableFolderPanel extends AbstractButtonsPanel implements ActionListener, IWindow {
+	private static final long           serialVersionUID       = 1L;
+	private SelectDirectoryPanel        selectDirectoryPanel   = null;
+	private JCheckBox                   allFiles               = null;
+	private Point                       posWindow              = null;
+	private int                         widthWindow            = 320;
+	private int                         heightWindow           = 140;
+	private String                      defaultFolder          = null;
+	private String                      layerName              = null;
+	private ActionListener              listener               = null;
+	
+	public WritableFolderPanel(String defaultFolder, ActionListener listener, String layerName) {
+		this.defaultFolder = defaultFolder;
+		this.layerName = layerName;
+		setListener(listener);
+		posWindow = RasterMainPluginUtils.iwindowPosition(widthWindow, heightWindow);
+		initGUI();
+		PluginServices.getMDIManager().addWindow(this);
+	}
+	
+	private void initGUI() {
+		JButton accept = getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT);
+		JButton cancel = getButtonsPanel().getButton(IButtonsPanel.BUTTON_CANCEL);
+		getButtonsPanel().getButton(IButtonsPanel.BUTTON_APPLY).setVisible(false);
+		accept.setEnabled(false);
+		accept.addActionListener(this);
+		cancel.addActionListener(this);
+		
+		this.setLayout(new GridBagLayout());
+		GridBagConstraints gbc = new GridBagConstraints();
+		gbc.fill = GridBagConstraints.HORIZONTAL;
+		gbc.weightx = 1;
+		JLabel label = new JLabel();
+		label.setText("<html><p>" + Messages.getText("folder_not_writable") + "</p></html>");
+		
+		gbc.gridy = 0;
+		this.add(new JLabel("<html><p>" + layerName + "</p><BR></html>"), gbc);
+		
+		gbc.gridy = 1;
+		this.add(label, gbc);
+		
+		gbc.gridy = 2;
+		this.add(getSelectDirectoryPanel(), gbc);
+		
+		gbc.gridy = 3;
+		this.add(getCheckOption(), gbc);
+		
+		getSelectDirectoryPanel().setListener(this);
+	}
+	
+	public boolean aplyAllFiles() {
+		return getCheckOption().isSelected();
+	}
+	
+	public JCheckBox getCheckOption() {
+		if (allFiles == null)
+			allFiles = new JCheckBox(Messages.getText("apply_all"));
+		return allFiles;
+	}
+	
+	public SelectDirectoryPanel getSelectDirectoryPanel() {
+		if(selectDirectoryPanel == null) {
+			selectDirectoryPanel = new SelectDirectoryPanel();
+			selectDirectoryPanel.getJLabelDirectory().setVisible(false);
+			selectDirectoryPanel.getJBChooseDirectory().setEnabled(true);
+			selectDirectoryPanel.getDirectoryTextField().setText(defaultFolder);
+		}
+		return selectDirectoryPanel;
+	}
+	
+	public void setListener(ActionListener listener) {
+		this.listener = listener;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if(e.getSource() == getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT)) {
+			if(listener != null)
+				listener.actionPerformed(new ActionEvent(getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT), IButtonsPanel.BUTTON_ACCEPT, ""));
+			PluginServices.getMDIManager().closeWindow(this);
+		}
+		
+		if(e.getSource() == getButtonsPanel().getButton(IButtonsPanel.BUTTON_CANCEL)) {
+			if(listener != null)
+				listener.actionPerformed(new ActionEvent(getButtonsPanel().getButton(IButtonsPanel.BUTTON_CANCEL), IButtonsPanel.BUTTON_CANCEL, ""));
+			PluginServices.getMDIManager().closeWindow(this);
+		}
+		
+		if(e.getSource() == getSelectDirectoryPanel()) {
+			File f = new File(getSelectDirectoryPanel().getPath());
+			if(f.exists() && f.isDirectory() && f.canWrite()) {
+				getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT).setEnabled(true);
+				if(listener != null)
+					listener.actionPerformed(new ActionEvent(getChangeFolderButton(), 0, getSelectDirectoryPanel().getPath()));
+			} else {
+				getButtonsPanel().getButton(IButtonsPanel.BUTTON_ACCEPT).setEnabled(false);
+			}
+		}
+	}
+	
+	public JButton getChangeFolderButton() {
+		return getSelectDirectoryPanel().getJBChooseDirectory();
+	}
+	
+	public WindowInfo getWindowInfo() {
+		WindowInfo m_viewinfo = new WindowInfo(WindowInfo.MODALDIALOG);
+		m_viewinfo.setTitle(Messages.getText("warning"));
+		m_viewinfo.setHeight(heightWindow);
+		m_viewinfo.setWidth(widthWindow);
+		if (posWindow != null) {
+			m_viewinfo.setX((int) posWindow.getX());
+			m_viewinfo.setY((int) posWindow.getY());
+		}
+		return m_viewinfo;
+	}
+	
+	public Object getWindowProfile() {
+		return WindowInfo.DIALOG_PROFILE;
+	}
+}
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/NewLayerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/NewLayerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/NewLayerPanel.java	(revision 15423)
@@ -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.mainplugin.beans.createlayer;
+
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.io.File;
+import java.util.ArrayList;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+import javax.swing.JTextField;
+import javax.swing.filechooser.FileFilter;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.Utilities;
+import org.gvsig.andami.ui.mdiManager.IWindow;
+import org.gvsig.fmap.dal.coverage.RasterLocator;
+import org.gvsig.fmap.dal.coverage.exception.RasterDriverException;
+import org.gvsig.fmap.dal.coverage.util.FileUtils;
+import org.gvsig.fmap.dal.coverage.util.PropertyEvent;
+import org.gvsig.fmap.dal.coverage.util.PropertyListener;
+import org.gvsig.gui.beans.swing.JFileChooser;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+import org.gvsig.raster.util.ExtendedFileFilter;
+
+/**
+ *
+ * @version 18/06/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class NewLayerPanel implements PropertyListener {
+	private JPanel       panel              = null;
+	private JRadioButton jRBFileGenerate    = null;
+	private JRadioButton jRBOpenMemory      = null;
+	private JTextField   filenameTextField  = null;
+	private JLabel       labelFilename      = null;
+	private JPanel       panelNameFile      = null;
+	private boolean      compress           = false;
+	private FLyrRaster   lyr                = null;
+	protected FileUtils  fileUtil           = RasterLocator.getManager().getFileUtils();
+	
+	/**
+	 * Constructor de un CreateLayerPanel
+	 */
+	public NewLayerPanel(FLyrRaster lyr) {
+		this.lyr = lyr;
+		initialize();
+		translate();
+	}
+
+	/**
+	 * Devuelve el panel principal
+	 * @return
+	 */
+	public JPanel getJPanel() {
+		if (panel == null) {
+			panel = new JPanel();
+		}
+		return panel;
+	}
+
+	private void initialize() {
+		ButtonGroup buttonGroup2;
+		GridBagConstraints gridBagConstraints;
+
+		getJPanel().setLayout(new GridBagLayout());
+
+		getJPanel().setBorder(BorderFactory.createTitledBorder(""));
+		buttonGroup2 = new ButtonGroup();
+		buttonGroup2.add(getRadioFileGenerate());
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		gridBagConstraints.weightx = 1.0;
+		getJPanel().add(getRadioFileGenerate(), gridBagConstraints);
+
+		buttonGroup2.add(getRadioOpenMemory());
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getRadioOpenMemory(), gridBagConstraints);
+	}
+
+	/**
+	 * Seccion donde ir�n todas las traducciones invariables del componente
+	 */
+	private void translate() {
+		getRadioFileGenerate().setText(PluginServices.getText(this, "generar_fichero"));
+		getRadioOpenMemory().setText(PluginServices.getText(this, "abrir_memoria"));
+		getLabelFilename().setText(PluginServices.getText(this, "nombre_capa") + ":");
+	}
+
+	/**
+	 * Devuelve el JRadioButton de generar fichero
+	 * @return
+	 */
+	public JRadioButton getRadioFileGenerate() {
+		if (jRBFileGenerate == null) {
+			jRBFileGenerate = new JRadioButton();
+			jRBFileGenerate.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBFileGenerate.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return jRBFileGenerate;
+	}
+
+	/**
+	 * Devuelve el JRadioButton de Abrir en memoria
+	 * @return
+	 */
+	public JRadioButton getRadioOpenMemory() {
+		if (jRBOpenMemory == null) {
+			jRBOpenMemory = new JRadioButton();
+			jRBOpenMemory.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBOpenMemory.setMargin(new Insets(0, 0, 0, 0));
+
+			jRBOpenMemory.addItemListener(new ItemListener() {
+				public void itemStateChanged(ItemEvent evt) {
+					jRBOpenMemoryStateChanged(evt);
+				}
+			});
+			jRBOpenMemory.setSelected(true);
+		}
+		return jRBOpenMemory;
+	}
+
+	/**
+	 * This method initializes filenameTextField
+	 *
+	 * @return javax.swing.JTextField
+	 */
+	private JTextField getFilenameTextField() {
+		if (filenameTextField == null) {
+			filenameTextField = new JTextField();
+			filenameTextField.setPreferredSize(new Dimension(150, filenameTextField.getPreferredSize().height));
+			fileUtil.addOnlyLayerNameListener(this);
+		}
+		return filenameTextField;
+	}
+
+	/**
+	 * This method initializes jPNameFile
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public JPanel getFileNamePanel() {
+		if (panelNameFile == null) {
+			panelNameFile = new JPanel();
+			panelNameFile.add(getLabelFilename());
+			panelNameFile.add(getFilenameTextField());
+			updateNewLayerText();
+		}
+		return panelNameFile;
+	}
+
+	private JLabel getLabelFilename() {
+		if (labelFilename == null) {
+			labelFilename = new JLabel();
+		}
+		return labelFilename;
+	}
+
+	/**
+	 * Establece si esta habilitado o no el cuadro de texto de entrada de nombre de
+	 * fichero
+	 * @param value
+	 */
+	public void setFilenameEnabled(boolean value) {
+		getFilenameTextField().setEnabled(value);
+		getLabelFilename().setEnabled(value);
+	}
+
+	/**
+	 * Poner los estados de los RadioButton en caso de que cambien de valor
+	 * @param evt
+	 */
+	protected void jRBOpenMemoryStateChanged(ItemEvent evt) {
+		if (getRadioOpenMemory().getSelectedObjects() != null) {
+			setFilenameEnabled(true);
+		} else {
+			setFilenameEnabled(false);
+		}
+	}
+
+	/**
+	 * Especificar el nombre de la nueva capa para el recuadro de texto asignando
+	 * en cada llamada un nombre consecutivo.
+	 */
+	public void updateNewLayerText() {
+		getFilenameTextField().setText(fileUtil.getOnlyLayerName());
+	}
+
+	/**
+	 * Establece el texto de la etiqueta del nombre de fichero
+	 * @param text
+	 */
+	public void setLabelFilename(String text) {
+		getLabelFilename().setText(text);
+	}
+
+	/**
+	 * Asigna un valor para el par�metro que informa de si el raster de salida hay
+	 * que comprimirlo o no. Este valor es necesario cuando el raster de salida
+	 * es mayor de 4G ya que no se puede crear un tiff tan grande.
+	 * @param compress true para comprimir el raster de salida y false para no hacerlo.
+	 */
+	public void setCompress(boolean compress) {
+		this.compress = compress;
+	}
+
+	/**
+	 * Devuelve la ruta del fichero donde se va a guardar, en caso de guardarse
+	 * en memoria, calcula el nombre sin preguntar y devuelve la ruta.
+	 * @return
+	 */
+	public String getFileSelected() {
+		String path = "";
+		if (getRadioFileGenerate().isSelected()) {
+			JFileChooser chooser = new JFileChooser("NEW_LAYER_RASTER_PANEL", JFileChooser.getLastPath("NEW_LAYER_RASTER_PANEL", null));
+			chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_fichero"));
+
+			// A�adimos las extensiones que hayan sido registradas en el driver
+			ArrayList<String> extList = new ArrayList<String>();
+			try {
+				extList = RasterLocator.getManager().getProviderServices().getExtensionsSupported(
+							lyr.getDataStore().getDataType()[0], 
+							lyr.getDataStore().getBandCount());
+			} catch (RasterDriverException e2) {
+				RasterSwingLibrary.messageBoxError("error_extensiones_soportadas", chooser, e2);
+				return null;
+			}
+
+			FileFilter selected = null;
+			for (int i = 0; i < extList.size(); i++) {
+				FileFilter filter = new ExtendedFileFilter((String) extList.get(i));
+				if (extList.get(i).equals("tif")) {
+					selected = filter;
+				}
+				chooser.addChoosableFileFilter(filter);
+			}
+			if (selected != null)
+				chooser.setFileFilter(selected);
+
+			// Cargamos el panel de propiedades en el selector
+			chooser.setAcceptAllFileFilterUsed(false);
+
+			IWindow w = PluginServices.getMDIManager().getActiveWindow();
+
+			if (!(w instanceof Component))
+				w = null;
+
+ 			if (chooser.showSaveDialog((Component) w) != JFileChooser.APPROVE_OPTION)
+ 				return null;
+
+			JFileChooser.setLastPath("NEW_LAYER_RASTER_PANEL", chooser.getSelectedFile());
+
+			ExtendedFileFilter fileFilter = (ExtendedFileFilter) chooser.getFileFilter();
+			path = fileFilter.getNormalizedFilename(chooser.getSelectedFile());
+		} else {
+
+			String file = getFilenameTextField().getText();
+			if (file.compareTo(fileUtil.getOnlyLayerName()) == 0)
+				fileUtil.usesOnlyLayerName();
+
+			if (!compress)
+				path = Utilities.createTempDirectory() + File.separator + file + ".tif";
+			else
+				path = Utilities.createTempDirectory() + File.separator + file + ".jp2";
+			updateNewLayerText();
+		}
+		return path;
+	}
+
+	/**
+	 * Cuando alguien ha cambiado la propiedad del nombre de la
+	 * capa se actualiza autom�ticamente
+	 */
+	public void actionValueChanged(PropertyEvent e) {
+		updateNewLayerText();
+	}
+
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/CreateLayerPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/CreateLayerPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/CreateLayerPanel.java	(revision 15423)
@@ -0,0 +1,237 @@
+/* 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.mainplugin.beans.createlayer;
+
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+
+import javax.swing.BorderFactory;
+import javax.swing.ButtonGroup;
+import javax.swing.JPanel;
+import javax.swing.JRadioButton;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+
+/**
+ * Panel para unificar las propiedades de generacion de capas nuevas en ficheros
+ * o solo en visualizacion.
+ * 
+ * @version 10/03/2008
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class CreateLayerPanel {
+	private JPanel        panel         = null;
+	private JRadioButton  jRBOnlyView   = null;
+	private JRadioButton  jRBNewLayer   = null;
+	private NewLayerPanel panelNewLayer = null;
+	private FLyrRaster    lyr           = null;
+
+	/**
+	 * Constructor de un CreateLayerPanel
+	 */
+	public CreateLayerPanel(FLyrRaster lyr) {
+		this.lyr = lyr;
+		initialize();
+		translate();
+	}
+	
+	/**
+	 * Disables the new layer option. It is useful for remote
+	 * services
+	 */
+	public void disableNewLayer() {
+		getRadioOnlyView().setSelected(true);
+		getRadioNewLayer().setEnabled(false);
+	}
+	
+	/**
+	 * Devuelve el panel principal
+	 * @return
+	 */
+	public JPanel getJPanel() {
+		if (panel == null) {
+			panel = new JPanel();
+		}
+		return panel;
+	}
+
+	/**
+	 * Seccion donde ir�n todas las traducciones invariables del componente
+	 */
+	private void translate() {
+		getRadioOnlyView().setText(PluginServices.getText(this, "solo_visualizacion"));
+		getRadioNewLayer().setText(PluginServices.getText(this, "capa_nueva"));
+	}
+	
+	/**
+	 * Inicializar el panel de CreateLayer
+	 */
+	private void initialize() {
+		ButtonGroup buttonGroup1;
+		GridBagConstraints gridBagConstraints;
+
+		getJPanel().setLayout(new GridBagLayout());
+		
+		buttonGroup1 = new ButtonGroup();
+		buttonGroup1.add(getRadioOnlyView());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 0;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getRadioOnlyView(), gridBagConstraints);
+
+		buttonGroup1.add(getRadioNewLayer());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 1;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getRadioNewLayer(), gridBagConstraints);
+		
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.gridx = 0;
+		gridBagConstraints.gridy = 2;
+		gridBagConstraints.anchor = GridBagConstraints.WEST;
+		gridBagConstraints.insets = new Insets(3, 3, 3, 3);
+		getJPanel().add(getPanelNewLayer().getJPanel(), gridBagConstraints);
+	}
+	
+	public NewLayerPanel getPanelNewLayer() {
+		if (panelNewLayer == null)
+			panelNewLayer = new NewLayerPanel(lyr);
+		return panelNewLayer;
+	}
+	
+	/**
+	 * Poner los estados de los RadioButton en caso de que cambien de valor
+	 * @param evt
+	 */
+	private void jRBNewLayerStateChanged(ItemEvent evt) {
+		if (getRadioNewLayer().getSelectedObjects() != null) {
+			getPanelNewLayer().getRadioFileGenerate().setEnabled(true);
+			getPanelNewLayer().getRadioOpenMemory().setEnabled(true);
+			if (getPanelNewLayer().getRadioOpenMemory().getSelectedObjects() != null)
+				getPanelNewLayer().setFilenameEnabled(true);
+			else
+				getPanelNewLayer().setFilenameEnabled(false);
+		} else {
+			getPanelNewLayer().getRadioFileGenerate().setEnabled(false);
+			getPanelNewLayer().getRadioOpenMemory().setEnabled(false);
+			getPanelNewLayer().setFilenameEnabled(false);
+		}
+	}
+
+	/**
+	 * Especifica si se generara solo en la vista o se guardara en un fichero
+	 * @param enabled
+	 */
+	public void setOnlyView(boolean enabled) {
+		getRadioOnlyView().setSelected(enabled);
+	}
+
+	/**
+	 * Devuelve el JRadioButton de Solo vista
+	 * @return
+	 */
+	private JRadioButton getRadioOnlyView() {
+		if (jRBOnlyView == null) {
+			jRBOnlyView = new JRadioButton();
+			jRBOnlyView.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBOnlyView.setMargin(new Insets(0, 0, 0, 0));
+		}
+		return jRBOnlyView;
+	}
+	
+	/**
+	 * Devuelve el JRadioButton de nueva capa
+	 * @return
+	 */
+	private JRadioButton getRadioNewLayer() {
+		if (jRBNewLayer == null) {
+			jRBNewLayer = new JRadioButton();
+			jRBNewLayer.setBorder(BorderFactory.createEmptyBorder(0, 0, 0, 0));
+			jRBNewLayer.setMargin(new Insets(0, 0, 0, 0));
+			jRBNewLayer.addItemListener(new ItemListener() {
+				public void itemStateChanged(ItemEvent evt) {
+					jRBNewLayerStateChanged(evt);
+				}
+			});
+			jRBNewLayer.setSelected(true);
+		}
+		return jRBNewLayer;
+	}
+	
+	/**
+	 * This method initializes jPNameFile
+	 *
+	 * @return javax.swing.JPanel
+	 */
+	public JPanel getFileNamePanel() {
+		return getPanelNewLayer().getFileNamePanel();
+	}
+	
+	/**
+	 * Establece el texto de la etiqueta del nombre de fichero
+	 * @param text
+	 */
+	public void setLabelFilename(String text) {
+		getPanelNewLayer().setLabelFilename(text);
+	}
+	
+	public boolean isNewLayerSelected() {
+		return getRadioNewLayer().isSelected();
+	}
+
+	public boolean isOnlyViewSelected() {
+		return getRadioOnlyView().isSelected();
+	}
+	
+	/**
+	 * Asigna un valor para el par�metro que informa de si el raster de salida hay
+	 * que comprimirlo o no. Este valor es necesario cuando el raster de salida 
+	 * es mayor de 4G ya que no se puede crear un tiff tan grande.
+	 * @param compress true para comprimir el raster de salida y false para no hacerlo.
+	 */
+	public void setCompress(boolean compress) {
+		getPanelNewLayer().setCompress(compress);
+	}
+	
+	/**
+	 * Devuelve la ruta del fichero donde se va a guardar, en caso de guardarse
+	 * en memoria, calcula el nombre sin preguntar y devuelve la ruta.
+	 * @return
+	 */
+	public String getFileSelected() {
+		return getPanelNewLayer().getFileSelected();
+	}
+	
+	public void updateNewLayerText() {
+		getPanelNewLayer().updateNewLayerText();
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/SelectDirectoryPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/SelectDirectoryPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/beans/createlayer/SelectDirectoryPanel.java	(revision 15423)
@@ -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.mainplugin.beans.createlayer;
+
+import java.awt.Dimension;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.io.File;
+
+import javax.swing.JButton;
+import javax.swing.JLabel;
+import javax.swing.JPanel;
+import javax.swing.JTextField;
+
+import org.gvsig.andami.PluginServices;
+import org.gvsig.gui.beans.swing.JFileChooser;
+
+
+/**
+ * Panel para la selecci�n de directorios.
+ * 
+ * 13/05/2008
+ * @author Nacho Brodin nachobrodin@gmail.com
+ */
+public class SelectDirectoryPanel extends JPanel implements ActionListener {
+	private static final long  serialVersionUID     = 1L;
+	private JTextField         directoryTextField   = null;
+	private JLabel             jLabelDirectory      = null;
+	private JButton            jBChooseDirectory    = null;
+	private ActionListener     listener             = null;
+	
+	/**
+	 * Constructor. 
+	 * Inicializa los componentes gr�ficos
+	 */
+	public SelectDirectoryPanel() {
+		init();
+	}
+	
+	/**
+	 * This method initializes jPNameFile
+	 * @return javax.swing.JPanel
+	 */
+	private void init() {
+		GridBagConstraints gridBagConstraints = null;
+
+		setLayout(new GridBagLayout());
+
+		gridBagConstraints = new GridBagConstraints();
+		gridBagConstraints.insets = new Insets(2, 5, 5, 2);
+		add(getJLabelDirectory(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
+		gridBagConstraints.weightx = 1.0;
+		gridBagConstraints.insets = new java.awt.Insets(2, 2, 5, 2);
+		add(getDirectoryTextField(), gridBagConstraints);
+
+		gridBagConstraints = new java.awt.GridBagConstraints();
+		gridBagConstraints.insets = new java.awt.Insets(2, 2, 5, 5);
+		add(getJBChooseDirectory(), gridBagConstraints);
+
+		getJBChooseDirectory().addActionListener(this);
+	}
+	
+	public void setListener(ActionListener listener) {
+		this.listener = listener;
+	}
+	
+	/**
+	 * Obtiene el bot�n de asignaci�n de directorio
+	 * @return JButton
+	 */
+	public JButton getJBChooseDirectory() {
+		if (jBChooseDirectory == null) {
+			jBChooseDirectory = new JButton(PluginServices.getText(this, "cambiar_ruta"));
+			jBChooseDirectory.setEnabled(false);
+		}
+		return jBChooseDirectory;
+	}
+	
+	/**
+	 * Obtiene la etiqueta con la ruta
+	 * @return JLabel
+	 */
+	public JLabel getJLabelDirectory() {
+		if (jLabelDirectory == null) {
+			jLabelDirectory = new JLabel(PluginServices.getText(this, "ruta") + ":");
+			jLabelDirectory.setEnabled(false);
+		}
+		return jLabelDirectory;
+	}
+	
+	/**
+	 * Obtiene el campo de texto con la ruta de directorio
+	 * @return JTextField
+	 */
+	public JTextField getDirectoryTextField() {
+		if (directoryTextField  == null) {
+			directoryTextField = new JTextField();
+			directoryTextField.setText(JFileChooser.getLastPath(this.getClass().getName(), (File) null).toString());
+			directoryTextField.setEditable(false);
+			directoryTextField.setEnabled(false);
+			directoryTextField.setPreferredSize(new Dimension(200, directoryTextField.getPreferredSize().height));
+		}
+		return directoryTextField;
+	}
+	
+	/**
+	 * Accion que sucede cuando se pulsa el boton de cambiar directorio
+	 */
+	public void actionPerformed(ActionEvent e) {
+		JFileChooser chooser = new JFileChooser(this.getClass().getName(), new File(getDirectoryTextField().getText()));
+		chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
+		chooser.setDialogTitle(PluginServices.getText(this, "seleccionar_directorio"));
+
+		if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION)
+			getDirectoryTextField().setText(chooser.getSelectedFile().toString());
+		else
+			chooser.setLastPath(new File(getDirectoryTextField().getText()));
+		
+		if(listener != null)
+			listener.actionPerformed(new ActionEvent(this, 0, getPath()));
+	}
+	
+	/**
+	 * Obtiene la ruta al directorio.
+	 * @return String
+	 */
+	public String getPath() {
+		return getDirectoryTextField().getText();
+	}
+}
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/GenericToolBarExtension.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/GenericToolBarExtension.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/GenericToolBarExtension.java	(revision 15423)
@@ -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.mainplugin;
+
+import java.awt.Dimension;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.PluginServices;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.andami.ui.mdiFrame.MDIFrame;
+import org.gvsig.app.project.documents.view.ViewDocument;
+import org.gvsig.app.project.documents.view.gui.AbstractViewPanel;
+import org.gvsig.fmap.mapcontext.MapContext;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.mainplugin.toolbar.GenericToolBarMenuItem;
+import org.gvsig.raster.mainplugin.toolbar.GenericToolBarPanel;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+/**
+ * Extension para la barra de herramientas generica
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano
+ */
+public class GenericToolBarExtension extends Extension {
+	private GenericToolBarPanel toolBar = null;
+
+	/**
+	 * Crea y devuelve la barra de herramientas
+	 * @return
+	 */
+	private GenericToolBarPanel getGenericToolBarPanel() {
+		if (toolBar == null) {
+			MDIFrame f = (MDIFrame) PluginServices.getMainFrame();
+			if (f == null)
+				return null;
+			toolBar = new GenericToolBarPanel();
+			toolBar.setVisible(true);
+			f.addToolBarControl(getClass(), toolBar, "RasterToolBar");
+		} else {
+			toolBar.setPreferredSize(new Dimension(300, getToolbarHeight()));
+		}
+
+		return toolBar;
+	}
+
+	/**
+	 * Obtenemos el alto de cualquier toolbar que este visible en gvSIG y no sea
+	 * nuestro para poder asignarselo al GenericToolBar como PreferredSize. En
+	 * caso de no encontrar ninguno que cumpla las condiciones, se devolver� 24
+	 * @return
+	 */
+	private int getToolbarHeight() {
+		if ((PluginServices.getMainFrame() == null) ||
+				(PluginServices.getMainFrame().getToolbars() == null) ||
+				(PluginServices.getMainFrame().getToolbars().length <= 0))
+			return 24;
+
+		for (int i = 0; i < PluginServices.getMainFrame().getToolbars().length; i++) {
+			if ((PluginServices.getMainFrame().getToolbars()[i].getHeight() > 16) &&
+					((Object) PluginServices.getMainFrame().getToolbars()[i] != (Object) toolBar))
+				return PluginServices.getMainFrame().getToolbars()[i].getHeight();
+		}
+		return 24;
+	}
+
+	public void initialize() {
+		registerIcons();
+		
+		 Messages.addResourceFamily("org.gvsig.raster.mainplugin.i18n.text",
+				 GenericToolBarExtension.class.getClassLoader(),
+				 GenericToolBarExtension.class.getClass().getName()); 
+		
+		// Creaci�n del punto de extensi�n para registrar paneles en el cuadro de propiedades.
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add("GenericToolBarGroup");
+		point.setDescription("Punto de extension para los grupos de menus del GenericToolBarPanel");
+
+		point.append("RasterLayer", "", new GenericToolBarMenuItem(Messages.getText("capa_raster"), IconThemeHelper.getImageIcon("menu-layer-icon")));
+		//point.append("RasterProcess", "", new GenericToolBarMenuItem(Messages.getText("process_raster"), IconThemeHelper.getImageIcon("menu-process-icon")));
+		point.append("Dataset", "", new GenericToolBarMenuItem(Messages.getText("dataset_raster"), IconThemeHelper.getImageIcon("menu-dataset-icon")));
+		point.append("Multispectral", "", new GenericToolBarMenuItem(Messages.getText("multispectral"), IconThemeHelper.getImageIcon("menu-multispectral-icon")));
+		point.append("Enhanced", "", new GenericToolBarMenuItem(Messages.getText("enhanced"), IconThemeHelper.getImageIcon("menu-enhanced-icon")));
+		point.append("GeoRaster", "", new GenericToolBarMenuItem(Messages.getText("transformaciones_geograficas"), IconThemeHelper.getImageIcon("menu-transgeo-icon")));
+		point.append("RasterExport", "", new GenericToolBarMenuItem(Messages.getText("raster_export"), IconThemeHelper.getImageIcon("menu-raster-export")));
+
+		point = extensionPoints.add("GenericToolBarMenu");
+		point.setDescription("Punto de extension para los submenus del GenericToolBarPanel");
+	}
+	
+	private void registerIcons() {	
+		//Actions
+		IconThemeHelper.registerIcon("action", "menu-layer-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-process-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-transgeo-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-dataset-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-raster-export", this);
+		IconThemeHelper.registerIcon("action", "menu-multispectral-icon", this);
+		IconThemeHelper.registerIcon("action", "menu-enhanced-icon", this);
+	}
+	
+	@Override
+	public void postInitialize() {
+		super.postInitialize();
+		if (getGenericToolBarPanel() != null)
+			getGenericToolBarPanel().reloadMenuGroup();
+	}
+
+	public boolean isEnabled() {
+		return false;
+	}
+
+	/**
+	 * Establece si la barra de herramientas esta visible
+	 * @param enabled
+	 */
+	private void setToolBarVisible(boolean enabled) {
+		if (getGenericToolBarPanel() == null)
+			return;
+
+		toolBar.setVisible(enabled);
+	}
+
+	@SuppressWarnings("deprecation")
+	public boolean isVisible() {
+		setToolBarVisible(true);
+		org.gvsig.andami.ui.mdiManager.IWindow f = PluginServices.getMDIManager().getActiveWindow();
+		if (f == null || !(f instanceof AbstractViewPanel)) {
+			//setToolBarVisible(false);
+			return false;
+		}
+		
+		if (getGenericToolBarPanel() != null)
+			getGenericToolBarPanel().setLayers(null);
+		AbstractViewPanel vista = (AbstractViewPanel) f;
+		ViewDocument model = vista.getModel();
+		MapContext mapa = model.getMapContext();
+		if (mapa.getLayers().getLayersCount() > 0) {
+			if (getGenericToolBarPanel() != null) {
+				getGenericToolBarPanel().setLayers(mapa.getLayers());
+			}
+		}
+		
+		//setToolBarVisible(true);
+		return true;
+
+		/*if (f instanceof AbstractViewPanel) {
+			AbstractViewPanel vista = (AbstractViewPanel) f;
+			ViewDocument model = vista.getModel();
+			MapContext mapa = model.getMapContext();
+			if (mapa.getLayers().getLayersCount() > 0) {
+				setToolBarVisible(true);
+				if (getGenericToolBarPanel() != null) {
+					getGenericToolBarPanel().setLayers(mapa.getLayers());
+				}
+				return true;
+			}
+		}
+
+		setToolBarVisible(false);
+		return false;*/
+	}
+
+	public void execute(String actionCommand) {}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/properties/RasterPropertiesTocMenuEntry.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/properties/RasterPropertiesTocMenuEntry.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/properties/RasterPropertiesTocMenuEntry.java	(revision 15423)
@@ -0,0 +1,144 @@
+/* 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.mainplugin.properties;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.ui.mdiManager.WindowInfo;
+import org.gvsig.app.panelGroup.PanelGroupDialog;
+import org.gvsig.app.panelGroup.loaders.PanelGroupLoaderFromExtensionPoint;
+import org.gvsig.app.project.documents.view.toc.AbstractTocContextMenuAction;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.IconThemeHelper;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.gui.beans.panelGroup.PanelGroupManager;
+import org.gvsig.gui.beans.panelGroup.tabbedPanel.TabbedPanel;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.fmap.layers.FLyrRaster;
+import org.gvsig.raster.fmap.layers.ILayerState;
+import org.gvsig.raster.mainplugin.RasterMainPluginUtils;
+import org.gvsig.raster.mainplugin.toolbar.IGenericToolBarMenuItem;
+import org.gvsig.raster.swing.RasterSwingLibrary;
+
+/**
+ * Entrada en del men� contextual del TOC correspondiente al cuadro de
+ * propiedades del raster
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterPropertiesTocMenuEntry extends AbstractTocContextMenuAction implements IGenericToolBarMenuItem {
+	static private RasterPropertiesTocMenuEntry singleton  = null;
+	private FLayer                              lyr        = null;
+
+	/**
+	 * Variable para controlar si los eventos de los paneles se deben interpretar.
+	 * En la carga inicial se deben desactivar todos los eventos
+	 */
+	public static boolean                     enableEvents = false;
+	
+	/**
+	 * Nadie puede crear una instancia a esta clase �nica, hay que usar el
+	 * getSingleton()
+	 */
+	private RasterPropertiesTocMenuEntry() {}
+
+	/**
+	 * Devuelve un objeto unico a dicha clase
+	 * @return
+	 */
+	static public RasterPropertiesTocMenuEntry getSingleton() {
+		if (singleton == null)
+			singleton = new RasterPropertiesTocMenuEntry();
+		return singleton;
+	}	
+
+	public String getGroup() {
+		return "RasterLayer";
+	}
+
+	public int getGroupOrder() {
+		return 10;
+	}
+
+	public int getOrder() {
+		return 10;
+	}
+
+	public String getText() {
+		return Messages.getText("propiedades_raster");
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+		if (selectedItems[0] instanceof ILayerState) {
+			if (!((ILayerState) selectedItems[0]).isOpen())
+				return false;
+			return true;
+		}
+		return false;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return false;
+		if (selectedItems[0] instanceof FLyrRaster)
+			return true;
+		return false;
+	}
+
+	/**
+	 * Gestiona la apertura del dialogo de propiedades de raster cuando se pulsa
+	 * la opci�n asignando a este las propiedades iniciales.
+	 */
+	public void execute(ITocItem item, FLayer[] selectedItems) {
+		if ((selectedItems == null) || (selectedItems.length != 1))
+			return;
+
+		lyr = selectedItems[0];
+		PanelGroupDialog properties = null;
+		try {
+			enableEvents = false;
+
+			PanelGroupManager manager = PanelGroupManager.getManager();
+
+			manager.registerPanelGroup(TabbedPanel.class);
+			manager.setDefaultType(TabbedPanel.class);
+
+			TabbedPanel panelGroup = (TabbedPanel) manager.getPanelGroup(lyr);
+			PanelGroupLoaderFromExtensionPoint loader = new PanelGroupLoaderFromExtensionPoint("RasterSEPropertiesDialog");
+
+			properties = new PanelGroupDialog(lyr.getName() ,Messages.getText("propiedades_raster"), 550, 450, (byte) (WindowInfo.MODELESSDIALOG | WindowInfo.RESIZABLE | WindowInfo.MAXIMIZABLE), panelGroup);
+			properties.loadPanels(loader);
+			enableEvents = true;
+			RasterMainPluginUtils.addWindow(properties);
+		} catch (Exception e) {
+			RasterSwingLibrary.messageBoxInfo("error_props_tabs", properties, e);
+		} finally  {
+			enableEvents = true;
+		}
+	}
+	
+	public Icon getIcon() {
+		return IconThemeHelper.getImageIcon("layer-properties-raster");
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginExtension.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginExtension.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/RasterMainPluginExtension.java	(revision 15423)
@@ -0,0 +1,83 @@
+/* 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.mainplugin;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.andami.plugins.Extension;
+import org.gvsig.i18n.Messages;
+import org.gvsig.raster.mainplugin.properties.RasterPropertiesTocMenuEntry;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+
+
+/**
+ * Main plugin for raster
+ *
+ * @author Nacho Brodin (nachobrodin@gmail.com)
+ */
+public class RasterMainPluginExtension extends Extension {
+
+	public void initialize() {
+        Messages.addResourceFamily("org.gvsig.raster.mainplugin.i18n.text",
+        		RasterMainPluginExtension.class.getClassLoader(),
+        		RasterMainPluginExtension.class.getClass().getName()); 
+        
+        IconThemeHelper.registerIcon(null, "map-ok-ico", this);
+        IconThemeHelper.registerIcon("action", "layer-properties-raster", this);
+        
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = null;
+		
+		//Registro punto de extensi�n del cuadro de propiedades
+		if (!extensionPoints.has("RasterSEPropertiesDialog")) {
+			point = extensionPoints.add("RasterSEPropertiesDialog");
+			point.setDescription("Raster Properties registrable panels (register instances of javax.swing.JPanel)");
+		}
+
+		//Entradas del men� del toc de raster
+		if (!extensionPoints.has("View_TocActions")) {
+			point = extensionPoints.add("View_TocActions");
+		}
+		point = extensionPoints.get("View_TocActions");
+		point.append("RasterSEProperties", "Raster Properties", RasterPropertiesTocMenuEntry.getSingleton());
+		
+		//A�ade las propiedades de raster a la barra de herramientas. Si nadie registra paneles estar� vacio
+		//cuando se abra
+		
+		point = extensionPoints.add("GenericToolBarMenu");
+		point.append("RasterProperties", "", RasterPropertiesTocMenuEntry.getSingleton());
+	}
+	
+	public void execute(String actionCommand) {
+		
+	}
+
+	public boolean isEnabled() {
+		return false;
+	}
+
+	public boolean isVisible() {
+		return false;
+	}
+
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarPanel.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarPanel.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarPanel.java	(revision 15423)
@@ -0,0 +1,333 @@
+/* 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.mainplugin.toolbar;
+
+import java.awt.Insets;
+import java.awt.event.ActionEvent;
+import java.awt.event.ActionListener;
+import java.awt.event.ItemEvent;
+import java.awt.event.ItemListener;
+import java.awt.event.MouseEvent;
+import java.awt.event.MouseListener;
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.swing.JButton;
+import javax.swing.JToolBar;
+
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.fmap.mapcontext.layers.FLayers;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.DefaultComboBoxConfigurableLookUpModel;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.JComboBoxConfigurableLookUp;
+import org.gvsig.gui.beans.controls.IControl;
+import org.gvsig.gui.beans.controls.combobutton.ComboButton;
+import org.gvsig.gui.beans.controls.combobutton.ComboButtonEvent;
+import org.gvsig.gui.beans.controls.combobutton.ComboButtonListener;
+import org.gvsig.tools.ToolsLocator;
+import org.gvsig.tools.extensionpoint.ExtensionPoint;
+import org.gvsig.tools.extensionpoint.ExtensionPointManager;
+/**
+ * Componente que contiene los objetos visuales de la barra de herramientas
+ * generica
+ *
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class GenericToolBarPanel extends JToolBar implements ComboButtonListener, ActionListener, MouseListener, ItemListener, IControl {
+	private static final long serialVersionUID = -4382962282970490523L;
+	private JComboBoxConfigurableLookUp jCBCLU = null;
+	private ComboButton buttonGroup = new ComboButton();
+	private ComboButton buttonMenu = new ComboButton();
+	private FLayers lastLayers = null;
+
+	public GenericToolBarPanel() {
+		super("GenericToolBarPanel");
+		initialize();
+	}
+
+	/**
+	 * Especifica que las capas de la vista han cambiado.
+	 * @param layers
+	 */
+	public void setLayers(FLayers layers) {
+		lastLayers = layers;
+
+		getComboBoxConfigurableLookUp().setBlockPopupHided(true);
+		getComboBoxConfigurableLookUp().removeAllItems();
+
+		if(layers != null) {
+			List<FLayer> lyrs = getLayerList(layers, null);
+			for (int i = 0; i < lyrs.size(); i++)
+				getComboBoxConfigurableLookUp().addItem(((FLayer)lyrs.get(i)).getName());
+
+			if (layers.getActives().length > 0)
+				getComboBoxConfigurableLookUp().setSelectedItem(layers.getActives()[0].getName());
+			else if (layers.getLayersCount() > 0)
+				getComboBoxConfigurableLookUp().setSelectedItem(layers.getLayer(0).getName());
+		}
+		reloadSubMenu();
+		getComboBoxConfigurableLookUp().setBlockPopupHided(false);
+	}
+	
+	/**
+	 * Devuelve un combo de busqueda de items.
+	 * @return
+	 */
+	private JComboBoxConfigurableLookUp getComboBoxConfigurableLookUp() {
+		if (jCBCLU == null) {
+			jCBCLU = new JComboBoxConfigurableLookUp();
+			jCBCLU.setOnlyOneColorOnText(true);
+			jCBCLU.setPrototypeDisplayValue(" ");
+			if (jCBCLU.getModel() instanceof DefaultComboBoxConfigurableLookUpModel) {
+				((DefaultComboBoxConfigurableLookUpModel) jCBCLU.getModel()).setShowAllItemsInListBox(false);
+				((DefaultComboBoxConfigurableLookUpModel) jCBCLU.getModel()).setLookUpAgent(new BinarySearch());
+				((DefaultComboBoxConfigurableLookUpModel) jCBCLU.getModel()).setCaseSensitive(false);
+				jCBCLU.setToForceSelectAnItem(true);
+				jCBCLU.setDisplayAllItemsWithArrowButton(true);
+			}
+			jCBCLU.addActionListener(this);
+		}
+		return jCBCLU;
+	}
+
+	private void initialize() {
+		buttonGroup.addComboButtonClickedListener(this);
+		buttonGroup.setName("Menu principal");
+		buttonGroup.setMargin(new Insets(0, 0, 0, 0));
+		buttonGroup.setAlwaysMenuOnClick(true);
+		reloadMenuGroup();
+		add(buttonGroup);
+
+		buttonMenu.addComboButtonClickedListener(this);
+		buttonMenu.setName("Submenus");
+		buttonMenu.addMouseListener(this);
+		buttonMenu.setMargin(new Insets(0, 0, 0, 0));
+		reloadMenuGroup();
+		add(buttonMenu);
+
+		add(getComboBoxConfigurableLookUp());
+		this.setRollover(true);
+	}
+
+	/**
+	 * Recarga los items del menu global dejando seleccionado el item que habia
+	 * previamente, en caso de que exista
+	 */
+	public void reloadMenuGroup() {
+		FLayer[] layers = new FLayer[] { getLayerSelected() };
+		ButtonItems buttonItems = new ButtonItems(buttonGroup, layers);
+
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.get("GenericToolBarGroup");
+		Iterator<?> iterator = point.iterator();
+		while (iterator.hasNext()) {
+			ExtensionPoint.Extension extension = (ExtensionPoint.Extension) iterator.next();
+			Object object;
+			try {
+				object = extension.create();
+			} catch (Exception e) {
+				throw new RuntimeException(e);
+			}
+			if (object instanceof IGenericToolBarMenuItem)
+				buttonItems.addButton((IGenericToolBarMenuItem) object, extension.getName());
+		}
+		buttonItems.refresh();
+		reloadSubMenu();
+	}
+
+	/**
+	 * Recarga los items del submenu dejando seleccionado el item que habia
+	 * previamente, en caso de que exista
+	 */
+	public void reloadSubMenu() {
+		FLayer[] layers = new FLayer[] { getLayerSelected() };
+		ButtonItems buttonItems = new ButtonItems(buttonMenu, layers);
+		ExtensionPointManager extensionPoints = ToolsLocator.getExtensionPointManager();
+		ExtensionPoint point = extensionPoints.add("GenericToolBarMenu");
+		Iterator<?> iterator = point.iterator();
+		while (iterator.hasNext()) {
+			ExtensionPoint.Extension entry = (ExtensionPoint.Extension) iterator.next();
+			Object object;
+			try {
+				object = entry.create();
+			} catch (Exception e) {
+				throw new RuntimeException(e);
+			}
+			if (object instanceof IGenericToolBarMenuItem) {
+				IGenericToolBarMenuItem item = (IGenericToolBarMenuItem) object;
+				if (!buttonGroup.getActionCommand().equals(item.getGroup()))
+					continue;
+				buttonItems.addButton(item, entry.getName());
+			}
+		}
+		buttonItems.refresh();
+	}
+
+	/**
+	 * Devuelve el layer seleccionado en el combobox
+	 * @return
+	 */
+	public FLayer getLayerSelected() {
+		if (lastLayers == null)
+			return null;
+		List<FLayer> lyrs = getLayerList(lastLayers, null);
+		for (int i = 0; i < lyrs.size(); i++)
+			if (((FLayer)lyrs.get(i)).getName().equals(getComboBoxConfigurableLookUp().getEditor().getItem()))
+				return (FLayer)lyrs.get(i);
+		return null;
+	}
+	
+	public static List<FLayer> getLayerList(FLayers srcLyrs, List<FLayer> destLyrs) {
+		if(srcLyrs == null)
+			return null;
+		if(destLyrs == null)
+			destLyrs = new ArrayList<FLayer>();
+		for (int i = 0; i < srcLyrs.getLayersCount(); i++) {
+			if(srcLyrs.getLayer(i) instanceof FLayers)
+				destLyrs = getLayerList((FLayers)srcLyrs.getLayer(i), destLyrs);
+			else 
+				destLyrs.add(srcLyrs.getLayer(i));
+		}
+		return destLyrs;
+	}
+
+	public void actionPerformed(ActionEvent e) {
+		if (e.getSource() == getComboBoxConfigurableLookUp()) {
+//			selectLayerInTOC(lastLayers, (String) getComboBoxConfigurableLookUp().getSelectedItem());
+		}
+	}
+
+	public void actionComboButtonClicked(ComboButtonEvent e) {
+		if (e.getSource() == buttonGroup) {
+			reloadSubMenu();
+			return;
+		}
+		if (e.getSource() == buttonMenu) {
+			ExtensionPointManager extensionPoints =ToolsLocator.getExtensionPointManager();
+			ExtensionPoint point=extensionPoints.add("GenericToolBarMenu");
+			Iterator<?> iterator = point.iterator();
+			while (iterator.hasNext()) {
+				ExtensionPoint.Extension entry = (ExtensionPoint.Extension) iterator
+						.next();
+				if (!entry.getName().equals(
+						((JButton) e.getSource()).getActionCommand()))
+					continue;
+				Object object;
+				try {
+					object = entry.create();
+				} catch (Exception e1) {
+					// TODO Auto-generated catch block
+					throw new RuntimeException(e1);
+				}
+				if (object instanceof IGenericToolBarMenuItem) {
+					IGenericToolBarMenuItem item = (IGenericToolBarMenuItem) object;
+
+					FLayer[] layers = new FLayer[] { getLayerSelected() };
+					if (!item.isVisible(null, layers))
+						continue;
+					if (!item.isEnabled(null, layers))
+						continue;
+
+					if (getLayerSelected() != null) {
+						item.execute(null, new FLayer[] { getLayerSelected() });
+					} else
+						item.execute(null, null);
+					reloadSubMenu();
+					return;
+				}
+			}
+			return;
+		}
+	}
+
+	/**
+	 * Selecciona una capa en el TOC
+	 * @param layers
+	 * @param nameLayer
+	 */
+//	private void selectLayerInTOC(FLayers layers, String nameLayer) {
+//		if (layers == null)
+//			return;
+//		for (int i = 0; i < layers.getLayersCount(); i++) {
+//			if (layers.getLayer(i) instanceof FLayers) {
+//				selectLayerInTOC((FLayers) layers.getLayer(i), nameLayer);
+//			} else {
+//				if (layers.getLayer(i) instanceof FLayer) {
+//					FLayer layer = ((FLayer) layers.getLayer(i));
+//					if (layer.getName().equals(nameLayer) && !layer.isActive()) {
+//						layer.setActive(true);
+//					}
+//				}
+//			}
+//		}
+//	}
+
+	/**
+	 * Recargo el menu cada vez que entra el raton en el boton, para ahorrar tiempo en
+	 * la visualizacion del mismo
+	 */
+	public void mouseEntered(MouseEvent e) {
+		this.reloadSubMenu();
+	}
+
+	public void itemStateChanged(ItemEvent e) {
+//		if (e.getStateChange() != ItemEvent.SELECTED)
+//			return;
+//
+//		FLayer layer = getLayerSelected();
+//
+//		if (layer == null)
+//			return;
+//
+//		FLayers layers = lastLayers;
+//		for(int i = 0; i < layers.getLayersCount(); i++)
+//			layers.getLayer(i).setActive(false);
+//
+//		layer.setActive(true);
+//		View view = (View) PluginServices.getMDIManager().getActiveWindow();
+//		JScrollBar verticalBar = view.getTOC().getJScrollPane().getVerticalScrollBar();
+//		double widthPerEntry = verticalBar.getMaximum() / layer.getMapContext().getLayers().getLayersCount();
+//		verticalBar.setValue((int)widthPerEntry * (layer.getMapContext().getLayers().getLayersCount() - pos - 1));
+	}
+
+	public void mouseClicked(MouseEvent e) {}
+	public void mouseExited(MouseEvent e) {}
+	public void mousePressed(MouseEvent e) {}
+	public void mouseReleased(MouseEvent e) {}
+
+	public void addActionListener(ActionListener listener) {
+		
+	}
+
+	public Object getValue() {
+		return null;
+	}
+
+	public void removeActionListener(ActionListener listener) {
+		
+	}
+
+	public Object setValue(Object value) {
+		return null;
+	}
+
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarMenuItem.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarMenuItem.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/GenericToolBarMenuItem.java	(revision 15423)
@@ -0,0 +1,116 @@
+/* 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.mainplugin.toolbar;
+
+import java.util.Map;
+
+import javax.swing.Icon;
+
+import org.gvsig.andami.IconThemeHelper;
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.tools.extensionpoint.ExtensionBuilder;
+
+/**
+ * Clase que implementa un IGenericToolBarMenuItem para evitar tener que crear
+ * clases para items de menu sencillas
+ *
+ * @version 06/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class GenericToolBarMenuItem implements IGenericToolBarMenuItem, ExtensionBuilder {
+	private String text  = "";
+	private int    order = 0;
+	private int    groupOrder = 0;
+	private Icon   icon  = null;
+	private String group = "";
+
+	public GenericToolBarMenuItem(String text, Icon icon) {
+		this(text, icon, "", 0);
+	}
+
+	public GenericToolBarMenuItem(String text) {
+		this(text, IconThemeHelper.getImageIcon("blank-icon"), "", 0);
+	}
+
+	public GenericToolBarMenuItem(String text, Icon icon, String group, int order) {
+		this.text = text;
+		this.order = order;
+		this.icon = icon;
+		this.group = group;
+	}
+
+	public GenericToolBarMenuItem(String text, Icon icon, String group) {
+		this(text, icon, group, 0);
+	}
+
+	public GenericToolBarMenuItem(String text, Icon icon, int order) {
+		this(text, icon, "", 0);
+	}
+
+	public String getGroup() {
+		return group;
+	}
+
+	public int getOrder() {
+		return order;
+	}
+
+	public String getText() {
+		return text;
+	}
+
+	public Icon getIcon() {
+		return icon;
+	}
+
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems) {
+		return true;
+	}
+
+	public int getGroupOrder() {
+		return groupOrder;
+	}
+
+	public void execute(ITocItem item, FLayer[] selectedItems) {}
+
+	public Object create() {
+		return this;
+	}
+
+	public Object create(Object[] args) {
+		return this;
+	}
+
+	@SuppressWarnings("rawtypes")
+	public Object create(Map args) {
+		return this;
+	}
+
+	public boolean isEnableEvents() {
+		return true;
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/BinarySearch.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/BinarySearch.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/BinarySearch.java	(revision 15423)
@@ -0,0 +1,75 @@
+/* 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.mainplugin.toolbar;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Vector;
+import org.apache.commons.lang3.StringUtils;
+
+import org.gvsig.gui.beans.comboboxconfigurablelookup.ILookUp;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.JComboBoxConfigurableLookUp;
+import org.gvsig.gui.beans.comboboxconfigurablelookup.StringComparator;
+/**
+ * Clase para reimplementar una nueva busqueda para el componente
+ * {@link JComboBoxConfigurableLookUp}
+ * 
+ * @version 13/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano 
+ */
+public class BinarySearch implements ILookUp {
+	public List<Object> doLookUpConsideringCaseSensitive(String text, Vector<Object> sortOrderedItems, StringComparator comp) {
+                Vector<Object> list = new Vector<Object>();
+                for (int i = 0; i < sortOrderedItems.size(); i++) {
+                    Object cur_o = sortOrderedItems.get(i);
+                    if( cur_o!=null ) {
+                        String cur_s = cur_o.toString();
+                        if( StringUtils.isEmpty(text) ) {
+                                list.add(cur_o);
+                        } else {
+                            if (cur_s.indexOf(text) != -1) {
+                                    list.add(cur_o);
+                            }
+                        }
+                    }
+                }
+		return Arrays.asList(list.toArray());
+        }
+
+	public List<Object> doLookUpIgnoringCaseSensitive(String text, Vector<Object> sortOrderedItems, StringComparator comp) {
+                Vector<Object> list = new Vector<Object>();
+                for (int i = 0; i < sortOrderedItems.size(); i++) {
+                    Object cur_o = sortOrderedItems.get(i);
+                    if( cur_o!=null ) {
+                        String cur_s = cur_o.toString();
+                        if( StringUtils.isEmpty(text) ) {
+                                list.add(cur_o);
+                        } else {
+                            if (cur_s.toLowerCase().indexOf(text.toLowerCase()) != -1) {
+                                    list.add(cur_o);
+                            }
+                        }
+                    }
+                }
+		return Arrays.asList(list.toArray());
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/IGenericToolBarMenuItem.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/IGenericToolBarMenuItem.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/IGenericToolBarMenuItem.java	(revision 15423)
@@ -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.mainplugin.toolbar;
+
+import javax.swing.Icon;
+
+import org.gvsig.app.project.documents.view.toc.ITocItem;
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+
+/**
+ * Interfaz que debe implementar quien quiera aparecer en la barra de
+ * herramientas gen�rica.
+ * 
+ * @version 06/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public interface IGenericToolBarMenuItem {
+	/**
+	 * Devuelve el nombre del grupo al que pertenece el item de menu
+	 * @return
+	 */
+	public String getGroup();
+	
+	/**
+	 * Devuelve el orden en el que aparecer� en el men�
+	 * @return
+	 */
+	public int getOrder();
+
+	/**
+	 * Devuelve el orden en el que aparecer� en el men�
+	 * @return
+	 */
+	public int getGroupOrder();
+	
+	/**
+	 * Devuelve el texto que se ver� en el men�
+	 * @return
+	 */
+	public String getText();
+	
+	/**
+	 * Devuelve el icono del item del menu
+	 * @return
+	 */
+	public Icon getIcon();
+
+	/**
+	 * Dice si es visible el item de menu para dicha entrada
+	 * @param item
+	 * @param selectedItems
+	 * @return
+	 */
+	public boolean isVisible(ITocItem item, FLayer[] selectedItems);
+	
+	/**
+	 * Dice si el item actual esta habilitado
+	 * @param item
+	 * @param selectedItems
+	 * @return
+	 */
+	public boolean isEnabled(ITocItem item, FLayer[] selectedItems);
+	
+	/**
+	 * Metodo que sera invocado cuando el item del menu sea presionado
+	 * @param item
+	 * @param selectedItems
+	 */
+	public void execute(ITocItem item, FLayer[] selectedItems);
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/ButtonItems.java
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/ButtonItems.java	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/java/org/gvsig/raster/mainplugin/toolbar/ButtonItems.java	(revision 15423)
@@ -0,0 +1,103 @@
+/* gvSIG. Geographic Information System of the Valencian Government
+*
+* Copyright (C) 2007-2008 Infrastructures and Transports Department
+* of the Valencian Government (CIT)
+* 
+* This program is free software; you can redistribute it and/or
+* modify it under the terms of the GNU General Public License
+* as published by the Free Software Foundation; either version 2
+* of the License, or (at your option) any later version.
+* 
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+* GNU General Public License for more details.
+* 
+* You should have received a copy of the GNU General Public License
+* along with this program; if not, write to the Free Software
+* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+* MA  02110-1301, USA.
+* 
+*/
+package org.gvsig.raster.mainplugin.toolbar;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.swing.JButton;
+
+import org.gvsig.fmap.mapcontext.layers.FLayer;
+import org.gvsig.gui.beans.controls.combobutton.ComboButton;
+/**
+ * Clase para gestionar y ordenar los items de un ComboButton
+ *  
+ * @version 13/02/2008
+ * @author BorSanZa - Borja S�nchez Zamorano (borja.sanchez@iver.es)
+ */
+public class ButtonItems {
+	private ComboButton comboButton = null;
+	private FLayer[] layers = null;
+	private List<IGenericToolBarMenuItem> arrayList = new ArrayList<IGenericToolBarMenuItem>();
+	private List<String> arrayKeys = new ArrayList<String>();
+
+	public ButtonItems(ComboButton comboButton, FLayer[] layers) {
+		this.comboButton = comboButton;
+		this.layers = layers;
+	}
+	
+	/**
+	 * A�ade un item al ComboButton
+	 * @param menuItem
+	 * @param key
+	 */
+	public void addButton(IGenericToolBarMenuItem menuItem, String key) {
+		int pos = 0;
+		boolean find = false;
+		for (int i = 0; i < arrayList.size(); i++) {
+			pos = i;
+			IGenericToolBarMenuItem aux = (IGenericToolBarMenuItem) arrayList.get(i);
+			if (aux.getGroupOrder() > menuItem.getGroupOrder()) {
+				find = true;
+				break;
+			}
+			if (aux.getGroupOrder() == menuItem.getGroupOrder()) {
+				if (aux.getOrder() > menuItem.getOrder()) {
+					find = true;
+					break;
+				}
+			}
+		}
+		if (!find)
+			pos = arrayList.size();
+		arrayList.add(pos, menuItem);
+		arrayKeys.add(pos, key);
+	}
+	
+	/**
+	 * Refresca los items del ComboButton
+	 */
+	public void refresh() {
+		String actionCommand = comboButton.getActionCommand();
+		comboButton.clearButtons();
+		int group = -1;
+		for (int i = 0; i < arrayList.size(); i++) {
+			IGenericToolBarMenuItem aux = (IGenericToolBarMenuItem) arrayList.get(i);
+
+			if ((group != -1) && (group != aux.getGroupOrder()))
+				comboButton.addSeparator();
+
+			JButton button2 = new JButton(aux.getText(), aux.getIcon());
+
+			if (!aux.isVisible(null, layers))
+				button2.setEnabled(false);
+
+			if (!aux.isEnabled(null, layers))
+				button2.setEnabled(false);
+			
+			button2.setActionCommand((String) arrayKeys.get(i));
+			comboButton.addButton(button2);
+			group = aux.getGroupOrder();
+		}
+		comboButton.setSelectedItem(actionCommand);
+	}
+}
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/scripting/lib/gvsig_raster.py
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/scripting/lib/gvsig_raster.py	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/scripting/lib/gvsig_raster.py	(revision 15423)
@@ -0,0 +1,612 @@
+from gvsig import *
+from org.gvsig.fmap.dal import DALLocator
+from org.gvsig.fmap.mapcontext import MapContextLocator
+from org.gvsig.fmap.dal.coverage import RasterLocator
+from org.gvsig.fmap.dal.coverage.store.parameter import NewRasterStoreParameters
+from org.gvsig.fmap.dal.coverage.dataset import Buffer
+from org.gvsig.fmap.dal.serverexplorer.filesystem import FilesystemServerExplorer
+from org.gvsig.raster.fmap.layers import FLyrRaster
+from java.lang import Byte,Short,Integer,Float,Double
+from java.io import File
+from java.awt.geom import AffineTransform
+import os
+
+from os.path import splitext
+
+global sourceFileName
+sourceFileName = []
+sourceFileName.append(None)
+
+
+##
+#
+# Loads the raster layer given the filepath
+#
+# @params rasterfile the filename of the input layer
+#
+# @returns None loads the raster layer 
+def loadRasterLayer (rasterfile, mode = "r" ):
+    ## Load a Raster file in a Layer
+    sourceFileName[0]=rasterfile
+    if not isinstance (rasterfile,File):
+        rasterfile = File(rasterfile)
+
+    name, ext = splitext(rasterfile.getName())
+
+    view = currentView()
+  
+    # Get the manager to use
+    dalManager = DALLocator.getDataManager()
+    mapContextManager = MapContextLocator.getMapContextManager()
+
+    if ext.lower() == ".ecw" or ext.lower() == ".jp2" :
+        # FIXME
+        pass
+    elif ext.lower() == ".mrsid":
+        # FIXME
+        pass
+    else:
+        # Create the parameters to open the raster store based in GDAL
+        params = dalManager.createStoreParameters("Gdal Store")
+        params.setFile(rasterfile)
+
+    # Create the raster store
+    dataStore = dalManager.createStore(params)
+
+    # Create a raster layer based in this raster store
+    layer = mapContextManager.createLayer(name, dataStore);
+
+    view.addLayer(layer)
+    return layer
+
+
+## @cond FALSE
+rasterLayerExtensions = dict ()
+
+
+class RasterLayerExtensions(object):
+    ##This class hold aditional properties and operations need to manage the scripting raster layer
+    def __init__(self, store=None):
+        self.store = store
+        self.buffer = None
+        self.query = None
+        self.values = None
+        self.kernel = None
+        self.setElem = None
+        self.getElem = None
+
+    def prepareQuery(self):
+        ## See RasterManager in javadocs for more info
+        self.query = RasterLocator.getManager().createQuery();
+        ## See RasterQuery in javadocs for more
+        self.query.setAllDrawableBands()
+        self.query.setAreaOfInterest()
+        self.buffer = None
+        self.values = None
+        self.kernel = None
+
+    def loadStore (self,rasterfile, mode = "r" ):
+        if not isinstance(rasterfile,File):
+            rasterfile = File(rasterfile)
+
+        name, ext = splitext(rasterfile.getName())
+
+        dalManager = DALLocator.getDataManager()
+
+        if ext.lower() == ".ecw" or ext.lower() == ".jp2" :
+           # FIXME
+           pass
+        elif ext.lower() == ".mrsid":
+           # FIXME
+           pass
+        else:
+           # Create the parameters to open the raster store based in GDAL
+           params = dalManager.createStoreParameters("Gdal Store")
+           params.setFile(rasterfile)
+
+        # Create the raster store
+        dataStore = dalManager.createStore(params)
+        return dataStore
+
+    def createBuffer(self):
+        if sourceFileName[0] == None:
+            self.buffer = self.store.query(self.getQuery())
+        else:
+            queryStore = self.loadStore(sourceFileName[0])
+            self.buffer = queryStore.query(self.getQuery())
+        #print self.buffer.getBandCount()
+
+    def createNewBuffer(self,width, height, bandcount, datatype):
+        if self.store != None:
+            raise RuntimeException("Can't create a new buffer associated to a store")
+
+        # FIXME: workaround to work with a jython bug passing byte, short and
+        # double values as parameters
+        if datatype in (Buffer.TYPE_BYTE, Buffer.TYPE_SHORT, Buffer.TYPE_INT):
+            datatype = Buffer.TYPE_INT
+        else:
+            datatype = Buffer.TYPE_FLOAT
+        # End workaround
+
+        #print "---->>>>Buffer", datatype, width, height, bandcount
+        self.buffer = RasterLocator.getManager().createBuffer(
+            int(datatype),
+            int(width),
+            int(height),
+            int(0 if bandcount is None else bandcount),
+            True
+        )
+        self.prepareBuffer(self.buffer)
+
+    def prepareBuffer(self, buffer):
+        def setElemByte(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Byte(data).byteValue())
+
+        def setElemShort (buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Short(data).shortValue())
+
+        def setElemInt(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Integer(data).intValue())
+
+        def setElemFloat(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Float(data).floatValue())
+
+        def setElemDouble(buffer, line, col, band, data):
+            buffer.setElem(line, col, band, Double(data).doubleValue())
+
+        t = buffer.getDataType()
+        if t == Buffer.TYPE_BYTE:
+            self.getElem = buffer.getElemByte
+            self.setElem = setElemByte
+        elif t == Buffer.TYPE_SHORT or t == Buffer.TYPE_USHORT:
+            self.getElem = buffer.getElemShort
+            self.setElem = setElemShort
+        elif t == Buffer.TYPE_INT:
+            self.getElem = buffer.getElemInt
+            self.setElem = setElemInt
+        elif t == Buffer.TYPE_FLOAT:
+            self.getElem = buffer.getElemFloat
+            self.setElem = setElemFloat
+        elif t == Buffer.TYPE_DOUBLE:
+            self.getElem = buffer.getElemDouble
+            self.setElem = setElemDouble
+        #print buffer.getBandCount()
+        self.values = [0 for count in range(buffer.getBandCount())]
+        self.kernel = [[self.values for count in range(3)] for count in range(3)]
+
+    def getQuery(self):
+        if self.query == None:
+            self.prepareQuery()
+        return self.query
+
+    def getBuffer(self, store):
+        if self.buffer == None:
+            self.createBuffer()
+            self.prepareBuffer(self.buffer)
+        return self.buffer
+
+    def setValue(self, band, line, col, data):
+        t = self.buffer.getDataType()
+        if t == Buffer.TYPE_BYTE:
+           self.buffer.setElem(line, col, band, Byte(data).byteValue())
+        elif t == Buffer.TYPE_SHORT or t == Buffer.TYPE_USHORT:
+            self.buffer.setElem(line, col, band, Short(data).shortValue())
+        elif t == Buffer.TYPE_INT:
+            self.buffer.setElem(line, col, band, Integer(data).intValue())
+        elif t == Buffer.TYPE_FLOAT:
+            self.buffer.setElem(line, col, band, Float(data).floatValue())
+        elif t == Buffer.TYPE_DOUBLE:
+            self.buffer.setElem(line, col, band, Double(data).doubleValue())
+
+    def getValue(self, band, row, column):
+        if self.getElem == None:
+            self.createBuffer()
+            self.prepareBuffer(self.buffer)
+        return self.getElem(row, column, band)
+
+    def getBandValues(self, row, column):
+        if self.getElem == None:
+            self.createBuffer()
+            self.prepareBuffer(self.buffer)
+        for b in xrange(self.buffer.getBandCount()):
+            self.values[b] = self.getElem(row, column, b)
+        return self.values
+    
+    def setBandValues(self,row,column,values):
+        for b in xrange(self.buffer.getBandCount()):
+            self.setElem(self.buffer, row, column, b, values[b])
+
+    def saveBuffer(self,filename):
+        manager = DALLocator.getDataManager ()
+        eparams = manager.createServerExplorerParameters(FilesystemServerExplorer.NAME)
+        eparams.setDynValue("initialpath",os.path.dirname(sourceFileName[0]))
+        serverExplorer = manager.openServerExplorer(eparams.getExplorerName(),eparams)
+
+        sparams = serverExplorer.getAddParameters("Gdal Store")
+        sparams.setDestination(os.path.dirname(sourceFileName[0]),filename)
+        sparams.setBuffer(self.buffer)
+        #at = AffineTransform(1, 0, 0, -1, 0, 0)
+        #sparams.setAffineTransform(at);
+
+        serverExplorer.add("Gdal Store", sparams, True)
+
+## @endcond
+
+##
+#
+# Represents a raster layer.
+#
+class RasterLayer(FLyrRaster):
+    TYPE_BYTE = Buffer.TYPE_BYTE
+    TYPE_SHORT = Buffer.TYPE_SHORT
+    TYPE_INT = Buffer.TYPE_INT
+    TYPE_FLOAT = Buffer.TYPE_FLOAT
+    TYPE_DOUBLE = Buffer.TYPE_DOUBLE
+
+    @staticmethod
+    ## @cond FALSE
+    def getExtensions(self):
+        ## This is a internal method, don't use it.
+
+        global rasterLayerExtensions
+        extensions = rasterLayerExtensions.get(self.hashCode(), None)
+        if extensions == None:
+            extensions = RasterLayerExtensions(self.getDataStore())
+            rasterLayerExtensions[self.hashCode()] = extensions
+        return extensions
+    ## @endcond
+
+    @staticmethod
+    ##
+    #
+    # Return the number of bands of the raster
+    #
+    # @param self The raster layer object
+    #
+    # @return the number of bands of the raster layer
+    #
+    def getBandsCount(self):
+        return self.getDataStore().getBandCount()
+
+    @staticmethod
+    ##
+    #
+    # Return the width in points/pixels of the raster
+    #
+    # @param self The raster layer object
+    #
+    # @return the width of the raster
+    #
+    def getWidth(self):
+        return self.getDataStore().getWidth()
+
+    @staticmethod
+    ##
+    #
+    # Return the height in points/pixels of the raster
+    #
+    # @param self The raster layer object
+    #
+    # @return the height of the raster
+    def getHeight(self):
+        return self.getDataStore().getHeight()
+
+    @staticmethod
+    ##
+    #
+    # Return the data type of the raster
+    #
+    # TYPE_BYTE = Byte datatype
+    #
+    # TYPE_USHORT  = Unsigned Short datatype
+    #
+    # TYPE_SHORT = Signed Short datatype
+    #
+    # TYPE_INT = Integer datatype
+    #
+    # TYPE_FLOAT = Float Datatype
+    #
+    # TYPE_DOUBLE = Double Datatype
+    #
+    # @param self The raster layer object
+    #
+    # @return the datatype of the raster layer
+    def getDataType(self):
+        return self.getDataStore().getDataType()
+
+    @staticmethod
+    ##
+    #
+    # Return the value of a point of a "band" from "row" and "coulmn" of
+    # the Raster.
+    #
+    # This method use with care, it has a strong overhead. Use instead
+    # the method "walk" to go over the raster.
+    #
+    # @param band band from which the value should be retrieved
+    # @param row row in the raster from which the value should be retrieved
+    # @param column column in the raster from which the value should be retrieved
+    #
+    # @return the value of a point/pixel of a "band" from "row" and "column" of the Raster
+    #
+    def getData(self, band, row, column):
+        return self.getExtensions().getValue(band, row, column)
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point call to the function
+    # "operation" and pass as argument a tuple with the values of
+    # the point for each band.
+    #
+    # This method don't return any value
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on the raster point-by-point
+    #
+    # @return None
+    #
+    def walk(self, operation):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        sourceExtension = RasterLayerExtensions()
+        sourceExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        
+        for band in xrange(store.getBandCount()):
+            for line in xrange(store.getHeight()):
+                for column in xrange(store.getWidth()):
+                    operation(extension.getBandValues(line, column))
+                    
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point, taking the neighbour points
+    # as a kernel(3x3) call to the function "operation" and pass as argument a
+    # tuple with the values of all the points in the kernel for each band.
+    #
+    # This method don't return any value
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on the raster by a kernel(3x3).
+    #
+    # @return None
+    #
+    def walkKernel(self, operation):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        sourceExtension = RasterLayerExtensions()
+        sourceExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        
+        k=0
+        l=0
+        values = [0 for count in xrange(store.getBandCount())]
+        values = [[values for count in xrange(3)] for count in xrange(3)]
+        outValues = list()
+        for band in xrange(store.getBandCount()):
+            for line in xrange(1,store.getHeight()-1):
+                for column in xrange(1,store.getWidth()-1):
+                    
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            values[i][j]=extension.getBandValues(k,l)
+                            j=j+1
+                        i=i+1
+                    operation(values)
+                    
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point call to the function "filter1"
+    # and pass as argument a tuple with the values of all the points in the
+    # kernel for each band.
+    #
+    # The function "filter1" must be such that it takes a tuple, modifies its value
+    # and returns a new tuple.
+    #
+    # This method saves the newly created(filter applied) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param filter1 any filter which modifies the raster layer point-by-point
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    # @param targetbandcount number of bands in the output layer
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def filter(self, filter1, targetfilename, targetdatatype=None, targetbandcount=None):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        targetExtension = RasterLayerExtensions()
+        #targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), targetbandcount, targetdatatype)
+
+        for band in xrange(store.getBandCount()):
+            for line in xrange(store.getHeight()):
+                for column in xrange(store.getWidth()):
+                    values = filter1(extension.getBandValues(line,column))
+                    targetExtension.setBandValues(line, column, values)
+
+        targetExtension.saveBuffer(targetfilename)
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster and for each point, taking the neighbour points
+    # as a kernel(3x3) call to the function "filter1" and pass as argument
+    # a tuple with the values of all the points in the kernel for each band.
+    #
+    # The function "filter1" must be such that it takes a tuple of multi-dimension,
+    # modifies its value and returns a new tuple having dimensions same as input.
+    #
+    # This method saves the newly created(filter applied) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param filter1 any filter which modifies the raster layer using a kernel(3x3).
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    # @param targetbandcount number of bands in the output layer
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def filterKernel(self, filter1, targetfilename, targetdatatype=None, targetbandcount=None):
+        extension = self.getExtensions()
+        store = self.getDataStore()
+        targetExtension = RasterLayerExtensions()
+        #targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), store.getBandCount(), store.getDataType())
+        targetExtension.createNewBuffer(store.getWidth(), store.getHeight(), targetbandcount, targetdatatype)
+
+        k=0
+        l=0
+        values = [0 for count in xrange(store.getBandCount())]
+        values = [[values for count in xrange(3)] for count in xrange(3)]
+        outValues = list()
+        for band in xrange(store.getBandCount()):
+            for line in xrange(1,store.getHeight()-1):
+                for column in xrange(1,store.getWidth()-1):
+                    
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            values[i][j]=extension.getBandValues(k,l)
+                            j=j+1
+                        i=i+1
+                    outValues = filter1(values)
+                    targetExtension.setBandValues(line, column, outValues)
+
+        targetExtension.saveBuffer(targetfilename)
+                    
+    @staticmethod
+    ##
+    #
+    # Go over the raster layer and for each point call to the function "operation" and
+    # pass as arguments two tuples (One corresponding to the first layer at that point,
+    # the other corresponding to the second layer at the same point) with the values of
+    # each point for each band.
+    #
+    # The function "operation" must be such that it takes two tuples as input, performs
+    # operations involving both of them and returns a new tuple.
+    #
+    # This method saves the newly created(from the two rasters) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on both the raster layers at a respective point/pixel.
+    # @param layer2 the layer which forms the second input to the "operation" function.
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def operation(self, operation, layer2, targetfilename, targetdatatype=None):
+        layer1Extension = self.getExtensions()
+        layer2Extension = layer2.getExtensions()
+
+        layer1Store = self.getDataStore()
+        layer2Store = layer2.getDataStore()
+
+        bandCount = layer1Store.getBandCount()
+        layerWidth = layer1Store.getWidth()
+        layerHeight = layer1Store.getHeight()
+        targetExtension = RasterLayerExtensions()
+        resultValues = list()
+        #targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, layer1Store.getDataType())
+        targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, targetdatatype)
+
+        for band in xrange(bandCount):
+            for line in xrange(layerHeight):
+                for column in xrange(layerWidth):
+                    layer1Values = layer1Extension.getBandValues(line, column)
+                    layer2Values = layer2Extension.getBandValues(line, column)
+                    resultValues = operation(layer1Values, layer2Values)
+                    targetExtension.setBandValues(line, column, resultValues)
+
+        targetExtension.saveBuffer(targetfilename)
+
+    @staticmethod
+    ##
+    #
+    # Go over the raster layer and for each point, taking the neighbour points as a
+    # kernel(3x3) call to the function "operation" and pass as arguments two tuples
+    # (One corresponding to the first layer at that point, the other corresponding
+    # to the second layer at the same point) with the values of all the points of the
+    # kernel for each band.
+    #
+    # The function "operation" must be such that it takes two tuples of multiple
+    # dimensions as input, performs operations involving both of them and returns a
+    # new tuple having dimensions same as input tuples.
+    #
+    # This method saves the newly created(from the two rasters) layer to "targetfilename"
+    #
+    # @param self pointer to the Layer object
+    # @param operation any operation which operates on both the raster layers at a respective point/pixel but involving kernel(3x3)[neighbour points].
+    # @param layer2 the layer which forms the second input to the "operation" function.
+    # @param targetfilename filename to which the output layer should be saved
+    # @param targetdatatype datatype of which the output layer to be saved (use only TYPE_INT,TYPE_BYTE or TYPE_SHORT as of now)
+    #
+    # @return saves the created layer to "targetfilename" in the current directory
+    #
+    def operationKernel(self, operation, layer2, targetfilename, targetdatatype=None):
+        layer1Extension = self.getExtensions()
+        layer2Extension = self.getExtensions()
+
+        layer1Store = self.getDataStore()
+        layer2Store = layer2.getDataStore()
+
+        bandCount = layer1Store.getBandCount()
+        layerWidth = layer1Store.getWidth()
+        layerHeight = layer1Store.getHeight()
+        targetExtension = RasterLayerExtensions()
+        #targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, layer1Store.getDataType())targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, layer1Store.getDataType())
+        targetExtension.createNewBuffer(layerWidth, layerHeight, bandCount, targetdatatype)
+
+        k=0
+        l=0
+        values1 = [[[None for count in range(bandCount)] for count in range(3)] for count in range(3)]
+        values2 = [[[None for count in range(bandCount)] for count in range(3)] for count in range(3)]
+        outValues = list()
+        for band in xrange(bandCount):
+            for line in xrange(1,layerHeight-1):
+                for column in xrange(1,layerWidth-1):
+
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            values1[i][j]=layer1Extension.getBandValues(k,l)
+                            #print i,j,values1[i][j]
+                            #print values1
+                            values2[i][j]=layer2Extension.getBandValues(k,l)
+                            j=j+1
+                        i=i+1
+
+                    outValues = operation(values1, values2)
+                    i=0
+                    for k in xrange(line-1,line+2):
+                        j=0
+                        for l in xrange(column-1,column+2):
+                            targetExtension.setBandValues(k,l, outValues[i][j])
+                            j=j+1
+                        i=i+1
+
+        targetExtension.saveBuffer(targetfilename)
+        
+
+#
+# Inject new methods in the class FLyrRaster
+#
+FLyrRaster.getExtensions = RasterLayer.getExtensions
+FLyrRaster.getBandsCount = RasterLayer.getBandsCount
+FLyrRaster.getWidth = RasterLayer.getWidth
+FLyrRaster.getHeight = RasterLayer.getHeight
+FLyrRaster.getDataType = RasterLayer.getDataType
+FLyrRaster.getData = RasterLayer.getData
+FLyrRaster.walk = RasterLayer.walk
+FLyrRaster.walkKernel = RasterLayer.walkKernel
+FLyrRaster.filter = RasterLayer.filter
+FLyrRaster.filterKernel = RasterLayer.filterKernel
+FLyrRaster.operation = RasterLayer.operation
+FLyrRaster.operationKernel = RasterLayer.operationKernel
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/config.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/config.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/config.xml	(revision 15423)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<plugin-config>
+ <depends plugin-name="org.gvsig.app" />
+ <depends plugin-name="org.gvsig.app.document.table.app.mainplugin" />
+	<resourceBundle name="text"/>
+	<libraries library-dir="lib"/>
+	<extensions>
+		<extension class-name="org.gvsig.raster.mainplugin.RasterMainPluginExtension"
+			description="" 
+			active="true" 
+			priority="1">
+		</extension>	
+		<extension class-name="org.gvsig.raster.mainplugin.GenericToolBarExtension"
+			description="" 
+			active="true" 
+			priority="1">
+		</extension>
+	</extensions>
+</plugin-config>
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-transgeo-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-transgeo-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-dataset-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-dataset-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-enhanced-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-enhanced-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-multispectral-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-multispectral-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-raster-export.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-raster-export.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-layer-icon.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-layer-icon.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/layer-properties-raster.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/layer-properties-raster.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/ico.sol.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/ico.sol.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-process-icon.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/action/menu-process-icon.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/map-ok-ico.gif
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/images/map-ok-ico.gif
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_cs.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_fr.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_de.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_eu.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_it.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text.properties	(revision 15423)
@@ -0,0 +1,7 @@
+capa_raster=Capa Raster
+process_raster=Procesos Raster
+multispectral=Multiespectral
+enhanced=Realce
+transformaciones_geograficas=Transformaciones geograficas
+raster_export=Exportar Raster
+dataset_raster=Conjunto de datos raster
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_zh.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_en.properties
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_en.properties	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_en.properties	(revision 15423)
@@ -0,0 +1,7 @@
+capa_raster=Raster layer
+process_raster=Raster process
+multispectral=Multispectral
+enhanced=Enhanced
+transformaciones_geograficas=Geographic transformations
+raster_export=Export to raster
+dataset_raster=Raster dataset
\ No newline at end of file
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_gl.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_ca.properties
===================================================================
Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common/src/main/resources-plugin/org/gvsig/raster/mainplugin/i18n/text_pt.properties
===================================================================

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/org.gvsig.raster.app.common
___________________________________________________________________
Added: svn:ignore
   + target
.pom.xml.swp


Index: org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/pom.xml
===================================================================
--- org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/pom.xml	(revision 0)
+++ org.gvsig.raster/tags/org.gvsig.raster-2.2.171/org.gvsig.raster.app/pom.xml	(revision 15423)
@@ -0,0 +1,58 @@
+<?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.app</artifactId>
+  <packaging>pom</packaging>
+  <name>${project.artifactId} (old)</name>
+  <description>Basic libraries for raster support</description>
+  <parent>
+      <groupId>org.gvsig</groupId>
+      <artifactId>org.gvsig.raster</artifactId>
+      <version>2.2.171</version>
+  </parent>
+  
+  <properties>
+    <svn.tags.folder>http://devel.gvsig.org/svn/gvsig-raster/org.gvsig.raster/tags/</svn.tags.folder>
+    <gvsig.install.plugin>false</gvsig.install.plugin>    
+    <gvsig.package.info.name>Raster base support</gvsig.package.info.name>
+    
+    <gvsig.package.info.state>testing</gvsig.package.info.state>
+    <gvsig.package.info.official>true</gvsig.package.info.official>
+    <gvsig.package.info.operatingSystem>all</gvsig.package.info.operatingSystem>
+    <gvsig.package.info.architecture>all</gvsig.package.info.architecture>
+    <gvsig.package.info.categories>Raster</gvsig.package.info.categories>
+    <gvsig.package.info.poolURL>https://devel.gvsig.org/download/projects/Raster/pool/</gvsig.package.info.poolURL>
+    <gvsig.package.info.dependencies />
+    <gvsig.package.info.code>org.gvsig.raster.mainplugin</gvsig.package.info.code>
+    <gvsig.package.info.codealias />
+    <gvsig.package.info.name>${project.parent.name}</gvsig.package.info.name>
+    <gvsig.package.info.description>${project.parent.description}</gvsig.package.info.description>
+  </properties>
+  
+  <dependencyManagement>
+      <dependencies>
+        <dependency>
+          <groupId>org.gvsig</groupId>
+          <artifactId>org.gvsig.raster.app.common</artifactId>
+          <version>2.2.171</version>
+          <type>zip</type>
+        </dependency>
+      </dependencies>
+  </dependencyManagement>
+  
+  <modules>
+    <module>org.gvsig.raster.app.common</module>
+    <module>org.gvsig.raster.app.mainplugin</module>
+    <!--
+    <module>org.gvsig.raster.app.lin.x86</module>
+    <module>org.gvsig.raster.app.lin.x86_64</module>
+    <module>org.gvsig.raster.app.win.x86</module>
+    <module>org.gvsig.raster.app.fedora.x86</module>
+    <module>org.gvsig.raster.app.mac_10.5</module>
+    -->
+  </modules>
+
+
+</project>
+

Property changes on: org.gvsig.raster/tags/org.gvsig.raster-2.2.171
___________________________________________________________________
Added: svn:mergeinfo
   Merged /org.gvsig.raster/branches/org.gvisg.raster_proyeccion_al_vuelo:r5460-5461
Added: svn:ignore
   + .project
.pom.xml.swp


